@shtabapp/ui-kit 1.45.0 → 1.47.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/{SChartBurnup-DhuCNXhU.cjs → SChartBurnup-BhCS06uF.cjs} +1 -1
- package/dist/SChartBurnup-CG239MJx.js +251 -0
- package/dist/SChartHorizontalBar-DnKbf_9E.cjs +1 -0
- package/dist/SChartHorizontalBar-DqTZ4H-9.js +175 -0
- package/dist/SChartLegend-DGtjd6zV.cjs +1 -0
- package/dist/SChartLegend-oZoF8XK7.js +42 -0
- package/dist/SChartLine-CEnRbnVo.cjs +1 -0
- package/dist/SChartLine-CQhbtAjJ.js +129 -0
- package/dist/SChartMultiLine-B6GldTYv.cjs +1 -0
- package/dist/SChartMultiLine-CPEglksk.js +198 -0
- package/dist/SChartPie-CQyENNM6.cjs +1 -0
- package/dist/SChartPie-DXHCXNEs.js +168 -0
- package/dist/{SChartProgress-Zdphet8I.js → SChartProgress-BwDuidgB.js} +54 -50
- package/dist/{SChartProgress-QsGTZ8kT.cjs → SChartProgress-CMcM6yvT.cjs} +1 -1
- package/dist/SChartSkeletonHost-BlIYGj-7.cjs +1 -0
- package/dist/{SChartSkeletonHost-CecfQ3Ye.js → SChartSkeletonHost-DSFyP_DN.js} +150 -89
- package/dist/SChartStackedArea-BR7W44h6.js +254 -0
- package/dist/SChartStackedArea-DHSamqau.cjs +1 -0
- package/dist/SChartStackedBar-B3HcO4UQ.cjs +1 -0
- package/dist/SChartStackedBar-BbYna5KB.js +245 -0
- package/dist/{SColorPicker-ksmNupJa.js → SColorPicker-BqsD-5xA.js} +1 -1
- package/dist/{SColorPicker-BIrkgFys.cjs → SColorPicker-CeKB3QS1.cjs} +1 -1
- package/dist/SList-DAzztC-7.js +514 -0
- package/dist/SList-S18K8mlH.cjs +1 -0
- package/dist/{SSelect-DS2EGmjV.js → SSelect-Bntb-dgY.js} +1 -1
- package/dist/{SSelect-CkV6gq4S.cjs → SSelect-DcTEwHx6.cjs} +1 -1
- package/dist/components/SChartBurnup/SChartBurnup.vue.d.ts +4 -1
- package/dist/components/SChartBurnup/SChartBurnup.vue.d.ts.map +1 -1
- package/dist/components/SChartHorizontalBar/SChartHorizontalBar.vue.d.ts +9 -2
- package/dist/components/SChartHorizontalBar/SChartHorizontalBar.vue.d.ts.map +1 -1
- package/dist/components/SChartHorizontalBar/utils/buildSChartHorizontalBarConfig.d.ts +1 -0
- package/dist/components/SChartHorizontalBar/utils/buildSChartHorizontalBarConfig.d.ts.map +1 -1
- package/dist/components/SChartLegend/SChartLegend.types.d.ts +2 -0
- package/dist/components/SChartLegend/SChartLegend.types.d.ts.map +1 -1
- package/dist/components/SChartLegend/SChartLegend.vue.d.ts +5 -1
- package/dist/components/SChartLegend/SChartLegend.vue.d.ts.map +1 -1
- package/dist/components/SChartLine/SChartLine.vue.d.ts +4 -1
- package/dist/components/SChartLine/SChartLine.vue.d.ts.map +1 -1
- package/dist/components/SChartMultiLine/SChartMultiLine.vue.d.ts +9 -2
- package/dist/components/SChartMultiLine/SChartMultiLine.vue.d.ts.map +1 -1
- package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts +2 -1
- package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts.map +1 -1
- package/dist/components/SChartPie/SChartPie.vue.d.ts +9 -2
- package/dist/components/SChartPie/SChartPie.vue.d.ts.map +1 -1
- package/dist/components/SChartPie/utils/buildPieChartConfig.d.ts +2 -1
- package/dist/components/SChartPie/utils/buildPieChartConfig.d.ts.map +1 -1
- package/dist/components/SChartProgress/SChartProgress.vue.d.ts +4 -1
- package/dist/components/SChartProgress/SChartProgress.vue.d.ts.map +1 -1
- package/dist/components/SChartSegmentedBar/SChartSegmentedBar.vue.d.ts +9 -2
- 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/SChartStackedArea/SChartStackedArea.vue.d.ts +9 -2
- package/dist/components/SChartStackedArea/SChartStackedArea.vue.d.ts.map +1 -1
- package/dist/components/SChartStackedArea/utils/buildStackedAreaChartConfig.d.ts +2 -1
- package/dist/components/SChartStackedArea/utils/buildStackedAreaChartConfig.d.ts.map +1 -1
- package/dist/components/SChartStackedBar/SChartStackedBar.vue.d.ts +9 -2
- package/dist/components/SChartStackedBar/SChartStackedBar.vue.d.ts.map +1 -1
- package/dist/components/SChartStackedBar/utils/buildStackedBarChartConfig.d.ts +2 -1
- package/dist/components/SChartStackedBar/utils/buildStackedBarChartConfig.d.ts.map +1 -1
- package/dist/components/SList/SList.types.d.ts +11 -0
- package/dist/components/SList/SList.types.d.ts.map +1 -1
- package/dist/components/SList/SList.vue.d.ts +11 -3
- package/dist/components/SList/SList.vue.d.ts.map +1 -1
- package/dist/composables/useChartInteractivity.d.ts +14 -0
- package/dist/composables/useChartInteractivity.d.ts.map +1 -0
- package/dist/composables/useFlatTreeList.d.ts +4 -1
- package/dist/composables/useFlatTreeList.d.ts.map +1 -1
- package/dist/composables/useHasListener.d.ts +2 -0
- package/dist/composables/useHasListener.d.ts.map +1 -0
- package/dist/{createChartCrosshairPlugin-HfMMUP5O.cjs → createChartCrosshairPlugin-DdLyEWI0.cjs} +1 -1
- package/dist/{createChartCrosshairPlugin-BC0IDCn3.js → createChartCrosshairPlugin-q3U4ePnf.js} +2 -2
- package/dist/entries/chart-burnup.cjs +1 -1
- package/dist/entries/chart-burnup.js +1 -1
- package/dist/entries/chart-horizontal-bar.cjs +1 -1
- package/dist/entries/chart-horizontal-bar.js +1 -1
- package/dist/entries/chart-line.cjs +1 -1
- package/dist/entries/chart-line.js +1 -1
- package/dist/entries/chart-multi-line.cjs +1 -1
- package/dist/entries/chart-multi-line.js +1 -1
- package/dist/entries/chart-pie.cjs +1 -1
- package/dist/entries/chart-pie.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/color-picker.cjs +1 -1
- package/dist/entries/color-picker.js +1 -1
- package/dist/entries/list.cjs +1 -1
- package/dist/entries/list.js +1 -1
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +184 -140
- package/dist/resolveSeriesPaletteColor-YACKW1NO.cjs +1 -0
- package/dist/{resolveSeriesPaletteColor-m8HQ9qwV.js → resolveSeriesPaletteColor-fuhGbjFO.js} +1 -1
- package/dist/{resolveStackedChartContext-DdraOueU.js → resolveStackedChartContext-BiIGZ2or.js} +5 -5
- package/dist/{resolveStackedChartContext-BywAnZUu.cjs → resolveStackedChartContext-Bp75eU_I.cjs} +1 -1
- package/dist/useHasListener-BPgtbbo6.cjs +1 -0
- package/dist/useHasListener-RSjlUyqH.js +8 -0
- package/dist/utils/chart/core/chartCssVariables.d.ts +2 -0
- package/dist/utils/chart/core/chartCssVariables.d.ts.map +1 -1
- package/dist/utils/chart/core/chartInteractivity.d.ts +41 -0
- package/dist/utils/chart/core/chartInteractivity.d.ts.map +1 -0
- package/dist/utils/chart/horizontalBar/buildHorizontalBarChartConfig.d.ts +2 -1
- package/dist/utils/chart/horizontalBar/buildHorizontalBarChartConfig.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/SChartBurnup-DYBnJMnm.js +0 -247
- package/dist/SChartHorizontalBar-DMBzyz9x.cjs +0 -1
- package/dist/SChartHorizontalBar-bm3Jexa3.js +0 -156
- package/dist/SChartLegend-Chr0IZWN.js +0 -30
- package/dist/SChartLegend-DXFXKXCm.cjs +0 -1
- package/dist/SChartLine-CiREb4H_.js +0 -125
- package/dist/SChartLine-P57XRR2o.cjs +0 -1
- package/dist/SChartMultiLine-3cdB0U12.js +0 -166
- package/dist/SChartMultiLine-BW1kITlR.cjs +0 -1
- package/dist/SChartPie-55wx2zRi.cjs +0 -1
- package/dist/SChartPie-Dc_gjzIl.js +0 -143
- package/dist/SChartSkeletonHost-CfM0zolj.cjs +0 -1
- package/dist/SChartStackedArea-BaJ963lU.cjs +0 -1
- package/dist/SChartStackedArea-cjN9gECV.js +0 -219
- package/dist/SChartStackedBar-0jGICBA0.js +0 -217
- package/dist/SChartStackedBar-j9WyOnsL.cjs +0 -1
- package/dist/SList-BtfUntkw.js +0 -437
- package/dist/SList-fZQdPkFG.cjs +0 -1
- package/dist/resolveSeriesPaletteColor-BcFyrhh0.cjs +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { computed as e, createBlock as t, defineComponent as n, onBeforeUnmount as r, onMounted as i, openBlock as a, renderSlot as o, shallowRef as s, toValue as c, unref as l, watch as u, withCtx as
|
|
2
|
-
import { ESSkeletonType as
|
|
3
|
-
import { useResizeObserver as
|
|
4
|
-
import { ArcElement as
|
|
1
|
+
import { computed as e, createBlock as t, defineComponent as n, onBeforeUnmount as r, onMounted as i, openBlock as a, renderSlot as o, shallowRef as s, toValue as c, unref as l, watch as u, withCtx as ee } from "vue";
|
|
2
|
+
import { ESSkeletonType as d, SSkeleton as f } from "@shtabapp/ui-kit-primitives";
|
|
3
|
+
import { useResizeObserver as p } from "@vueuse/core";
|
|
4
|
+
import { ArcElement as m, BarController as te, BarElement as ne, CategoryScale as re, Chart as h, Filler as ie, LineController as ae, LineElement as oe, LinearScale as g, PieController as _, PointElement as v, Tooltip as y } from "chart.js";
|
|
5
5
|
//#region src/utils/chart/css/readCssColor.ts
|
|
6
|
-
var
|
|
6
|
+
var b = (e, t) => {
|
|
7
7
|
if (typeof window > "u") return "";
|
|
8
8
|
let n = t ?? document.documentElement;
|
|
9
9
|
return getComputedStyle(n).getPropertyValue(e).trim();
|
|
10
|
-
},
|
|
10
|
+
}, x = {
|
|
11
11
|
axisLabel: "--s-ui-chart-axis-label",
|
|
12
12
|
grid: "--s-ui-chart-grid",
|
|
13
13
|
crosshair: "--s-ui-chart-crosshair",
|
|
@@ -26,6 +26,8 @@ var T = (e, t) => {
|
|
|
26
26
|
skeletonFillStart: "--s-ui-chart-skeleton-fill-start",
|
|
27
27
|
skeletonFillEnd: "--s-ui-chart-skeleton-fill-end",
|
|
28
28
|
skeletonFillOpacity: "--s-ui-chart-skeleton-fill-opacity",
|
|
29
|
+
fillMuted: "--s-ui-chart-fill-muted",
|
|
30
|
+
exportBackground: "--s-ui-chart-export-background",
|
|
29
31
|
tooltipBackground: "--s-ui-chart-tooltip-background",
|
|
30
32
|
tooltipText: "--s-ui-chart-tooltip-text",
|
|
31
33
|
stackedPalette1: "--s-ui-chart-stacked-palette-1",
|
|
@@ -84,70 +86,70 @@ var T = (e, t) => {
|
|
|
84
86
|
burnupFactFillEnd: "--s-ui-chart-burnup-fact-fill-end",
|
|
85
87
|
burnupToday: "--s-ui-chart-burnup-today",
|
|
86
88
|
burnupTagBackground: "--s-ui-chart-burnup-tag-background"
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
}, S = [
|
|
90
|
+
x.stackedPalette1,
|
|
91
|
+
x.stackedPalette2,
|
|
92
|
+
x.stackedPalette3,
|
|
93
|
+
x.stackedPalette4,
|
|
94
|
+
x.stackedPalette5,
|
|
95
|
+
x.stackedPalette6
|
|
96
|
+
], C = [
|
|
97
|
+
x.skeletonPalette1,
|
|
98
|
+
x.skeletonPalette2,
|
|
99
|
+
x.skeletonPalette3,
|
|
100
|
+
x.skeletonPalette4,
|
|
101
|
+
x.skeletonPalette5,
|
|
102
|
+
x.skeletonPalette6
|
|
103
|
+
], w = [
|
|
104
|
+
x.barStackedPalette1,
|
|
105
|
+
x.barStackedPalette2,
|
|
106
|
+
x.barStackedPalette3,
|
|
107
|
+
x.barStackedPalette4,
|
|
108
|
+
x.barStackedPalette5,
|
|
109
|
+
x.barStackedPalette6
|
|
110
|
+
], T = [
|
|
111
|
+
x.barSkeletonPalette1,
|
|
112
|
+
x.barSkeletonPalette2,
|
|
113
|
+
x.barSkeletonPalette3,
|
|
114
|
+
x.barSkeletonPalette4,
|
|
115
|
+
x.barSkeletonPalette5,
|
|
116
|
+
x.barSkeletonPalette6
|
|
117
|
+
], E = [
|
|
118
|
+
x.piePalette1,
|
|
119
|
+
x.piePalette2,
|
|
120
|
+
x.piePalette3,
|
|
121
|
+
x.piePalette4,
|
|
122
|
+
x.piePalette5,
|
|
123
|
+
x.piePalette6,
|
|
124
|
+
x.piePalette7,
|
|
125
|
+
x.piePalette8
|
|
126
|
+
], D = [
|
|
127
|
+
x.pieSkeletonPalette1,
|
|
128
|
+
x.pieSkeletonPalette2,
|
|
129
|
+
x.pieSkeletonPalette3,
|
|
130
|
+
x.pieSkeletonPalette4,
|
|
131
|
+
x.pieSkeletonPalette5,
|
|
132
|
+
x.pieSkeletonPalette6,
|
|
133
|
+
x.pieSkeletonPalette7,
|
|
134
|
+
x.pieSkeletonPalette8
|
|
94
135
|
], O = [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
E.skeletonPalette5,
|
|
100
|
-
E.skeletonPalette6
|
|
101
|
-
], k = [
|
|
102
|
-
E.barStackedPalette1,
|
|
103
|
-
E.barStackedPalette2,
|
|
104
|
-
E.barStackedPalette3,
|
|
105
|
-
E.barStackedPalette4,
|
|
106
|
-
E.barStackedPalette5,
|
|
107
|
-
E.barStackedPalette6
|
|
108
|
-
], A = [
|
|
109
|
-
E.barSkeletonPalette1,
|
|
110
|
-
E.barSkeletonPalette2,
|
|
111
|
-
E.barSkeletonPalette3,
|
|
112
|
-
E.barSkeletonPalette4,
|
|
113
|
-
E.barSkeletonPalette5,
|
|
114
|
-
E.barSkeletonPalette6
|
|
115
|
-
], j = [
|
|
116
|
-
E.piePalette1,
|
|
117
|
-
E.piePalette2,
|
|
118
|
-
E.piePalette3,
|
|
119
|
-
E.piePalette4,
|
|
120
|
-
E.piePalette5,
|
|
121
|
-
E.piePalette6,
|
|
122
|
-
E.piePalette7,
|
|
123
|
-
E.piePalette8
|
|
124
|
-
], M = [
|
|
125
|
-
E.pieSkeletonPalette1,
|
|
126
|
-
E.pieSkeletonPalette2,
|
|
127
|
-
E.pieSkeletonPalette3,
|
|
128
|
-
E.pieSkeletonPalette4,
|
|
129
|
-
E.pieSkeletonPalette5,
|
|
130
|
-
E.pieSkeletonPalette6,
|
|
131
|
-
E.pieSkeletonPalette7,
|
|
132
|
-
E.pieSkeletonPalette8
|
|
133
|
-
], N = [
|
|
134
|
-
E.multiLinePalette1,
|
|
135
|
-
E.multiLinePalette2,
|
|
136
|
-
E.multiLinePalette3
|
|
137
|
-
], P = (e) => "captions" in e, F = (e, t) => {
|
|
136
|
+
x.multiLinePalette1,
|
|
137
|
+
x.multiLinePalette2,
|
|
138
|
+
x.multiLinePalette3
|
|
139
|
+
], k = (e) => "captions" in e, A = (e, t) => {
|
|
138
140
|
let n = e.data.datasets[0];
|
|
139
|
-
if (!n || !
|
|
141
|
+
if (!n || !k(n)) return;
|
|
140
142
|
let r = n.captions?.[t];
|
|
141
143
|
if (r) return r;
|
|
142
|
-
},
|
|
144
|
+
}, j = () => ({
|
|
143
145
|
title: (e) => {
|
|
144
146
|
let t = e[0];
|
|
145
147
|
if (!t) return "";
|
|
146
|
-
let n =
|
|
148
|
+
let n = A(t.chart, t.dataIndex), r = [`${t.label}`];
|
|
147
149
|
return n && r.push(n), r;
|
|
148
150
|
},
|
|
149
151
|
label: (e) => `${e.dataset.label ?? ""} – ${e.parsed.y ?? 0}`
|
|
150
|
-
}),
|
|
152
|
+
}), M = "stackedBarTop", N = function(e, t) {
|
|
151
153
|
if (e.length === 0) return {
|
|
152
154
|
x: t.x,
|
|
153
155
|
y: t.y
|
|
@@ -165,13 +167,13 @@ var T = (e, t) => {
|
|
|
165
167
|
x: (r + i) / 2,
|
|
166
168
|
y: n
|
|
167
169
|
};
|
|
168
|
-
},
|
|
170
|
+
}, P = () => ({
|
|
169
171
|
title: (e) => {
|
|
170
172
|
let t = e[0];
|
|
171
173
|
return t ? `${t.label}` : "";
|
|
172
174
|
},
|
|
173
175
|
label: (e) => `${e.dataset.label ?? ""}: ${e.parsed.y ?? 0}`
|
|
174
|
-
}),
|
|
176
|
+
}), F = "multiLineTop", I = function(e, t) {
|
|
175
177
|
let n = this.chart.chartArea;
|
|
176
178
|
return !n || e.length === 0 ? {
|
|
177
179
|
x: t.x,
|
|
@@ -180,22 +182,22 @@ var T = (e, t) => {
|
|
|
180
182
|
x: t.x,
|
|
181
183
|
y: n.top
|
|
182
184
|
};
|
|
183
|
-
},
|
|
184
|
-
let n = e.data.datasets[
|
|
185
|
+
}, L = "progressChartPoint", R = 1, z = (e, t) => {
|
|
186
|
+
let n = e.data.datasets[R]?.data[t];
|
|
185
187
|
return typeof n == "number" ? n : null;
|
|
186
|
-
},
|
|
187
|
-
let t = e.find((e) => e.datasetIndex ===
|
|
188
|
+
}, se = function(e) {
|
|
189
|
+
let t = e.find((e) => e.datasetIndex === R) ?? e[0];
|
|
188
190
|
if (!t) return !1;
|
|
189
191
|
let n = this.chart.scales.y;
|
|
190
192
|
if (!n) return !1;
|
|
191
|
-
let r =
|
|
193
|
+
let r = z(this.chart, t.index);
|
|
192
194
|
return r === null ? !1 : {
|
|
193
195
|
x: t.element.x,
|
|
194
196
|
y: n.getPixelForValue(r),
|
|
195
197
|
xAlign: "center",
|
|
196
198
|
yAlign: "bottom"
|
|
197
199
|
};
|
|
198
|
-
},
|
|
200
|
+
}, B = ({ total: e } = {}) => ({
|
|
199
201
|
title: (e) => {
|
|
200
202
|
let t = e[0];
|
|
201
203
|
return t ? `${t.label}` : "";
|
|
@@ -205,7 +207,7 @@ var T = (e, t) => {
|
|
|
205
207
|
let n = t.reduce((e, t) => e + (t.parsed.y ?? 0), 0);
|
|
206
208
|
return e ? `${e} – ${n}` : `${n}`;
|
|
207
209
|
}
|
|
208
|
-
}),
|
|
210
|
+
}), V = "stackedAreaTop", H = function(e, t) {
|
|
209
211
|
let n = this.chart.chartArea;
|
|
210
212
|
return !n || e.length === 0 ? {
|
|
211
213
|
x: t.x,
|
|
@@ -214,20 +216,69 @@ var T = (e, t) => {
|
|
|
214
216
|
x: t.x,
|
|
215
217
|
y: n.top
|
|
216
218
|
};
|
|
217
|
-
},
|
|
218
|
-
|
|
219
|
-
},
|
|
220
|
-
|
|
221
|
-
},
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
},
|
|
219
|
+
}, U = !1, W = !1, G = !1, K = !1, ce = !1, le = () => {
|
|
220
|
+
W ||= (y.positioners.stackedAreaTop = H, !0);
|
|
221
|
+
}, ue = () => {
|
|
222
|
+
G ||= (y.positioners.stackedBarTop = N, !0);
|
|
223
|
+
}, de = () => {
|
|
224
|
+
K ||= (y.positioners.progressChartPoint = se, !0);
|
|
225
|
+
}, fe = () => {
|
|
226
|
+
ce ||= (y.positioners.multiLineTop = I, !0);
|
|
227
|
+
}, pe = () => {
|
|
228
|
+
U ||= (h.register(ae, oe, v, te, ne, _, m, g, re, y, ie), le(), ue(), de(), fe(), !0);
|
|
229
|
+
}, me = (e, t) => e ? {
|
|
228
230
|
mode: "nearest",
|
|
229
231
|
intersect: !1
|
|
230
|
-
} : t,
|
|
232
|
+
} : t, he = (e) => !e, ge = (e, t) => e ? [] : t, q = /* @__PURE__ */ new WeakMap(), J = {
|
|
233
|
+
element: (e, t, n) => {
|
|
234
|
+
let r = e.data.datasets[0], i = r?.hoverBackgroundColor;
|
|
235
|
+
!r || !Array.isArray(i) || (r.backgroundColor = t === null ? [...i] : i.map((e, r) => r === t ? e : n));
|
|
236
|
+
},
|
|
237
|
+
series: (e, t, n) => {
|
|
238
|
+
e.data.datasets.forEach((e, r) => {
|
|
239
|
+
let i = t === null || r === t, { hoverBackgroundColor: a, hoverBorderColor: o } = e;
|
|
240
|
+
a !== void 0 && !Array.isArray(a) && (e.backgroundColor = i ? a : n), o !== void 0 && !Array.isArray(o) && (e.borderColor = i ? o : n);
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}, Y = (e, t, n, r, i = !1) => {
|
|
244
|
+
(q.get(e)?.index ?? null) !== n && (q.set(e, {
|
|
245
|
+
index: n,
|
|
246
|
+
kind: t,
|
|
247
|
+
mutedColor: r
|
|
248
|
+
}), J[t](e, n, r), e.canvas.style.cursor = n !== null && i ? "pointer" : "", e.update());
|
|
249
|
+
}, X = (e) => {
|
|
250
|
+
let t = q.get(e);
|
|
251
|
+
!t || t.index === null || (q.set(e, {
|
|
252
|
+
...t,
|
|
253
|
+
index: null
|
|
254
|
+
}), J[t.kind](e, null, t.mutedColor), e.canvas.style.cursor = "", e.update());
|
|
255
|
+
}, _e = {
|
|
256
|
+
id: "sChartHoverDimReset",
|
|
257
|
+
afterEvent: (e, t) => {
|
|
258
|
+
t.event.type === "mouseout" && X(e);
|
|
259
|
+
}
|
|
260
|
+
}, Z = (e, t) => {
|
|
261
|
+
let n = e[0];
|
|
262
|
+
return n ? t === "element" ? n.index : n.datasetIndex : null;
|
|
263
|
+
}, ve = ({ kind: e, skeleton: t, colorHostElement: n, onIndexClick: r }) => {
|
|
264
|
+
if (t) return { plugins: [] };
|
|
265
|
+
let i = Q(n), a = !!r, o = {
|
|
266
|
+
onHover: (t, n, r) => {
|
|
267
|
+
Y(r, e, Z(n, e), i, a);
|
|
268
|
+
},
|
|
269
|
+
plugins: [_e]
|
|
270
|
+
};
|
|
271
|
+
return r && (o.onClick = (t, n) => {
|
|
272
|
+
let i = Z(n, e);
|
|
273
|
+
i !== null && r(i);
|
|
274
|
+
}), o;
|
|
275
|
+
}, Q = (e) => b(x.fillMuted, e), ye = (e, t) => {
|
|
276
|
+
if (!e.canvas.width || !e.canvas.height) return;
|
|
277
|
+
let n = document.createElement("canvas");
|
|
278
|
+
n.width = e.canvas.width, n.height = e.canvas.height;
|
|
279
|
+
let r = n.getContext("2d");
|
|
280
|
+
if (r) return r.fillStyle = b(x.exportBackground, t) || "#ffffff", r.fillRect(0, 0, n.width, n.height), r.drawImage(e.canvas, 0, 0), n.toDataURL("image/png");
|
|
281
|
+
}, be = ({ canvasRef: e, config: t, enabled: n }) => {
|
|
231
282
|
let a = s(), o = () => {
|
|
232
283
|
a.value &&= (a.value.destroy(), void 0);
|
|
233
284
|
}, l = () => {
|
|
@@ -240,7 +291,7 @@ var T = (e, t) => {
|
|
|
240
291
|
o();
|
|
241
292
|
return;
|
|
242
293
|
}
|
|
243
|
-
|
|
294
|
+
pe(), a.value &&= (a.value.destroy(), void 0), a.value = new h(r, i);
|
|
244
295
|
};
|
|
245
296
|
return i(() => {
|
|
246
297
|
l();
|
|
@@ -250,14 +301,24 @@ var T = (e, t) => {
|
|
|
250
301
|
c(t)
|
|
251
302
|
], () => {
|
|
252
303
|
l();
|
|
253
|
-
}, { deep: !0 }),
|
|
304
|
+
}, { deep: !0 }), p(e, () => {
|
|
254
305
|
a.value?.resize();
|
|
255
306
|
}), r(() => {
|
|
256
307
|
o();
|
|
257
308
|
}), { chartInstance: a };
|
|
258
|
-
},
|
|
309
|
+
}, xe = ({ chartInstance: e, canvasRef: t, colorHostElement: n, legendDimKind: r = "series" }) => (u(e, () => {
|
|
310
|
+
let e = c(t);
|
|
311
|
+
e?.style.cursor && (e.style.cursor = "");
|
|
312
|
+
}), {
|
|
313
|
+
exportImage: () => {
|
|
314
|
+
if (e.value) return ye(e.value, c(n));
|
|
315
|
+
},
|
|
316
|
+
handleLegendItemHover: (t) => {
|
|
317
|
+
e.value && Y(e.value, r, t, Q(c(n)));
|
|
318
|
+
}
|
|
319
|
+
}), $ = /* @__PURE__ */ function(e) {
|
|
259
320
|
return e.CARTESIAN = "cartesian", e.PIE = "pie", e;
|
|
260
|
-
}({}),
|
|
321
|
+
}({}), Se = /* @__PURE__ */ n({
|
|
261
322
|
__name: "SChartSkeletonHost",
|
|
262
323
|
props: {
|
|
263
324
|
loading: {
|
|
@@ -267,16 +328,16 @@ var T = (e, t) => {
|
|
|
267
328
|
type: { default: () => $.CARTESIAN }
|
|
268
329
|
},
|
|
269
330
|
setup(n) {
|
|
270
|
-
let r = e(() => n.type === $.PIE ?
|
|
271
|
-
return (e, i) => n.loading ? (a(), t(l(
|
|
331
|
+
let r = e(() => n.type === $.PIE ? d.CHART_PIE : d.CHART_CARTESIAN);
|
|
332
|
+
return (e, i) => n.loading ? (a(), t(l(f), {
|
|
272
333
|
key: 0,
|
|
273
334
|
type: r.value,
|
|
274
335
|
class: "s-ui-chart-skeleton-host"
|
|
275
336
|
}, {
|
|
276
|
-
default:
|
|
337
|
+
default: ee(() => [o(e.$slots, "default")]),
|
|
277
338
|
_: 3
|
|
278
339
|
}, 8, ["type"])) : o(e.$slots, "default", { key: 1 });
|
|
279
340
|
}
|
|
280
341
|
});
|
|
281
342
|
//#endregion
|
|
282
|
-
export {
|
|
343
|
+
export { S as C, C as S, w as _, ve as a, D as b, ge as c, L as d, F as f, T as g, j as h, be as i, V as l, M as m, $ as n, me as o, P as p, xe as r, he as s, Se as t, B as u, x as v, b as w, E as x, O as y };
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { C as e, S as t, a as n, c as r, i, l as a, o, r as s, s as c, t as l, u, v as d } from "./SChartSkeletonHost-DSFyP_DN.js";
|
|
2
|
+
import { t as f } from "./buildCartesianChartScales-EofFq3ry.js";
|
|
3
|
+
import { n as p, t as m } from "./buildChartSeriesPoints-D8Xpfwp7.js";
|
|
4
|
+
import { t as h } from "./resolveStackedChartContext-BiIGZ2or.js";
|
|
5
|
+
import { t as g } from "./createChartCrosshairPlugin-q3U4ePnf.js";
|
|
6
|
+
import { t as _ } from "./resolveSeriesPaletteColor-fuhGbjFO.js";
|
|
7
|
+
import { t as v } from "./SChartLegend-oZoF8XK7.js";
|
|
8
|
+
import { t as y } from "./useHasListener-RSjlUyqH.js";
|
|
9
|
+
import { computed as b, createBlock as x, createCommentVNode as S, createElementBlock as C, createElementVNode as w, createVNode as T, defineComponent as E, normalizeClass as D, openBlock as O, unref as k, useTemplateRef as A, withCtx as j } from "vue";
|
|
10
|
+
//#region src/utils/chart/stacked/resolveStackedSeriesColor.ts
|
|
11
|
+
var M = (n, r, i, a = !1) => _(n, r, i, a, {
|
|
12
|
+
palette: e,
|
|
13
|
+
paletteFallback: d.stackedPalette1,
|
|
14
|
+
skeletonPalette: t,
|
|
15
|
+
skeletonFallback: d.skeletonPalette1
|
|
16
|
+
}), N = 20, P = "stack0", F = ({ seriesList: e, colorHostElement: t, yMax: i, yMin: s, yStep: l = N, skeleton: d = !1, totalLabel: p, onSeriesClick: m }) => {
|
|
17
|
+
let _ = h({
|
|
18
|
+
seriesList: e,
|
|
19
|
+
colorHostElement: t,
|
|
20
|
+
yMax: i,
|
|
21
|
+
yMin: s,
|
|
22
|
+
yStep: l,
|
|
23
|
+
skeleton: d
|
|
24
|
+
});
|
|
25
|
+
if (!_) return null;
|
|
26
|
+
let { axisLabelColor: v, gridColor: y, tooltipBackgroundColor: b, tooltipTextColor: x, resolvedYMax: S, resolvedYMin: C, chartLabels: w } = _, T = n({
|
|
27
|
+
kind: "series",
|
|
28
|
+
skeleton: d,
|
|
29
|
+
colorHostElement: t,
|
|
30
|
+
onIndexClick: m
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
type: "line",
|
|
34
|
+
data: {
|
|
35
|
+
labels: w,
|
|
36
|
+
datasets: e.map((e, n) => {
|
|
37
|
+
let r = M(n, t, e.fillColor, d);
|
|
38
|
+
return {
|
|
39
|
+
label: e.label,
|
|
40
|
+
data: e.points.map((e) => e.value),
|
|
41
|
+
borderColor: r,
|
|
42
|
+
backgroundColor: r,
|
|
43
|
+
...d ? {} : {
|
|
44
|
+
hoverBorderColor: r,
|
|
45
|
+
hoverBackgroundColor: r
|
|
46
|
+
},
|
|
47
|
+
borderWidth: 0,
|
|
48
|
+
fill: !0,
|
|
49
|
+
pointRadius: 0,
|
|
50
|
+
pointHoverRadius: 0,
|
|
51
|
+
tension: 0,
|
|
52
|
+
stack: P
|
|
53
|
+
};
|
|
54
|
+
})
|
|
55
|
+
},
|
|
56
|
+
options: {
|
|
57
|
+
responsive: !0,
|
|
58
|
+
maintainAspectRatio: !1,
|
|
59
|
+
onHover: T.onHover,
|
|
60
|
+
onClick: T.onClick,
|
|
61
|
+
hover: d ? void 0 : {
|
|
62
|
+
mode: "nearest",
|
|
63
|
+
intersect: !1
|
|
64
|
+
},
|
|
65
|
+
interaction: o(d, {
|
|
66
|
+
mode: "index",
|
|
67
|
+
intersect: !1
|
|
68
|
+
}),
|
|
69
|
+
plugins: {
|
|
70
|
+
legend: { display: !1 },
|
|
71
|
+
tooltip: {
|
|
72
|
+
enabled: c(d),
|
|
73
|
+
backgroundColor: b,
|
|
74
|
+
titleColor: x,
|
|
75
|
+
bodyColor: x,
|
|
76
|
+
footerColor: x,
|
|
77
|
+
displayColors: !1,
|
|
78
|
+
position: a,
|
|
79
|
+
yAlign: "bottom",
|
|
80
|
+
xAlign: "center",
|
|
81
|
+
caretPadding: 8,
|
|
82
|
+
callbacks: u({ total: p })
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
scales: f({
|
|
86
|
+
axisLabelColor: v,
|
|
87
|
+
gridColor: y,
|
|
88
|
+
yMin: C,
|
|
89
|
+
yMax: S,
|
|
90
|
+
yStep: l,
|
|
91
|
+
stacked: !0
|
|
92
|
+
})
|
|
93
|
+
},
|
|
94
|
+
plugins: r(d, [g(t), ...T.plugins])
|
|
95
|
+
};
|
|
96
|
+
}, I = [
|
|
97
|
+
"24.02",
|
|
98
|
+
"28.02",
|
|
99
|
+
"04.03",
|
|
100
|
+
"08.03",
|
|
101
|
+
"12.03",
|
|
102
|
+
"16.03",
|
|
103
|
+
"20.03",
|
|
104
|
+
"24.03",
|
|
105
|
+
"28.03",
|
|
106
|
+
"01.04",
|
|
107
|
+
"05.04",
|
|
108
|
+
"09.04",
|
|
109
|
+
"13.04",
|
|
110
|
+
"17.04"
|
|
111
|
+
], L = [
|
|
112
|
+
18,
|
|
113
|
+
22,
|
|
114
|
+
26,
|
|
115
|
+
30,
|
|
116
|
+
34,
|
|
117
|
+
38,
|
|
118
|
+
42,
|
|
119
|
+
44,
|
|
120
|
+
46,
|
|
121
|
+
48,
|
|
122
|
+
49,
|
|
123
|
+
50,
|
|
124
|
+
51,
|
|
125
|
+
52
|
|
126
|
+
], R = [
|
|
127
|
+
6,
|
|
128
|
+
6,
|
|
129
|
+
7,
|
|
130
|
+
7,
|
|
131
|
+
7,
|
|
132
|
+
7,
|
|
133
|
+
7,
|
|
134
|
+
7,
|
|
135
|
+
7,
|
|
136
|
+
7,
|
|
137
|
+
7,
|
|
138
|
+
7,
|
|
139
|
+
7,
|
|
140
|
+
7
|
|
141
|
+
], z = [
|
|
142
|
+
10,
|
|
143
|
+
11,
|
|
144
|
+
12,
|
|
145
|
+
12,
|
|
146
|
+
11,
|
|
147
|
+
10,
|
|
148
|
+
10,
|
|
149
|
+
10,
|
|
150
|
+
10,
|
|
151
|
+
10,
|
|
152
|
+
10,
|
|
153
|
+
10,
|
|
154
|
+
10,
|
|
155
|
+
10
|
|
156
|
+
], B = [
|
|
157
|
+
32,
|
|
158
|
+
30,
|
|
159
|
+
28,
|
|
160
|
+
26,
|
|
161
|
+
28,
|
|
162
|
+
30,
|
|
163
|
+
29,
|
|
164
|
+
28,
|
|
165
|
+
27,
|
|
166
|
+
26,
|
|
167
|
+
26,
|
|
168
|
+
27,
|
|
169
|
+
28,
|
|
170
|
+
28
|
|
171
|
+
], V = [
|
|
172
|
+
"Готово",
|
|
173
|
+
"На ревью",
|
|
174
|
+
"В процессе",
|
|
175
|
+
"Бэклог"
|
|
176
|
+
], H = [
|
|
177
|
+
{
|
|
178
|
+
label: V[0] ?? "Series 1",
|
|
179
|
+
points: m(I, L)
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
label: V[1] ?? "Series 2",
|
|
183
|
+
points: m(I, R)
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
label: V[2] ?? "Series 3",
|
|
187
|
+
points: m(I, z)
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
label: V[3] ?? "Series 4",
|
|
191
|
+
points: m(I, B)
|
|
192
|
+
}
|
|
193
|
+
], U = { class: "s-ui-chart-stacked-area__canvas-wrap" }, W = /* @__PURE__ */ E({
|
|
194
|
+
__name: "SChartStackedArea",
|
|
195
|
+
props: {
|
|
196
|
+
series: { default: () => [] },
|
|
197
|
+
loading: {
|
|
198
|
+
type: Boolean,
|
|
199
|
+
default: !1
|
|
200
|
+
},
|
|
201
|
+
yMax: {},
|
|
202
|
+
yStep: {},
|
|
203
|
+
totalLabel: {}
|
|
204
|
+
},
|
|
205
|
+
emits: ["seriesClick"],
|
|
206
|
+
setup(e, { expose: t, emit: n }) {
|
|
207
|
+
let r = n, a = A("chartRootRef"), o = A("chartCanvasRef"), c = b(() => e.loading ? H : e.series), u = (t) => {
|
|
208
|
+
let n = e.series[t];
|
|
209
|
+
n && r("seriesClick", t, n);
|
|
210
|
+
}, d = y("onSeriesClick"), f = b(() => !e.loading && e.series.length === 0 ? null : F({
|
|
211
|
+
seriesList: c.value,
|
|
212
|
+
colorHostElement: a.value,
|
|
213
|
+
yMax: e.loading ? 160 : e.yMax,
|
|
214
|
+
yMin: e.loading ? 0 : void 0,
|
|
215
|
+
yStep: e.loading ? 20 : e.yStep,
|
|
216
|
+
skeleton: e.loading,
|
|
217
|
+
totalLabel: e.totalLabel,
|
|
218
|
+
onSeriesClick: d() ? u : void 0
|
|
219
|
+
})), m = b(() => p(c.value, (t, n) => M(t, a.value, n, e.loading))), { chartInstance: h } = i({
|
|
220
|
+
canvasRef: o,
|
|
221
|
+
config: f,
|
|
222
|
+
enabled: b(() => e.loading || e.series.length > 0)
|
|
223
|
+
}), { exportImage: g, handleLegendItemHover: _ } = s({
|
|
224
|
+
chartInstance: h,
|
|
225
|
+
canvasRef: o,
|
|
226
|
+
colorHostElement: a
|
|
227
|
+
});
|
|
228
|
+
return t({ exportImage: g }), (t, n) => (O(), C("div", {
|
|
229
|
+
ref_key: "chartRootRef",
|
|
230
|
+
ref: a,
|
|
231
|
+
class: D(["s-ui-chart-stacked-area", { "s-ui-chart-stacked-area--skeleton": e.loading }])
|
|
232
|
+
}, [w("div", U, [T(k(l), { loading: e.loading }, {
|
|
233
|
+
default: j(() => [w("canvas", {
|
|
234
|
+
ref_key: "chartCanvasRef",
|
|
235
|
+
ref: o,
|
|
236
|
+
class: "s-ui-chart-stacked-area__canvas"
|
|
237
|
+
}, null, 512)]),
|
|
238
|
+
_: 1
|
|
239
|
+
}, 8, ["loading"])]), m.value.length ? (O(), x(k(v), {
|
|
240
|
+
key: 0,
|
|
241
|
+
items: m.value,
|
|
242
|
+
disabled: e.loading,
|
|
243
|
+
interactive: !e.loading,
|
|
244
|
+
onItemHover: k(_)
|
|
245
|
+
}, null, 8, [
|
|
246
|
+
"items",
|
|
247
|
+
"disabled",
|
|
248
|
+
"interactive",
|
|
249
|
+
"onItemHover"
|
|
250
|
+
])) : S("", !0)], 2));
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
//#endregion
|
|
254
|
+
export { W as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./SChartSkeletonHost-BlIYGj-7.cjs"),t=require("./buildCartesianChartScales-Dck5yBMo.cjs"),n=require("./buildChartSeriesPoints-Bv3nXvSu.cjs"),r=require("./resolveStackedChartContext-Bp75eU_I.cjs"),i=require("./createChartCrosshairPlugin-DdLyEWI0.cjs"),a=require("./resolveSeriesPaletteColor-YACKW1NO.cjs"),o=require("./SChartLegend-DGtjd6zV.cjs"),s=require("./useHasListener-BPgtbbo6.cjs");let c=require("vue");var l=(t,n,r,i=!1)=>a.t(t,n,r,i,{palette:e.C,paletteFallback:e.v.stackedPalette1,skeletonPalette:e.S,skeletonFallback:e.v.skeletonPalette1}),u=20,d=`stack0`,f=({seriesList:n,colorHostElement:a,yMax:o,yMin:s,yStep:c=u,skeleton:f=!1,totalLabel:p,onSeriesClick:m})=>{let h=r.t({seriesList:n,colorHostElement:a,yMax:o,yMin:s,yStep:c,skeleton:f});if(!h)return null;let{axisLabelColor:g,gridColor:_,tooltipBackgroundColor:v,tooltipTextColor:y,resolvedYMax:b,resolvedYMin:x,chartLabels:S}=h,C=e.a({kind:`series`,skeleton:f,colorHostElement:a,onIndexClick:m});return{type:`line`,data:{labels:S,datasets:n.map((e,t)=>{let n=l(t,a,e.fillColor,f);return{label:e.label,data:e.points.map(e=>e.value),borderColor:n,backgroundColor:n,...f?{}:{hoverBorderColor:n,hoverBackgroundColor:n},borderWidth:0,fill:!0,pointRadius:0,pointHoverRadius:0,tension:0,stack:d}})},options:{responsive:!0,maintainAspectRatio:!1,onHover:C.onHover,onClick:C.onClick,hover:f?void 0:{mode:`nearest`,intersect:!1},interaction:e.o(f,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:e.s(f),backgroundColor:v,titleColor:y,bodyColor:y,footerColor:y,displayColors:!1,position:e.l,yAlign:`bottom`,xAlign:`center`,caretPadding:8,callbacks:e.u({total:p})}},scales:t.t({axisLabelColor:g,gridColor:_,yMin:x,yMax:b,yStep:c,stacked:!0})},plugins:e.c(f,[i.t(a),...C.plugins])}},p=[`24.02`,`28.02`,`04.03`,`08.03`,`12.03`,`16.03`,`20.03`,`24.03`,`28.03`,`01.04`,`05.04`,`09.04`,`13.04`,`17.04`],m=[18,22,26,30,34,38,42,44,46,48,49,50,51,52],h=[6,6,7,7,7,7,7,7,7,7,7,7,7,7],g=[10,11,12,12,11,10,10,10,10,10,10,10,10,10],_=[32,30,28,26,28,30,29,28,27,26,26,27,28,28],v=[`Готово`,`На ревью`,`В процессе`,`Бэклог`],y=[{label:v[0]??`Series 1`,points:n.t(p,m)},{label:v[1]??`Series 2`,points:n.t(p,h)},{label:v[2]??`Series 3`,points:n.t(p,g)},{label:v[3]??`Series 4`,points:n.t(p,_)}],b={class:`s-ui-chart-stacked-area__canvas-wrap`},x=(0,c.defineComponent)({__name:`SChartStackedArea`,props:{series:{default:()=>[]},loading:{type:Boolean,default:!1},yMax:{},yStep:{},totalLabel:{}},emits:[`seriesClick`],setup(t,{expose:r,emit:i}){let a=i,u=(0,c.useTemplateRef)(`chartRootRef`),d=(0,c.useTemplateRef)(`chartCanvasRef`),p=(0,c.computed)(()=>t.loading?y:t.series),m=e=>{let n=t.series[e];n&&a(`seriesClick`,e,n)},h=s.t(`onSeriesClick`),g=(0,c.computed)(()=>!t.loading&&t.series.length===0?null:f({seriesList:p.value,colorHostElement:u.value,yMax:t.loading?160:t.yMax,yMin:t.loading?0:void 0,yStep:t.loading?20:t.yStep,skeleton:t.loading,totalLabel:t.totalLabel,onSeriesClick:h()?m:void 0})),_=(0,c.computed)(()=>n.n(p.value,(e,n)=>l(e,u.value,n,t.loading))),{chartInstance:v}=e.i({canvasRef:d,config:g,enabled:(0,c.computed)(()=>t.loading||t.series.length>0)}),{exportImage:x,handleLegendItemHover:S}=e.r({chartInstance:v,canvasRef:d,colorHostElement:u});return r({exportImage:x}),(n,r)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:u,class:(0,c.normalizeClass)([`s-ui-chart-stacked-area`,{"s-ui-chart-stacked-area--skeleton":t.loading}])},[(0,c.createElementVNode)(`div`,b,[(0,c.createVNode)((0,c.unref)(e.t),{loading:t.loading},{default:(0,c.withCtx)(()=>[(0,c.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:d,class:`s-ui-chart-stacked-area__canvas`},null,512)]),_:1},8,[`loading`])]),_.value.length?((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(o.t),{key:0,items:_.value,disabled:t.loading,interactive:!t.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 x}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./SChartSkeletonHost-BlIYGj-7.cjs"),t=require("./buildCartesianChartScales-Dck5yBMo.cjs"),n=require("./buildChartSeriesPoints-Bv3nXvSu.cjs"),r=require("./resolveStackedChartContext-Bp75eU_I.cjs"),i=require("./resolveSeriesPaletteColor-YACKW1NO.cjs"),a=require("./SChartLegend-DGtjd6zV.cjs"),o=require("./useHasListener-BPgtbbo6.cjs");let s=require("vue");var c=(t,n,r,a=!1)=>i.t(t,n,r,a,{palette:e._,paletteFallback:e.v.barStackedPalette1,skeletonPalette:e.g,skeletonFallback:e.v.barSkeletonPalette1}),l=3,u=4,d=(e,t,n,r,i,a)=>{let o=Math.min(a,r/2,i),s=o;e.beginPath(),e.moveTo(t,n+i),e.lineTo(t,n+o),e.arcTo(t,n,t+o,n,o),e.lineTo(t+r-s,n),e.arcTo(t+r,n,t+r,n+s,s),e.lineTo(t+r,n+i),e.closePath(),e.stroke()},f=t=>({id:`stackedBarHoverOutline`,afterDatasetsDraw(n){let r=n.tooltip?.getActiveElements()??[];if(r.length===0)return;let i=1/0,a=1/0,o=-1/0,s=-1/0;for(let e of r){let{x:t,y:n,width:r,base:c}=e.element.getProps([`x`,`y`,`width`,`base`]),l=t-r/2,u=t+r/2,d=n,f=c;i=Math.min(i,l),o=Math.max(o,u),a=Math.min(a,d),s=Math.max(s,f)}let c=e.w(e.v.barHoverOutline,t),{ctx:f,chartArea:p}=n,m=l/2,h=p?.bottom??s,g=Math.min(s,h),_=i+m,v=a+m,y=o-i-l,b=g-a-l;if(y<=0||b<=0)return;let x=Math.max(0,u-m);f.save(),f.strokeStyle=c,f.lineWidth=l,d(f,_,v,y,b,x),f.restore()}}),p=5,m=`stack0`,h=36,g=4,_=12,v=({seriesList:n,colorHostElement:i,yMax:a,yMin:o,yStep:s=p,skeleton:l=!1,onSeriesClick:u})=>{let d=r.t({seriesList:n,colorHostElement:i,yMax:a,yMin:o,yStep:s,skeleton:l});if(!d)return null;let{axisLabelColor:v,gridColor:y,tooltipBackgroundColor:b,tooltipTextColor:x,resolvedYMax:S,resolvedYMin:C,chartLabels:w,pointCaptions:T,topSeriesIndex:E}=d,D=e.a({kind:`series`,skeleton:l,colorHostElement:i,onIndexClick:u});return{type:`bar`,data:{labels:w,datasets:n.map((e,t)=>{let n=c(t,i,e.fillColor,l);return{label:e.label,data:e.points.map(e=>e.value),backgroundColor:n,hoverBackgroundColor:n,borderWidth:0,hoverBorderWidth:0,stack:m,barThickness:h,borderRadius:t===E?{topLeft:g,topRight:g}:0,...t===0?{captions:T}:{}}})},options:{responsive:!0,maintainAspectRatio:!1,onHover:D.onHover,onClick:D.onClick,hover:l?void 0:{mode:`nearest`,intersect:!0},interaction:e.o(l,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:e.s(l),backgroundColor:b,titleColor:x,bodyColor:x,displayColors:!1,position:e.m,yAlign:`bottom`,xAlign:`center`,caretPadding:8,callbacks:e.h()}},scales:t.t({axisLabelColor:v,gridColor:y,yMin:C,yMax:S,yStep:s,stacked:!0,xTickFontSize:_})},plugins:e.c(l,[f(i),...D.plugins])}},y=[`5 неделя`,`6 неделя`,`7 неделя`,`8 неделя`,`9 неделя`,`10 неделя`,`11 неделя`,`12 неделя`,`13 неделя`,`14 неделя`,`15 неделя`,`16 неделя`],b=[12,14,15,16,18,17,16,15,14,13,12,11],x=[6,7,8,8,9,8,7,7,6,6,5,5],S=[4,5,5,6,6,5,5,4,4,3,3,3],C=[`Series 1`,`Series 2`,`Series 3`],w=[{label:C[0]??`Series 1`,points:n.t(y,b)},{label:C[1]??`Series 2`,points:n.t(y,x)},{label:C[2]??`Series 3`,points:n.t(y,S)}],T={class:`s-ui-chart-stacked-bar__canvas-wrap`},E=(0,s.defineComponent)({__name:`SChartStackedBar`,props:{series:{default:()=>[]},loading:{type:Boolean,default:!1},yMax:{},yStep:{}},emits:[`seriesClick`],setup(t,{expose:r,emit:i}){let l=i,u=(0,s.useTemplateRef)(`chartRootRef`),d=(0,s.useTemplateRef)(`chartCanvasRef`),f=(0,s.computed)(()=>t.loading?w:t.series),p=e=>{let n=t.series[e];n&&l(`seriesClick`,e,n)},m=o.t(`onSeriesClick`),h=(0,s.computed)(()=>!t.loading&&t.series.length===0?null:v({seriesList:f.value,colorHostElement:u.value,yMax:t.loading?50:t.yMax,yMin:t.loading?0:void 0,yStep:t.loading?5:t.yStep,skeleton:t.loading,onSeriesClick:m()?p:void 0})),g=(0,s.computed)(()=>n.n(f.value,(e,n)=>c(e,u.value,n,t.loading))),{chartInstance:_}=e.i({canvasRef:d,config:h,enabled:(0,s.computed)(()=>t.loading||t.series.length>0)}),{exportImage:y,handleLegendItemHover:b}=e.r({chartInstance:_,canvasRef:d,colorHostElement:u});return r({exportImage:y}),(n,r)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:u,class:(0,s.normalizeClass)([`s-ui-chart-stacked-bar`,{"s-ui-chart-stacked-bar--skeleton":t.loading}])},[(0,s.createElementVNode)(`div`,T,[(0,s.createVNode)((0,s.unref)(e.t),{loading:t.loading},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:d,class:`s-ui-chart-stacked-bar__canvas`},null,512)]),_:1},8,[`loading`])]),g.value.length?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),{key:0,items:g.value,disabled:t.loading,interactive:!t.loading,onItemHover:(0,s.unref)(b)},null,8,[`items`,`disabled`,`interactive`,`onItemHover`])):(0,s.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return E}});
|