@shtabapp/ui-kit 1.69.0 → 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 +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-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/STable-Ch7thYCy.cjs +1 -0
- package/dist/{STable-9Kb75bwz.js → STable-CunQFK-x.js} +5 -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/components/STable/STable.vue.d.ts.map +1 -1
- package/dist/components/STable/parts/STableGroupRow.vue.d.ts +3 -1
- package/dist/components/STable/parts/STableGroupRow.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/entries/table.cjs +1 -1
- package/dist/entries/table.js +1 -1
- 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/STable-EpiUErdI.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
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## [@shtabapp/ui-kit-v1.70.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.69.1...@shtabapp/ui-kit@1.70.0) (2026-09-03)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- charts calendar improvements ([8a2bc57](https://gitlab.com/mstikharev/shtab-ui-kit/commit/8a2bc57d77a078cd1e1bd1aa2a7f5a8cad16e111))
|
|
6
|
+
- hover multiline fix ([a945305](https://gitlab.com/mstikharev/shtab-ui-kit/commit/a9453059ea9e66d3925fae38af36d50428636954))
|
|
7
|
+
|
|
8
|
+
## [@shtabapp/ui-kit-v1.69.1](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.69.0...@shtabapp/ui-kit@1.69.1) (2026-09-02)
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
- **components:** s-table group rows receive rowStyle inline style ([e9c9dd0](https://gitlab.com/mstikharev/shtab-ui-kit/commit/e9c9dd0ce466e6805738085d0a94a2c4a3839f2b))
|
|
13
|
+
|
|
1
14
|
## [@shtabapp/ui-kit-v1.69.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.68.0...@shtabapp/ui-kit@1.69.0) (2026-09-02)
|
|
2
15
|
|
|
3
16
|
### Features
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { t as e } from "./SChartLegend-oZoF8XK7.js";
|
|
2
|
+
import { E as t, T as n, c as r, l as i, n as a, r as o, s, t as c, y as l } from "./useChartInteractivity-Cl06JL4l.js";
|
|
3
|
+
import { t as u } from "./buildCartesianChartScales-EofFq3ry.js";
|
|
4
|
+
import { t as d } from "./resolveChartValueRange-DZybnmaX.js";
|
|
5
|
+
import { t as f } from "./resolveBarStackedSeriesColor-DM7Ax0-s.js";
|
|
6
|
+
import { n as p, t as m } from "./buildChartSeriesPoints-BTyOpkin.js";
|
|
7
|
+
import { t as h } from "./useHasListener-RSjlUyqH.js";
|
|
8
|
+
import { computed as g, createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createVNode as x, defineComponent as S, normalizeClass as C, openBlock as w, unref as T, useTemplateRef as E, withCtx as D } from "vue";
|
|
9
|
+
//#region src/components/SChartBar/utils/createBarTargetLinePlugin.ts
|
|
10
|
+
var O = 1, k = [4, 4], A = "500 10px var(--s-ui-font-family-label)", j = 4, M = (e) => e.length > 0 && new Set(e).size === 1, N = ({ target: e, colorHostElement: t, rightAxisId: r }) => ({
|
|
11
|
+
id: "barTargetLine",
|
|
12
|
+
afterDatasetsDraw(i) {
|
|
13
|
+
if (!e || e.values.length === 0) return;
|
|
14
|
+
let a = e.axis === "right" ? r : "y", o = i.scales[a], s = i.scales.x;
|
|
15
|
+
if (!o || !s) return;
|
|
16
|
+
let { ctx: c, chartArea: u } = i, d = e.color ? n(e.color, t) || e.color : n(l.grid, t);
|
|
17
|
+
c.save(), c.strokeStyle = d, c.lineWidth = O, c.setLineDash(k);
|
|
18
|
+
let [f] = e.values;
|
|
19
|
+
if (f !== void 0 && M(e.values)) {
|
|
20
|
+
let t = o.getPixelForValue(f);
|
|
21
|
+
c.beginPath(), c.moveTo(u.left, t), c.lineTo(u.right, t), c.stroke(), e.label && (c.setLineDash([]), c.fillStyle = d, c.font = A, c.textAlign = "left", c.fillText(e.label, u.left, t - j));
|
|
22
|
+
} else {
|
|
23
|
+
let t = (u.right - u.left) / e.values.length;
|
|
24
|
+
e.values.forEach((e, n) => {
|
|
25
|
+
if (e <= 0) return;
|
|
26
|
+
let r = o.getPixelForValue(e);
|
|
27
|
+
c.beginPath(), c.moveTo(u.left + t * n, r), c.lineTo(u.left + t * (n + 1), r), c.stroke();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
c.restore();
|
|
31
|
+
}
|
|
32
|
+
}), P = 5, F = 4, I = 12, L = "yRight", R = "yMirror", z = 1.05, B = (e, t, n, r) => d(e.flatMap((e) => e.points.map((e) => e.value * z)), {
|
|
33
|
+
yMin: t,
|
|
34
|
+
yMax: n,
|
|
35
|
+
yStep: r
|
|
36
|
+
}), V = ({ seriesList: e, colorHostElement: t, yMax: a, yMin: c, yStep: d = P, rightYMax: p, rightYStep: m = P, mirrorYAxis: h = !1, target: g, skeleton: _ = !1, onPointClick: v }) => {
|
|
37
|
+
if (e.length === 0) return null;
|
|
38
|
+
let y = e.filter((e) => e.axis !== "right"), b = e.filter((e) => e.axis === "right"), x = n(l.axisLabel, t), S = n(l.grid, t), C = n(l.tooltipBackground, t), w = n(l.tooltipText, t), T = B(y, c, a, d), E = B(b, void 0, p, m), D = u({
|
|
39
|
+
axisLabelColor: x,
|
|
40
|
+
gridColor: S,
|
|
41
|
+
yMin: T.min,
|
|
42
|
+
yMax: T.max,
|
|
43
|
+
yStep: d,
|
|
44
|
+
xTickFontSize: I
|
|
45
|
+
}), O = (e, t) => ({
|
|
46
|
+
type: "linear",
|
|
47
|
+
position: "right",
|
|
48
|
+
min: e,
|
|
49
|
+
max: t,
|
|
50
|
+
border: { display: !1 },
|
|
51
|
+
grid: { drawOnChartArea: !1 },
|
|
52
|
+
ticks: D.y.ticks
|
|
53
|
+
}), k = b.length > 0 ? { [L]: O(E.min, E.max) } : h ? { [R]: O(T.min, T.max) } : {}, A = {
|
|
54
|
+
...D,
|
|
55
|
+
...k
|
|
56
|
+
}, j = o({
|
|
57
|
+
kind: "segment",
|
|
58
|
+
skeleton: _,
|
|
59
|
+
colorHostElement: t,
|
|
60
|
+
onElementIndexClick: v
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
type: "bar",
|
|
64
|
+
data: {
|
|
65
|
+
labels: e[0]?.points.map((e) => e.label) ?? [],
|
|
66
|
+
datasets: e.map((e, r) => {
|
|
67
|
+
let i = f(r, t, e.fillColor, _), a = e.points.map((e) => e.fillColor ? n(e.fillColor, t) || e.fillColor : i);
|
|
68
|
+
return {
|
|
69
|
+
label: e.label,
|
|
70
|
+
data: e.points.map((e) => e.value),
|
|
71
|
+
backgroundColor: a,
|
|
72
|
+
hoverBackgroundColor: a,
|
|
73
|
+
borderWidth: 0,
|
|
74
|
+
hoverBorderWidth: 0,
|
|
75
|
+
borderRadius: F,
|
|
76
|
+
yAxisID: e.axis === "right" ? L : "y",
|
|
77
|
+
captions: e.points.map((e) => e.caption)
|
|
78
|
+
};
|
|
79
|
+
})
|
|
80
|
+
},
|
|
81
|
+
options: {
|
|
82
|
+
responsive: !0,
|
|
83
|
+
maintainAspectRatio: !1,
|
|
84
|
+
onHover: j.onHover,
|
|
85
|
+
onClick: j.onClick,
|
|
86
|
+
hover: _ ? void 0 : {
|
|
87
|
+
mode: "nearest",
|
|
88
|
+
intersect: !0
|
|
89
|
+
},
|
|
90
|
+
interaction: s(_, {
|
|
91
|
+
mode: "nearest",
|
|
92
|
+
intersect: !0
|
|
93
|
+
}),
|
|
94
|
+
plugins: {
|
|
95
|
+
legend: { display: !1 },
|
|
96
|
+
tooltip: {
|
|
97
|
+
enabled: r(_),
|
|
98
|
+
backgroundColor: C,
|
|
99
|
+
titleColor: w,
|
|
100
|
+
bodyColor: w,
|
|
101
|
+
displayColors: !1
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
scales: A
|
|
105
|
+
},
|
|
106
|
+
plugins: i(_, [N({
|
|
107
|
+
target: g,
|
|
108
|
+
colorHostElement: t,
|
|
109
|
+
rightAxisId: L
|
|
110
|
+
}), ...j.plugins])
|
|
111
|
+
};
|
|
112
|
+
}, H = [
|
|
113
|
+
"5 неделя",
|
|
114
|
+
"6 неделя",
|
|
115
|
+
"7 неделя",
|
|
116
|
+
"8 неделя",
|
|
117
|
+
"9 неделя",
|
|
118
|
+
"10 неделя"
|
|
119
|
+
], U = [{
|
|
120
|
+
label: "Series 1",
|
|
121
|
+
points: m(H, [
|
|
122
|
+
28,
|
|
123
|
+
34,
|
|
124
|
+
24,
|
|
125
|
+
42,
|
|
126
|
+
30,
|
|
127
|
+
36
|
|
128
|
+
])
|
|
129
|
+
}, {
|
|
130
|
+
label: "Series 2",
|
|
131
|
+
points: m(H, [
|
|
132
|
+
18,
|
|
133
|
+
22,
|
|
134
|
+
16,
|
|
135
|
+
28,
|
|
136
|
+
20,
|
|
137
|
+
24
|
|
138
|
+
])
|
|
139
|
+
}], W = { class: "s-ui-chart-bar__canvas-wrap" }, G = /* @__PURE__ */ S({
|
|
140
|
+
__name: "SChartBar",
|
|
141
|
+
props: {
|
|
142
|
+
series: { default: () => [] },
|
|
143
|
+
mode: { default: "grouped" },
|
|
144
|
+
loading: {
|
|
145
|
+
type: Boolean,
|
|
146
|
+
default: !1
|
|
147
|
+
},
|
|
148
|
+
yMax: {},
|
|
149
|
+
yMin: {},
|
|
150
|
+
yStep: {},
|
|
151
|
+
rightYMax: {},
|
|
152
|
+
rightYStep: {},
|
|
153
|
+
mirrorYAxis: {
|
|
154
|
+
type: Boolean,
|
|
155
|
+
default: !1
|
|
156
|
+
},
|
|
157
|
+
target: {},
|
|
158
|
+
showLegend: {
|
|
159
|
+
type: Boolean,
|
|
160
|
+
default: !0
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
emits: ["pointClick"],
|
|
164
|
+
setup(n, { expose: r, emit: i }) {
|
|
165
|
+
let o = i, s = E("chartRootRef"), l = E("chartCanvasRef"), u = g(() => n.loading ? U : n.mode === "single" ? n.series.slice(0, 1) : n.series), d = (e, t) => {
|
|
166
|
+
let n = u.value[t], r = n?.points[e];
|
|
167
|
+
n && r && o("pointClick", e, t, r, n);
|
|
168
|
+
}, m = h("onPointClick"), S = g(() => !n.loading && n.series.length === 0 ? null : V({
|
|
169
|
+
seriesList: u.value,
|
|
170
|
+
colorHostElement: s.value,
|
|
171
|
+
yMax: n.loading ? 50 : n.yMax,
|
|
172
|
+
yMin: n.loading ? void 0 : n.yMin,
|
|
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: m() ? d : void 0
|
|
180
|
+
})), O = g(() => p(u.value, (e, t) => f(e, s.value, t, n.loading))), { chartInstance: k } = a({
|
|
181
|
+
canvasRef: l,
|
|
182
|
+
config: S,
|
|
183
|
+
enabled: g(() => n.loading || n.series.length > 0)
|
|
184
|
+
}), { exportImage: A, handleLegendItemHover: j } = c({
|
|
185
|
+
chartInstance: k,
|
|
186
|
+
canvasRef: l,
|
|
187
|
+
colorHostElement: s
|
|
188
|
+
});
|
|
189
|
+
return r({ exportImage: A }), (r, i) => (w(), y("div", {
|
|
190
|
+
ref_key: "chartRootRef",
|
|
191
|
+
ref: s,
|
|
192
|
+
class: C(["s-ui-chart-bar", { "s-ui-chart-bar--skeleton": n.loading }])
|
|
193
|
+
}, [b("div", W, [x(T(t), { loading: n.loading }, {
|
|
194
|
+
default: D(() => [b("canvas", {
|
|
195
|
+
ref_key: "chartCanvasRef",
|
|
196
|
+
ref: l,
|
|
197
|
+
class: "s-ui-chart-bar__canvas"
|
|
198
|
+
}, null, 512)]),
|
|
199
|
+
_: 1
|
|
200
|
+
}, 8, ["loading"])]), n.showLegend && O.value.length ? (w(), _(T(e), {
|
|
201
|
+
key: 0,
|
|
202
|
+
items: O.value,
|
|
203
|
+
disabled: n.loading,
|
|
204
|
+
interactive: !n.loading,
|
|
205
|
+
onItemHover: T(j)
|
|
206
|
+
}, null, 8, [
|
|
207
|
+
"items",
|
|
208
|
+
"disabled",
|
|
209
|
+
"interactive",
|
|
210
|
+
"onItemHover"
|
|
211
|
+
])) : v("", !0)], 2));
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
//#endregion
|
|
215
|
+
export { G as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./SChartLegend-DGtjd6zV.cjs"),t=require("./useChartInteractivity-LbJiqlvI.cjs"),n=require("./buildCartesianChartScales-Dck5yBMo.cjs"),r=require("./resolveChartValueRange-DBCYLCXs.cjs"),i=require("./resolveBarStackedSeriesColor-z3NP5vAS.cjs"),a=require("./buildChartSeriesPoints-Cqo2ed-n.cjs"),o=require("./useHasListener-BPgtbbo6.cjs");let s=require("vue");var c=1,l=[4,4],u=`500 10px var(--s-ui-font-family-label)`,d=4,f=e=>e.length>0&&new Set(e).size===1,p=({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],s=i.scales.x;if(!o||!s)return;let{ctx:p,chartArea:m}=i,h=e.color?t.T(e.color,n)||e.color:t.T(t.y.grid,n);p.save(),p.strokeStyle=h,p.lineWidth=c,p.setLineDash(l);let[g]=e.values;if(g!==void 0&&f(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=u,p.textAlign=`left`,p.fillText(e.label,m.left,t-d))}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()}}),m=5,h=4,g=12,_=`yRight`,v=`yMirror`,y=1.05,b=(e,t,n,i)=>r.t(e.flatMap(e=>e.points.map(e=>e.value*y)),{yMin:t,yMax:n,yStep:i}),x=({seriesList:e,colorHostElement:r,yMax:a,yMin:o,yStep:s=m,rightYMax:c,rightYStep:l=m,mirrorYAxis:u=!1,target:d,skeleton:f=!1,onPointClick:y})=>{if(e.length===0)return null;let x=e.filter(e=>e.axis!==`right`),S=e.filter(e=>e.axis===`right`),C=t.T(t.y.axisLabel,r),w=t.T(t.y.grid,r),T=t.T(t.y.tooltipBackground,r),E=t.T(t.y.tooltipText,r),D=b(x,o,a,s),O=b(S,void 0,c,l),k=n.t({axisLabelColor:C,gridColor:w,yMin:D.min,yMax:D.max,yStep:s,xTickFontSize:g}),A=(e,t)=>({type:`linear`,position:`right`,min:e,max:t,border:{display:!1},grid:{drawOnChartArea:!1},ticks:k.y.ticks}),j=S.length>0?{[_]:A(O.min,O.max)}:u?{[v]:A(D.min,D.max)}:{},M={...k,...j},N=t.r({kind:`segment`,skeleton:f,colorHostElement:r,onElementIndexClick:y});return{type:`bar`,data:{labels:e[0]?.points.map(e=>e.label)??[],datasets:e.map((e,n)=>{let a=i.t(n,r,e.fillColor,f),o=e.points.map(e=>e.fillColor?t.T(e.fillColor,r)||e.fillColor:a);return{label:e.label,data:e.points.map(e=>e.value),backgroundColor:o,hoverBackgroundColor:o,borderWidth:0,hoverBorderWidth:0,borderRadius:h,yAxisID:e.axis===`right`?_:`y`,captions:e.points.map(e=>e.caption)}})},options:{responsive:!0,maintainAspectRatio:!1,onHover:N.onHover,onClick:N.onClick,hover:f?void 0:{mode:`nearest`,intersect:!0},interaction:t.s(f,{mode:`nearest`,intersect:!0}),plugins:{legend:{display:!1},tooltip:{enabled:t.c(f),backgroundColor:T,titleColor:E,bodyColor:E,displayColors:!1}},scales:M},plugins:t.l(f,[p({target:d,colorHostElement:r,rightAxisId:_}),...N.plugins])}},S=[`5 неделя`,`6 неделя`,`7 неделя`,`8 неделя`,`9 неделя`,`10 неделя`],C=[{label:`Series 1`,points:a.t(S,[28,34,24,42,30,36])},{label:`Series 2`,points:a.t(S,[18,22,16,28,20,24])}],w={class:`s-ui-chart-bar__canvas-wrap`},T=(0,s.defineComponent)({__name:`SChartBar`,props:{series:{default:()=>[]},mode:{default:`grouped`},loading:{type:Boolean,default:!1},yMax:{},yMin:{},yStep:{},rightYMax:{},rightYStep:{},mirrorYAxis:{type:Boolean,default:!1},target:{},showLegend:{type:Boolean,default:!0}},emits:[`pointClick`],setup(n,{expose:r,emit:c}){let l=c,u=(0,s.useTemplateRef)(`chartRootRef`),d=(0,s.useTemplateRef)(`chartCanvasRef`),f=(0,s.computed)(()=>n.loading?C: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=o.t(`onPointClick`),h=(0,s.computed)(()=>!n.loading&&n.series.length===0?null:x({seriesList:f.value,colorHostElement:u.value,yMax:n.loading?50:n.yMax,yMin:n.loading?void 0:n.yMin,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,s.computed)(()=>a.n(f.value,(e,t)=>i.t(e,u.value,t,n.loading))),{chartInstance:_}=t.n({canvasRef:d,config:h,enabled:(0,s.computed)(()=>n.loading||n.series.length>0)}),{exportImage:v,handleLegendItemHover:y}=t.t({chartInstance:_,canvasRef:d,colorHostElement:u});return r({exportImage:v}),(r,i)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:u,class:(0,s.normalizeClass)([`s-ui-chart-bar`,{"s-ui-chart-bar--skeleton":n.loading}])},[(0,s.createElementVNode)(`div`,w,[(0,s.createVNode)((0,s.unref)(t.E),{loading:n.loading},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:d,class:`s-ui-chart-bar__canvas`},null,512)]),_:1},8,[`loading`])]),n.showLegend&&g.value.length?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(e.t),{key:0,items:g.value,disabled:n.loading,interactive:!n.loading,onItemHover:(0,s.unref)(y)},null,8,[`items`,`disabled`,`interactive`,`onItemHover`])):(0,s.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return T}});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./SChartLegend-oZoF8XK7.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as d } from "./createChartCrosshairPlugin-DU5grSok.js";
|
|
2
|
+
import { E as t, T as n, c as r, l as i, n as a, o, p as s, s as c, t as l, y as u } from "./useChartInteractivity-Cl06JL4l.js";
|
|
3
|
+
import { t as d } from "./createChartCrosshairPlugin-C2NUAO5s.js";
|
|
5
4
|
import { t as f } from "./buildMultiLineChartScales-CFZ8YVeJ.js";
|
|
6
5
|
import { computed as p, createElementBlock as m, createElementVNode as h, createVNode as g, defineComponent as _, normalizeClass as v, openBlock as y, unref as b, useTemplateRef as x, withCtx as S } from "vue";
|
|
7
6
|
//#region src/utils/chart/burnup/createBurnupTodayLinePlugin.ts
|
|
@@ -9,10 +8,10 @@ var C = (e, t) => ({
|
|
|
9
8
|
id: "sUiChartBurnupTodayLine",
|
|
10
9
|
beforeDatasetsDraw(r) {
|
|
11
10
|
if (e < 0) return;
|
|
12
|
-
let { ctx:
|
|
13
|
-
if (!
|
|
14
|
-
let
|
|
15
|
-
|
|
11
|
+
let { ctx: i, chartArea: a } = r, o = r.scales.x;
|
|
12
|
+
if (!a || !o) return;
|
|
13
|
+
let s = n(u.burnupToday, t), c = o.getPixelForValue(e);
|
|
14
|
+
i.save(), i.beginPath(), i.moveTo(c, a.top), i.lineTo(c, a.bottom), i.lineWidth = 1, i.strokeStyle = s, i.stroke(), i.restore();
|
|
16
15
|
}
|
|
17
16
|
}), w = 8, T = 4, E = 5, D = 12, O = 12, k = 60, A = 12, j = (e) => {
|
|
18
17
|
if (typeof window > "u") return "500 10px sans-serif";
|
|
@@ -21,16 +20,16 @@ var C = (e, t) => ({
|
|
|
21
20
|
}, M = (e, t, n, r, i, a) => {
|
|
22
21
|
let o = Math.min(a, r / 2, i / 2);
|
|
23
22
|
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();
|
|
24
|
-
}, N = ({ tagLines: e, factDatasetIndex: t, todayIndex: r },
|
|
23
|
+
}, N = ({ tagLines: e, factDatasetIndex: t, todayIndex: r }, i) => ({
|
|
25
24
|
id: "sUiChartBurnupTag",
|
|
26
|
-
afterDatasetsDraw(
|
|
25
|
+
afterDatasetsDraw(a) {
|
|
27
26
|
if (r < 0 || e.length === 0) return;
|
|
28
|
-
let
|
|
29
|
-
if (!
|
|
30
|
-
let
|
|
31
|
-
d.save(), d.font = j(
|
|
32
|
-
let f = e.reduce((e, t) => Math.max(e, d.measureText(t).width), 0), p = Math.max(k, f + w * 2), m = e.length * O + T + E, h = Math.min(Math.max(
|
|
33
|
-
M(d, h, g, p, m, D), d.fillStyle =
|
|
27
|
+
let o = a.getDatasetMeta(t)?.data[r], { chartArea: s } = a;
|
|
28
|
+
if (!o || !s) return;
|
|
29
|
+
let c = n(u.burnupToday, i), l = n(u.burnupTagBackground, i), { ctx: d } = a;
|
|
30
|
+
d.save(), d.font = j(i), d.textAlign = "center", d.textBaseline = "middle";
|
|
31
|
+
let f = e.reduce((e, t) => Math.max(e, d.measureText(t).width), 0), p = Math.max(k, f + w * 2), m = e.length * O + T + E, h = Math.min(Math.max(o.x - p / 2, s.left), s.right - p), g = Math.max(o.y - A - m, s.top);
|
|
32
|
+
M(d, h, g, p, m, D), d.fillStyle = l, d.fill(), d.lineWidth = 1, d.strokeStyle = c, d.stroke(), d.fillStyle = c, e.forEach((e, t) => {
|
|
34
33
|
d.fillText(e, h + p / 2, g + T + O * (t + .5));
|
|
35
34
|
}), d.restore();
|
|
36
35
|
}
|
|
@@ -43,17 +42,17 @@ var C = (e, t) => ({
|
|
|
43
42
|
}), I = (e) => (t) => !P(t.dataIndex, e) || t.datasetIndex === 0, L = 1, R = 1, z = 2, B = [8, 8], V = [9, 9], H = 2, U = 25, W = (e) => e.reduce((e, t, n) => t.fact === null ? e : n, -1), G = (e, t, n) => {
|
|
44
43
|
let r = e.reduce((e, t) => Math.max(e, t.plan, t.fact ?? 0), t);
|
|
45
44
|
return Math.ceil(r / n) * n;
|
|
46
|
-
}, K = ({ points: e, colorHostElement: t, goalValue:
|
|
45
|
+
}, K = ({ points: e, colorHostElement: t, goalValue: a = 100, goalLabel: l = "Цель", planLabel: p = "План", factLabel: m = "Факт", futureLabel: h = "Этот день ещё не наступил", yStep: g = U, mirrorYAxis: _ = !0, showTag: v = !0, skeleton: y = !1 }) => {
|
|
47
46
|
if (e.length === 0) return null;
|
|
48
|
-
let b = n(
|
|
47
|
+
let b = n(u.axisLabel, t), x = n(u.grid, t), S = n(u.tooltipBackground, t), w = n(u.tooltipText, t), T = n(u.skeletonSeries, t), E = y ? T : n(u.burnupGoal, t), D = y ? T : n(u.burnupPlan, t), O = y ? T : n(u.burnupFact, t), k = n(u.burnupFactFillStart, t), A = n(u.burnupFactFillEnd, t), j = W(e), M = j >= 0 ? e[j] : void 0, P = M ? [`${m.toLowerCase()} ${M.fact}%`, `${p.toLowerCase()} ${M.plan}%`] : [];
|
|
49
48
|
return {
|
|
50
49
|
type: "line",
|
|
51
50
|
data: {
|
|
52
51
|
labels: e.map((e) => e.label),
|
|
53
52
|
datasets: [
|
|
54
53
|
{
|
|
55
|
-
label:
|
|
56
|
-
data: e.map(() =>
|
|
54
|
+
label: l,
|
|
55
|
+
data: e.map(() => a),
|
|
57
56
|
borderColor: E,
|
|
58
57
|
backgroundColor: E,
|
|
59
58
|
borderWidth: L,
|
|
@@ -79,7 +78,7 @@ var C = (e, t) => ({
|
|
|
79
78
|
label: m,
|
|
80
79
|
data: e.map((e) => e.fact ?? null),
|
|
81
80
|
borderColor: O,
|
|
82
|
-
backgroundColor: y ? O : (e) =>
|
|
81
|
+
backgroundColor: y ? O : (e) => o(e, k, A),
|
|
83
82
|
borderWidth: z,
|
|
84
83
|
fill: !y,
|
|
85
84
|
spanGaps: !1,
|
|
@@ -92,7 +91,7 @@ var C = (e, t) => ({
|
|
|
92
91
|
options: {
|
|
93
92
|
responsive: !0,
|
|
94
93
|
maintainAspectRatio: !1,
|
|
95
|
-
interaction:
|
|
94
|
+
interaction: c(y, {
|
|
96
95
|
mode: "index",
|
|
97
96
|
intersect: !1
|
|
98
97
|
}),
|
|
@@ -104,7 +103,7 @@ var C = (e, t) => ({
|
|
|
104
103
|
titleColor: w,
|
|
105
104
|
bodyColor: w,
|
|
106
105
|
displayColors: !1,
|
|
107
|
-
position:
|
|
106
|
+
position: s,
|
|
108
107
|
yAlign: "bottom",
|
|
109
108
|
xAlign: "center",
|
|
110
109
|
caretPadding: 8,
|
|
@@ -119,13 +118,13 @@ var C = (e, t) => ({
|
|
|
119
118
|
axisLabelColor: b,
|
|
120
119
|
gridColor: x,
|
|
121
120
|
yMin: 0,
|
|
122
|
-
yMax: G(e,
|
|
121
|
+
yMax: G(e, a, g),
|
|
123
122
|
yStep: g,
|
|
124
123
|
mirrorYAxis: _,
|
|
125
124
|
formatYAxisTick: (e) => `${e}%`
|
|
126
125
|
})
|
|
127
126
|
},
|
|
128
|
-
plugins:
|
|
127
|
+
plugins: i(y, [
|
|
129
128
|
d(t),
|
|
130
129
|
C(j, t),
|
|
131
130
|
...v ? [N({
|
|
@@ -192,10 +191,10 @@ var C = (e, t) => ({
|
|
|
192
191
|
default: !0
|
|
193
192
|
}
|
|
194
193
|
},
|
|
195
|
-
setup(r, { expose:
|
|
196
|
-
let
|
|
197
|
-
points:
|
|
198
|
-
colorHostElement:
|
|
194
|
+
setup(r, { expose: i }) {
|
|
195
|
+
let o = x("chartRootRef"), s = x("chartCanvasRef"), c = p(() => r.loading ? Y : r.points), d = p(() => !r.loading && r.points.length === 0 ? null : K({
|
|
196
|
+
points: c.value,
|
|
197
|
+
colorHostElement: o.value,
|
|
199
198
|
goalValue: r.goalValue,
|
|
200
199
|
goalLabel: r.goalLabel,
|
|
201
200
|
planLabel: r.planLabel,
|
|
@@ -208,36 +207,36 @@ var C = (e, t) => ({
|
|
|
208
207
|
})), f = p(() => [
|
|
209
208
|
{
|
|
210
209
|
label: r.goalLabel,
|
|
211
|
-
cssVariable:
|
|
210
|
+
cssVariable: u.burnupGoal
|
|
212
211
|
},
|
|
213
212
|
{
|
|
214
213
|
label: r.planLabel,
|
|
215
|
-
cssVariable:
|
|
214
|
+
cssVariable: u.burnupPlan
|
|
216
215
|
},
|
|
217
216
|
{
|
|
218
217
|
label: r.factLabel,
|
|
219
|
-
cssVariable:
|
|
218
|
+
cssVariable: u.burnupFact
|
|
220
219
|
}
|
|
221
220
|
].map((e) => ({
|
|
222
221
|
label: e.label.toLowerCase(),
|
|
223
|
-
color: n(r.loading ?
|
|
224
|
-
}))), { chartInstance: _ } =
|
|
225
|
-
canvasRef:
|
|
222
|
+
color: n(r.loading ? u.skeletonSeries : e.cssVariable, o.value)
|
|
223
|
+
}))), { chartInstance: _ } = a({
|
|
224
|
+
canvasRef: s,
|
|
226
225
|
config: d,
|
|
227
226
|
enabled: p(() => r.loading || r.points.length > 0)
|
|
228
|
-
}), { exportImage: C } =
|
|
227
|
+
}), { exportImage: C } = l({
|
|
229
228
|
chartInstance: _,
|
|
230
|
-
canvasRef:
|
|
231
|
-
colorHostElement:
|
|
229
|
+
canvasRef: s,
|
|
230
|
+
colorHostElement: o
|
|
232
231
|
});
|
|
233
|
-
return
|
|
232
|
+
return i({ exportImage: C }), (n, i) => (y(), m("div", {
|
|
234
233
|
ref_key: "chartRootRef",
|
|
235
|
-
ref:
|
|
234
|
+
ref: o,
|
|
236
235
|
class: v(["s-ui-chart-burnup", { "s-ui-chart-burnup--skeleton": r.loading }])
|
|
237
236
|
}, [h("div", X, [g(b(t), { loading: r.loading }, {
|
|
238
237
|
default: S(() => [h("canvas", {
|
|
239
238
|
ref_key: "chartCanvasRef",
|
|
240
|
-
ref:
|
|
239
|
+
ref: s,
|
|
241
240
|
class: "s-ui-chart-burnup__canvas"
|
|
242
241
|
}, null, 512)]),
|
|
243
242
|
_: 1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./SChartLegend-DGtjd6zV.cjs"),t=require("./useChartInteractivity-LbJiqlvI.cjs"),n=require("./createChartCrosshairPlugin-B4e8d8OF.cjs"),r=require("./buildMultiLineChartScales-7mcIfRVG.cjs");let i=require("vue");var a=(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.T(t.y.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()}}),o=8,s=4,c=5,l=12,u=12,d=60,f=12,p=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`}`},m=(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()},h=({tagLines:e,factDatasetIndex:n,todayIndex:r},i)=>({id:`sUiChartBurnupTag`,afterDatasetsDraw(a){if(r<0||e.length===0)return;let h=a.getDatasetMeta(n)?.data[r],{chartArea:g}=a;if(!h||!g)return;let _=t.T(t.y.burnupToday,i),v=t.T(t.y.burnupTagBackground,i),{ctx:y}=a;y.save(),y.font=p(i),y.textAlign=`center`,y.textBaseline=`middle`;let b=e.reduce((e,t)=>Math.max(e,y.measureText(t).width),0),x=Math.max(d,b+o*2),S=e.length*u+s+c,C=Math.min(Math.max(h.x-x/2,g.left),g.right-x),w=Math.max(h.y-f-S,g.top);m(y,C,w,x,S,l),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+s+u*(t+.5))}),y.restore()}}),g=(e,t)=>t>=0&&e>t,_=({todayIndex:e,futureLabel:t})=>({title:t=>{let n=t[0];return!n||g(n.dataIndex,e)?``:`${n.label}`},label:n=>g(n.dataIndex,e)?t:`${n.dataset.label??``}: ${n.parsed.y??0}%`}),v=e=>t=>!g(t.dataIndex,e)||t.datasetIndex===0,y=1,b=1,x=2,S=[8,8],C=[9,9],w=2,T=25,E=e=>e.reduce((e,t,n)=>t.fact===null?e:n,-1),D=(e,t,n)=>{let r=e.reduce((e,t)=>Math.max(e,t.plan,t.fact??0),t);return Math.ceil(r/n)*n},O=({points:e,colorHostElement:i,goalValue:o=100,goalLabel:s=`Цель`,planLabel:c=`План`,factLabel:l=`Факт`,futureLabel:u=`Этот день ещё не наступил`,yStep:d=T,mirrorYAxis:f=!0,showTag:p=!0,skeleton:m=!1})=>{if(e.length===0)return null;let g=t.T(t.y.axisLabel,i),O=t.T(t.y.grid,i),k=t.T(t.y.tooltipBackground,i),A=t.T(t.y.tooltipText,i),j=t.T(t.y.skeletonSeries,i),M=m?j:t.T(t.y.burnupGoal,i),N=m?j:t.T(t.y.burnupPlan,i),P=m?j:t.T(t.y.burnupFact,i),F=t.T(t.y.burnupFactFillStart,i),I=t.T(t.y.burnupFactFillEnd,i),L=E(e),R=L>=0?e[L]:void 0,z=R?[`${l.toLowerCase()} ${R.fact}%`,`${c.toLowerCase()} ${R.plan}%`]:[];return{type:`line`,data:{labels:e.map(e=>e.label),datasets:[{label:s,data:e.map(()=>o),borderColor:M,backgroundColor:M,borderWidth:y,borderDash:S,fill:!1,pointRadius:0,pointHoverRadius:0,tension:0},{label:c,data:e.map(e=>e.plan),borderColor:N,backgroundColor:N,borderWidth:b,borderDash:C,fill:!1,pointRadius:0,pointHoverRadius:0,tension:.4},{label:l,data:e.map(e=>e.fact??null),borderColor:P,backgroundColor:m?P:e=>t.o(e,F,I),borderWidth:x,fill:!m,spanGaps:!1,pointRadius:0,pointHoverRadius:4,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:t.s(m,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:t.c(m),backgroundColor:k,titleColor:A,bodyColor:A,displayColors:!1,position:t.p,yAlign:`bottom`,xAlign:`center`,caretPadding:8,filter:v(L),callbacks:_({todayIndex:L,futureLabel:u})}},scales:r.t({axisLabelColor:g,gridColor:O,yMin:0,yMax:D(e,o,d),yStep:d,mirrorYAxis:f,formatYAxisTick:e=>`${e}%`})},plugins:t.l(m,[n.t(i),a(L,i),...p?[h({tagLines:z,factDatasetIndex:w,todayIndex:L},i)]:[]])}},k=[8,15,23,31,38,46,54,62,69,77,85,92,96,100],A=[5,10,16,22,28,34,40,45,50,54,57,60,null,null],j=k.map((e,t)=>({label:`Д${t+1}`,plan:e,fact:A[t]})),M={class:`s-ui-chart-burnup__canvas-wrap`},N=(0,i.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 a=(0,i.useTemplateRef)(`chartRootRef`),o=(0,i.useTemplateRef)(`chartCanvasRef`),s=(0,i.computed)(()=>n.loading?j:n.points),c=(0,i.computed)(()=>!n.loading&&n.points.length===0?null:O({points:s.value,colorHostElement:a.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,i.computed)(()=>[{label:n.goalLabel,cssVariable:t.y.burnupGoal},{label:n.planLabel,cssVariable:t.y.burnupPlan},{label:n.factLabel,cssVariable:t.y.burnupFact}].map(e=>({label:e.label.toLowerCase(),color:t.T(n.loading?t.y.skeletonSeries:e.cssVariable,a.value)}))),{chartInstance:u}=t.n({canvasRef:o,config:c,enabled:(0,i.computed)(()=>n.loading||n.points.length>0)}),{exportImage:d}=t.t({chartInstance:u,canvasRef:o,colorHostElement:a});return r({exportImage:d}),(r,s)=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:a,class:(0,i.normalizeClass)([`s-ui-chart-burnup`,{"s-ui-chart-burnup--skeleton":n.loading}])},[(0,i.createElementVNode)(`div`,M,[(0,i.createVNode)((0,i.unref)(t.E),{loading:n.loading},{default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:o,class:`s-ui-chart-burnup__canvas`},null,512)]),_:1},8,[`loading`])]),(0,i.createVNode)((0,i.unref)(e.t),{items:l.value,disabled:n.loading},null,8,[`items`,`disabled`])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return N}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./useChartInteractivity-
|
|
1
|
+
const e=require("./useChartInteractivity-LbJiqlvI.cjs"),t=require("./useHasListener-BPgtbbo6.cjs");let n=require("vue");var r=10,i=14,a=({axisLabelColor:e,categoryLabelColor:t,gridColor:n,xMin:a,xMax:o,xStep:s})=>({x:{type:`linear`,min:a,max:o,border:{display:!1},grid:{color:n,drawTicks:!1},ticks:{color:e,stepSize:s,font:{size:r,weight:500},padding:8}},y:{border:{display:!1},grid:{display:!1},ticks:{color:t,font:{size:i,weight:400},padding:8,crossAlign:`far`,autoSkip:!1}}}),o=(t,n,r)=>r?e.T(e.y.barHorizontalSkeletonFill,n):t?e.T(t,n):e.T(e.y.barHorizontalFillDefault,n),s=(e,t,n)=>{if(t)return t;let r=0;for(let t of e)r=Math.max(r,t.value);let i=Math.ceil(r/n)*n;return i>0?i:n*6},c=10,l=0,u=36,d=4,f=({items:t,colorHostElement:n,xMax:r,xMin:i=l,xStep:f=c,skeleton:p=!1,onBarClick:m})=>{if(t.length===0)return null;let h=e.T(e.y.axisLabel,n),g=e.T(e.y.grid,n),_=e.T(e.y.tooltipBackground,n),v=e.T(e.y.tooltipText,n),y=e.T(p?e.y.barHorizontalCategoryLabelSkeleton:e.y.barHorizontalCategoryLabel,n),b=s(t,r,f),x=t.map(e=>o(e.color,n,p)),S=e.r({kind:`element`,skeleton:p,colorHostElement:n,onIndexClick:m});return{type:`bar`,data:{labels:t.map(e=>e.label),datasets:[{data:t.map(e=>e.value),backgroundColor:x,hoverBackgroundColor:x,borderWidth:0,hoverBorderWidth:0,barThickness:u,borderRadius:{topRight:d,bottomRight:d}}]},options:{indexAxis:`y`,responsive:!0,maintainAspectRatio:!1,onHover:S.onHover,onClick:S.onClick,interaction:e.s(p,{mode:`index`,axis:`y`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:e.c(p),backgroundColor:_,titleColor:v,bodyColor:v}},scales:a({axisLabelColor:h,categoryLabelColor:y,gridColor:g,xMin:i,xMax:b,xStep:f})},plugins:S.plugins}},p=e=>f(e),m=[{label:`Открыта`,value:48},{label:`В процессе`,value:32},{label:`Ревью`,value:53},{label:`Готова для QA`,value:18},{label:`QA`,value:25},{label:`Готова`,value:0}],h={class:`s-ui-chart-horizontal-bar__canvas-wrap`},g=(0,n.defineComponent)({__name:`SChartHorizontalBar`,props:{items:{default:()=>[]},loading:{type:Boolean,default:!1},xMin:{},xMax:{},xStep:{}},emits:[`barClick`],setup(r,{expose:i,emit:a}){let o=a,s=(0,n.useTemplateRef)(`chartRootRef`),c=(0,n.useTemplateRef)(`chartCanvasRef`),l=(0,n.computed)(()=>r.loading?m:r.items),u=e=>{let t=r.items[e];t&&o(`barClick`,e,t)},d=t.t(`onBarClick`),{chartInstance:f}=e.n({canvasRef:c,config:(0,n.computed)(()=>!r.loading&&r.items.length===0?null:p({items:l.value,colorHostElement:s.value,xMax:r.loading?60:r.xMax,xMin:r.loading?0:r.xMin,xStep:r.loading?10:r.xStep,skeleton:r.loading,onBarClick:d()?u:void 0})),enabled:(0,n.computed)(()=>r.loading||r.items.length>0)}),{exportImage:g}=e.t({chartInstance:f,canvasRef:c,colorHostElement:s});return i({exportImage:g}),(t,i)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:s,class:(0,n.normalizeClass)([`s-ui-chart-horizontal-bar`,{"s-ui-chart-horizontal-bar--skeleton":r.loading}])},[(0,n.createElementVNode)(`div`,h,[(0,n.createVNode)((0,n.unref)(e.E),{loading:r.loading},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:c,class:`s-ui-chart-horizontal-bar__canvas`},null,512)]),_:1},8,[`loading`])])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return g}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as e, T as t, c as n, n as r, r as i, s as a, t as o, y as s } from "./useChartInteractivity-Cl06JL4l.js";
|
|
2
2
|
import { t as c } from "./useHasListener-RSjlUyqH.js";
|
|
3
3
|
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";
|
|
4
4
|
//#region src/utils/chart/horizontalBar/buildHorizontalBarChartScales.ts
|
|
@@ -36,18 +36,18 @@ var y = 10, b = 14, x = ({ axisLabelColor: e, categoryLabelColor: t, gridColor:
|
|
|
36
36
|
autoSkip: !1
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
}), S = (e, n,
|
|
39
|
+
}), S = (e, n, r) => t(r ? s.barHorizontalSkeletonFill : e || s.barHorizontalFillDefault, n), C = (e, t, n) => {
|
|
40
40
|
if (t) return t;
|
|
41
41
|
let r = 0;
|
|
42
42
|
for (let t of e) r = Math.max(r, t.value);
|
|
43
43
|
let i = Math.ceil(r / n) * n;
|
|
44
44
|
return i > 0 ? i : n * 6;
|
|
45
|
-
}, w = 10, T = 0, E = 36, D = 4, O = ({ items: e, colorHostElement:
|
|
45
|
+
}, w = 10, T = 0, E = 36, D = 4, O = ({ items: e, colorHostElement: r, xMax: o, xMin: c = T, xStep: l = w, skeleton: u = !1, onBarClick: d }) => {
|
|
46
46
|
if (e.length === 0) return null;
|
|
47
|
-
let f = t(
|
|
47
|
+
let f = t(s.axisLabel, r), p = t(s.grid, r), m = t(s.tooltipBackground, r), h = t(s.tooltipText, r), g = t(u ? s.barHorizontalCategoryLabelSkeleton : s.barHorizontalCategoryLabel, r), _ = C(e, o, l), v = e.map((e) => S(e.color, r, u)), y = i({
|
|
48
48
|
kind: "element",
|
|
49
49
|
skeleton: u,
|
|
50
|
-
colorHostElement:
|
|
50
|
+
colorHostElement: r,
|
|
51
51
|
onIndexClick: d
|
|
52
52
|
});
|
|
53
53
|
return {
|
|
@@ -73,7 +73,7 @@ var y = 10, b = 14, x = ({ axisLabelColor: e, categoryLabelColor: t, gridColor:
|
|
|
73
73
|
maintainAspectRatio: !1,
|
|
74
74
|
onHover: y.onHover,
|
|
75
75
|
onClick: y.onClick,
|
|
76
|
-
interaction:
|
|
76
|
+
interaction: a(u, {
|
|
77
77
|
mode: "index",
|
|
78
78
|
axis: "y",
|
|
79
79
|
intersect: !1
|
|
@@ -136,15 +136,15 @@ var y = 10, b = 14, x = ({ axisLabelColor: e, categoryLabelColor: t, gridColor:
|
|
|
136
136
|
xStep: {}
|
|
137
137
|
},
|
|
138
138
|
emits: ["barClick"],
|
|
139
|
-
setup(t, { expose: n, emit:
|
|
140
|
-
let
|
|
139
|
+
setup(t, { expose: n, emit: i }) {
|
|
140
|
+
let a = i, s = _("chartRootRef"), p = _("chartCanvasRef"), y = l(() => t.loading ? A : t.items), b = (e) => {
|
|
141
141
|
let n = t.items[e];
|
|
142
|
-
n &&
|
|
143
|
-
}, x = c("onBarClick"), { chartInstance: S } =
|
|
142
|
+
n && a("barClick", e, n);
|
|
143
|
+
}, x = c("onBarClick"), { chartInstance: S } = r({
|
|
144
144
|
canvasRef: p,
|
|
145
145
|
config: l(() => !t.loading && t.items.length === 0 ? null : k({
|
|
146
146
|
items: y.value,
|
|
147
|
-
colorHostElement:
|
|
147
|
+
colorHostElement: s.value,
|
|
148
148
|
xMax: t.loading ? 60 : t.xMax,
|
|
149
149
|
xMin: t.loading ? 0 : t.xMin,
|
|
150
150
|
xStep: t.loading ? 10 : t.xStep,
|
|
@@ -152,14 +152,14 @@ var y = 10, b = 14, x = ({ axisLabelColor: e, categoryLabelColor: t, gridColor:
|
|
|
152
152
|
onBarClick: x() ? b : void 0
|
|
153
153
|
})),
|
|
154
154
|
enabled: l(() => t.loading || t.items.length > 0)
|
|
155
|
-
}), { exportImage: C } =
|
|
155
|
+
}), { exportImage: C } = o({
|
|
156
156
|
chartInstance: S,
|
|
157
157
|
canvasRef: p,
|
|
158
|
-
colorHostElement:
|
|
158
|
+
colorHostElement: s
|
|
159
159
|
});
|
|
160
160
|
return n({ exportImage: C }), (n, r) => (h(), u("div", {
|
|
161
161
|
ref_key: "chartRootRef",
|
|
162
|
-
ref:
|
|
162
|
+
ref: s,
|
|
163
163
|
class: m(["s-ui-chart-horizontal-bar", { "s-ui-chart-horizontal-bar--skeleton": t.loading }])
|
|
164
164
|
}, [d("div", j, [f(g(e), { loading: t.loading }, {
|
|
165
165
|
default: v(() => [d("canvas", {
|