@shtabapp/ui-kit 1.69.1 → 1.71.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 +13 -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-3l507dBg.cjs +1 -0
- package/dist/SChartLine-v0tkmnN6.js +165 -0
- package/dist/SChartMultiLine-CG6dKmWm.js +244 -0
- package/dist/SChartMultiLine-vz7JdyA3.cjs +1 -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-Cg1yGzxW.cjs +1 -0
- package/dist/createChartMarkersPlugin-DkXituwE.js +43 -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 +3 -3
- 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
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./SChartLegend-oZoF8XK7.js";
|
|
2
|
-
import { C as t, S as n, a as r, g as i, i as a, n as o, o as s, r as c, t as l } from "./useChartInteractivity-BATdT86l.js";
|
|
3
|
-
import { t as u } from "./buildCartesianChartScales-EofFq3ry.js";
|
|
4
|
-
import { t as d } from "./resolveBarStackedSeriesColor-LpVh1SvQ.js";
|
|
5
|
-
import { n as f, t as p } from "./buildChartSeriesPoints-BTyOpkin.js";
|
|
6
|
-
import { t as m } from "./useHasListener-RSjlUyqH.js";
|
|
7
|
-
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";
|
|
8
|
-
//#region src/components/SChartBar/utils/createBarTargetLinePlugin.ts
|
|
9
|
-
var D = 1, O = [4, 4], k = "500 10px var(--s-ui-font-family-label)", A = 4, j = (e) => e.length > 0 && new Set(e).size === 1, M = ({ target: e, colorHostElement: t, rightAxisId: r }) => ({
|
|
10
|
-
id: "barTargetLine",
|
|
11
|
-
afterDatasetsDraw(a) {
|
|
12
|
-
if (!e || e.values.length === 0) return;
|
|
13
|
-
let o = e.axis === "right" ? r : "y", s = a.scales[o], c = a.scales.x;
|
|
14
|
-
if (!s || !c) return;
|
|
15
|
-
let { ctx: l, chartArea: u } = a, d = e.color ? n(e.color, t) || e.color : n(i.grid, t);
|
|
16
|
-
l.save(), l.strokeStyle = d, l.lineWidth = D, l.setLineDash(O);
|
|
17
|
-
let [f] = e.values;
|
|
18
|
-
if (f !== void 0 && j(e.values)) {
|
|
19
|
-
let t = s.getPixelForValue(f);
|
|
20
|
-
l.beginPath(), l.moveTo(u.left, t), l.lineTo(u.right, t), l.stroke(), e.label && (l.setLineDash([]), l.fillStyle = d, l.font = k, l.textAlign = "left", l.fillText(e.label, u.left, t - A));
|
|
21
|
-
} else {
|
|
22
|
-
let t = (u.right - u.left) / e.values.length;
|
|
23
|
-
e.values.forEach((e, n) => {
|
|
24
|
-
if (e <= 0) return;
|
|
25
|
-
let r = s.getPixelForValue(e);
|
|
26
|
-
l.beginPath(), l.moveTo(u.left + t * n, r), l.lineTo(u.left + t * (n + 1), r), l.stroke();
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
l.restore();
|
|
30
|
-
}
|
|
31
|
-
}), N = 5, P = 4, F = 12, I = "yRight", L = "yMirror", R = 1.05, z = (e, t, n) => {
|
|
32
|
-
if (t !== void 0) return t;
|
|
33
|
-
let r = e.flatMap((e) => e.points.map((e) => e.value)), i = r.length > 0 ? Math.max(...r) : 0;
|
|
34
|
-
return i > 0 ? Math.ceil(i * R / n) * n : n;
|
|
35
|
-
}, B = ({ seriesList: e, colorHostElement: t, yMax: o, yStep: l = N, rightYMax: f, rightYStep: p = N, mirrorYAxis: m = !1, target: h, skeleton: g = !1, onPointClick: _ }) => {
|
|
36
|
-
if (e.length === 0) return null;
|
|
37
|
-
let v = e.filter((e) => e.axis !== "right"), y = e.filter((e) => e.axis === "right"), b = n(i.axisLabel, t), x = n(i.grid, t), S = n(i.tooltipBackground, t), C = n(i.tooltipText, t), w = z(v, o, l), T = z(y, f, p), E = u({
|
|
38
|
-
axisLabelColor: b,
|
|
39
|
-
gridColor: x,
|
|
40
|
-
yMin: 0,
|
|
41
|
-
yMax: w,
|
|
42
|
-
yStep: l,
|
|
43
|
-
xTickFontSize: F
|
|
44
|
-
}), D = (e) => ({
|
|
45
|
-
type: "linear",
|
|
46
|
-
position: "right",
|
|
47
|
-
min: 0,
|
|
48
|
-
max: e,
|
|
49
|
-
border: { display: !1 },
|
|
50
|
-
grid: { drawOnChartArea: !1 },
|
|
51
|
-
ticks: E.y.ticks
|
|
52
|
-
}), O = y.length > 0 ? { [I]: D(T) } : m ? { [L]: D(w) } : {}, k = {
|
|
53
|
-
...E,
|
|
54
|
-
...O
|
|
55
|
-
}, A = c({
|
|
56
|
-
kind: "segment",
|
|
57
|
-
skeleton: g,
|
|
58
|
-
colorHostElement: t,
|
|
59
|
-
onElementIndexClick: _
|
|
60
|
-
});
|
|
61
|
-
return {
|
|
62
|
-
type: "bar",
|
|
63
|
-
data: {
|
|
64
|
-
labels: e[0]?.points.map((e) => e.label) ?? [],
|
|
65
|
-
datasets: e.map((e, r) => {
|
|
66
|
-
let i = d(r, t, e.fillColor, g), a = e.points.map((e) => e.fillColor ? n(e.fillColor, t) || e.fillColor : i);
|
|
67
|
-
return {
|
|
68
|
-
label: e.label,
|
|
69
|
-
data: e.points.map((e) => e.value),
|
|
70
|
-
backgroundColor: a,
|
|
71
|
-
hoverBackgroundColor: a,
|
|
72
|
-
borderWidth: 0,
|
|
73
|
-
hoverBorderWidth: 0,
|
|
74
|
-
borderRadius: {
|
|
75
|
-
topLeft: P,
|
|
76
|
-
topRight: P
|
|
77
|
-
},
|
|
78
|
-
yAxisID: e.axis === "right" ? I : "y",
|
|
79
|
-
captions: e.points.map((e) => e.caption)
|
|
80
|
-
};
|
|
81
|
-
})
|
|
82
|
-
},
|
|
83
|
-
options: {
|
|
84
|
-
responsive: !0,
|
|
85
|
-
maintainAspectRatio: !1,
|
|
86
|
-
onHover: A.onHover,
|
|
87
|
-
onClick: A.onClick,
|
|
88
|
-
hover: g ? void 0 : {
|
|
89
|
-
mode: "nearest",
|
|
90
|
-
intersect: !0
|
|
91
|
-
},
|
|
92
|
-
interaction: a(g, {
|
|
93
|
-
mode: "nearest",
|
|
94
|
-
intersect: !0
|
|
95
|
-
}),
|
|
96
|
-
plugins: {
|
|
97
|
-
legend: { display: !1 },
|
|
98
|
-
tooltip: {
|
|
99
|
-
enabled: r(g),
|
|
100
|
-
backgroundColor: S,
|
|
101
|
-
titleColor: C,
|
|
102
|
-
bodyColor: C,
|
|
103
|
-
displayColors: !1
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
scales: k
|
|
107
|
-
},
|
|
108
|
-
plugins: s(g, [M({
|
|
109
|
-
target: h,
|
|
110
|
-
colorHostElement: t,
|
|
111
|
-
rightAxisId: I
|
|
112
|
-
}), ...A.plugins])
|
|
113
|
-
};
|
|
114
|
-
}, V = [
|
|
115
|
-
"5 неделя",
|
|
116
|
-
"6 неделя",
|
|
117
|
-
"7 неделя",
|
|
118
|
-
"8 неделя",
|
|
119
|
-
"9 неделя",
|
|
120
|
-
"10 неделя"
|
|
121
|
-
], H = [{
|
|
122
|
-
label: "Series 1",
|
|
123
|
-
points: p(V, [
|
|
124
|
-
28,
|
|
125
|
-
34,
|
|
126
|
-
24,
|
|
127
|
-
42,
|
|
128
|
-
30,
|
|
129
|
-
36
|
|
130
|
-
])
|
|
131
|
-
}, {
|
|
132
|
-
label: "Series 2",
|
|
133
|
-
points: p(V, [
|
|
134
|
-
18,
|
|
135
|
-
22,
|
|
136
|
-
16,
|
|
137
|
-
28,
|
|
138
|
-
20,
|
|
139
|
-
24
|
|
140
|
-
])
|
|
141
|
-
}], U = { class: "s-ui-chart-bar__canvas-wrap" }, W = /* @__PURE__ */ x({
|
|
142
|
-
__name: "SChartBar",
|
|
143
|
-
props: {
|
|
144
|
-
series: { default: () => [] },
|
|
145
|
-
mode: { default: "grouped" },
|
|
146
|
-
loading: {
|
|
147
|
-
type: Boolean,
|
|
148
|
-
default: !1
|
|
149
|
-
},
|
|
150
|
-
yMax: {},
|
|
151
|
-
yStep: {},
|
|
152
|
-
rightYMax: {},
|
|
153
|
-
rightYStep: {},
|
|
154
|
-
mirrorYAxis: {
|
|
155
|
-
type: Boolean,
|
|
156
|
-
default: !1
|
|
157
|
-
},
|
|
158
|
-
target: {},
|
|
159
|
-
showLegend: {
|
|
160
|
-
type: Boolean,
|
|
161
|
-
default: !0
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
emits: ["pointClick"],
|
|
165
|
-
setup(n, { expose: r, emit: i }) {
|
|
166
|
-
let a = i, s = T("chartRootRef"), c = T("chartCanvasRef"), u = h(() => n.loading ? H : n.mode === "single" ? n.series.slice(0, 1) : n.series), p = (e, t) => {
|
|
167
|
-
let n = u.value[t], r = n?.points[e];
|
|
168
|
-
n && r && a("pointClick", e, t, r, n);
|
|
169
|
-
}, x = m("onPointClick"), D = h(() => !n.loading && n.series.length === 0 ? null : B({
|
|
170
|
-
seriesList: u.value,
|
|
171
|
-
colorHostElement: s.value,
|
|
172
|
-
yMax: n.loading ? 50 : n.yMax,
|
|
173
|
-
yStep: n.loading ? 10 : n.yStep,
|
|
174
|
-
rightYMax: n.rightYMax,
|
|
175
|
-
rightYStep: n.rightYStep,
|
|
176
|
-
mirrorYAxis: n.mirrorYAxis,
|
|
177
|
-
target: n.loading ? void 0 : n.target,
|
|
178
|
-
skeleton: n.loading,
|
|
179
|
-
onPointClick: x() ? p : void 0
|
|
180
|
-
})), O = h(() => f(u.value, (e, t) => d(e, s.value, t, n.loading))), { chartInstance: k } = o({
|
|
181
|
-
canvasRef: c,
|
|
182
|
-
config: D,
|
|
183
|
-
enabled: h(() => n.loading || n.series.length > 0)
|
|
184
|
-
}), { exportImage: A, handleLegendItemHover: j } = l({
|
|
185
|
-
chartInstance: k,
|
|
186
|
-
canvasRef: c,
|
|
187
|
-
colorHostElement: s
|
|
188
|
-
});
|
|
189
|
-
return r({ exportImage: A }), (r, i) => (C(), v("div", {
|
|
190
|
-
ref_key: "chartRootRef",
|
|
191
|
-
ref: s,
|
|
192
|
-
class: S(["s-ui-chart-bar", { "s-ui-chart-bar--skeleton": n.loading }])
|
|
193
|
-
}, [y("div", U, [b(w(t), { loading: n.loading }, {
|
|
194
|
-
default: E(() => [y("canvas", {
|
|
195
|
-
ref_key: "chartCanvasRef",
|
|
196
|
-
ref: c,
|
|
197
|
-
class: "s-ui-chart-bar__canvas"
|
|
198
|
-
}, null, 512)]),
|
|
199
|
-
_: 1
|
|
200
|
-
}, 8, ["loading"])]), n.showLegend && O.value.length ? (C(), g(w(e), {
|
|
201
|
-
key: 0,
|
|
202
|
-
items: O.value,
|
|
203
|
-
disabled: n.loading,
|
|
204
|
-
interactive: !n.loading,
|
|
205
|
-
onItemHover: w(j)
|
|
206
|
-
}, null, 8, [
|
|
207
|
-
"items",
|
|
208
|
-
"disabled",
|
|
209
|
-
"interactive",
|
|
210
|
-
"onItemHover"
|
|
211
|
-
])) : _("", !0)], 2));
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
//#endregion
|
|
215
|
-
export { W as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SChartLegend-DGtjd6zV.cjs"),t=require("./useChartInteractivity-CXSdHPOw.cjs"),n=require("./buildCartesianChartScales-Dck5yBMo.cjs"),r=require("./resolveBarStackedSeriesColor-HDSkh6Mw.cjs"),i=require("./buildChartSeriesPoints-Cqo2ed-n.cjs"),a=require("./useHasListener-BPgtbbo6.cjs");let o=require("vue");var s=1,c=[4,4],l=`500 10px var(--s-ui-font-family-label)`,u=4,d=e=>e.length>0&&new Set(e).size===1,f=({target:e,colorHostElement:n,rightAxisId:r})=>({id:`barTargetLine`,afterDatasetsDraw(i){if(!e||e.values.length===0)return;let a=e.axis===`right`?r:`y`,o=i.scales[a],f=i.scales.x;if(!o||!f)return;let{ctx:p,chartArea:m}=i,h=e.color?t.S(e.color,n)||e.color:t.S(t.g.grid,n);p.save(),p.strokeStyle=h,p.lineWidth=s,p.setLineDash(c);let[g]=e.values;if(g!==void 0&&d(e.values)){let t=o.getPixelForValue(g);p.beginPath(),p.moveTo(m.left,t),p.lineTo(m.right,t),p.stroke(),e.label&&(p.setLineDash([]),p.fillStyle=h,p.font=l,p.textAlign=`left`,p.fillText(e.label,m.left,t-u))}else{let t=(m.right-m.left)/e.values.length;e.values.forEach((e,n)=>{if(e<=0)return;let r=o.getPixelForValue(e);p.beginPath(),p.moveTo(m.left+t*n,r),p.lineTo(m.left+t*(n+1),r),p.stroke()})}p.restore()}}),p=5,m=4,h=12,g=`yRight`,_=`yMirror`,v=1.05,y=(e,t,n)=>{if(t!==void 0)return t;let r=e.flatMap(e=>e.points.map(e=>e.value)),i=r.length>0?Math.max(...r):0;return i>0?Math.ceil(i*v/n)*n:n},b=({seriesList:e,colorHostElement:i,yMax:a,yStep:o=p,rightYMax:s,rightYStep:c=p,mirrorYAxis:l=!1,target:u,skeleton:d=!1,onPointClick:v})=>{if(e.length===0)return null;let b=e.filter(e=>e.axis!==`right`),x=e.filter(e=>e.axis===`right`),S=t.S(t.g.axisLabel,i),C=t.S(t.g.grid,i),w=t.S(t.g.tooltipBackground,i),T=t.S(t.g.tooltipText,i),E=y(b,a,o),D=y(x,s,c),O=n.t({axisLabelColor:S,gridColor:C,yMin:0,yMax:E,yStep:o,xTickFontSize:h}),k=e=>({type:`linear`,position:`right`,min:0,max:e,border:{display:!1},grid:{drawOnChartArea:!1},ticks:O.y.ticks}),A=x.length>0?{[g]:k(D)}:l?{[_]:k(E)}:{},j={...O,...A},M=t.r({kind:`segment`,skeleton:d,colorHostElement:i,onElementIndexClick:v});return{type:`bar`,data:{labels:e[0]?.points.map(e=>e.label)??[],datasets:e.map((e,n)=>{let a=r.t(n,i,e.fillColor,d),o=e.points.map(e=>e.fillColor?t.S(e.fillColor,i)||e.fillColor:a);return{label:e.label,data:e.points.map(e=>e.value),backgroundColor:o,hoverBackgroundColor:o,borderWidth:0,hoverBorderWidth:0,borderRadius:{topLeft:m,topRight:m},yAxisID:e.axis===`right`?g:`y`,captions:e.points.map(e=>e.caption)}})},options:{responsive:!0,maintainAspectRatio:!1,onHover:M.onHover,onClick:M.onClick,hover:d?void 0:{mode:`nearest`,intersect:!0},interaction:t.i(d,{mode:`nearest`,intersect:!0}),plugins:{legend:{display:!1},tooltip:{enabled:t.a(d),backgroundColor:w,titleColor:T,bodyColor:T,displayColors:!1}},scales:j},plugins:t.o(d,[f({target:u,colorHostElement:i,rightAxisId:g}),...M.plugins])}},x=[`5 неделя`,`6 неделя`,`7 неделя`,`8 неделя`,`9 неделя`,`10 неделя`],S=[{label:`Series 1`,points:i.t(x,[28,34,24,42,30,36])},{label:`Series 2`,points:i.t(x,[18,22,16,28,20,24])}],C={class:`s-ui-chart-bar__canvas-wrap`},w=(0,o.defineComponent)({__name:`SChartBar`,props:{series:{default:()=>[]},mode:{default:`grouped`},loading:{type:Boolean,default:!1},yMax:{},yStep:{},rightYMax:{},rightYStep:{},mirrorYAxis:{type:Boolean,default:!1},target:{},showLegend:{type:Boolean,default:!0}},emits:[`pointClick`],setup(n,{expose:s,emit:c}){let l=c,u=(0,o.useTemplateRef)(`chartRootRef`),d=(0,o.useTemplateRef)(`chartCanvasRef`),f=(0,o.computed)(()=>n.loading?S:n.mode===`single`?n.series.slice(0,1):n.series),p=(e,t)=>{let n=f.value[t],r=n?.points[e];n&&r&&l(`pointClick`,e,t,r,n)},m=a.t(`onPointClick`),h=(0,o.computed)(()=>!n.loading&&n.series.length===0?null:b({seriesList:f.value,colorHostElement:u.value,yMax:n.loading?50:n.yMax,yStep:n.loading?10:n.yStep,rightYMax:n.rightYMax,rightYStep:n.rightYStep,mirrorYAxis:n.mirrorYAxis,target:n.loading?void 0:n.target,skeleton:n.loading,onPointClick:m()?p:void 0})),g=(0,o.computed)(()=>i.n(f.value,(e,t)=>r.t(e,u.value,t,n.loading))),{chartInstance:_}=t.n({canvasRef:d,config:h,enabled:(0,o.computed)(()=>n.loading||n.series.length>0)}),{exportImage:v,handleLegendItemHover:y}=t.t({chartInstance:_,canvasRef:d,colorHostElement:u});return s({exportImage:v}),(r,i)=>((0,o.openBlock)(),(0,o.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:u,class:(0,o.normalizeClass)([`s-ui-chart-bar`,{"s-ui-chart-bar--skeleton":n.loading}])},[(0,o.createElementVNode)(`div`,C,[(0,o.createVNode)((0,o.unref)(t.C),{loading:n.loading},{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:d,class:`s-ui-chart-bar__canvas`},null,512)]),_:1},8,[`loading`])]),n.showLegend&&g.value.length?((0,o.openBlock)(),(0,o.createBlock)((0,o.unref)(e.t),{key:0,items:g.value,disabled:n.loading,interactive:!n.loading,onItemHover:(0,o.unref)(y)},null,8,[`items`,`disabled`,`interactive`,`onItemHover`])):(0,o.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return w}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SChartLegend-DGtjd6zV.cjs"),t=require("./useChartInteractivity-CXSdHPOw.cjs"),n=require("./createChartAreaFillGradient-BwsojVzU.cjs"),r=require("./createChartCrosshairPlugin-DfYzBie2.cjs"),i=require("./buildMultiLineChartScales-7mcIfRVG.cjs");let a=require("vue");var o=(e,n)=>({id:`sUiChartBurnupTodayLine`,beforeDatasetsDraw(r){if(e<0)return;let{ctx:i,chartArea:a}=r,o=r.scales.x;if(!a||!o)return;let s=t.S(t.g.burnupToday,n),c=o.getPixelForValue(e);i.save(),i.beginPath(),i.moveTo(c,a.top),i.lineTo(c,a.bottom),i.lineWidth=1,i.strokeStyle=s,i.stroke(),i.restore()}}),s=8,c=4,l=5,u=12,d=12,f=60,p=12,m=e=>{if(typeof window>`u`)return`500 10px sans-serif`;let t=e??document.documentElement;return`500 10px ${getComputedStyle(t).getPropertyValue(`--s-ui-font-family-label`).trim()||`sans-serif`}`},h=(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()},g=({tagLines:e,factDatasetIndex:n,todayIndex:r},i)=>({id:`sUiChartBurnupTag`,afterDatasetsDraw(a){if(r<0||e.length===0)return;let o=a.getDatasetMeta(n)?.data[r],{chartArea:g}=a;if(!o||!g)return;let _=t.S(t.g.burnupToday,i),v=t.S(t.g.burnupTagBackground,i),{ctx:y}=a;y.save(),y.font=m(i),y.textAlign=`center`,y.textBaseline=`middle`;let b=e.reduce((e,t)=>Math.max(e,y.measureText(t).width),0),x=Math.max(f,b+s*2),S=e.length*d+c+l,C=Math.min(Math.max(o.x-x/2,g.left),g.right-x),w=Math.max(o.y-p-S,g.top);h(y,C,w,x,S,u),y.fillStyle=v,y.fill(),y.lineWidth=1,y.strokeStyle=_,y.stroke(),y.fillStyle=_,e.forEach((e,t)=>{y.fillText(e,C+x/2,w+c+d*(t+.5))}),y.restore()}}),_=(e,t)=>t>=0&&e>t,v=({todayIndex:e,futureLabel:t})=>({title:t=>{let n=t[0];return!n||_(n.dataIndex,e)?``:`${n.label}`},label:n=>_(n.dataIndex,e)?t:`${n.dataset.label??``}: ${n.parsed.y??0}%`}),y=e=>t=>!_(t.dataIndex,e)||t.datasetIndex===0,b=1,x=1,S=2,C=[8,8],w=[9,9],T=2,E=25,D=e=>e.reduce((e,t,n)=>t.fact===null?e:n,-1),O=(e,t,n)=>{let r=e.reduce((e,t)=>Math.max(e,t.plan,t.fact??0),t);return Math.ceil(r/n)*n},k=({points:e,colorHostElement:a,goalValue:s=100,goalLabel:c=`Цель`,planLabel:l=`План`,factLabel:u=`Факт`,futureLabel:d=`Этот день ещё не наступил`,yStep:f=E,mirrorYAxis:p=!0,showTag:m=!0,skeleton:h=!1})=>{if(e.length===0)return null;let _=t.S(t.g.axisLabel,a),k=t.S(t.g.grid,a),A=t.S(t.g.tooltipBackground,a),j=t.S(t.g.tooltipText,a),M=t.S(t.g.skeletonSeries,a),N=h?M:t.S(t.g.burnupGoal,a),P=h?M:t.S(t.g.burnupPlan,a),F=h?M:t.S(t.g.burnupFact,a),I=t.S(t.g.burnupFactFillStart,a),L=t.S(t.g.burnupFactFillEnd,a),R=D(e),z=R>=0?e[R]:void 0,B=z?[`${u.toLowerCase()} ${z.fact}%`,`${l.toLowerCase()} ${z.plan}%`]:[];return{type:`line`,data:{labels:e.map(e=>e.label),datasets:[{label:c,data:e.map(()=>s),borderColor:N,backgroundColor:N,borderWidth:b,borderDash:C,fill:!1,pointRadius:0,pointHoverRadius:0,tension:0},{label:l,data:e.map(e=>e.plan),borderColor:P,backgroundColor:P,borderWidth:x,borderDash:w,fill:!1,pointRadius:0,pointHoverRadius:0,tension:.4},{label:u,data:e.map(e=>e.fact??null),borderColor:F,backgroundColor:h?F:e=>n.t(e,I,L),borderWidth:S,fill:!h,spanGaps:!1,pointRadius:0,pointHoverRadius:4,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:t.i(h,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:t.a(h),backgroundColor:A,titleColor:j,bodyColor:j,displayColors:!1,position:t.u,yAlign:`bottom`,xAlign:`center`,caretPadding:8,filter:y(R),callbacks:v({todayIndex:R,futureLabel:d})}},scales:i.t({axisLabelColor:_,gridColor:k,yMin:0,yMax:O(e,s,f),yStep:f,mirrorYAxis:p,formatYAxisTick:e=>`${e}%`})},plugins:t.o(h,[r.t(a),o(R,a),...m?[g({tagLines:B,factDatasetIndex:T,todayIndex:R},a)]:[]])}},A=[8,15,23,31,38,46,54,62,69,77,85,92,96,100],j=[5,10,16,22,28,34,40,45,50,54,57,60,null,null],M=A.map((e,t)=>({label:`Д${t+1}`,plan:e,fact:j[t]})),N={class:`s-ui-chart-burnup__canvas-wrap`},P=(0,a.defineComponent)({__name:`SChartBurnup`,props:{points:{default:()=>[]},loading:{type:Boolean,default:!1},goalValue:{default:100},goalLabel:{default:`Цель`},planLabel:{default:`План`},factLabel:{default:`Факт`},futureLabel:{default:`Этот день ещё не наступил`},yStep:{default:25},mirrorYAxis:{type:Boolean,default:!0},showTag:{type:Boolean,default:!0}},setup(n,{expose:r}){let i=(0,a.useTemplateRef)(`chartRootRef`),o=(0,a.useTemplateRef)(`chartCanvasRef`),s=(0,a.computed)(()=>n.loading?M:n.points),c=(0,a.computed)(()=>!n.loading&&n.points.length===0?null:k({points:s.value,colorHostElement:i.value,goalValue:n.goalValue,goalLabel:n.goalLabel,planLabel:n.planLabel,factLabel:n.factLabel,futureLabel:n.futureLabel,yStep:n.yStep,mirrorYAxis:n.mirrorYAxis,showTag:n.showTag,skeleton:n.loading})),l=(0,a.computed)(()=>[{label:n.goalLabel,cssVariable:t.g.burnupGoal},{label:n.planLabel,cssVariable:t.g.burnupPlan},{label:n.factLabel,cssVariable:t.g.burnupFact}].map(e=>({label:e.label.toLowerCase(),color:t.S(n.loading?t.g.skeletonSeries:e.cssVariable,i.value)}))),{chartInstance:u}=t.n({canvasRef:o,config:c,enabled:(0,a.computed)(()=>n.loading||n.points.length>0)}),{exportImage:d}=t.t({chartInstance:u,canvasRef:o,colorHostElement:i});return r({exportImage:d}),(r,s)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:i,class:(0,a.normalizeClass)([`s-ui-chart-burnup`,{"s-ui-chart-burnup--skeleton":n.loading}])},[(0,a.createElementVNode)(`div`,N,[(0,a.createVNode)((0,a.unref)(t.C),{loading:n.loading},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:o,class:`s-ui-chart-burnup__canvas`},null,512)]),_:1},8,[`loading`])]),(0,a.createVNode)((0,a.unref)(e.t),{items:l.value,disabled:n.loading},null,8,[`items`,`disabled`])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return P}});
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { C as e, S as t, a as n, g as r, i, n as a, t as o } from "./useChartInteractivity-BATdT86l.js";
|
|
2
|
-
import { t as s } from "./createChartAreaFillGradient-BDmME9Gy.js";
|
|
3
|
-
import { t as c } from "./buildCartesianChartScales-EofFq3ry.js";
|
|
4
|
-
import { computed as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, normalizeClass as m, openBlock as h, unref as g, useTemplateRef as _, withCtx as v } from "vue";
|
|
5
|
-
//#region src/utils/chart/css/readCssNumber.ts
|
|
6
|
-
var y = (e, t, n = 1) => {
|
|
7
|
-
if (typeof window > "u") return n;
|
|
8
|
-
let r = t ?? document.documentElement, i = getComputedStyle(r).getPropertyValue(e).trim(), a = Number.parseFloat(i);
|
|
9
|
-
return Number.isNaN(a) ? n : a;
|
|
10
|
-
}, b = 5, x = 5, S = (e, t, n) => {
|
|
11
|
-
if (t) return t;
|
|
12
|
-
let r = e.reduce((e, t) => Math.max(e, t.value), 0), i = Math.ceil(r / n) * n;
|
|
13
|
-
return i > 0 ? i : n * 5;
|
|
14
|
-
}, C = (e, t) => !t || typeof e != "number" ? e : `${e}%`, w = ({ points: e, seriesLabel: a, colorHostElement: o, yMax: l, yMin: u, yStep: d = x, skeleton: f = !1 }) => {
|
|
15
|
-
let p = t(r.axisLabel, o), m = t(r.grid, o), h = t(f ? r.skeletonSeries : r.seriesPrimary, o), g = t(f ? r.skeletonFillStart : r.seriesFillStart, o), _ = t(f ? r.skeletonFillEnd : r.seriesFillEnd, o), v = t(r.tooltipBackground, o), w = t(r.tooltipText, o), T = y(f ? r.skeletonFillOpacity : r.seriesFillOpacity, o, .8), E = f && l ? l : S(e, l, d), D = f && u !== void 0 ? u : 0;
|
|
16
|
-
return {
|
|
17
|
-
type: "line",
|
|
18
|
-
data: {
|
|
19
|
-
labels: e.map((e) => e.label),
|
|
20
|
-
datasets: [{
|
|
21
|
-
label: a,
|
|
22
|
-
data: e.map((e) => e.value),
|
|
23
|
-
borderColor: h,
|
|
24
|
-
backgroundColor: (e) => s(e, g, _, T),
|
|
25
|
-
borderWidth: b,
|
|
26
|
-
fill: !0,
|
|
27
|
-
pointRadius: 0,
|
|
28
|
-
pointHoverRadius: 4,
|
|
29
|
-
tension: .4
|
|
30
|
-
}]
|
|
31
|
-
},
|
|
32
|
-
options: {
|
|
33
|
-
responsive: !0,
|
|
34
|
-
maintainAspectRatio: !1,
|
|
35
|
-
interaction: i(f, {
|
|
36
|
-
mode: "index",
|
|
37
|
-
intersect: !1
|
|
38
|
-
}),
|
|
39
|
-
plugins: {
|
|
40
|
-
legend: { display: !1 },
|
|
41
|
-
tooltip: {
|
|
42
|
-
enabled: n(f),
|
|
43
|
-
backgroundColor: v,
|
|
44
|
-
titleColor: w,
|
|
45
|
-
bodyColor: w,
|
|
46
|
-
displayColors: !1
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
scales: c({
|
|
50
|
-
axisLabelColor: p,
|
|
51
|
-
gridColor: m,
|
|
52
|
-
yMin: D,
|
|
53
|
-
yMax: E,
|
|
54
|
-
yStep: d,
|
|
55
|
-
formatYAxisTick: (e) => C(e, f)
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
}, T = [
|
|
60
|
-
{
|
|
61
|
-
label: "ноябрь 2025",
|
|
62
|
-
value: 63
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
label: "декабрь 2025",
|
|
66
|
-
value: 77
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
label: "январь 2026",
|
|
70
|
-
value: 75
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
label: "февраль 2026",
|
|
74
|
-
value: 81
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
label: "март 2026",
|
|
78
|
-
value: 91
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
label: "апрель 2026",
|
|
82
|
-
value: 87
|
|
83
|
-
}
|
|
84
|
-
], E = { class: "s-ui-chart-line__canvas-wrap" }, D = /* @__PURE__ */ p({
|
|
85
|
-
__name: "SChartLine",
|
|
86
|
-
props: {
|
|
87
|
-
points: { default: () => [] },
|
|
88
|
-
seriesLabel: { default: "Series" },
|
|
89
|
-
loading: {
|
|
90
|
-
type: Boolean,
|
|
91
|
-
default: !1
|
|
92
|
-
},
|
|
93
|
-
yMax: {},
|
|
94
|
-
yStep: {}
|
|
95
|
-
},
|
|
96
|
-
setup(t, { expose: n }) {
|
|
97
|
-
let r = _("chartRootRef"), i = _("chartCanvasRef"), s = l(() => t.loading ? T : t.points), { chartInstance: c } = a({
|
|
98
|
-
canvasRef: i,
|
|
99
|
-
config: l(() => !t.loading && t.points.length === 0 ? null : w({
|
|
100
|
-
points: s.value,
|
|
101
|
-
seriesLabel: t.seriesLabel,
|
|
102
|
-
colorHostElement: r.value,
|
|
103
|
-
yMax: t.loading ? 100 : t.yMax,
|
|
104
|
-
yMin: t.loading ? 50 : void 0,
|
|
105
|
-
yStep: t.loading ? 10 : t.yStep,
|
|
106
|
-
skeleton: t.loading
|
|
107
|
-
})),
|
|
108
|
-
enabled: l(() => t.loading || t.points.length > 0)
|
|
109
|
-
}), { exportImage: p } = o({
|
|
110
|
-
chartInstance: c,
|
|
111
|
-
canvasRef: i,
|
|
112
|
-
colorHostElement: r
|
|
113
|
-
});
|
|
114
|
-
return n({ exportImage: p }), (n, a) => (h(), u("div", {
|
|
115
|
-
ref_key: "chartRootRef",
|
|
116
|
-
ref: r,
|
|
117
|
-
class: m(["s-ui-chart-line", { "s-ui-chart-line--skeleton": t.loading }])
|
|
118
|
-
}, [d("div", E, [f(g(e), { loading: t.loading }, {
|
|
119
|
-
default: v(() => [d("canvas", {
|
|
120
|
-
ref_key: "chartCanvasRef",
|
|
121
|
-
ref: i,
|
|
122
|
-
class: "s-ui-chart-line__canvas"
|
|
123
|
-
}, null, 512)]),
|
|
124
|
-
_: 1
|
|
125
|
-
}, 8, ["loading"])])], 2));
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
//#endregion
|
|
129
|
-
export { D as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./useChartInteractivity-CXSdHPOw.cjs"),t=require("./createChartAreaFillGradient-BwsojVzU.cjs"),n=require("./buildCartesianChartScales-Dck5yBMo.cjs");let r=require("vue");var i=(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},a=5,o=5,s=(e,t,n)=>{if(t)return t;let r=e.reduce((e,t)=>Math.max(e,t.value),0),i=Math.ceil(r/n)*n;return i>0?i:n*5},c=(e,t)=>!t||typeof e!=`number`?e:`${e}%`,l=({points:r,seriesLabel:l,colorHostElement:u,yMax:d,yMin:f,yStep:p=o,skeleton:m=!1})=>{let h=e.S(e.g.axisLabel,u),g=e.S(e.g.grid,u),_=e.S(m?e.g.skeletonSeries:e.g.seriesPrimary,u),v=e.S(m?e.g.skeletonFillStart:e.g.seriesFillStart,u),y=e.S(m?e.g.skeletonFillEnd:e.g.seriesFillEnd,u),b=e.S(e.g.tooltipBackground,u),x=e.S(e.g.tooltipText,u),S=i(m?e.g.skeletonFillOpacity:e.g.seriesFillOpacity,u,.8),C=m&&d?d:s(r,d,p),w=m&&f!==void 0?f:0;return{type:`line`,data:{labels:r.map(e=>e.label),datasets:[{label:l,data:r.map(e=>e.value),borderColor:_,backgroundColor:e=>t.t(e,v,y,S),borderWidth:a,fill:!0,pointRadius:0,pointHoverRadius:4,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:e.i(m,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:e.a(m),backgroundColor:b,titleColor:x,bodyColor:x,displayColors:!1}},scales:n.t({axisLabelColor:h,gridColor:g,yMin:w,yMax:C,yStep:p,formatYAxisTick:e=>c(e,m)})}}},u=[{label:`ноябрь 2025`,value:63},{label:`декабрь 2025`,value:77},{label:`январь 2026`,value:75},{label:`февраль 2026`,value:81},{label:`март 2026`,value:91},{label:`апрель 2026`,value:87}],d={class:`s-ui-chart-line__canvas-wrap`},f=(0,r.defineComponent)({__name:`SChartLine`,props:{points:{default:()=>[]},seriesLabel:{default:`Series`},loading:{type:Boolean,default:!1},yMax:{},yStep:{}},setup(t,{expose:n}){let i=(0,r.useTemplateRef)(`chartRootRef`),a=(0,r.useTemplateRef)(`chartCanvasRef`),o=(0,r.computed)(()=>t.loading?u:t.points),{chartInstance:s}=e.n({canvasRef:a,config:(0,r.computed)(()=>!t.loading&&t.points.length===0?null:l({points:o.value,seriesLabel:t.seriesLabel,colorHostElement:i.value,yMax:t.loading?100:t.yMax,yMin:t.loading?50:void 0,yStep:t.loading?10:t.yStep,skeleton:t.loading})),enabled:(0,r.computed)(()=>t.loading||t.points.length>0)}),{exportImage:c}=e.t({chartInstance:s,canvasRef:a,colorHostElement:i});return n({exportImage:c}),(n,o)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:i,class:(0,r.normalizeClass)([`s-ui-chart-line`,{"s-ui-chart-line--skeleton":t.loading}])},[(0,r.createElementVNode)(`div`,d,[(0,r.createVNode)((0,r.unref)(e.C),{loading:t.loading},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:a,class:`s-ui-chart-line__canvas`},null,512)]),_:1},8,[`loading`])])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SChartLegend-DGtjd6zV.cjs"),t=require("./useChartInteractivity-CXSdHPOw.cjs"),n=require("./areChartSeriesAligned-DiBX3TTk.cjs"),r=require("./createChartCrosshairPlugin-DfYzBie2.cjs"),i=require("./resolveSeriesPaletteColor-B5qoBbXN.cjs"),a=require("./buildMultiLineChartScales-7mcIfRVG.cjs"),o=require("./buildChartSeriesPoints-Cqo2ed-n.cjs"),s=require("./useHasListener-BPgtbbo6.cjs");let c=require("vue");var l=(e,n,r,a=!1)=>i.t(e,n,r,a,{palette:t._,paletteFallback:t.g.multiLinePalette1,skeletonPalette:t.b,skeletonFallback:t.g.skeletonPalette1}),u=(e,t,n)=>{if(t)return t;let r=e.reduce((e,t)=>{let n=t.points.reduce((e,t)=>Math.max(e,t.value),0);return Math.max(e,n)},0),i=Math.ceil(r/n)*n;return i>0?i:n*5},d=3,f=.4,p=4,m=5,h=({seriesList:e,colorHostElement:i,yMax:o,yMin:s,yStep:c=m,mirrorYAxis:h=!0,straightSegments:g=!1,skeleton:_=!1,onSeriesClick:v})=>{if(!n.t(e))return null;let y=t.S(t.g.axisLabel,i),b=t.S(t.g.grid,i),x=t.S(t.g.tooltipBackground,i),S=t.S(t.g.tooltipText,i),C=_&&o?o:u(e,o,c),w=_&&s!==void 0?s:0,T=e[0]?.points.map(e=>e.label)??[],E=t.r({kind:`series`,skeleton:_,colorHostElement:i,onIndexClick:v});return{type:`line`,data:{labels:T,datasets:e.map((e,t)=>{let n=l(t,i,e.fillColor,_);return{label:e.label,data:e.points.map(e=>e.value),borderColor:n,backgroundColor:n,..._?{}:{hoverBorderColor:n,hoverBackgroundColor:n},borderWidth:p,fill:!1,pointRadius:g&&!_?d:0,pointHoverRadius:4,tension:g?0:f}})},options:{responsive:!0,maintainAspectRatio:!1,onHover:E.onHover,onClick:E.onClick,interaction:t.i(_,{mode:`index`,intersect:!1}),hover:_?void 0:{mode:`nearest`,intersect:!1},plugins:{legend:{display:!1},tooltip:{enabled:t.a(_),backgroundColor:x,titleColor:S,bodyColor:S,footerColor:S,displayColors:!1,position:t.u,yAlign:`bottom`,xAlign:`center`,caretPadding:8,callbacks:t.d()}},scales:a.t({axisLabelColor:y,gridColor:b,yMin:w,yMax:C,yStep:c,mirrorYAxis:h})},plugins:t.o(_,[r.t(i),...E.plugins])}},g=[`26.01`,`2.02`,`9.02`,`16.02`,`23.02`,`2.03`,`9.03`,`16.03`,`23.03`,`30.03`,`6.04`],_=[{label:`Series 1`,points:o.t(g,[30,34,38,44,46,50,54,56,58,60,62])},{label:`Series 2`,points:o.t(g,[22,24,26,28,30,32,33,35,36,38,40])}],v={class:`s-ui-chart-multi-line__canvas-wrap`},y=(0,c.defineComponent)({__name:`SChartMultiLine`,props:{series:{default:()=>[]},loading:{type:Boolean,default:!1},yMax:{},yStep:{},mirrorYAxis:{type:Boolean,default:!0},straightSegments:{type:Boolean,default:!1}},emits:[`seriesClick`],setup(n,{expose:r,emit:i}){let a=i,u=(0,c.useTemplateRef)(`chartRootRef`),d=(0,c.useTemplateRef)(`chartCanvasRef`),f=(0,c.computed)(()=>n.loading?_:n.series),p=e=>{let t=n.series[e];t&&a(`seriesClick`,e,t)},m=s.t(`onSeriesClick`),g=(0,c.computed)(()=>!n.loading&&n.series.length===0?null:h({seriesList:f.value,colorHostElement:u.value,yMax:n.yMax,yStep:n.yStep,mirrorYAxis:n.mirrorYAxis,straightSegments:n.straightSegments,skeleton:n.loading,onSeriesClick:m()?p:void 0})),y=(0,c.computed)(()=>o.n(f.value,(e,t)=>l(e,u.value,t,n.loading))),{chartInstance:b}=t.n({canvasRef:d,config:g,enabled:(0,c.computed)(()=>n.loading||n.series.length>0)}),{exportImage:x,handleLegendItemHover:S}=t.t({chartInstance:b,canvasRef:d,colorHostElement:u});return r({exportImage:x}),(r,i)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:u,class:(0,c.normalizeClass)([`s-ui-chart-multi-line`,{"s-ui-chart-multi-line--skeleton":n.loading}])},[(0,c.createElementVNode)(`div`,v,[(0,c.createVNode)((0,c.unref)(t.C),{loading:n.loading},{default:(0,c.withCtx)(()=>[(0,c.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:d,class:`s-ui-chart-multi-line__canvas`},null,512)]),_:1},8,[`loading`])]),y.value.length?((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(e.t),{key:0,items:y.value,disabled:n.loading,interactive:!n.loading,onItemHover:(0,c.unref)(S)},null,8,[`items`,`disabled`,`interactive`,`onItemHover`])):(0,c.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return y}});
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./SChartLegend-oZoF8XK7.js";
|
|
2
|
-
import { C as t, S as n, _ as r, a as i, b as a, d as o, g as s, i as c, n as l, o as u, r as d, t as f, u as p } from "./useChartInteractivity-BATdT86l.js";
|
|
3
|
-
import { t as m } from "./areChartSeriesAligned-DjonrIMm.js";
|
|
4
|
-
import { t as h } from "./createChartCrosshairPlugin-DU5grSok.js";
|
|
5
|
-
import { t as g } from "./resolveSeriesPaletteColor-DcLSyk-D.js";
|
|
6
|
-
import { t as _ } from "./buildMultiLineChartScales-CFZ8YVeJ.js";
|
|
7
|
-
import { n as v, t as y } from "./buildChartSeriesPoints-BTyOpkin.js";
|
|
8
|
-
import { t as b } from "./useHasListener-RSjlUyqH.js";
|
|
9
|
-
import { computed as x, createBlock as S, createCommentVNode as C, createElementBlock as w, createElementVNode as T, createVNode as E, defineComponent as D, normalizeClass as O, openBlock as k, unref as A, useTemplateRef as j, withCtx as M } from "vue";
|
|
10
|
-
//#region src/utils/chart/multiLine/resolveMultiLineSeriesColor.ts
|
|
11
|
-
var N = (e, t, n, i = !1) => g(e, t, n, i, {
|
|
12
|
-
palette: r,
|
|
13
|
-
paletteFallback: s.multiLinePalette1,
|
|
14
|
-
skeletonPalette: a,
|
|
15
|
-
skeletonFallback: s.skeletonPalette1
|
|
16
|
-
}), P = (e, t, n) => {
|
|
17
|
-
if (t) return t;
|
|
18
|
-
let r = e.reduce((e, t) => {
|
|
19
|
-
let n = t.points.reduce((e, t) => Math.max(e, t.value), 0);
|
|
20
|
-
return Math.max(e, n);
|
|
21
|
-
}, 0), i = Math.ceil(r / n) * n;
|
|
22
|
-
return i > 0 ? i : n * 5;
|
|
23
|
-
}, F = 3, I = .4, L = 4, R = 5, z = ({ seriesList: e, colorHostElement: t, yMax: r, yMin: a, yStep: l = R, mirrorYAxis: f = !0, straightSegments: g = !1, skeleton: v = !1, onSeriesClick: y }) => {
|
|
24
|
-
if (!m(e)) return null;
|
|
25
|
-
let b = n(s.axisLabel, t), x = n(s.grid, t), S = n(s.tooltipBackground, t), C = n(s.tooltipText, t), w = v && r ? r : P(e, r, l), T = v && a !== void 0 ? a : 0, E = e[0]?.points.map((e) => e.label) ?? [], D = d({
|
|
26
|
-
kind: "series",
|
|
27
|
-
skeleton: v,
|
|
28
|
-
colorHostElement: t,
|
|
29
|
-
onIndexClick: y
|
|
30
|
-
});
|
|
31
|
-
return {
|
|
32
|
-
type: "line",
|
|
33
|
-
data: {
|
|
34
|
-
labels: E,
|
|
35
|
-
datasets: e.map((e, n) => {
|
|
36
|
-
let r = N(n, t, e.fillColor, v);
|
|
37
|
-
return {
|
|
38
|
-
label: e.label,
|
|
39
|
-
data: e.points.map((e) => e.value),
|
|
40
|
-
borderColor: r,
|
|
41
|
-
backgroundColor: r,
|
|
42
|
-
...v ? {} : {
|
|
43
|
-
hoverBorderColor: r,
|
|
44
|
-
hoverBackgroundColor: r
|
|
45
|
-
},
|
|
46
|
-
borderWidth: L,
|
|
47
|
-
fill: !1,
|
|
48
|
-
pointRadius: g && !v ? F : 0,
|
|
49
|
-
pointHoverRadius: 4,
|
|
50
|
-
tension: g ? 0 : I
|
|
51
|
-
};
|
|
52
|
-
})
|
|
53
|
-
},
|
|
54
|
-
options: {
|
|
55
|
-
responsive: !0,
|
|
56
|
-
maintainAspectRatio: !1,
|
|
57
|
-
onHover: D.onHover,
|
|
58
|
-
onClick: D.onClick,
|
|
59
|
-
interaction: c(v, {
|
|
60
|
-
mode: "index",
|
|
61
|
-
intersect: !1
|
|
62
|
-
}),
|
|
63
|
-
hover: v ? void 0 : {
|
|
64
|
-
mode: "nearest",
|
|
65
|
-
intersect: !1
|
|
66
|
-
},
|
|
67
|
-
plugins: {
|
|
68
|
-
legend: { display: !1 },
|
|
69
|
-
tooltip: {
|
|
70
|
-
enabled: i(v),
|
|
71
|
-
backgroundColor: S,
|
|
72
|
-
titleColor: C,
|
|
73
|
-
bodyColor: C,
|
|
74
|
-
footerColor: C,
|
|
75
|
-
displayColors: !1,
|
|
76
|
-
position: p,
|
|
77
|
-
yAlign: "bottom",
|
|
78
|
-
xAlign: "center",
|
|
79
|
-
caretPadding: 8,
|
|
80
|
-
callbacks: o()
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
scales: _({
|
|
84
|
-
axisLabelColor: b,
|
|
85
|
-
gridColor: x,
|
|
86
|
-
yMin: T,
|
|
87
|
-
yMax: w,
|
|
88
|
-
yStep: l,
|
|
89
|
-
mirrorYAxis: f
|
|
90
|
-
})
|
|
91
|
-
},
|
|
92
|
-
plugins: u(v, [h(t), ...D.plugins])
|
|
93
|
-
};
|
|
94
|
-
}, B = [
|
|
95
|
-
"26.01",
|
|
96
|
-
"2.02",
|
|
97
|
-
"9.02",
|
|
98
|
-
"16.02",
|
|
99
|
-
"23.02",
|
|
100
|
-
"2.03",
|
|
101
|
-
"9.03",
|
|
102
|
-
"16.03",
|
|
103
|
-
"23.03",
|
|
104
|
-
"30.03",
|
|
105
|
-
"6.04"
|
|
106
|
-
], V = [{
|
|
107
|
-
label: "Series 1",
|
|
108
|
-
points: y(B, [
|
|
109
|
-
30,
|
|
110
|
-
34,
|
|
111
|
-
38,
|
|
112
|
-
44,
|
|
113
|
-
46,
|
|
114
|
-
50,
|
|
115
|
-
54,
|
|
116
|
-
56,
|
|
117
|
-
58,
|
|
118
|
-
60,
|
|
119
|
-
62
|
|
120
|
-
])
|
|
121
|
-
}, {
|
|
122
|
-
label: "Series 2",
|
|
123
|
-
points: y(B, [
|
|
124
|
-
22,
|
|
125
|
-
24,
|
|
126
|
-
26,
|
|
127
|
-
28,
|
|
128
|
-
30,
|
|
129
|
-
32,
|
|
130
|
-
33,
|
|
131
|
-
35,
|
|
132
|
-
36,
|
|
133
|
-
38,
|
|
134
|
-
40
|
|
135
|
-
])
|
|
136
|
-
}], H = { class: "s-ui-chart-multi-line__canvas-wrap" }, U = /* @__PURE__ */ D({
|
|
137
|
-
__name: "SChartMultiLine",
|
|
138
|
-
props: {
|
|
139
|
-
series: { default: () => [] },
|
|
140
|
-
loading: {
|
|
141
|
-
type: Boolean,
|
|
142
|
-
default: !1
|
|
143
|
-
},
|
|
144
|
-
yMax: {},
|
|
145
|
-
yStep: {},
|
|
146
|
-
mirrorYAxis: {
|
|
147
|
-
type: Boolean,
|
|
148
|
-
default: !0
|
|
149
|
-
},
|
|
150
|
-
straightSegments: {
|
|
151
|
-
type: Boolean,
|
|
152
|
-
default: !1
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
emits: ["seriesClick"],
|
|
156
|
-
setup(n, { expose: r, emit: i }) {
|
|
157
|
-
let a = i, o = j("chartRootRef"), s = j("chartCanvasRef"), c = x(() => n.loading ? V : n.series), u = (e) => {
|
|
158
|
-
let t = n.series[e];
|
|
159
|
-
t && a("seriesClick", e, t);
|
|
160
|
-
}, d = b("onSeriesClick"), p = x(() => !n.loading && n.series.length === 0 ? null : z({
|
|
161
|
-
seriesList: c.value,
|
|
162
|
-
colorHostElement: o.value,
|
|
163
|
-
yMax: n.yMax,
|
|
164
|
-
yStep: n.yStep,
|
|
165
|
-
mirrorYAxis: n.mirrorYAxis,
|
|
166
|
-
straightSegments: n.straightSegments,
|
|
167
|
-
skeleton: n.loading,
|
|
168
|
-
onSeriesClick: d() ? u : void 0
|
|
169
|
-
})), m = x(() => v(c.value, (e, t) => N(e, o.value, t, n.loading))), { chartInstance: h } = l({
|
|
170
|
-
canvasRef: s,
|
|
171
|
-
config: p,
|
|
172
|
-
enabled: x(() => n.loading || n.series.length > 0)
|
|
173
|
-
}), { exportImage: g, handleLegendItemHover: _ } = f({
|
|
174
|
-
chartInstance: h,
|
|
175
|
-
canvasRef: s,
|
|
176
|
-
colorHostElement: o
|
|
177
|
-
});
|
|
178
|
-
return r({ exportImage: g }), (r, i) => (k(), w("div", {
|
|
179
|
-
ref_key: "chartRootRef",
|
|
180
|
-
ref: o,
|
|
181
|
-
class: O(["s-ui-chart-multi-line", { "s-ui-chart-multi-line--skeleton": n.loading }])
|
|
182
|
-
}, [T("div", H, [E(A(t), { loading: n.loading }, {
|
|
183
|
-
default: M(() => [T("canvas", {
|
|
184
|
-
ref_key: "chartCanvasRef",
|
|
185
|
-
ref: s,
|
|
186
|
-
class: "s-ui-chart-multi-line__canvas"
|
|
187
|
-
}, null, 512)]),
|
|
188
|
-
_: 1
|
|
189
|
-
}, 8, ["loading"])]), m.value.length ? (k(), S(A(e), {
|
|
190
|
-
key: 0,
|
|
191
|
-
items: m.value,
|
|
192
|
-
disabled: n.loading,
|
|
193
|
-
interactive: !n.loading,
|
|
194
|
-
onItemHover: A(_)
|
|
195
|
-
}, null, 8, [
|
|
196
|
-
"items",
|
|
197
|
-
"disabled",
|
|
198
|
-
"interactive",
|
|
199
|
-
"onItemHover"
|
|
200
|
-
])) : C("", !0)], 2));
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
//#endregion
|
|
204
|
-
export { U as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SChartLegend-DGtjd6zV.cjs"),t=require("./useChartInteractivity-CXSdHPOw.cjs"),n=require("./resolveSeriesPaletteColor-B5qoBbXN.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.y,paletteFallback:t.g.piePalette1,skeletonPalette:t.v,skeletonFallback:t.g.pieSkeletonPalette1}),o=()=>({title:()=>``,label:e=>`${e.label??``} – ${e.parsed??0}`}),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=>({id:`pieSegmentBadge`,afterDatasetsDraw(n){let r=n.getDatasetMeta(0);if(!r)return;let i=t.S(t.g.pieBadgeBackground,e),a=t.S(t.g.pieBadgeBorder,e),o=t.S(t.g.pieBadgeText,e),{ctx:p}=n;p.save(),p.font=u,p.textAlign=`center`,p.textBaseline=`middle`;for(let e=0;e<r.data.length;e+=1){let t=r.data[e],u=n.data.datasets[0]?.data[e],m=t?f(t):null;if(t&&typeof u==`number`&&u>0&&m){let e=`${u}`,t=p.measureText(e).width+s*2;d(p,m.x-t/2,m.y-20/2,t,20,c),p.fillStyle=i,p.fill(),p.lineWidth=l,p.strokeStyle=a,p.stroke(),p.fillStyle=o,p.fillText(e,m.x,m.y)}}p.restore()}}),m=({sliceList:e,colorHostElement:n,skeleton:r=!1,onSliceClick:i})=>{if(e.length===0)return null;let s=t.S(t.g.pieSegmentBorder,n),c=t.S(t.g.tooltipBackground,n),l=t.S(t.g.tooltipText,n),u=e.map((e,t)=>a(t,n,e.fillColor,r)),d=t.r({kind:`element`,skeleton:r,colorHostElement:n,onIndexClick:i});return{type:`pie`,data:{labels:e.map(e=>e.label),datasets:[{data:e.map(e=>e.value),backgroundColor:u,hoverBackgroundColor:u,borderColor:s,hoverBorderColor:s,borderWidth:4,hoverBorderWidth:4,hoverOffset:26,spacing:0,borderRadius:8}]},options:{responsive:!0,maintainAspectRatio:!0,cutout:`58%`,rotation:115,layout:{padding:26},onHover:d.onHover,onClick:d.onClick,interaction:t.i(r,{mode:`nearest`,intersect:!0}),plugins:{legend:{display:!1},tooltip:{enabled:t.a(r),backgroundColor:c,titleColor:l,bodyColor:l,displayColors:!1,callbacks:o()}}},plugins:t.o(r,[p(n),...d.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}},emits:[`sliceClick`],setup(n,{expose:o,emit:s}){let c=s,l=t.w,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,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.C),{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`])]),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 +0,0 @@
|
|
|
1
|
-
let e=require("vue"),t=require("@shtabapp/ui-kit-primitives"),n=require("@vueuse/core");var r=e=>{let t=Math.round(Math.max(0,e)/60),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`},i={class:`s-ui-calendar-month__header`,role:`row`},a={key:0,class:`s-ui-calendar-month__weekday s-ui-calendar-month__weekday--summary`,role:`columnheader`},o={class:`s-ui-calendar-month__day-number`},s={key:0,class:`s-ui-calendar-month__skeleton`,"aria-hidden":`true`},c={class:`s-ui-calendar-month__day-values`},l={key:0,class:`s-ui-calendar-month__day s-ui-calendar-month__day--summary`,role:`gridcell`},u={key:0,class:`s-ui-calendar-month__skeleton`,"aria-hidden":`true`},d={key:1,class:`s-ui-calendar-month__week-total`},f=5,p=`00:00`,m=(0,e.defineComponent)({__name:`SCalendarMonth`,props:{weeks:{},weekdayLabels:{},weekSummaryLabel:{default:``},hideWeekends:{type:Boolean,default:!1},hideWeekSummary:{type:Boolean,default:!1},hideEmpty:{type:Boolean,default:!1},todayDate:{default:``},loading:{type:Boolean,default:!1},interactive:{type:Boolean,default:!1},formatDuration:{type:Function}},emits:[`dayClick`],setup(t,{emit:n}){let m=n,h=e=>(t.formatDuration??r)(e),g=(0,e.computed)(()=>t.hideWeekends?t.weekdayLabels.slice(0,f):t.weekdayLabels),_=(0,e.computed)(()=>({"s-ui-calendar-month--no-weekends":t.hideWeekends,"s-ui-calendar-month--no-summary":t.hideWeekSummary,"s-ui-calendar-month--loading":t.loading})),v=e=>t.hideWeekends?e.days.slice(0,f):e.days,y=e=>e.totalSeconds===void 0?v(e).reduce((e,t)=>e+(t.isOtherMonth?0:t.workedSeconds),0):e.totalSeconds,b=e=>e.workedSeconds>0?h(e.workedSeconds):t.hideEmpty?``:p,x=e=>e.overtimeSeconds>0?e.overtimeSeconds:e.undertimeSeconds,S=e=>e.workedSeconds>0?`s-ui-calendar-month__worked--filled`:`s-ui-calendar-month__worked--empty`,C=e=>({"s-ui-calendar-month__day--other":!!e.isOtherMonth,"s-ui-calendar-month__day--today":!!t.todayDate&&e.date===t.todayDate,"s-ui-calendar-month__day--interactive":t.interactive&&!e.isOtherMonth}),w=e=>{!t.interactive||e.isOtherMonth||t.loading||m(`dayClick`,e)};return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`s-ui-calendar-month`,_.value]),role:`grid`},[(0,e.createElementVNode)(`div`,i,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(g.value,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`span`,{key:t,class:`s-ui-calendar-month__weekday`,role:`columnheader`},(0,e.toDisplayString)(t),1))),128)),t.hideWeekSummary?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`span`,a,(0,e.toDisplayString)(t.weekSummaryLabel),1))]),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.weeks,(i,a)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:i.days[0]?.date??a,class:`s-ui-calendar-month__week`,role:`row`},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(v(i),i=>((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.interactive?`button`:`div`),{key:i.date,type:t.interactive?`button`:void 0,class:(0,e.normalizeClass)([`s-ui-calendar-month__day`,C(i)]),role:`gridcell`,onClick:e=>w(i)},{default:(0,e.withCtx)(()=>[i.isOtherMonth?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:0},[(0,e.createElementVNode)(`span`,o,(0,e.toDisplayString)(i.dayNumber),1),t.loading?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,s)):(0,e.renderSlot)(n.$slots,`day`,{key:1,day:i},()=>[(0,e.createElementVNode)(`span`,c,[(0,e.createElementVNode)(`span`,{class:(0,e.normalizeClass)([`s-ui-calendar-month__worked`,S(i)])},(0,e.toDisplayString)(b(i)),3),x(i)>0?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:0},[r[0]||=(0,e.createElementVNode)(`span`,{class:`s-ui-calendar-month__dot`,"aria-hidden":`true`},`•`,-1),(0,e.createElementVNode)(`span`,{class:(0,e.normalizeClass)([`s-ui-calendar-month__delta`,i.overtimeSeconds>0?`s-ui-calendar-month__delta--overtime`:`s-ui-calendar-month__delta--undertime`])},(0,e.toDisplayString)(h(x(i))),3)],64)):(0,e.createCommentVNode)(``,!0)])])],64))]),_:2},1032,[`type`,`class`,`onClick`]))),128)),t.hideWeekSummary?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,l,[t.loading?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,u)):((0,e.openBlock)(),(0,e.createElementBlock)(`span`,d,(0,e.toDisplayString)(h(y(i))),1))]))]))),128))],2))}}),h=function(e){return e.COMPUTER=`computer`,e.PHONE=`phone`,e.MANUAL=`manual`,e.IDLE=`idle`,e}({}),g=[h.COMPUTER,h.PHONE,h.MANUAL,h.IDLE],_={[h.COMPUTER]:`var(--s-ui-color-background-accent-blue-secondary)`,[h.PHONE]:`var(--s-ui-color-background-accent-indigo-secondary)`,[h.MANUAL]:`var(--s-ui-color-background-accent-teal-secondary)`,[h.IDLE]:`var(--s-ui-color-background-accent-orange-secondary)`},v=12,y={class:`s-ui-calendar-week-grid__header`,role:`row`},b={class:`s-ui-calendar-week-grid__slot-label`,role:`rowheader`},x=(0,e.defineComponent)({__name:`SCalendarWeekGrid`,props:{days:{},slotLabels:{},highlightedCategory:{default:null},loading:{type:Boolean,default:!1},interactive:{type:Boolean,default:!1}},emits:[`cellClick`],setup(t,{emit:n}){let r=n,i=()=>Array.from({length:12},(e,t)=>{let n=t*2,r=(n+2)%24,i=e=>String(e).padStart(2,`0`);return`${i(n)}:00 - ${i(r)}:00`}),a=(0,e.computed)(()=>t.slotLabels??i()),o=(0,e.computed)(()=>({"s-ui-calendar-week-grid--loading":t.loading,"s-ui-calendar-week-grid--highlighting":t.highlightedCategory!==null})),s=(0,e.computed)(()=>({"--s-ui-calendar-week-grid-day-count":String(t.days.length)})),c=e=>({"s-ui-calendar-week-grid__cell--empty":e===null,"s-ui-calendar-week-grid__cell--muted":t.highlightedCategory!==null&&e!==t.highlightedCategory,"s-ui-calendar-week-grid__cell--interactive":t.interactive}),l=e=>{if(!(t.loading||e===null))return{backgroundColor:_[e]}},u=(e,n)=>{!t.interactive||t.loading||r(`cellClick`,{day:e,slotIndex:n,category:e.slots[n]??null})};return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`s-ui-calendar-week-grid`,o.value]),style:(0,e.normalizeStyle)(s.value),role:`grid`},[(0,e.createElementVNode)(`div`,y,[r[0]||=(0,e.createElementVNode)(`span`,{class:`s-ui-calendar-week-grid__corner`,"aria-hidden":`true`},null,-1),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.days,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`span`,{key:t.date,class:`s-ui-calendar-week-grid__day-label`,role:`columnheader`},(0,e.toDisplayString)(t.label),1))),128))]),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(a.value,(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:n,class:`s-ui-calendar-week-grid__row`,role:`row`},[(0,e.createElementVNode)(`span`,b,(0,e.toDisplayString)(n),1),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.days,n=>((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.interactive?`button`:`div`),{key:n.date,type:t.interactive?`button`:void 0,"aria-label":t.interactive?`${n.label}, ${a.value[r]}`:void 0,class:(0,e.normalizeClass)([`s-ui-calendar-week-grid__cell`,c(n.slots[r]??null)]),style:(0,e.normalizeStyle)(l(n.slots[r]??null)),role:`gridcell`,onClick:e=>u(n,r)},null,8,[`type`,`aria-label`,`class`,`style`,`onClick`]))),128))]))),128))],6))}}),S=1440,C=[`role`,`aria-pressed`,`aria-label`,`onClick`],w={class:`s-ui-day-timeline__range-label`},T=[`aria-label`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`onPointerdown`,`onKeydown`],E=[`aria-label`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`onPointerdown`,`onKeydown`],D={key:1,class:`s-ui-day-timeline__skeleton`,"aria-hidden":`true`},O={class:`s-ui-day-timeline__scale`,"aria-hidden":`true`},k=5,A=5,j=(0,e.defineComponent)({__name:`SDayTimeline`,props:{intervals:{},hourLabels:{},highlightedCategory:{default:null},loading:{type:Boolean,default:!1},interactive:{type:Boolean,default:!1},resizable:{type:Boolean,default:!1},selectedId:{default:null}},emits:[`select`,`resizeCommit`],setup(r,{emit:i}){let a=S/60,o=i,{t:s}=(0,t.useUiKitI18n)(),c=(0,e.useTemplateRef)(`trackRef`),l=(0,e.ref)(null),u=(0,e.ref)(null),d=e=>{let t=Math.min(S,Math.max(0,e)),n=Math.floor(t/60),r=t%60;return`${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`},f=e=>`${d(e.startMinute)} – ${d(e.endMinute)}`,p=(0,e.computed)(()=>r.hourLabels??Array.from({length:a/2+1},(e,t)=>String(t*2))),m=(0,e.computed)(()=>({"s-ui-day-timeline--loading":r.loading,"s-ui-day-timeline--resizable":r.resizable})),h=e=>l.value?.id===e.id&&u.value?u.value:{start:e.startMinute,end:e.endMinute},g=e=>{let{start:t,end:n}=h(e);return`${d(t)} – ${d(n)}`},v=e=>({"s-ui-day-timeline__block--empty":e.category===null,"s-ui-day-timeline__block--muted":r.highlightedCategory!==null&&e.category!==r.highlightedCategory,"s-ui-day-timeline__block--interactive":r.interactive,"s-ui-day-timeline__block--selected":r.selectedId===e.id}),y=e=>{let{start:t,end:n}=h(e);return{left:`${t/S*100}%`,width:`${(n-t)/S*100}%`,backgroundColor:e.category?_[e.category]:void 0}},b=e=>{!r.interactive||r.loading||o(`select`,r.selectedId===e.id?null:e.id)},x=e=>{let t=c.value;if(!t)return 0;let n=t.getBoundingClientRect(),r=(e-n.left)/n.width;return Math.min(S,Math.max(0,Math.round(r*S)))},j=(e,t,n)=>t===`start`?{start:Math.max(0,Math.min(n,e.end-k)),end:e.end}:{start:e.start,end:Math.min(S,Math.max(n,e.start+k))},M=(e,t,n)=>{!r.resizable||r.loading||(n.preventDefault(),n.stopPropagation(),l.value={id:e.id,edge:t},u.value={start:e.startMinute,end:e.endMinute})},N=(e,t,n)=>{let r=n.key===`ArrowLeft`||n.key===`ArrowDown`?-1:+(n.key===`ArrowRight`||n.key===`ArrowUp`);if(r===0)return;n.preventDefault();let i=h(e),a=j(i,t,(t===`start`?i.start:i.end)+r*A);(a.start!==e.startMinute||a.end!==e.endMinute)&&o(`resizeCommit`,{id:e.id,startMinute:a.start,endMinute:a.end})};return(0,n.useEventListener)(`pointermove`,e=>{!l.value||!u.value||(u.value=j(u.value,l.value.edge,x(e.clientX)))}),(0,n.useEventListener)(`pointerup`,()=>{if(l.value&&u.value){let{id:e}=l.value,{start:t,end:n}=u.value,i=r.intervals.find(t=>t.id===e);i&&(i.startMinute!==t||i.endMinute!==n)&&o(`resizeCommit`,{id:e,startMinute:t,endMinute:n})}l.value=null,u.value=null}),(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`s-ui-day-timeline`,m.value])},[(0,e.createElementVNode)(`div`,{ref_key:`trackRef`,ref:c,class:`s-ui-day-timeline__track`},[r.loading?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,{key:0},(0,e.renderList)(r.intervals,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.id,class:(0,e.normalizeClass)([`s-ui-day-timeline__block`,v(t)]),style:(0,e.normalizeStyle)(y(t)),role:r.interactive?`button`:void 0,"aria-pressed":r.interactive?r.selectedId===t.id:void 0,"aria-label":r.interactive?f(t):void 0,onClick:e=>b(t)},[r.resizable&&r.selectedId===t.id?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:0},[(0,e.createElementVNode)(`span`,w,(0,e.toDisplayString)(g(t)),1),(0,e.createElementVNode)(`button`,{type:`button`,role:`slider`,class:`s-ui-day-timeline__handle s-ui-day-timeline__handle--start`,"aria-label":(0,e.unref)(s)(`dayTimeline.rangeStart`),"aria-valuemin":0,"aria-valuemax":(0,e.unref)(S),"aria-valuenow":h(t).start,"aria-valuetext":d(h(t).start),onClick:n[0]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerdown:e=>M(t,`start`,e),onKeydown:e=>N(t,`start`,e)},[...n[2]||=[(0,e.createElementVNode)(`span`,{class:`s-ui-day-timeline__handle-icon`,"aria-hidden":`true`},`‹`,-1)]],40,T),(0,e.createElementVNode)(`button`,{type:`button`,role:`slider`,class:`s-ui-day-timeline__handle s-ui-day-timeline__handle--end`,"aria-label":(0,e.unref)(s)(`dayTimeline.rangeEnd`),"aria-valuemin":0,"aria-valuemax":(0,e.unref)(S),"aria-valuenow":h(t).end,"aria-valuetext":d(h(t).end),onClick:n[1]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerdown:e=>M(t,`end`,e),onKeydown:e=>N(t,`end`,e)},[...n[3]||=[(0,e.createElementVNode)(`span`,{class:`s-ui-day-timeline__handle-icon`,"aria-hidden":`true`},`›`,-1)]],40,E)],64)):(0,e.createCommentVNode)(``,!0)],14,C))),128)),r.loading?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,D)):(0,e.createCommentVNode)(``,!0)],512),(0,e.createElementVNode)(`div`,O,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(p.value,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`span`,{key:t,class:`s-ui-day-timeline__scale-label`},(0,e.toDisplayString)(t),1))),128))])],2))}}),M=(e,t=g)=>t.map(t=>({label:e[t],color:_[t]}));Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return r}});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region src/utils/chart/css/applyOpacityToCssColor.ts
|
|
2
|
-
var e = (e, t) => !e || t >= 1 ? e : t <= 0 ? "transparent" : `color-mix(in srgb, ${e} ${Math.round(t * 100)}%, transparent)`, t = 172, n = .0643, r = .8972, i = (e, t) => {
|
|
3
|
-
let n = e.right - e.left, r = e.bottom - e.top, i = (t - 90) * Math.PI / 180, a = Math.abs(n * Math.sin(i)) + Math.abs(r * Math.cos(i)), o = (e.left + e.right) / 2, s = (e.top + e.bottom) / 2, c = Math.cos(i) * a / 2, l = Math.sin(i) * a / 2;
|
|
4
|
-
return {
|
|
5
|
-
x0: o - c,
|
|
6
|
-
y0: s - l,
|
|
7
|
-
x1: o + c,
|
|
8
|
-
y1: s + l
|
|
9
|
-
};
|
|
10
|
-
}, a = (a, o, s, c = 1) => {
|
|
11
|
-
let { chart: l } = a, { ctx: u, chartArea: d } = l;
|
|
12
|
-
if (!d) return o;
|
|
13
|
-
let f = e(o, c), p = e(s, c), { x0: m, y0: h, x1: g, y1: _ } = i(d, t), v = u.createLinearGradient(m, h, g, _);
|
|
14
|
-
return v.addColorStop(0, f), v.addColorStop(n, f), v.addColorStop(r, p), v.addColorStop(1, p), v;
|
|
15
|
-
};
|
|
16
|
-
//#endregion
|
|
17
|
-
export { a as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=(e,t)=>!e||t>=1?e:t<=0?`transparent`:`color-mix(in srgb, ${e} ${Math.round(t*100)}%, transparent)`,t=172,n=.0643,r=.8972,i=(e,t)=>{let n=e.right-e.left,r=e.bottom-e.top,i=(t-90)*Math.PI/180,a=Math.abs(n*Math.sin(i))+Math.abs(r*Math.cos(i)),o=(e.left+e.right)/2,s=(e.top+e.bottom)/2,c=Math.cos(i)*a/2,l=Math.sin(i)*a/2;return{x0:o-c,y0:s-l,x1:o+c,y1:s+l}},a=(a,o,s,c=1)=>{let{chart:l}=a,{ctx:u,chartArea:d}=l;if(!d)return o;let f=e(o,c),p=e(s,c),{x0:m,y0:h,x1:g,y1:_}=i(d,t),v=u.createLinearGradient(m,h,g,_);return v.addColorStop(0,f),v.addColorStop(n,f),v.addColorStop(r,p),v.addColorStop(1,p),v};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./useChartInteractivity-CXSdHPOw.cjs"),t=require("./resolveSeriesPaletteColor-B5qoBbXN.cjs");var n=(n,r,i,a=!1)=>t.t(n,r,i,a,{palette:e.h,paletteFallback:e.g.barStackedPalette1,skeletonPalette:e.m,skeletonFallback:e.g.barSkeletonPalette1});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|