@shtabapp/ui-kit 1.62.0 → 1.64.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 +19 -0
- package/dist/SChartBar-BVgwPlYi.js +215 -0
- package/dist/SChartBar-CBU1uCuL.cjs +1 -0
- package/dist/SChartBurnup-Ch3UMa9w.cjs +1 -0
- package/dist/{SChartBurnup-Dxi0MBwo.js → SChartBurnup-DyJHdRlf.js} +75 -75
- package/dist/SChartHorizontalBar-Bv90SV6E.cjs +1 -0
- package/dist/{SChartHorizontalBar-XNasKzaO.js → SChartHorizontalBar-DDo6TfE8.js} +28 -28
- package/dist/{SChartLine-DSQaezYq.js → SChartLine-Cs1JzPEK.js} +29 -29
- package/dist/SChartLine-nIGaef_o.cjs +1 -0
- package/dist/SChartMultiLine-BzoW4ETf.cjs +1 -0
- package/dist/SChartMultiLine-DqCQ7FCv.js +204 -0
- package/dist/{SChartPie-bN8rY-y5.js → SChartPie-Bt3o7LZI.js} +55 -55
- package/dist/SChartPie-Bv5Obcwb.cjs +1 -0
- package/dist/{SChartProgress-BtwqE4xL.js → SChartProgress-uMg4DBpS.js} +30 -30
- package/dist/SChartProgress-xxqrj03o.cjs +1 -0
- package/dist/SChartStackedArea-BNe6FAg8.cjs +1 -0
- package/dist/{SChartStackedArea-BxUex_Di.js → SChartStackedArea-BQGnKp1i.js} +58 -58
- package/dist/SChartStackedBar-D1G-VloG.cjs +1 -0
- package/dist/SChartStackedBar-fiUU9lNp.js +245 -0
- package/dist/SColorPicker-BRSi0Xhm.cjs +1 -0
- package/dist/{SColorPicker-BL-zrskU.js → SColorPicker-Djr-R81h.js} +2 -1
- package/dist/SDropdownMenu-2koPU6IG.js +38 -0
- package/dist/SDropdownMenu-k9SxaFVH.cjs +1 -0
- package/dist/SList-D0PDc8VN.cjs +1 -0
- package/dist/SList-D2K9dNsj.js +465 -0
- package/dist/{SSegmentControl-CAoM03V6.js → SSegmentControl-B9KkAQiG.js} +11 -9
- package/dist/SSegmentControl-OXTka86u.cjs +1 -0
- package/dist/SSelect-CRlkCLik.cjs +1 -0
- package/dist/SSelect-D6taevzT.js +650 -0
- package/dist/STable-NbCfen0n.cjs +1 -0
- package/dist/STable-aS1eGuVB.js +3445 -0
- package/dist/areChartSeriesAligned-DiBX3TTk.cjs +1 -0
- package/dist/{buildChartSeriesPoints-D8Xpfwp7.js → areChartSeriesAligned-DjonrIMm.js} +2 -8
- package/dist/buildChartSeriesPoints-BTyOpkin.js +10 -0
- package/dist/buildChartSeriesPoints-Cqo2ed-n.cjs +1 -0
- package/dist/components/SChartBar/SChartBar.types.d.ts +47 -0
- package/dist/components/SChartBar/SChartBar.types.d.ts.map +1 -0
- package/dist/components/SChartBar/SChartBar.vue.d.ts +11 -0
- package/dist/components/SChartBar/SChartBar.vue.d.ts.map +1 -0
- package/dist/components/SChartBar/index.d.ts +3 -0
- package/dist/components/SChartBar/index.d.ts.map +1 -0
- package/dist/components/SChartBar/utils/buildBarChartConfig.d.ts +16 -0
- package/dist/components/SChartBar/utils/buildBarChartConfig.d.ts.map +1 -0
- package/dist/components/SChartBar/utils/createBarTargetLinePlugin.d.ts +9 -0
- package/dist/components/SChartBar/utils/createBarTargetLinePlugin.d.ts.map +1 -0
- package/dist/components/SChartBar/utils/demoBarSeries.d.ts +9 -0
- package/dist/components/SChartBar/utils/demoBarSeries.d.ts.map +1 -0
- package/dist/components/SChartBar/utils/skeletonBarSeries.d.ts +5 -0
- package/dist/components/SChartBar/utils/skeletonBarSeries.d.ts.map +1 -0
- package/dist/components/SChartMultiLine/SChartMultiLine.types.d.ts +2 -0
- 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/utils/buildMultiLineChartConfig.d.ts +2 -1
- package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts.map +1 -1
- package/dist/components/SList/SList.vue.d.ts.map +1 -1
- package/dist/components/SList/utils/resolveListItemFields.d.ts +1 -1
- package/dist/components/SList/utils/resolveListItemFields.d.ts.map +1 -1
- package/dist/components/SSegmentControl/SSegmentControl.types.d.ts +2 -0
- package/dist/components/SSegmentControl/SSegmentControl.types.d.ts.map +1 -1
- package/dist/components/SSegmentControl/SSegmentControlItem.vue.d.ts.map +1 -1
- package/dist/components/STable/STable.types.d.ts +317 -0
- package/dist/components/STable/STable.types.d.ts.map +1 -0
- package/dist/components/STable/STable.vue.d.ts +154 -0
- package/dist/components/STable/STable.vue.d.ts.map +1 -0
- package/dist/components/STable/constants/tableSizes.d.ts +76 -0
- package/dist/components/STable/constants/tableSizes.d.ts.map +1 -0
- package/dist/components/STable/index.d.ts +4 -0
- package/dist/components/STable/index.d.ts.map +1 -0
- package/dist/components/STable/parts/STableCellText.vue.d.ts +23 -0
- package/dist/components/STable/parts/STableCellText.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableCheckbox.vue.d.ts +17 -0
- package/dist/components/STable/parts/STableCheckbox.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableContentRow.vue.d.ts +41 -0
- package/dist/components/STable/parts/STableContentRow.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableGroupRow.vue.d.ts +55 -0
- package/dist/components/STable/parts/STableGroupRow.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableHeaderCell.vue.d.ts +36 -0
- package/dist/components/STable/parts/STableHeaderCell.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableHint.vue.d.ts +7 -0
- package/dist/components/STable/parts/STableHint.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STablePlaceholderRow.vue.d.ts +25 -0
- package/dist/components/STable/parts/STablePlaceholderRow.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableRow.vue.d.ts +67 -0
- package/dist/components/STable/parts/STableRow.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableSkeletonRow.vue.d.ts +27 -0
- package/dist/components/STable/parts/STableSkeletonRow.vue.d.ts.map +1 -0
- package/dist/components/STable/utils/tableDndShared.d.ts +17 -0
- package/dist/components/STable/utils/tableDndShared.d.ts.map +1 -0
- package/dist/components/STable/utils/useFlatTableRows.d.ts +62 -0
- package/dist/components/STable/utils/useFlatTableRows.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableCellPlans.d.ts +48 -0
- package/dist/components/STable/utils/useTableCellPlans.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableColumnDnd.d.ts +28 -0
- package/dist/components/STable/utils/useTableColumnDnd.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableColumnResize.d.ts +24 -0
- package/dist/components/STable/utils/useTableColumnResize.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableColumns.d.ts +86 -0
- package/dist/components/STable/utils/useTableColumns.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableGridFocus.d.ts +79 -0
- package/dist/components/STable/utils/useTableGridFocus.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableGridKeyboard.d.ts +36 -0
- package/dist/components/STable/utils/useTableGridKeyboard.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableRenderEntries.d.ts +56 -0
- package/dist/components/STable/utils/useTableRenderEntries.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableRowDnd.d.ts +37 -0
- package/dist/components/STable/utils/useTableRowDnd.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableRowHydration.d.ts +29 -0
- package/dist/components/STable/utils/useTableRowHydration.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableScrollScale.d.ts +34 -0
- package/dist/components/STable/utils/useTableScrollScale.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableSelection.d.ts +27 -0
- package/dist/components/STable/utils/useTableSelection.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableServiceRows.d.ts +57 -0
- package/dist/components/STable/utils/useTableServiceRows.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableSorting.d.ts +21 -0
- package/dist/components/STable/utils/useTableSorting.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableStickyRows.d.ts +38 -0
- package/dist/components/STable/utils/useTableStickyRows.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableStyleVars.d.ts +22 -0
- package/dist/components/STable/utils/useTableStyleVars.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableVirtualRows.d.ts +56 -0
- package/dist/components/STable/utils/useTableVirtualRows.d.ts.map +1 -0
- package/dist/composables/treeKeyboardNavigation.d.ts +26 -0
- package/dist/composables/treeKeyboardNavigation.d.ts.map +1 -0
- package/dist/composables/useFlatTreeList.d.ts +1 -0
- package/dist/composables/useFlatTreeList.d.ts.map +1 -1
- package/dist/{createChartCrosshairPlugin-DwFOncWI.js → createChartCrosshairPlugin-DU5grSok.js} +2 -2
- package/dist/createChartCrosshairPlugin-DfYzBie2.cjs +1 -0
- package/dist/entries/chart-bar.cjs +1 -0
- package/dist/entries/chart-bar.d.ts +3 -0
- package/dist/entries/chart-bar.d.ts.map +1 -0
- package/dist/entries/chart-bar.js +2 -0
- 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/segment-control.cjs +1 -1
- package/dist/entries/segment-control.js +1 -1
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/entries/table.cjs +1 -0
- package/dist/entries/table.d.ts +3 -0
- package/dist/entries/table.d.ts.map +1 -0
- package/dist/entries/table.js +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +133 -129
- package/dist/resolveBarStackedSeriesColor-HDSkh6Mw.cjs +1 -0
- package/dist/resolveBarStackedSeriesColor-LpVh1SvQ.js +11 -0
- package/dist/resolveSeriesPaletteColor-B5qoBbXN.cjs +1 -0
- package/dist/{resolveSeriesPaletteColor-BdvGT-PI.js → resolveSeriesPaletteColor-DcLSyk-D.js} +1 -1
- package/dist/{resolveStackedChartContext-DFre3tt0.js → resolveStackedChartContext-CIKVXkDn.js} +6 -6
- package/dist/resolveStackedChartContext-CQbgdV55.cjs +1 -0
- package/dist/treeKeyboardNavigation-BOz2SVus.cjs +1 -0
- package/dist/treeKeyboardNavigation-SmxTdnDz.js +131 -0
- package/dist/uikit-components.css +1 -1
- package/dist/{SChartSkeletonHost-BT96eWSF.js → useChartInteractivity-BATdT86l.js} +126 -126
- package/dist/useChartInteractivity-CXSdHPOw.cjs +1 -0
- package/package.json +19 -3
- package/dist/SChartBurnup-C4x5kik6.cjs +0 -1
- package/dist/SChartHorizontalBar-4H-lgfO4.cjs +0 -1
- package/dist/SChartLine-BF6Klm4j.cjs +0 -1
- package/dist/SChartMultiLine-CrMmphFe.js +0 -198
- package/dist/SChartMultiLine-Ddvfmf__.cjs +0 -1
- package/dist/SChartPie-namQTFla.cjs +0 -1
- package/dist/SChartProgress-DsFHotRv.cjs +0 -1
- package/dist/SChartSkeletonHost-Dt5EjQr5.cjs +0 -1
- package/dist/SChartStackedArea-BLHs3sSH.cjs +0 -1
- package/dist/SChartStackedBar-BJ9LOgSP.js +0 -250
- package/dist/SChartStackedBar-CWNyvUj9.cjs +0 -1
- package/dist/SColorPicker-CvhpJEj1.cjs +0 -1
- package/dist/SList-C39LrsoS.js +0 -590
- package/dist/SList-Du0gqyFs.cjs +0 -1
- package/dist/SSegmentControl-B9jT8Axu.cjs +0 -1
- package/dist/SSelect-BkX3VuCr.js +0 -682
- package/dist/SSelect-CHWKMbB_.cjs +0 -1
- package/dist/buildChartSeriesPoints-Bv3nXvSu.cjs +0 -1
- package/dist/components/SList/utils/treeKeyboardNavigation.d.ts +0 -16
- package/dist/components/SList/utils/treeKeyboardNavigation.d.ts.map +0 -1
- package/dist/createChartCrosshairPlugin-ZZwKUQm8.cjs +0 -1
- package/dist/resolveSeriesPaletteColor-hI4YDdUg.cjs +0 -1
- package/dist/resolveStackedChartContext-Dsxhhhel.cjs +0 -1
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { S as e, a as t, c as n, f as r, i, o as a, p as o, r as s, s as c, t as l, v as u, w as d, y as f } from "./SChartSkeletonHost-BT96eWSF.js";
|
|
2
|
-
import { n as p, r as m, t as h } from "./buildChartSeriesPoints-D8Xpfwp7.js";
|
|
3
|
-
import { t as g } from "./createChartCrosshairPlugin-DwFOncWI.js";
|
|
4
|
-
import { t as _ } from "./resolveSeriesPaletteColor-BdvGT-PI.js";
|
|
5
|
-
import { t as v } from "./buildMultiLineChartScales-CFZ8YVeJ.js";
|
|
6
|
-
import { t as y } from "./SChartLegend-oZoF8XK7.js";
|
|
7
|
-
import { t as b } from "./useHasListener-RSjlUyqH.js";
|
|
8
|
-
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";
|
|
9
|
-
//#region src/utils/chart/multiLine/resolveMultiLineSeriesColor.ts
|
|
10
|
-
var N = (t, n, r, i = !1) => _(t, n, r, i, {
|
|
11
|
-
palette: f,
|
|
12
|
-
paletteFallback: u.multiLinePalette1,
|
|
13
|
-
skeletonPalette: e,
|
|
14
|
-
skeletonFallback: u.skeletonPalette1
|
|
15
|
-
}), P = (e, t, n) => {
|
|
16
|
-
if (t) return t;
|
|
17
|
-
let r = e.reduce((e, t) => {
|
|
18
|
-
let n = t.points.reduce((e, t) => Math.max(e, t.value), 0);
|
|
19
|
-
return Math.max(e, n);
|
|
20
|
-
}, 0), i = Math.ceil(r / n) * n;
|
|
21
|
-
return i > 0 ? i : n * 5;
|
|
22
|
-
}, F = 4, I = 5, L = ({ seriesList: e, colorHostElement: i, yMax: s, yMin: l, yStep: f = I, mirrorYAxis: p = !0, skeleton: h = !1, onSeriesClick: _ }) => {
|
|
23
|
-
if (!m(e)) return null;
|
|
24
|
-
let y = d(u.axisLabel, i), b = d(u.grid, i), x = d(u.tooltipBackground, i), S = d(u.tooltipText, i), C = h && s ? s : P(e, s, f), w = h && l !== void 0 ? l : 0, T = e[0]?.points.map((e) => e.label) ?? [], E = t({
|
|
25
|
-
kind: "series",
|
|
26
|
-
skeleton: h,
|
|
27
|
-
colorHostElement: i,
|
|
28
|
-
onIndexClick: _
|
|
29
|
-
});
|
|
30
|
-
return {
|
|
31
|
-
type: "line",
|
|
32
|
-
data: {
|
|
33
|
-
labels: T,
|
|
34
|
-
datasets: e.map((e, t) => {
|
|
35
|
-
let n = N(t, i, e.fillColor, h);
|
|
36
|
-
return {
|
|
37
|
-
label: e.label,
|
|
38
|
-
data: e.points.map((e) => e.value),
|
|
39
|
-
borderColor: n,
|
|
40
|
-
backgroundColor: n,
|
|
41
|
-
...h ? {} : {
|
|
42
|
-
hoverBorderColor: n,
|
|
43
|
-
hoverBackgroundColor: n
|
|
44
|
-
},
|
|
45
|
-
borderWidth: F,
|
|
46
|
-
fill: !1,
|
|
47
|
-
pointRadius: 0,
|
|
48
|
-
pointHoverRadius: 4,
|
|
49
|
-
tension: .4
|
|
50
|
-
};
|
|
51
|
-
})
|
|
52
|
-
},
|
|
53
|
-
options: {
|
|
54
|
-
responsive: !0,
|
|
55
|
-
maintainAspectRatio: !1,
|
|
56
|
-
onHover: E.onHover,
|
|
57
|
-
onClick: E.onClick,
|
|
58
|
-
interaction: a(h, {
|
|
59
|
-
mode: "index",
|
|
60
|
-
intersect: !1
|
|
61
|
-
}),
|
|
62
|
-
hover: h ? void 0 : {
|
|
63
|
-
mode: "nearest",
|
|
64
|
-
intersect: !1
|
|
65
|
-
},
|
|
66
|
-
plugins: {
|
|
67
|
-
legend: { display: !1 },
|
|
68
|
-
tooltip: {
|
|
69
|
-
enabled: c(h),
|
|
70
|
-
backgroundColor: x,
|
|
71
|
-
titleColor: S,
|
|
72
|
-
bodyColor: S,
|
|
73
|
-
footerColor: S,
|
|
74
|
-
displayColors: !1,
|
|
75
|
-
position: r,
|
|
76
|
-
yAlign: "bottom",
|
|
77
|
-
xAlign: "center",
|
|
78
|
-
caretPadding: 8,
|
|
79
|
-
callbacks: o()
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
scales: v({
|
|
83
|
-
axisLabelColor: y,
|
|
84
|
-
gridColor: b,
|
|
85
|
-
yMin: w,
|
|
86
|
-
yMax: C,
|
|
87
|
-
yStep: f,
|
|
88
|
-
mirrorYAxis: p
|
|
89
|
-
})
|
|
90
|
-
},
|
|
91
|
-
plugins: n(h, [g(i), ...E.plugins])
|
|
92
|
-
};
|
|
93
|
-
}, R = [
|
|
94
|
-
"26.01",
|
|
95
|
-
"2.02",
|
|
96
|
-
"9.02",
|
|
97
|
-
"16.02",
|
|
98
|
-
"23.02",
|
|
99
|
-
"2.03",
|
|
100
|
-
"9.03",
|
|
101
|
-
"16.03",
|
|
102
|
-
"23.03",
|
|
103
|
-
"30.03",
|
|
104
|
-
"6.04"
|
|
105
|
-
], z = [{
|
|
106
|
-
label: "Series 1",
|
|
107
|
-
points: h(R, [
|
|
108
|
-
30,
|
|
109
|
-
34,
|
|
110
|
-
38,
|
|
111
|
-
44,
|
|
112
|
-
46,
|
|
113
|
-
50,
|
|
114
|
-
54,
|
|
115
|
-
56,
|
|
116
|
-
58,
|
|
117
|
-
60,
|
|
118
|
-
62
|
|
119
|
-
])
|
|
120
|
-
}, {
|
|
121
|
-
label: "Series 2",
|
|
122
|
-
points: h(R, [
|
|
123
|
-
22,
|
|
124
|
-
24,
|
|
125
|
-
26,
|
|
126
|
-
28,
|
|
127
|
-
30,
|
|
128
|
-
32,
|
|
129
|
-
33,
|
|
130
|
-
35,
|
|
131
|
-
36,
|
|
132
|
-
38,
|
|
133
|
-
40
|
|
134
|
-
])
|
|
135
|
-
}], B = { class: "s-ui-chart-multi-line__canvas-wrap" }, V = /* @__PURE__ */ D({
|
|
136
|
-
__name: "SChartMultiLine",
|
|
137
|
-
props: {
|
|
138
|
-
series: { default: () => [] },
|
|
139
|
-
loading: {
|
|
140
|
-
type: Boolean,
|
|
141
|
-
default: !1
|
|
142
|
-
},
|
|
143
|
-
yMax: {},
|
|
144
|
-
yStep: {},
|
|
145
|
-
mirrorYAxis: {
|
|
146
|
-
type: Boolean,
|
|
147
|
-
default: !0
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
emits: ["seriesClick"],
|
|
151
|
-
setup(e, { expose: t, emit: n }) {
|
|
152
|
-
let r = n, a = j("chartRootRef"), o = j("chartCanvasRef"), c = x(() => e.loading ? z : e.series), u = (t) => {
|
|
153
|
-
let n = e.series[t];
|
|
154
|
-
n && r("seriesClick", t, n);
|
|
155
|
-
}, d = b("onSeriesClick"), f = x(() => !e.loading && e.series.length === 0 ? null : L({
|
|
156
|
-
seriesList: c.value,
|
|
157
|
-
colorHostElement: a.value,
|
|
158
|
-
yMax: e.yMax,
|
|
159
|
-
yStep: e.yStep,
|
|
160
|
-
mirrorYAxis: e.mirrorYAxis,
|
|
161
|
-
skeleton: e.loading,
|
|
162
|
-
onSeriesClick: d() ? u : void 0
|
|
163
|
-
})), m = x(() => p(c.value, (t, n) => N(t, a.value, n, e.loading))), { chartInstance: h } = i({
|
|
164
|
-
canvasRef: o,
|
|
165
|
-
config: f,
|
|
166
|
-
enabled: x(() => e.loading || e.series.length > 0)
|
|
167
|
-
}), { exportImage: g, handleLegendItemHover: _ } = s({
|
|
168
|
-
chartInstance: h,
|
|
169
|
-
canvasRef: o,
|
|
170
|
-
colorHostElement: a
|
|
171
|
-
});
|
|
172
|
-
return t({ exportImage: g }), (t, n) => (k(), w("div", {
|
|
173
|
-
ref_key: "chartRootRef",
|
|
174
|
-
ref: a,
|
|
175
|
-
class: O(["s-ui-chart-multi-line", { "s-ui-chart-multi-line--skeleton": e.loading }])
|
|
176
|
-
}, [T("div", B, [E(A(l), { loading: e.loading }, {
|
|
177
|
-
default: M(() => [T("canvas", {
|
|
178
|
-
ref_key: "chartCanvasRef",
|
|
179
|
-
ref: o,
|
|
180
|
-
class: "s-ui-chart-multi-line__canvas"
|
|
181
|
-
}, null, 512)]),
|
|
182
|
-
_: 1
|
|
183
|
-
}, 8, ["loading"])]), m.value.length ? (k(), S(A(y), {
|
|
184
|
-
key: 0,
|
|
185
|
-
items: m.value,
|
|
186
|
-
disabled: e.loading,
|
|
187
|
-
interactive: !e.loading,
|
|
188
|
-
onItemHover: A(_)
|
|
189
|
-
}, null, 8, [
|
|
190
|
-
"items",
|
|
191
|
-
"disabled",
|
|
192
|
-
"interactive",
|
|
193
|
-
"onItemHover"
|
|
194
|
-
])) : C("", !0)], 2));
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
//#endregion
|
|
198
|
-
export { V as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SChartSkeletonHost-Dt5EjQr5.cjs"),t=require("./buildChartSeriesPoints-Bv3nXvSu.cjs"),n=require("./createChartCrosshairPlugin-ZZwKUQm8.cjs"),r=require("./resolveSeriesPaletteColor-hI4YDdUg.cjs"),i=require("./buildMultiLineChartScales-7mcIfRVG.cjs"),a=require("./SChartLegend-DGtjd6zV.cjs"),o=require("./useHasListener-BPgtbbo6.cjs");let s=require("vue");var c=(t,n,i,a=!1)=>r.t(t,n,i,a,{palette:e.y,paletteFallback:e.v.multiLinePalette1,skeletonPalette:e.S,skeletonFallback:e.v.skeletonPalette1}),l=(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},u=4,d=5,f=({seriesList:r,colorHostElement:a,yMax:o,yMin:s,yStep:f=d,mirrorYAxis:p=!0,skeleton:m=!1,onSeriesClick:h})=>{if(!t.r(r))return null;let g=e.w(e.v.axisLabel,a),_=e.w(e.v.grid,a),v=e.w(e.v.tooltipBackground,a),y=e.w(e.v.tooltipText,a),b=m&&o?o:l(r,o,f),x=m&&s!==void 0?s:0,S=r[0]?.points.map(e=>e.label)??[],C=e.a({kind:`series`,skeleton:m,colorHostElement:a,onIndexClick:h});return{type:`line`,data:{labels:S,datasets:r.map((e,t)=>{let n=c(t,a,e.fillColor,m);return{label:e.label,data:e.points.map(e=>e.value),borderColor:n,backgroundColor:n,...m?{}:{hoverBorderColor:n,hoverBackgroundColor:n},borderWidth:u,fill:!1,pointRadius:0,pointHoverRadius:4,tension:.4}})},options:{responsive:!0,maintainAspectRatio:!1,onHover:C.onHover,onClick:C.onClick,interaction:e.o(m,{mode:`index`,intersect:!1}),hover:m?void 0:{mode:`nearest`,intersect:!1},plugins:{legend:{display:!1},tooltip:{enabled:e.s(m),backgroundColor:v,titleColor:y,bodyColor:y,footerColor:y,displayColors:!1,position:e.f,yAlign:`bottom`,xAlign:`center`,caretPadding:8,callbacks:e.p()}},scales:i.t({axisLabelColor:g,gridColor:_,yMin:x,yMax:b,yStep:f,mirrorYAxis:p})},plugins:e.c(m,[n.t(a),...C.plugins])}},p=[`26.01`,`2.02`,`9.02`,`16.02`,`23.02`,`2.03`,`9.03`,`16.03`,`23.03`,`30.03`,`6.04`],m=[{label:`Series 1`,points:t.t(p,[30,34,38,44,46,50,54,56,58,60,62])},{label:`Series 2`,points:t.t(p,[22,24,26,28,30,32,33,35,36,38,40])}],h={class:`s-ui-chart-multi-line__canvas-wrap`},g=(0,s.defineComponent)({__name:`SChartMultiLine`,props:{series:{default:()=>[]},loading:{type:Boolean,default:!1},yMax:{},yStep:{},mirrorYAxis:{type:Boolean,default:!0}},emits:[`seriesClick`],setup(n,{expose:r,emit:i}){let l=i,u=(0,s.useTemplateRef)(`chartRootRef`),d=(0,s.useTemplateRef)(`chartCanvasRef`),p=(0,s.computed)(()=>n.loading?m:n.series),g=e=>{let t=n.series[e];t&&l(`seriesClick`,e,t)},_=o.t(`onSeriesClick`),v=(0,s.computed)(()=>!n.loading&&n.series.length===0?null:f({seriesList:p.value,colorHostElement:u.value,yMax:n.yMax,yStep:n.yStep,mirrorYAxis:n.mirrorYAxis,skeleton:n.loading,onSeriesClick:_()?g:void 0})),y=(0,s.computed)(()=>t.n(p.value,(e,t)=>c(e,u.value,t,n.loading))),{chartInstance:b}=e.i({canvasRef:d,config:v,enabled:(0,s.computed)(()=>n.loading||n.series.length>0)}),{exportImage:x,handleLegendItemHover:S}=e.r({chartInstance:b,canvasRef:d,colorHostElement:u});return r({exportImage:x}),(t,r)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:u,class:(0,s.normalizeClass)([`s-ui-chart-multi-line`,{"s-ui-chart-multi-line--skeleton":n.loading}])},[(0,s.createElementVNode)(`div`,h,[(0,s.createVNode)((0,s.unref)(e.t),{loading:n.loading},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:d,class:`s-ui-chart-multi-line__canvas`},null,512)]),_:1},8,[`loading`])]),y.value.length?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),{key:0,items:y.value,disabled:n.loading,interactive:!n.loading,onItemHover:(0,s.unref)(S)},null,8,[`items`,`disabled`,`interactive`,`onItemHover`])):(0,s.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return g}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SChartSkeletonHost-Dt5EjQr5.cjs"),t=require("./resolveSeriesPaletteColor-hI4YDdUg.cjs"),n=require("./SChartLegend-DGtjd6zV.cjs"),r=require("./useHasListener-BPgtbbo6.cjs");let i=require("vue");var a=(n,r,i,a=!1)=>t.t(n,r,i,a,{palette:e.x,paletteFallback:e.v.piePalette1,skeletonPalette:e.b,skeletonFallback:e.v.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=t=>({id:`pieSegmentBadge`,afterDatasetsDraw(n){let r=n.getDatasetMeta(0);if(!r)return;let i=e.w(e.v.pieBadgeBackground,t),a=e.w(e.v.pieBadgeBorder,t),o=e.w(e.v.pieBadgeText,t),{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:t,colorHostElement:n,skeleton:r=!1,onSliceClick:i})=>{if(t.length===0)return null;let s=e.w(e.v.pieSegmentBorder,n),c=e.w(e.v.tooltipBackground,n),l=e.w(e.v.tooltipText,n),u=t.map((e,t)=>a(t,n,e.fillColor,r)),d=e.a({kind:`element`,skeleton:r,colorHostElement:n,onIndexClick:i});return{type:`pie`,data:{labels:t.map(e=>e.label),datasets:[{data:t.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:e.o(r,{mode:`nearest`,intersect:!0}),plugins:{legend:{display:!1},tooltip:{enabled:e.s(r),backgroundColor:c,titleColor:l,bodyColor:l,displayColors:!1,callbacks:o()}}},plugins:e.c(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(t,{expose:o,emit:s}){let c=s,l=e.n,u=(0,i.useTemplateRef)(`chartRootRef`),d=(0,i.useTemplateRef)(`chartCanvasRef`),f=(0,i.computed)(()=>t.loading?_:t.slices),p=e=>{let n=t.slices[e];n&&c(`sliceClick`,e,n)},h=r.t(`onSliceClick`),g=(0,i.computed)(()=>!t.loading&&t.slices.length===0?null:m({sliceList:f.value,colorHostElement:u.value,skeleton:t.loading,onSliceClick:h()?p:void 0})),y=(0,i.computed)(()=>f.value.map((e,n)=>({label:e.label,color:a(n,u.value,e.fillColor,t.loading)}))),{chartInstance:b}=e.i({canvasRef:d,config:g,enabled:(0,i.computed)(()=>t.loading||t.slices.length>0)}),{exportImage:x,handleLegendItemHover:S}=e.r({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":t.loading}])},[(0,i.createElementVNode)(`div`,v,[(0,i.createVNode)((0,i.unref)(e.t),{loading:t.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)(n.t),{key:0,items:y.value,disabled:t.loading,interactive:!t.loading,direction:`column`,onItemHover:(0,i.unref)(S)},null,8,[`items`,`disabled`,`interactive`,`onItemHover`])):(0,i.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return y}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SChartSkeletonHost-Dt5EjQr5.cjs");let t=require("vue");var n=4,r=12,i=24,a=e=>{let t=e<=15;return{pointRadius:t?n:0,pointHoverRadius:n,pointHitRadius:t?r:i}},o=e=>e<=15?{mode:`nearest`,intersect:!0}:{mode:`nearest`,axis:`x`,intersect:!1},s=.3,c=1,l=({labels:t,progressValues:n,referenceValues:r,seriesLabel:i,valuePrefix:l,minValue:u,maxValue:d,stepSize:f,progressSnapshotCount:p,colorHostElement:m,skeleton:h=!1})=>{let g=e.w(e.v.axisLabel,m),_=e.w(e.v.grid,m),v=e.w(h?e.v.skeletonSeries:e.v.progressLine,m),y=e.w(h?e.v.skeletonFillStart:e.v.referenceFill,m),b=e.w(e.v.tooltipBackground,m),x=e.w(e.v.tooltipText,m),S=s,C=a(p),w=o(p);return{type:`line`,data:{labels:t,datasets:[{data:r,borderColor:`transparent`,backgroundColor:y,pointRadius:0,pointHoverRadius:0,pointHitRadius:0,fill:`start`,order:0},{label:i,data:n,borderColor:v,backgroundColor:v,tension:S,pointRadius:C.pointRadius,pointHoverRadius:C.pointHoverRadius,pointHitRadius:C.pointHitRadius,pointBackgroundColor:v,pointBorderColor:v,fill:!1,order:1}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:e.o(h,w),plugins:{legend:{display:!1},tooltip:{enabled:e.s(h),backgroundColor:b,titleColor:x,bodyColor:x,position:e.d,filter:e=>e.datasetIndex===c,callbacks:{label:e=>{let t=e.parsed.y;return t===null?``:`${t}${l}`}}}},scales:{x:{type:`category`,border:{display:!1},grid:{color:_,drawTicks:!0},ticks:{color:g,font:{family:`var(--s-ui-font-family-label)`,size:10,weight:500},padding:8}},y:{type:`linear`,min:u,max:d,border:{display:!1},grid:{color:_,drawTicks:!0},ticks:{color:g,stepSize:f,callback:e=>`${e}${l}`,font:{family:`var(--s-ui-font-family-label)`,size:10,weight:500},padding:8}}}}}},u=e=>{let t=e.match(/^(\d{4})-(\d{2})-(\d{2})/);return t?`${t[3]}.${t[2]}.${t[1]}`:e},d=e=>Math.round(e*10)/10,f=({progressSnapshots:e,deadline:t=null,minValue:n=0,maxValue:r=100})=>{let i=e.map(e=>u(e.date)),a=e.map(e=>e.progress),o=t?u(t):null,s=a.length===1?[``,i[0]??``,``]:o?[...i,o]:i,c=a.length===1?[null,a[0]??null,null]:o?[...a,null]:a,l=s.length;return{labels:s,progressValues:c,referenceValues:l===0?[]:l===1?[n]:Array.from({length:l},(e,t)=>d(n+t*((r-n)/(l-1)))),minValue:n,maxValue:r,stepSize:d((r-n)/4),progressSnapshotCount:e.length}},p=[{date:`2025-11-01`,progress:20},{date:`2025-12-01`,progress:35},{date:`2026-01-01`,progress:42},{date:`2026-02-01`,progress:58},{date:`2026-03-01`,progress:71},{date:`2026-04-01`,progress:84}],m={class:`s-ui-chart-progress__canvas-wrap`},h=(0,t.defineComponent)({__name:`SChartProgress`,props:{progressSnapshots:{default:()=>[]},deadline:{default:null},minValue:{},maxValue:{},prefix:{},seriesLabel:{default:`Progress`},loading:{type:Boolean,default:!1}},setup(n,{expose:r}){let i=(0,t.useTemplateRef)(`chartRootRef`),a=(0,t.useTemplateRef)(`chartCanvasRef`),o=(0,t.computed)(()=>n.minValue??0),s=(0,t.computed)(()=>n.maxValue??100),c=(0,t.computed)(()=>n.prefix??`%`),u=(0,t.computed)(()=>n.loading?p:n.progressSnapshots),d=(0,t.computed)(()=>f({progressSnapshots:u.value,deadline:n.loading?`2026-06-28`:n.deadline,minValue:n.loading?0:o.value,maxValue:n.loading?100:s.value})),{chartInstance:h}=e.i({canvasRef:a,config:(0,t.computed)(()=>!n.loading&&n.progressSnapshots.length===0?null:l({labels:d.value.labels,progressValues:d.value.progressValues,referenceValues:d.value.referenceValues,seriesLabel:n.seriesLabel,valuePrefix:c.value,minValue:d.value.minValue,maxValue:d.value.maxValue,stepSize:n.loading?25:d.value.stepSize,progressSnapshotCount:d.value.progressSnapshotCount,colorHostElement:i.value,skeleton:n.loading})),enabled:(0,t.computed)(()=>n.loading||n.progressSnapshots.length>0)}),{exportImage:g}=e.r({chartInstance:h,canvasRef:a,colorHostElement:i});return r({exportImage:g}),(r,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:i,class:(0,t.normalizeClass)([`s-ui-chart-progress`,{"s-ui-chart-progress--skeleton":n.loading}])},[(0,t.createElementVNode)(`div`,m,[(0,t.createVNode)((0,t.unref)(e.t),{loading:n.loading},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:a,class:`s-ui-chart-progress__canvas`},null,512)]),_:1},8,[`loading`])])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=require("vue"),t=require("@shtabapp/ui-kit-primitives"),n=require("@vueuse/core"),r=require("chart.js");var i=(e,t)=>{if(typeof window>`u`)return``;let n=t??document.documentElement;return getComputedStyle(n).getPropertyValue(e).trim()},a={axisLabel:`--s-ui-chart-axis-label`,grid:`--s-ui-chart-grid`,crosshair:`--s-ui-chart-crosshair`,legendLabel:`--s-ui-chart-legend-label`,seriesPrimary:`--s-ui-chart-series-primary`,seriesFillStart:`--s-ui-chart-series-fill-start`,seriesFillEnd:`--s-ui-chart-series-fill-end`,seriesFillOpacity:`--s-ui-chart-series-fill-opacity`,skeletonSeries:`--s-ui-chart-skeleton-series`,skeletonPalette1:`--s-ui-chart-skeleton-palette-1`,skeletonPalette2:`--s-ui-chart-skeleton-palette-2`,skeletonPalette3:`--s-ui-chart-skeleton-palette-3`,skeletonPalette4:`--s-ui-chart-skeleton-palette-4`,skeletonPalette5:`--s-ui-chart-skeleton-palette-5`,skeletonPalette6:`--s-ui-chart-skeleton-palette-6`,skeletonFillStart:`--s-ui-chart-skeleton-fill-start`,skeletonFillEnd:`--s-ui-chart-skeleton-fill-end`,skeletonFillOpacity:`--s-ui-chart-skeleton-fill-opacity`,fillMuted:`--s-ui-chart-fill-muted`,exportBackground:`--s-ui-chart-export-background`,tooltipBackground:`--s-ui-chart-tooltip-background`,tooltipText:`--s-ui-chart-tooltip-text`,stackedPalette1:`--s-ui-chart-stacked-palette-1`,stackedPalette2:`--s-ui-chart-stacked-palette-2`,stackedPalette3:`--s-ui-chart-stacked-palette-3`,stackedPalette4:`--s-ui-chart-stacked-palette-4`,stackedPalette5:`--s-ui-chart-stacked-palette-5`,stackedPalette6:`--s-ui-chart-stacked-palette-6`,barStackedPalette1:`--s-ui-chart-bar-stacked-palette-1`,barStackedPalette2:`--s-ui-chart-bar-stacked-palette-2`,barStackedPalette3:`--s-ui-chart-bar-stacked-palette-3`,barStackedPalette4:`--s-ui-chart-bar-stacked-palette-4`,barStackedPalette5:`--s-ui-chart-bar-stacked-palette-5`,barStackedPalette6:`--s-ui-chart-bar-stacked-palette-6`,barHoverOutline:`--s-ui-chart-bar-hover-outline`,barSkeletonPalette1:`--s-ui-chart-bar-skeleton-palette-1`,barSkeletonPalette2:`--s-ui-chart-bar-skeleton-palette-2`,barSkeletonPalette3:`--s-ui-chart-bar-skeleton-palette-3`,barSkeletonPalette4:`--s-ui-chart-bar-skeleton-palette-4`,barSkeletonPalette5:`--s-ui-chart-bar-skeleton-palette-5`,barSkeletonPalette6:`--s-ui-chart-bar-skeleton-palette-6`,piePalette1:`--s-ui-chart-pie-palette-1`,piePalette2:`--s-ui-chart-pie-palette-2`,piePalette3:`--s-ui-chart-pie-palette-3`,piePalette4:`--s-ui-chart-pie-palette-4`,piePalette5:`--s-ui-chart-pie-palette-5`,piePalette6:`--s-ui-chart-pie-palette-6`,piePalette7:`--s-ui-chart-pie-palette-7`,piePalette8:`--s-ui-chart-pie-palette-8`,pieSegmentBorder:`--s-ui-chart-pie-segment-border`,pieBadgeBackground:`--s-ui-chart-pie-badge-background`,pieBadgeBorder:`--s-ui-chart-pie-badge-border`,pieBadgeText:`--s-ui-chart-pie-badge-text`,pieHoverShadow:`--s-ui-chart-pie-hover-shadow`,pieSkeletonPalette1:`--s-ui-chart-pie-skeleton-palette-1`,pieSkeletonPalette2:`--s-ui-chart-pie-skeleton-palette-2`,pieSkeletonPalette3:`--s-ui-chart-pie-skeleton-palette-3`,pieSkeletonPalette4:`--s-ui-chart-pie-skeleton-palette-4`,pieSkeletonPalette5:`--s-ui-chart-pie-skeleton-palette-5`,pieSkeletonPalette6:`--s-ui-chart-pie-skeleton-palette-6`,pieSkeletonPalette7:`--s-ui-chart-pie-skeleton-palette-7`,pieSkeletonPalette8:`--s-ui-chart-pie-skeleton-palette-8`,barHorizontalFillDefault:`--s-ui-chart-bar-horizontal-fill-default`,barHorizontalSkeletonFill:`--s-ui-chart-bar-horizontal-skeleton-fill`,barHorizontalCategoryLabel:`--s-ui-chart-bar-horizontal-category-label`,barHorizontalCategoryLabelSkeleton:`--s-ui-chart-bar-horizontal-category-label-skeleton`,progressLine:`--s-ui-chart-progress-line`,referenceFill:`--s-ui-chart-reference-fill`,multiLinePalette1:`--s-ui-chart-multi-line-palette-1`,multiLinePalette2:`--s-ui-chart-multi-line-palette-2`,multiLinePalette3:`--s-ui-chart-multi-line-palette-3`,burnupGoal:`--s-ui-chart-burnup-goal`,burnupPlan:`--s-ui-chart-burnup-plan`,burnupFact:`--s-ui-chart-burnup-fact`,burnupFactFillStart:`--s-ui-chart-burnup-fact-fill-start`,burnupFactFillEnd:`--s-ui-chart-burnup-fact-fill-end`,burnupToday:`--s-ui-chart-burnup-today`,burnupTagBackground:`--s-ui-chart-burnup-tag-background`},o=[a.stackedPalette1,a.stackedPalette2,a.stackedPalette3,a.stackedPalette4,a.stackedPalette5,a.stackedPalette6],s=[a.skeletonPalette1,a.skeletonPalette2,a.skeletonPalette3,a.skeletonPalette4,a.skeletonPalette5,a.skeletonPalette6],c=[a.barStackedPalette1,a.barStackedPalette2,a.barStackedPalette3,a.barStackedPalette4,a.barStackedPalette5,a.barStackedPalette6],l=[a.barSkeletonPalette1,a.barSkeletonPalette2,a.barSkeletonPalette3,a.barSkeletonPalette4,a.barSkeletonPalette5,a.barSkeletonPalette6],u=[a.piePalette1,a.piePalette2,a.piePalette3,a.piePalette4,a.piePalette5,a.piePalette6,a.piePalette7,a.piePalette8],d=[a.pieSkeletonPalette1,a.pieSkeletonPalette2,a.pieSkeletonPalette3,a.pieSkeletonPalette4,a.pieSkeletonPalette5,a.pieSkeletonPalette6,a.pieSkeletonPalette7,a.pieSkeletonPalette8],f=[a.multiLinePalette1,a.multiLinePalette2,a.multiLinePalette3],p=e=>`captions`in e,m=(e,t)=>{let n=e.data.datasets[0];if(!n||!p(n))return;let r=n.captions?.[t];if(r)return r},h=()=>({title:e=>{let t=e[0];if(!t)return``;let n=m(t.chart,t.dataIndex),r=[`${t.label}`];return n&&r.push(n),r},label:e=>`${e.dataset.label??``} – ${e.parsed.y??0}`}),ee=`stackedBarTop`,g=function(e,t){if(e.length===0)return{x:t.x,y:t.y};let n=1/0,r=1/0,i=-1/0;for(let t of e){let{x:e,y:a,width:o}=t.element.getProps([`x`,`y`,`width`]);n=Math.min(n,a),r=Math.min(r,e-o/2),i=Math.max(i,e+o/2)}return{x:(r+i)/2,y:n}},_=()=>({title:e=>{let t=e[0];return t?`${t.label}`:``},label:e=>`${e.dataset.label??``}: ${e.parsed.y??0}`}),v=`multiLineTop`,y=function(e,t){let n=this.chart.chartArea;return!n||e.length===0?{x:t.x,y:t.y}:{x:t.x,y:n.top}},b=`progressChartPoint`,x=1,S=(e,t)=>{let n=e.data.datasets[x]?.data[t];return typeof n==`number`?n:null},C=function(e){let t=e.find(e=>e.datasetIndex===x)??e[0];if(!t)return!1;let n=this.chart.scales.y;if(!n)return!1;let r=S(this.chart,t.index);return r===null?!1:{x:t.element.x,y:n.getPixelForValue(r),xAlign:`center`,yAlign:`bottom`}},w=({total:e}={})=>({title:e=>{let t=e[0];return t?`${t.label}`:``},label:e=>`${e.dataset.label??``} – ${e.parsed.y??0}`,footer:t=>{let n=t.reduce((e,t)=>e+(t.parsed.y??0),0);return e?`${e} – ${n}`:`${n}`}}),T=`stackedAreaTop`,E=function(e,t){let n=this.chart.chartArea;return!n||e.length===0?{x:t.x,y:t.y}:{x:t.x,y:n.top}},D=!1,O=!1,k=!1,A=!1,j=!1,M=()=>{O||=(r.Tooltip.positioners.stackedAreaTop=E,!0)},N=()=>{k||=(r.Tooltip.positioners.stackedBarTop=g,!0)},P=()=>{A||=(r.Tooltip.positioners.progressChartPoint=C,!0)},F=()=>{j||=(r.Tooltip.positioners.multiLineTop=y,!0)},te=()=>{D||=(r.Chart.register(r.LineController,r.LineElement,r.PointElement,r.BarController,r.BarElement,r.PieController,r.ArcElement,r.LinearScale,r.CategoryScale,r.Tooltip,r.Filler),M(),N(),P(),F(),!0)},I=(e,t)=>e?{mode:`nearest`,intersect:!1}:t,L=e=>!e,R=(e,t)=>e?[]:t,z=new WeakMap,B=(e,t)=>e===null?null:typeof e==`number`?t===`series`?{index:0,datasetIndex:e}:{index:e,datasetIndex:0}:e,V=(e,t)=>e===null||t===null?e===t:e.index===t.index&&e.datasetIndex===t.datasetIndex,H=(e,t,n)=>{let r=e.data.datasets[0],i=r?.hoverBackgroundColor;!r||!Array.isArray(i)||(r.backgroundColor=t===null?[...i]:i.map((e,r)=>r===t.index?e:n))},U=(e,t,n)=>Array.isArray(t)?(e.data??[]).map(()=>n):n,W={element:H,series:(e,t,n)=>{e.data.datasets.forEach((e,r)=>{let i=t===null||r===t.datasetIndex,{hoverBackgroundColor:a,hoverBorderColor:o}=e;a!==void 0&&!Array.isArray(a)&&(e.backgroundColor=U(e,e.backgroundColor,i?a:n)),o!==void 0&&!Array.isArray(o)&&(e.borderColor=U(e,e.borderColor,i?o:n))})},segment:(e,t,n)=>{e.data.datasets.forEach((e,r)=>{let{hoverBackgroundColor:i}=e;i===void 0||Array.isArray(i)||(e.backgroundColor=(e.data??[]).map((e,a)=>t===null||r===t.datasetIndex&&a===t.index?i:n))})}},G=(e,t,n,r,i=!1,a=`external`)=>{let o=B(n,t);V(z.get(e)?.hovered??null,o)||(z.set(e,{hovered:o,kind:t,mutedColor:r,source:a}),W[t](e,o,r),e.canvas.style.cursor=o!==null&&i?`pointer`:``,e.update())},K=(e,t)=>{let n=z.get(e);!n||n.hovered===null||t!==void 0&&n.source!==t||(z.set(e,{...n,hovered:null}),W[n.kind](e,null,n.mutedColor),e.canvas.style.cursor=``,e.update())},q={id:`sChartHoverDimReset`,beforeEvent:(e,t)=>t.replay&&z.get(e)?.source===`external`?!1:void 0,afterEvent:(e,t)=>{t.event.type===`mouseout`&&K(e,`canvas`)}},J=(e,t)=>{let n=e[0];return n?t===`element`?n.index:n.datasetIndex:null},Y=e=>{let t=e[0];return t?{index:t.index,datasetIndex:t.datasetIndex}:null},X=({kind:e,skeleton:t,colorHostElement:n,onIndexClick:r,onElementIndexClick:i})=>{if(t)return{plugins:[]};let a=Z(n),o=!!(r||i),s={onHover:(t,n,r)=>{G(r,e,Y(n),a,o,`canvas`)},plugins:[q]};return(r||i)&&(s.onClick=(t,n)=>{if(r){let t=J(n,e);t!==null&&r(t)}let a=n[0];a&&i&&i(a.index,a.datasetIndex)}),s},Z=e=>i(a.fillMuted,e),Q=(e,t)=>{if(!e.canvas.width||!e.canvas.height)return;let n=document.createElement(`canvas`);n.width=e.canvas.width,n.height=e.canvas.height;let r=n.getContext(`2d`);if(r)return r.fillStyle=i(a.exportBackground,t)||`#ffffff`,r.fillRect(0,0,n.width,n.height),r.drawImage(e.canvas,0,0),n.toDataURL(`image/png`)},ne=({canvasRef:t,config:i,enabled:a})=>{let o=(0,e.shallowRef)(),s=()=>{o.value&&=(o.value.destroy(),void 0)},c=()=>{if(!(0,e.toValue)(a)){s();return}let n=(0,e.toValue)(t),c=(0,e.toValue)(i);if(!n||!c){s();return}te(),o.value&&=(o.value.destroy(),void 0),o.value=new r.Chart(n,c)};return(0,e.onMounted)(()=>{c()}),(0,e.watch)(()=>[(0,e.toValue)(a),(0,e.toValue)(t),(0,e.toValue)(i)],()=>{c()},{deep:!0}),(0,n.useResizeObserver)(t,()=>{o.value?.resize()}),(0,e.onBeforeUnmount)(()=>{s()}),{chartInstance:o}},re=({chartInstance:t,canvasRef:n,colorHostElement:r,legendDimKind:i=`series`})=>((0,e.watch)(t,()=>{let t=(0,e.toValue)(n);t?.style.cursor&&(t.style.cursor=``)}),{exportImage:()=>{if(t.value)return Q(t.value,(0,e.toValue)(r))},handleLegendItemHover:n=>{t.value&&G(t.value,i,n,Z((0,e.toValue)(r)))}}),$=function(e){return e.CARTESIAN=`cartesian`,e.PIE=`pie`,e}({}),ie=(0,e.defineComponent)({__name:`SChartSkeletonHost`,props:{loading:{type:Boolean,default:!1},type:{default:()=>$.CARTESIAN}},setup(n){let r=(0,e.computed)(()=>n.type===$.PIE?t.ESSkeletonType.CHART_PIE:t.ESSkeletonType.CHART_CARTESIAN);return(i,a)=>n.loading?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(t.SSkeleton),{key:0,type:r.value,class:`s-ui-chart-skeleton-host`},{default:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`default`)]),_:3},8,[`type`])):(0,e.renderSlot)(i.$slots,`default`,{key:1})}});Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return f}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SChartSkeletonHost-Dt5EjQr5.cjs"),t=require("./buildCartesianChartScales-Dck5yBMo.cjs"),n=require("./buildChartSeriesPoints-Bv3nXvSu.cjs"),r=require("./resolveStackedChartContext-Dsxhhhel.cjs"),i=require("./createChartCrosshairPlugin-ZZwKUQm8.cjs"),a=require("./resolveSeriesPaletteColor-hI4YDdUg.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}});
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import { _ as e, a as t, c as n, g as r, h as i, i as a, m as o, o as s, r as c, s as l, t as u, v as d, w as f } from "./SChartSkeletonHost-BT96eWSF.js";
|
|
2
|
-
import { t as p } from "./buildCartesianChartScales-EofFq3ry.js";
|
|
3
|
-
import { n as m, t as h } from "./buildChartSeriesPoints-D8Xpfwp7.js";
|
|
4
|
-
import { t as g } from "./resolveStackedChartContext-DFre3tt0.js";
|
|
5
|
-
import { t as _ } from "./resolveSeriesPaletteColor-BdvGT-PI.js";
|
|
6
|
-
import { t as v } from "./SChartLegend-oZoF8XK7.js";
|
|
7
|
-
import { t as y } from "./useHasListener-RSjlUyqH.js";
|
|
8
|
-
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";
|
|
9
|
-
//#region src/utils/chart/bar/resolveBarStackedSeriesColor.ts
|
|
10
|
-
var M = (t, n, i, a = !1) => _(t, n, i, a, {
|
|
11
|
-
palette: e,
|
|
12
|
-
paletteFallback: d.barStackedPalette1,
|
|
13
|
-
skeletonPalette: r,
|
|
14
|
-
skeletonFallback: d.barSkeletonPalette1
|
|
15
|
-
}), N = 3, P = 4, F = (e, t, n, r, i, a) => {
|
|
16
|
-
let o = Math.min(a, r / 2, i), s = o;
|
|
17
|
-
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();
|
|
18
|
-
}, I = (e) => ({
|
|
19
|
-
id: "stackedBarHoverOutline",
|
|
20
|
-
afterDatasetsDraw(t) {
|
|
21
|
-
let n = t.tooltip?.getActiveElements() ?? [];
|
|
22
|
-
if (n.length === 0) return;
|
|
23
|
-
let r = Infinity, i = Infinity, a = -Infinity, o = -Infinity;
|
|
24
|
-
for (let e of n) {
|
|
25
|
-
let { x: t, y: n, width: s, base: c } = e.element.getProps([
|
|
26
|
-
"x",
|
|
27
|
-
"y",
|
|
28
|
-
"width",
|
|
29
|
-
"base"
|
|
30
|
-
]), l = t - s / 2, u = t + s / 2, d = n, f = c;
|
|
31
|
-
r = Math.min(r, l), a = Math.max(a, u), i = Math.min(i, d), o = Math.max(o, f);
|
|
32
|
-
}
|
|
33
|
-
let s = f(d.barHoverOutline, e), { ctx: c, chartArea: l } = t, u = N / 2, p = l?.bottom ?? o, m = Math.min(o, p), h = r + u, g = i + u, _ = a - r - N, v = m - i - N;
|
|
34
|
-
if (_ <= 0 || v <= 0) return;
|
|
35
|
-
let y = Math.max(0, P - u);
|
|
36
|
-
c.save(), c.strokeStyle = s, c.lineWidth = N, F(c, h, g, _, v, y), c.restore();
|
|
37
|
-
}
|
|
38
|
-
}), L = 5, R = "stack0", z = 36, B = 4, V = 12, H = ({ seriesList: e, colorHostElement: r, yMax: a, yMin: c, yStep: u = L, skeleton: d = !1, onSeriesClick: f, onSegmentClick: m }) => {
|
|
39
|
-
let h = g({
|
|
40
|
-
seriesList: e,
|
|
41
|
-
colorHostElement: r,
|
|
42
|
-
yMax: a,
|
|
43
|
-
yMin: c,
|
|
44
|
-
yStep: u,
|
|
45
|
-
skeleton: d
|
|
46
|
-
});
|
|
47
|
-
if (!h) return null;
|
|
48
|
-
let { axisLabelColor: _, gridColor: v, tooltipBackgroundColor: y, tooltipTextColor: b, resolvedYMax: x, resolvedYMin: S, chartLabels: C, pointCaptions: w, topSeriesIndex: T } = h, E = t({
|
|
49
|
-
kind: "segment",
|
|
50
|
-
skeleton: d,
|
|
51
|
-
colorHostElement: r,
|
|
52
|
-
onIndexClick: f,
|
|
53
|
-
onElementIndexClick: m
|
|
54
|
-
});
|
|
55
|
-
return {
|
|
56
|
-
type: "bar",
|
|
57
|
-
data: {
|
|
58
|
-
labels: C,
|
|
59
|
-
datasets: e.map((e, t) => {
|
|
60
|
-
let n = M(t, r, e.fillColor, d);
|
|
61
|
-
return {
|
|
62
|
-
label: e.label,
|
|
63
|
-
data: e.points.map((e) => e.value),
|
|
64
|
-
backgroundColor: n,
|
|
65
|
-
hoverBackgroundColor: n,
|
|
66
|
-
borderWidth: 0,
|
|
67
|
-
hoverBorderWidth: 0,
|
|
68
|
-
stack: R,
|
|
69
|
-
barThickness: z,
|
|
70
|
-
borderRadius: t === T ? {
|
|
71
|
-
topLeft: B,
|
|
72
|
-
topRight: B
|
|
73
|
-
} : 0,
|
|
74
|
-
...t === 0 ? { captions: w } : {}
|
|
75
|
-
};
|
|
76
|
-
})
|
|
77
|
-
},
|
|
78
|
-
options: {
|
|
79
|
-
responsive: !0,
|
|
80
|
-
maintainAspectRatio: !1,
|
|
81
|
-
onHover: E.onHover,
|
|
82
|
-
onClick: E.onClick,
|
|
83
|
-
hover: d ? void 0 : {
|
|
84
|
-
mode: "nearest",
|
|
85
|
-
intersect: !0
|
|
86
|
-
},
|
|
87
|
-
interaction: s(d, {
|
|
88
|
-
mode: "nearest",
|
|
89
|
-
intersect: !0
|
|
90
|
-
}),
|
|
91
|
-
plugins: {
|
|
92
|
-
legend: { display: !1 },
|
|
93
|
-
tooltip: {
|
|
94
|
-
enabled: l(d),
|
|
95
|
-
backgroundColor: y,
|
|
96
|
-
titleColor: b,
|
|
97
|
-
bodyColor: b,
|
|
98
|
-
displayColors: !1,
|
|
99
|
-
position: o,
|
|
100
|
-
yAlign: "bottom",
|
|
101
|
-
xAlign: "center",
|
|
102
|
-
caretPadding: 8,
|
|
103
|
-
callbacks: i()
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
scales: p({
|
|
107
|
-
axisLabelColor: _,
|
|
108
|
-
gridColor: v,
|
|
109
|
-
yMin: S,
|
|
110
|
-
yMax: x,
|
|
111
|
-
yStep: u,
|
|
112
|
-
stacked: !0,
|
|
113
|
-
xTickFontSize: V
|
|
114
|
-
})
|
|
115
|
-
},
|
|
116
|
-
plugins: n(d, [I(r), ...E.plugins])
|
|
117
|
-
};
|
|
118
|
-
}, U = [
|
|
119
|
-
"5 неделя",
|
|
120
|
-
"6 неделя",
|
|
121
|
-
"7 неделя",
|
|
122
|
-
"8 неделя",
|
|
123
|
-
"9 неделя",
|
|
124
|
-
"10 неделя",
|
|
125
|
-
"11 неделя",
|
|
126
|
-
"12 неделя",
|
|
127
|
-
"13 неделя",
|
|
128
|
-
"14 неделя",
|
|
129
|
-
"15 неделя",
|
|
130
|
-
"16 неделя"
|
|
131
|
-
], W = [
|
|
132
|
-
12,
|
|
133
|
-
14,
|
|
134
|
-
15,
|
|
135
|
-
16,
|
|
136
|
-
18,
|
|
137
|
-
17,
|
|
138
|
-
16,
|
|
139
|
-
15,
|
|
140
|
-
14,
|
|
141
|
-
13,
|
|
142
|
-
12,
|
|
143
|
-
11
|
|
144
|
-
], G = [
|
|
145
|
-
6,
|
|
146
|
-
7,
|
|
147
|
-
8,
|
|
148
|
-
8,
|
|
149
|
-
9,
|
|
150
|
-
8,
|
|
151
|
-
7,
|
|
152
|
-
7,
|
|
153
|
-
6,
|
|
154
|
-
6,
|
|
155
|
-
5,
|
|
156
|
-
5
|
|
157
|
-
], K = [
|
|
158
|
-
4,
|
|
159
|
-
5,
|
|
160
|
-
5,
|
|
161
|
-
6,
|
|
162
|
-
6,
|
|
163
|
-
5,
|
|
164
|
-
5,
|
|
165
|
-
4,
|
|
166
|
-
4,
|
|
167
|
-
3,
|
|
168
|
-
3,
|
|
169
|
-
3
|
|
170
|
-
], q = [
|
|
171
|
-
"Series 1",
|
|
172
|
-
"Series 2",
|
|
173
|
-
"Series 3"
|
|
174
|
-
], J = [
|
|
175
|
-
{
|
|
176
|
-
label: q[0] ?? "Series 1",
|
|
177
|
-
points: h(U, W)
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
label: q[1] ?? "Series 2",
|
|
181
|
-
points: h(U, G)
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
label: q[2] ?? "Series 3",
|
|
185
|
-
points: h(U, K)
|
|
186
|
-
}
|
|
187
|
-
], Y = { class: "s-ui-chart-stacked-bar__canvas-wrap" }, X = /* @__PURE__ */ E({
|
|
188
|
-
__name: "SChartStackedBar",
|
|
189
|
-
props: {
|
|
190
|
-
series: { default: () => [] },
|
|
191
|
-
loading: {
|
|
192
|
-
type: Boolean,
|
|
193
|
-
default: !1
|
|
194
|
-
},
|
|
195
|
-
yMax: {},
|
|
196
|
-
yStep: {}
|
|
197
|
-
},
|
|
198
|
-
emits: ["seriesClick", "segmentClick"],
|
|
199
|
-
setup(e, { expose: t, emit: n }) {
|
|
200
|
-
let r = n, i = A("chartRootRef"), o = A("chartCanvasRef"), s = b(() => e.loading ? J : e.series), l = (t) => {
|
|
201
|
-
let n = e.series[t];
|
|
202
|
-
n && r("seriesClick", t, n);
|
|
203
|
-
}, d = (t, n) => {
|
|
204
|
-
let i = e.series[n], a = i?.points[t];
|
|
205
|
-
i && a && r("segmentClick", t, n, a, i);
|
|
206
|
-
}, f = y("onSeriesClick"), p = y("onSegmentClick"), h = b(() => !e.loading && e.series.length === 0 ? null : H({
|
|
207
|
-
seriesList: s.value,
|
|
208
|
-
colorHostElement: i.value,
|
|
209
|
-
yMax: e.loading ? 50 : e.yMax,
|
|
210
|
-
yMin: e.loading ? 0 : void 0,
|
|
211
|
-
yStep: e.loading ? 5 : e.yStep,
|
|
212
|
-
skeleton: e.loading,
|
|
213
|
-
onSeriesClick: f() ? l : void 0,
|
|
214
|
-
onSegmentClick: p() ? d : void 0
|
|
215
|
-
})), g = b(() => m(s.value, (t, n) => M(t, i.value, n, e.loading))), { chartInstance: _ } = a({
|
|
216
|
-
canvasRef: o,
|
|
217
|
-
config: h,
|
|
218
|
-
enabled: b(() => e.loading || e.series.length > 0)
|
|
219
|
-
}), { exportImage: E, handleLegendItemHover: N } = c({
|
|
220
|
-
chartInstance: _,
|
|
221
|
-
canvasRef: o,
|
|
222
|
-
colorHostElement: i
|
|
223
|
-
});
|
|
224
|
-
return t({ exportImage: E }), (t, n) => (O(), C("div", {
|
|
225
|
-
ref_key: "chartRootRef",
|
|
226
|
-
ref: i,
|
|
227
|
-
class: D(["s-ui-chart-stacked-bar", { "s-ui-chart-stacked-bar--skeleton": e.loading }])
|
|
228
|
-
}, [w("div", Y, [T(k(u), { loading: e.loading }, {
|
|
229
|
-
default: j(() => [w("canvas", {
|
|
230
|
-
ref_key: "chartCanvasRef",
|
|
231
|
-
ref: o,
|
|
232
|
-
class: "s-ui-chart-stacked-bar__canvas"
|
|
233
|
-
}, null, 512)]),
|
|
234
|
-
_: 1
|
|
235
|
-
}, 8, ["loading"])]), g.value.length ? (O(), x(k(v), {
|
|
236
|
-
key: 0,
|
|
237
|
-
items: g.value,
|
|
238
|
-
disabled: e.loading,
|
|
239
|
-
interactive: !e.loading,
|
|
240
|
-
onItemHover: k(N)
|
|
241
|
-
}, null, 8, [
|
|
242
|
-
"items",
|
|
243
|
-
"disabled",
|
|
244
|
-
"interactive",
|
|
245
|
-
"onItemHover"
|
|
246
|
-
])) : S("", !0)], 2));
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
//#endregion
|
|
250
|
-
export { X as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SChartSkeletonHost-Dt5EjQr5.cjs"),t=require("./buildCartesianChartScales-Dck5yBMo.cjs"),n=require("./buildChartSeriesPoints-Bv3nXvSu.cjs"),r=require("./resolveStackedChartContext-Dsxhhhel.cjs"),i=require("./resolveSeriesPaletteColor-hI4YDdUg.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,onSegmentClick:d})=>{let v=r.t({seriesList:n,colorHostElement:i,yMax:a,yMin:o,yStep:s,skeleton:l});if(!v)return null;let{axisLabelColor:y,gridColor:b,tooltipBackgroundColor:x,tooltipTextColor:S,resolvedYMax:C,resolvedYMin:w,chartLabels:T,pointCaptions:E,topSeriesIndex:D}=v,O=e.a({kind:`segment`,skeleton:l,colorHostElement:i,onIndexClick:u,onElementIndexClick:d});return{type:`bar`,data:{labels:T,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===D?{topLeft:g,topRight:g}:0,...t===0?{captions:E}:{}}})},options:{responsive:!0,maintainAspectRatio:!1,onHover:O.onHover,onClick:O.onClick,hover:l?void 0:{mode:`nearest`,intersect:!0},interaction:e.o(l,{mode:`nearest`,intersect:!0}),plugins:{legend:{display:!1},tooltip:{enabled:e.s(l),backgroundColor:x,titleColor:S,bodyColor:S,displayColors:!1,position:e.m,yAlign:`bottom`,xAlign:`center`,caretPadding:8,callbacks:e.h()}},scales:t.t({axisLabelColor:y,gridColor:b,yMin:w,yMax:C,yStep:s,stacked:!0,xTickFontSize:_})},plugins:e.c(l,[f(i),...O.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`,`segmentClick`],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=(e,n)=>{let r=t.series[n],i=r?.points[e];r&&i&&l(`segmentClick`,e,n,i,r)},h=o.t(`onSeriesClick`),g=o.t(`onSegmentClick`),_=(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:h()?p:void 0,onSegmentClick:g()?m:void 0})),y=(0,s.computed)(()=>n.n(f.value,(e,n)=>c(e,u.value,n,t.loading))),{chartInstance:b}=e.i({canvasRef:d,config:_,enabled:(0,s.computed)(()=>t.loading||t.series.length>0)}),{exportImage:x,handleLegendItemHover:S}=e.r({chartInstance:b,canvasRef:d,colorHostElement:u});return r({exportImage:x}),(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`])]),y.value.length?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),{key:0,items:y.value,disabled:t.loading,interactive:!t.loading,onItemHover:(0,s.unref)(S)},null,8,[`items`,`disabled`,`interactive`,`onItemHover`])):(0,s.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return E}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./contrastSurfaceTextColor-BRjRzXyZ.cjs"),t=require("./SColorPalette-CqIA4Qtp.cjs"),n=require("./colorValue-Dda7fKd3.cjs"),r=require("./SButton.types-UKroD-ev.cjs"),i=require("./SButton-9dLbCJvh.cjs"),a=require("./useFloatingOverlay-B1UCUYQQ.cjs"),o=require("./SDropdown-LNVnMol3.cjs"),s=require("./SSelect-CHWKMbB_.cjs");let c=require("vue"),l=require("@shtabapp/ui-kit-primitives"),u=require("@vueuse/core");var d=e=>Math.max(0,Math.min(255,Math.round(e))),f=e=>{let t=e%360;return t<0?t+360:t},p=e=>Math.max(0,Math.min(100,Math.round(e))),m=e=>{let t=e.slice(1);if(t.length===3){let e=t[0],n=t[1],r=t[2];return!e||!n||!r?void 0:`${e}${e}${n}${n}${r}${r}`}if(t.length===6||t.length===8)return t.slice(0,6)},h=e=>{let t=m(e);if(!t)return;let n=Number.parseInt(t.slice(0,2),16),r=Number.parseInt(t.slice(2,4),16),i=Number.parseInt(t.slice(4,6),16);if(!(Number.isNaN(n)||Number.isNaN(r)||Number.isNaN(i)))return{first:n,second:r,third:i}},g=e=>{let t=d(e.first),n=d(e.second),r=d(e.third);return`#${t.toString(16).padStart(2,`0`).toUpperCase()}${n.toString(16).padStart(2,`0`).toUpperCase()}${r.toString(16).padStart(2,`0`).toUpperCase()}`},_=e=>{let t=h(e);if(!t)return;let n=t.first/255,r=t.second/255,i=t.third/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=a-o,c=0,l=(a+o)/2;s!==0&&(c=a===n?((r-i)/s+(r<i?6:0))*60:a===r?((i-n)/s+2)*60:((n-r)/s+4)*60);let u=0;return s!==0&&(u=l>.5?s/(2-a-o):s/(a+o)),{first:Math.round(c),second:Math.round(u*100),third:Math.round(l*100)}},v=e=>{let t=f(e.first),n=p(e.second)/100,r=p(e.third)/100,i=e=>{let i=(t+e)/30;return d((r-n*Math.min(r,1-r)*Math.max(-1,Math.min(i%2-1,1)))*255)};return g({first:i(0),second:i(8),third:i(4)})},y=t=>{let n=t.toUpperCase(),r=n.startsWith(`#`)?n.slice(1):n;if(!/^[0-9A-F]{3}$/.test(r)&&!/^[0-9A-F]{6}$/.test(r))return;let i=`#${r}`;if(e.n(i))return g(h(i)??{first:0,second:0,third:0})},b=e=>e.slice(1).toUpperCase(),x=e=>{let t=e.first/255,n=e.second/255,r=e.third/255,i=Math.max(t,n,r),a=i-Math.min(t,n,r),o=0;a!==0&&(o=i===t?(n-r)/a%6:i===n?(r-t)/a+2:(t-n)/a+4,o=Math.round(o*60),o<0&&(o+=360));let s=i===0?0:a/i;return{hue:o,saturation:s,value:i}},S=e=>{let t=e.value*e.saturation,n=e.hue/60,r=t*(1-Math.abs(n%2-1)),i=e.value-t,a=0,o=0,s=0;return n>=0&&n<1?(a=t,o=r):n>=1&&n<2?(a=r,o=t):n>=2&&n<3?(o=t,s=r):n>=3&&n<4?(o=r,s=t):n>=4&&n<5?(a=r,s=t):(a=t,s=r),{first:d((a+i)*255),second:d((o+i)*255),third:d((s+i)*255)}},C=e=>{let t=h(e);if(t)return x(t)},w=e=>g(S(e)),T=[t.o.HEX,t.o.RGB,t.o.HSL],E={[t.o.HEX]:`Hex`,[t.o.RGB]:`RGB`,[t.o.HSL]:`HSL`},D=e=>{let t=getComputedStyle(e).backgroundColor.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(!t)return;let n=Number.parseInt(t[1]??`0`,10),r=Number.parseInt(t[2]??`0`,10),i=Number.parseInt(t[3]??`0`,10);return`#${n.toString(16).padStart(2,`0`).toUpperCase()}${r.toString(16).padStart(2,`0`).toUpperCase()}${i.toString(16).padStart(2,`0`).toUpperCase()}`},O=(t,r)=>{if(n.n(t)&&e.n(t))return t;if(r)return D(r)},k=(e,n)=>n===t.o.HEX?b(e):n===t.o.RGB?h(e)??{first:0,second:0,third:0}:_(e)??{first:0,second:0,third:0},A=e=>{let t=Number.parseInt(e,10);if(!Number.isNaN(t))return t},j=(e,n)=>{if(e===t.o.HEX)return typeof n==`string`?y(n):void 0;if(typeof n==`string`)return;if(e===t.o.RGB){let e=g({first:A(String(n.first))??0,second:A(String(n.second))??0,third:A(String(n.third))??0});return h(e)?e:void 0}let r=v({first:A(String(n.first))??0,second:A(String(n.second))??0,third:A(String(n.third))??0});if(r&&_(r))return r},M=17,N=`#000000`,P=e=>e??N,F=({modelValue:e,getEditableHex:t,saturationAreaRef:n,hueSliderRef:r,disabled:i,readonly:a})=>{let o=C(P(t()))??{hue:0,saturation:0,value:0},s=(0,c.ref)(o.hue),l=(0,c.ref)(o.saturation),d=(0,c.ref)(o.value),f=(0,c.ref)(!1),p=(0,c.ref)(!1),m=(0,c.ref)(!1),h=(0,c.shallowRef)(null),g=(0,c.shallowRef)(null),_=(0,c.computed)(()=>w({hue:s.value,saturation:l.value,value:d.value})),v=(0,c.computed)(()=>w({hue:s.value,saturation:1,value:1})),y=e=>{s.value=Math.max(0,Math.min(360,e))},b=(e,t)=>{l.value=Math.max(0,Math.min(1,e)),d.value=Math.max(0,Math.min(1,t))},x=e=>{let t=C(P(e));t&&(f.value=!0,t.saturation>0&&(s.value=t.hue),l.value=t.saturation,d.value=t.value,f.value=!1)},S=()=>{let e=t();e&&e.toUpperCase()!==_.value.toUpperCase()&&x(e)},T=()=>{let n=_.value;t()?.toUpperCase()!==n.toUpperCase()&&(f.value=!0,e.value=n,f.value=!1)};(0,c.watch)([s,l,d],()=>{f.value||T()}),(0,c.watch)(e,()=>{f.value||S()}),(0,c.onMounted)(()=>{(0,c.nextTick)(()=>{E(),D(),S()})});let E=()=>{h.value=n.value?.getBoundingClientRect()??null},D=()=>{g.value=r.value?.getBoundingClientRect()??null},O=(0,c.computed)(()=>{let e=h.value;return e?{transform:`translate3d(calc(${l.value*e.width}px - 50%), calc(${(1-d.value)*e.height}px - 50%), 0)`}:{}}),k=(0,c.computed)(()=>{let e=g.value;return e?{transform:`translate3d(-50%, calc(${s.value/360*e.height}px - 50%), 0)`}:{}}),A=()=>!i.value&&!a.value,j=e=>{let t=h.value;if(!t)return;let n=Math.max(0,Math.min(e.clientX-t.left,t.width)),r=Math.max(0,Math.min(e.clientY-t.top,t.height));b(n/t.width,1-r/t.height)},M=e=>{let t=g.value;t&&y(Math.max(0,Math.min(e.clientY-t.top,t.height))/t.height*360)},N=e=>{A()&&(E(),p.value=!0,j(e),e.currentTarget instanceof HTMLElement&&e.currentTarget.setPointerCapture(e.pointerId))},F=e=>{A()&&(D(),m.value=!0,M(e),e.currentTarget instanceof HTMLElement&&e.currentTarget.setPointerCapture(e.pointerId))},I=()=>{p.value=!1},L=()=>{m.value=!1};return(0,u.useEventListener)(n,`pointermove`,e=>{p.value&&j(e)}),(0,u.useEventListener)(n,`pointerup`,I),(0,u.useEventListener)(n,`pointercancel`,I),(0,u.useEventListener)(n,`lostpointercapture`,I),(0,u.useEventListener)(r,`pointermove`,e=>{m.value&&M(e)}),(0,u.useEventListener)(r,`pointerup`,L),(0,u.useEventListener)(r,`pointercancel`,L),(0,u.useEventListener)(r,`lostpointercapture`,L),{hexColor:_,hueBackground:v,saturationPointerStyle:O,huePointerStyle:k,handleSaturationPointerDown:N,handleHuePointerDown:F,syncFromModelValue:S}},I=e=>{if(!e)return null;let t=e.$el;if(!(t instanceof HTMLElement))return null;let n=t.querySelector(`.s-ui-color-swatch__fill`);return n instanceof HTMLElement?n:null},L={class:`s-ui-color-area__canvas-row`},R=[`aria-label`],z=[`aria-label`,`aria-disabled`],B=(0,c.defineComponent)({__name:`SColorArea`,props:(0,c.mergeModels)({disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=(0,c.useModel)(e,`modelValue`),{t:r}=(0,l.useUiKitI18n)(),i=(0,c.useTemplateRef)(`colorResolutionSwatchRef`),a=(0,c.useTemplateRef)(`saturationAreaRef`),o=(0,c.useTemplateRef)(`hueSliderRef`),s=()=>O(t.value,I(i.value)),u=(0,c.computed)(()=>n.a(t.value)),{hexColor:d,hueBackground:f,saturationPointerStyle:p,huePointerStyle:m,handleSaturationPointerDown:h,handleHuePointerDown:g}=F({modelValue:t,getEditableHex:s,saturationAreaRef:a,hueSliderRef:o,disabled:(0,c.toRef)(()=>e.disabled),readonly:(0,c.toRef)(()=>e.readonly)});return(t,n)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,(0,c.mergeProps)({class:[`s-ui-color-area`,{"s-ui-color-area--disabled":e.disabled,"s-ui-color-area--readonly":e.readonly}]},t.$attrs),[(0,c.createVNode)((0,c.unref)(l.SColorSwatch),{ref_key:`colorResolutionSwatchRef`,ref:i,class:`s-ui-color-area__color-resolution`,color:u.value,size:(0,c.unref)(l.ESColorSwatchSize).SIZE_24,tabindex:`-1`,"aria-hidden":`true`},null,8,[`color`,`size`]),(0,c.createElementVNode)(`div`,L,[(0,c.createElementVNode)(`div`,{ref_key:`saturationAreaRef`,ref:a,class:`s-ui-color-area__canvas`,role:`img`,"aria-label":(0,c.unref)(r)(`colorArea.saturationBrightness`),style:(0,c.normalizeStyle)({"--s-ui-color-area-hue":(0,c.unref)(f)}),onPointerdown:n[0]||=(...e)=>(0,c.unref)(h)&&(0,c.unref)(h)(...e)},[(0,c.createElementVNode)(`div`,{class:`s-ui-color-area__canvas-pointer`,style:(0,c.normalizeStyle)({...(0,c.unref)(p),backgroundColor:(0,c.unref)(d)})},null,4)],44,R),(0,c.createElementVNode)(`div`,{ref_key:`hueSliderRef`,ref:o,class:`s-ui-color-area__hue`,role:`slider`,"aria-label":(0,c.unref)(r)(`colorArea.hue`),"aria-valuemin":`0`,"aria-valuemax":`360`,"aria-disabled":e.disabled||e.readonly,onPointerdown:n[1]||=(...e)=>(0,c.unref)(g)&&(0,c.unref)(g)(...e)},[(0,c.createElementVNode)(`div`,{class:`s-ui-color-area__hue-pointer`,style:(0,c.normalizeStyle)({...(0,c.unref)(m),backgroundColor:(0,c.unref)(f)})},null,4)],40,z)])],16))}}),V={class:`s-ui-color-values__left`},H={class:`s-ui-color-values__format`},U={class:`s-ui-color-values__value-group`},W={class:`s-ui-color-values__inputs`},G={key:0,class:`s-ui-color-values__input-wrap`},K=[`disabled`,`readonly`,`aria-label`],q={class:`s-ui-color-values__input-wrap`},J=[`disabled`,`readonly`,`aria-label`],Y={class:`s-ui-color-values__input-wrap`},X=[`disabled`,`readonly`,`aria-label`],Z={class:`s-ui-color-values__input-wrap`},Q=[`disabled`,`readonly`,`aria-label`],$=(0,c.defineComponent)({__name:`SColorValues`,props:(0,c.mergeModels)({disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},formats:{default:()=>T}},{modelValue:{required:!0},modelModifiers:{},format:{default:t.o.HEX},formatModifiers:{}}),emits:(0,c.mergeModels)([`formatDropdownOpen`,`formatDropdownClose`],[`update:modelValue`,`update:format`]),setup(e,{emit:a}){let{t:o}=(0,l.useUiKitI18n)(),u=(0,c.useModel)(e,`modelValue`),d=(0,c.useModel)(e,`format`),f=a,p=(0,c.useTemplateRef)(`previewSwatchRef`),m=(0,c.ref)(``),h=(0,c.ref)(`0`),g=(0,c.ref)(`0`),_=(0,c.ref)(`0`),v=(0,c.computed)(()=>(e.formats.length>0?e.formats:T).map(e=>({value:e,label:E[e]}))),y=(0,c.computed)(()=>n.a(u.value)),b=(0,c.computed)(()=>O(u.value,I(p.value))),x=(0,c.computed)(()=>d.value===t.o.RGB?o(`colorValues.redChannel`):o(`colorValues.hueChannel`)),S=(0,c.computed)(()=>d.value===t.o.RGB?o(`colorValues.greenChannel`):o(`colorValues.saturationChannel`)),C=(0,c.computed)(()=>d.value===t.o.RGB?o(`colorValues.blueChannel`):o(`colorValues.lightnessChannel`)),w=()=>{let e=b.value;if(!e)return;let n=k(e,d.value);if(d.value===t.o.HEX&&typeof n==`string`){m.value=n;return}typeof n==`object`&&(h.value=String(n.first),g.value=String(n.second),_.value=String(n.third))};(0,c.watch)([u,d,b],()=>{w()}),(0,c.onMounted)(()=>{(0,c.nextTick)(()=>{w()})});let D=()=>{if(e.disabled||e.readonly)return;if(d.value===t.o.HEX){let e=j(t.o.HEX,m.value);e&&(u.value=e),w();return}let n=j(d.value,{first:Number.parseInt(h.value,10),second:Number.parseInt(g.value,10),third:Number.parseInt(_.value,10)});n&&(u.value=n),w()},A=e=>{e.key===`Enter`&&(e.preventDefault(),D())};return(n,a)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,(0,c.mergeProps)({class:[`s-ui-color-values`,{"s-ui-color-values--disabled":e.disabled,"s-ui-color-values--readonly":e.readonly}]},n.$attrs),[(0,c.createElementVNode)(`div`,V,[(0,c.createVNode)((0,c.unref)(l.SColorSwatch),{ref_key:`previewSwatchRef`,ref:p,class:`s-ui-color-values__preview`,color:y.value,size:(0,c.unref)(l.ESColorSwatchSize).SIZE_32,disabled:e.disabled,tabindex:`-1`,"aria-hidden":`true`},null,8,[`color`,`size`,`disabled`]),(0,c.createElementVNode)(`div`,H,[(0,c.createVNode)((0,c.unref)(s.t),{modelValue:d.value,"onUpdate:modelValue":a[0]||=e=>d.value=e,class:`s-ui-color-values__format-select`,options:v.value,disabled:e.disabled,readonly:e.readonly,bordered:!0,clearable:!1,"close-on-select":!0,"fit-viewport":!1,"aria-label":(0,c.unref)(o)(`colorValues.format`),onOpen:a[1]||=e=>f(`formatDropdownOpen`),onClose:a[2]||=e=>f(`formatDropdownClose`)},null,8,[`modelValue`,`options`,`disabled`,`readonly`,`aria-label`])])]),(0,c.createElementVNode)(`div`,U,[(0,c.createVNode)((0,c.unref)(i.t),{class:`s-ui-color-values__pipette`,appearance:(0,c.unref)(r.t).BARE,variant:(0,c.unref)(r.r).NEUTRAL,size:(0,c.unref)(r.n).SMALL,icon:`pipette`,"aria-label":(0,c.unref)(o)(`colorValues.pickColor`),"aria-disabled":`true`,disabled:e.disabled,tabindex:`-1`},null,8,[`appearance`,`variant`,`size`,`aria-label`,`disabled`]),a[9]||=(0,c.createElementVNode)(`span`,{class:`s-ui-color-values__separator`,"aria-hidden":`true`},null,-1),(0,c.createElementVNode)(`div`,W,[d.value===(0,c.unref)(t.o).HEX?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,G,[(0,c.withDirectives)((0,c.createElementVNode)(`input`,{"onUpdate:modelValue":a[3]||=e=>m.value=e,class:`s-ui-color-values__input s-ui-typography-body-14-regular`,type:`text`,inputmode:`text`,spellcheck:`false`,disabled:e.disabled,readonly:e.readonly,"aria-label":(0,c.unref)(o)(`colorValues.hexValue`),onBlur:D,onKeydown:A},null,40,K),[[c.vModelText,m.value]])])):((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,{key:1},[(0,c.createElementVNode)(`div`,q,[(0,c.withDirectives)((0,c.createElementVNode)(`input`,{"onUpdate:modelValue":a[4]||=e=>h.value=e,class:`s-ui-color-values__input s-ui-typography-body-14-regular`,type:`text`,inputmode:`numeric`,spellcheck:`false`,disabled:e.disabled,readonly:e.readonly,"aria-label":x.value,onBlur:D,onKeydown:A},null,40,J),[[c.vModelText,h.value]])]),a[7]||=(0,c.createElementVNode)(`span`,{class:`s-ui-color-values__separator`,"aria-hidden":`true`},null,-1),(0,c.createElementVNode)(`div`,Y,[(0,c.withDirectives)((0,c.createElementVNode)(`input`,{"onUpdate:modelValue":a[5]||=e=>g.value=e,class:`s-ui-color-values__input s-ui-typography-body-14-regular`,type:`text`,inputmode:`numeric`,spellcheck:`false`,disabled:e.disabled,readonly:e.readonly,"aria-label":S.value,onBlur:D,onKeydown:A},null,40,X),[[c.vModelText,g.value]])]),a[8]||=(0,c.createElementVNode)(`span`,{class:`s-ui-color-values__separator`,"aria-hidden":`true`},null,-1),(0,c.createElementVNode)(`div`,Z,[(0,c.withDirectives)((0,c.createElementVNode)(`input`,{"onUpdate:modelValue":a[6]||=e=>_.value=e,class:`s-ui-color-values__input s-ui-typography-body-14-regular`,type:`text`,inputmode:`numeric`,spellcheck:`false`,disabled:e.disabled,readonly:e.readonly,"aria-label":C.value,onBlur:D,onKeydown:A},null,40,Q),[[c.vModelText,_.value]])])],64))])])],16))}}),ee={class:`s-ui-color-picker__section`},te={class:`s-ui-color-picker__label`},ne={class:`s-ui-color-picker__section`},re={class:`s-ui-color-picker__label`},ie={class:`s-ui-color-picker__custom-editor`},ae={class:`s-ui-color-picker__custom-actions`},oe=(0,c.defineComponent)({__name:`SColorPicker`,props:(0,c.mergeModels)({disabled:{type:Boolean,default:!1},recommendedColors:{},recentColors:{default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:(0,c.mergeModels)([`select`,`customEditorOpen`,`customEditorClose`,`formatDropdownOpen`,`formatDropdownClose`],[`update:modelValue`]),setup(e,{emit:n}){let u=(0,c.useModel)(e,`modelValue`),d=n,{t:f}=(0,l.useUiKitI18n)(),p=(0,c.ref)(!1),m=(0,c.ref)(`#526DE3`),h=(0,c.ref)(t.o.HEX),g=(0,c.computed)(()=>e.recommendedColors&&e.recommendedColors.length>0?e.recommendedColors:t.r),_=(0,c.computed)(()=>e.recentColors.length<=17?e.recentColors:e.recentColors.slice(0,17)),v=()=>{if(u.value){m.value=u.value;return}m.value=`#526DE3`},y=e=>{d(`select`,e)},b=()=>{u.value=m.value,d(`select`,m.value),p.value=!1},x=()=>{p.value=!1};return(0,c.watch)(p,(e,t)=>{if(e&&!t){v(),d(`customEditorOpen`);return}!e&&t&&d(`customEditorClose`)}),(n,v)=>((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(s.r),(0,c.mergeProps)({width:336},n.$attrs),{default:(0,c.withCtx)(()=>[(0,c.createElementVNode)(`div`,{class:(0,c.normalizeClass)([`s-ui-color-picker`,{"s-ui-color-picker--disabled":e.disabled}])},[(0,c.createElementVNode)(`section`,ee,[(0,c.createElementVNode)(`span`,te,(0,c.toDisplayString)((0,c.unref)(f)(`colorPicker.recommendedColors`)),1),(0,c.createVNode)((0,c.unref)(t.t),{modelValue:u.value,"onUpdate:modelValue":v[0]||=e=>u.value=e,class:`s-ui-color-picker__palette`,layout:(0,c.unref)(t.n).GRID,colors:g.value,size:(0,c.unref)(l.ESColorSwatchSize).SIZE_32,disabled:e.disabled,onSelect:y},null,8,[`modelValue`,`layout`,`colors`,`size`,`disabled`])]),(0,c.createElementVNode)(`section`,ne,[(0,c.createElementVNode)(`span`,re,(0,c.toDisplayString)((0,c.unref)(f)(`colorPicker.recentColors`)),1),(0,c.createVNode)((0,c.unref)(t.t),{modelValue:u.value,"onUpdate:modelValue":v[7]||=e=>u.value=e,class:`s-ui-color-picker__palette`,layout:(0,c.unref)(t.n).ROW,colors:_.value,size:(0,c.unref)(l.ESColorSwatchSize).SIZE_32,disabled:e.disabled,onSelect:y},{append:(0,c.withCtx)(()=>[(0,c.createVNode)((0,c.unref)(o.t),{modelValue:p.value,"onUpdate:modelValue":v[6]||=e=>p.value=e,placement:(0,c.unref)(a.i).RIGHT_START,offset:8,shift:!0,flip:!0,disabled:e.disabled,"dismiss-on-click-outside":!0,"dismiss-on-escape":!0},{trigger:(0,c.withCtx)(({toggle:t,triggerProps:n})=>[(0,c.createVNode)((0,c.unref)(i.t),(0,c.mergeProps)(n,{class:`s-ui-color-picker__add-button`,appearance:(0,c.unref)(r.t).OUTLINED,variant:(0,c.unref)(r.r).NEUTRAL,size:(0,c.unref)(r.n).SMALL,icon:`plus`,"aria-label":(0,c.unref)(f)(`colorPicker.addCustomColor`),disabled:e.disabled,onClick:t}),null,16,[`appearance`,`variant`,`size`,`aria-label`,`disabled`,`onClick`])]),content:(0,c.withCtx)(()=>[(0,c.createVNode)((0,c.unref)(s.r),{width:320},{footer:(0,c.withCtx)(()=>[(0,c.createElementVNode)(`div`,ae,[(0,c.createVNode)((0,c.unref)(i.t),{class:`s-ui-color-picker__save-button`,appearance:(0,c.unref)(r.t).MAJOR,variant:(0,c.unref)(r.r).MAIN,size:(0,c.unref)(r.n).SMALL,disabled:e.disabled,onClick:b},{default:(0,c.withCtx)(()=>[(0,c.createTextVNode)((0,c.toDisplayString)((0,c.unref)(f)(`colorPicker.save`)),1)]),_:1},8,[`appearance`,`variant`,`size`,`disabled`]),(0,c.createVNode)((0,c.unref)(i.t),{class:`s-ui-color-picker__cancel-button`,appearance:(0,c.unref)(r.t).MINOR,variant:(0,c.unref)(r.r).NEUTRAL,size:(0,c.unref)(r.n).SMALL,disabled:e.disabled,onClick:x},{default:(0,c.withCtx)(()=>[(0,c.createTextVNode)((0,c.toDisplayString)((0,c.unref)(f)(`colorPicker.cancel`)),1)]),_:1},8,[`appearance`,`variant`,`size`,`disabled`])])]),default:(0,c.withCtx)(()=>[(0,c.createElementVNode)(`div`,ie,[(0,c.createVNode)(B,{modelValue:m.value,"onUpdate:modelValue":v[1]||=e=>m.value=e,disabled:e.disabled},null,8,[`modelValue`,`disabled`]),(0,c.createVNode)($,{modelValue:m.value,"onUpdate:modelValue":v[2]||=e=>m.value=e,format:h.value,"onUpdate:format":v[3]||=e=>h.value=e,disabled:e.disabled,onFormatDropdownOpen:v[4]||=e=>d(`formatDropdownOpen`),onFormatDropdownClose:v[5]||=e=>d(`formatDropdownClose`)},null,8,[`modelValue`,`format`,`disabled`])])]),_:1})]),_:1},8,[`modelValue`,`placement`,`disabled`])]),_:1},8,[`modelValue`,`layout`,`colors`,`size`,`disabled`])])],2)]),_:1},16))}});Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return oe}});
|