@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.
Files changed (162) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/SChartBar-CUAibXox.js +215 -0
  3. package/dist/SChartBar-xzw8oxXl.cjs +1 -0
  4. package/dist/{SChartBurnup-DyJHdRlf.js → SChartBurnup-C5Z7UDi-.js} +39 -40
  5. package/dist/SChartBurnup-CWSJUoA_.cjs +1 -0
  6. package/dist/{SChartHorizontalBar-Bv90SV6E.cjs → SChartHorizontalBar-0RpJa5EJ.cjs} +1 -1
  7. package/dist/{SChartHorizontalBar-DDo6TfE8.js → SChartHorizontalBar-B9SWFvdN.js} +14 -14
  8. package/dist/SChartLine-CTjiKi4H.js +165 -0
  9. package/dist/SChartLine-Cp1csHeY.cjs +1 -0
  10. package/dist/SChartMultiLine-Bt9Cf-L9.cjs +1 -0
  11. package/dist/SChartMultiLine-CbPSG0mN.js +244 -0
  12. package/dist/{SChartPie-Bt3o7LZI.js → SChartPie-0ugeo2fO.js} +72 -58
  13. package/dist/SChartPie-QpnxLQYv.cjs +1 -0
  14. package/dist/{SChartProgress-xxqrj03o.cjs → SChartProgress-9Zzy7E8K.cjs} +1 -1
  15. package/dist/{SChartProgress-uMg4DBpS.js → SChartProgress-DUgSOdv7.js} +15 -15
  16. package/dist/{SChartStackedArea-BQGnKp1i.js → SChartStackedArea-Blpqa23h.js} +40 -40
  17. package/dist/{SChartStackedArea-BNe6FAg8.cjs → SChartStackedArea-C3MezV9k.cjs} +1 -1
  18. package/dist/{SChartStackedBar-fiUU9lNp.js → SChartStackedBar-CCxEXw1H.js} +21 -21
  19. package/dist/{SChartStackedBar-D1G-VloG.cjs → SChartStackedBar-CJ-UdOfv.cjs} +1 -1
  20. package/dist/STable-Ch7thYCy.cjs +1 -0
  21. package/dist/{STable-9Kb75bwz.js → STable-CunQFK-x.js} +5 -1
  22. package/dist/{buildWorkTimeLegendItems-ChGHTwbn.js → buildWorkTimeLegendItems-CifzZM9C.js} +126 -76
  23. package/dist/buildWorkTimeLegendItems-DPx5Yma0.cjs +1 -0
  24. package/dist/components/SCalendar/index.d.ts +2 -2
  25. package/dist/components/SCalendar/index.d.ts.map +1 -1
  26. package/dist/components/SCalendar/utils/demoCalendarMonthEvents.d.ts +6 -0
  27. package/dist/components/SCalendar/utils/demoCalendarMonthEvents.d.ts.map +1 -0
  28. package/dist/components/SCalendarMonth/SCalendarMonth.types.d.ts +36 -3
  29. package/dist/components/SCalendarMonth/SCalendarMonth.types.d.ts.map +1 -1
  30. package/dist/components/SCalendarMonth/SCalendarMonth.vue.d.ts +6 -1
  31. package/dist/components/SCalendarMonth/SCalendarMonth.vue.d.ts.map +1 -1
  32. package/dist/components/SCalendarMonth/index.d.ts +2 -1
  33. package/dist/components/SCalendarMonth/index.d.ts.map +1 -1
  34. package/dist/components/SChartBar/SChartBar.types.d.ts +2 -0
  35. package/dist/components/SChartBar/SChartBar.types.d.ts.map +1 -1
  36. package/dist/components/SChartBar/SChartBar.vue.d.ts.map +1 -1
  37. package/dist/components/SChartBar/utils/buildBarChartConfig.d.ts +2 -1
  38. package/dist/components/SChartBar/utils/buildBarChartConfig.d.ts.map +1 -1
  39. package/dist/components/SChartBar/utils/demoBarSeries.d.ts +1 -0
  40. package/dist/components/SChartBar/utils/demoBarSeries.d.ts.map +1 -1
  41. package/dist/components/SChartLine/SChartLine.types.d.ts +14 -2
  42. package/dist/components/SChartLine/SChartLine.types.d.ts.map +1 -1
  43. package/dist/components/SChartLine/SChartLine.vue.d.ts.map +1 -1
  44. package/dist/components/SChartLine/index.d.ts +1 -1
  45. package/dist/components/SChartLine/index.d.ts.map +1 -1
  46. package/dist/components/SChartLine/utils/buildLineChartConfig.d.ts +6 -2
  47. package/dist/components/SChartLine/utils/buildLineChartConfig.d.ts.map +1 -1
  48. package/dist/components/SChartLine/utils/demoPoints.d.ts +3 -1
  49. package/dist/components/SChartLine/utils/demoPoints.d.ts.map +1 -1
  50. package/dist/components/SChartMultiLine/SChartMultiLine.types.d.ts +14 -2
  51. package/dist/components/SChartMultiLine/SChartMultiLine.types.d.ts.map +1 -1
  52. package/dist/components/SChartMultiLine/SChartMultiLine.vue.d.ts.map +1 -1
  53. package/dist/components/SChartMultiLine/index.d.ts +1 -1
  54. package/dist/components/SChartMultiLine/index.d.ts.map +1 -1
  55. package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts +5 -1
  56. package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts.map +1 -1
  57. package/dist/components/SChartMultiLine/utils/demoMultiLineSeries.d.ts +1 -0
  58. package/dist/components/SChartMultiLine/utils/demoMultiLineSeries.d.ts.map +1 -1
  59. package/dist/components/SChartPie/SChartPie.types.d.ts +6 -0
  60. package/dist/components/SChartPie/SChartPie.types.d.ts.map +1 -1
  61. package/dist/components/SChartPie/SChartPie.vue.d.ts.map +1 -1
  62. package/dist/components/SChartPie/utils/buildPieChartConfig.d.ts +3 -1
  63. package/dist/components/SChartPie/utils/buildPieChartConfig.d.ts.map +1 -1
  64. package/dist/components/SChartSegmentedBar/SChartSegmentedBar.types.d.ts +2 -0
  65. package/dist/components/SChartSegmentedBar/SChartSegmentedBar.types.d.ts.map +1 -1
  66. package/dist/components/SChartSegmentedBar/SChartSegmentedBar.vue.d.ts.map +1 -1
  67. package/dist/components/SChartSegmentedBar/utils/buildSegmentedBarChartConfig.d.ts +2 -1
  68. package/dist/components/SChartSegmentedBar/utils/buildSegmentedBarChartConfig.d.ts.map +1 -1
  69. package/dist/components/SChartSegmentedBar/utils/createSegmentedBarBadgePlugin.d.ts +1 -1
  70. package/dist/components/SChartSegmentedBar/utils/createSegmentedBarBadgePlugin.d.ts.map +1 -1
  71. package/dist/components/SChartStackedArea/utils/demoStackedSeries.d.ts +4 -0
  72. package/dist/components/SChartStackedArea/utils/demoStackedSeries.d.ts.map +1 -1
  73. package/dist/components/SChartWidget/SChartWidget.types.d.ts +2 -0
  74. package/dist/components/SChartWidget/SChartWidget.types.d.ts.map +1 -1
  75. package/dist/components/SChartWidget/SChartWidget.vue.d.ts +7 -3
  76. package/dist/components/SChartWidget/SChartWidget.vue.d.ts.map +1 -1
  77. package/dist/components/STable/STable.vue.d.ts.map +1 -1
  78. package/dist/components/STable/parts/STableGroupRow.vue.d.ts +3 -1
  79. package/dist/components/STable/parts/STableGroupRow.vue.d.ts.map +1 -1
  80. package/dist/{createChartCrosshairPlugin-DfYzBie2.cjs → createChartCrosshairPlugin-B4e8d8OF.cjs} +1 -1
  81. package/dist/{createChartCrosshairPlugin-DU5grSok.js → createChartCrosshairPlugin-C2NUAO5s.js} +1 -1
  82. package/dist/createChartMarkersPlugin-DSKGilFU.js +40 -0
  83. package/dist/createChartMarkersPlugin-S4oQKxO4.cjs +1 -0
  84. package/dist/entries/calendar.cjs +1 -1
  85. package/dist/entries/calendar.d.ts +2 -2
  86. package/dist/entries/calendar.d.ts.map +1 -1
  87. package/dist/entries/calendar.js +2 -2
  88. package/dist/entries/chart-bar.cjs +1 -1
  89. package/dist/entries/chart-bar.js +1 -1
  90. package/dist/entries/chart-burnup.cjs +1 -1
  91. package/dist/entries/chart-burnup.js +1 -1
  92. package/dist/entries/chart-horizontal-bar.cjs +1 -1
  93. package/dist/entries/chart-horizontal-bar.js +1 -1
  94. package/dist/entries/chart-line.cjs +1 -1
  95. package/dist/entries/chart-line.d.ts +1 -1
  96. package/dist/entries/chart-line.d.ts.map +1 -1
  97. package/dist/entries/chart-line.js +1 -1
  98. package/dist/entries/chart-multi-line.cjs +1 -1
  99. package/dist/entries/chart-multi-line.d.ts +1 -1
  100. package/dist/entries/chart-multi-line.d.ts.map +1 -1
  101. package/dist/entries/chart-multi-line.js +1 -1
  102. package/dist/entries/chart-pie.cjs +1 -1
  103. package/dist/entries/chart-pie.js +1 -1
  104. package/dist/entries/chart-progress.cjs +1 -1
  105. package/dist/entries/chart-progress.js +1 -1
  106. package/dist/entries/chart-stacked-area.cjs +1 -1
  107. package/dist/entries/chart-stacked-area.js +1 -1
  108. package/dist/entries/chart-stacked-bar.cjs +1 -1
  109. package/dist/entries/chart-stacked-bar.js +1 -1
  110. package/dist/entries/separator.cjs +1 -0
  111. package/dist/entries/separator.js +2 -0
  112. package/dist/entries/table.cjs +1 -1
  113. package/dist/entries/table.js +1 -1
  114. package/dist/index.cjs +1 -1
  115. package/dist/index.d.ts +3 -3
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +162 -149
  118. package/dist/resolveBarStackedSeriesColor-DM7Ax0-s.js +11 -0
  119. package/dist/resolveBarStackedSeriesColor-z3NP5vAS.cjs +1 -0
  120. package/dist/resolveChartValueRange-DBCYLCXs.cjs +1 -0
  121. package/dist/resolveChartValueRange-DZybnmaX.js +10 -0
  122. package/dist/{resolveSeriesPaletteColor-DcLSyk-D.js → resolveSeriesPaletteColor-B7wHDj1L.js} +1 -1
  123. package/dist/resolveSeriesPaletteColor-D0XlU5vT.cjs +1 -0
  124. package/dist/{resolveStackedChartContext-CQbgdV55.cjs → resolveStackedChartContext-Br3N7ISo.cjs} +1 -1
  125. package/dist/{resolveStackedChartContext-CIKVXkDn.js → resolveStackedChartContext-DxJNWqwE.js} +1 -1
  126. package/dist/uikit-components.css +1 -1
  127. package/dist/{useChartInteractivity-BATdT86l.js → useChartInteractivity-Cl06JL4l.js} +121 -108
  128. package/dist/useChartInteractivity-LbJiqlvI.cjs +1 -0
  129. package/dist/utils/chart/chart.types.d.ts +14 -0
  130. package/dist/utils/chart/chart.types.d.ts.map +1 -1
  131. package/dist/utils/chart/core/chartInteractivity.d.ts.map +1 -1
  132. package/dist/utils/chart/core/createChartMarkersPlugin.d.ts +8 -0
  133. package/dist/utils/chart/core/createChartMarkersPlugin.d.ts.map +1 -0
  134. package/dist/utils/chart/core/createZeroLinePlugin.d.ts +3 -0
  135. package/dist/utils/chart/core/createZeroLinePlugin.d.ts.map +1 -0
  136. package/dist/utils/chart/core/resolveChartValueRange.d.ts +11 -0
  137. package/dist/utils/chart/core/resolveChartValueRange.d.ts.map +1 -0
  138. package/dist/utils/chart/index.d.ts +7 -2
  139. package/dist/utils/chart/index.d.ts.map +1 -1
  140. package/dist/utils/chart/line/createChartAreaFillGradient.d.ts +2 -0
  141. package/dist/utils/chart/line/createChartAreaFillGradient.d.ts.map +1 -1
  142. package/dist/utils/chart/pie/createPieSegmentBadgePlugin.d.ts +1 -1
  143. package/dist/utils/chart/pie/createPieSegmentBadgePlugin.d.ts.map +1 -1
  144. package/dist/utils/chart/pie/createPieTooltipCallbacks.d.ts +1 -1
  145. package/dist/utils/chart/pie/createPieTooltipCallbacks.d.ts.map +1 -1
  146. package/package.json +1 -1
  147. package/dist/SChartBar-BVgwPlYi.js +0 -215
  148. package/dist/SChartBar-CBU1uCuL.cjs +0 -1
  149. package/dist/SChartBurnup-Ch3UMa9w.cjs +0 -1
  150. package/dist/SChartLine-Cs1JzPEK.js +0 -129
  151. package/dist/SChartLine-nIGaef_o.cjs +0 -1
  152. package/dist/SChartMultiLine-BzoW4ETf.cjs +0 -1
  153. package/dist/SChartMultiLine-DqCQ7FCv.js +0 -204
  154. package/dist/SChartPie-Bv5Obcwb.cjs +0 -1
  155. package/dist/STable-EpiUErdI.cjs +0 -1
  156. package/dist/buildWorkTimeLegendItems-DjhLKbAP.cjs +0 -1
  157. package/dist/createChartAreaFillGradient-BDmME9Gy.js +0 -17
  158. package/dist/createChartAreaFillGradient-BwsojVzU.cjs +0 -1
  159. package/dist/resolveBarStackedSeriesColor-HDSkh6Mw.cjs +0 -1
  160. package/dist/resolveBarStackedSeriesColor-LpVh1SvQ.js +0 -11
  161. package/dist/resolveSeriesPaletteColor-B5qoBbXN.cjs +0 -1
  162. 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}});