@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,13 +1,35 @@
|
|
|
1
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
2
|
import { ESSkeletonType as d, SSkeleton as f } from "@shtabapp/ui-kit-primitives";
|
|
3
3
|
import { useResizeObserver as p } from "@vueuse/core";
|
|
4
|
-
import { ArcElement as m, BarController as h, BarElement as
|
|
5
|
-
//#region src/
|
|
6
|
-
var
|
|
4
|
+
import { ArcElement as m, BarController as h, BarElement as g, CategoryScale as te, Chart as _, Filler as ne, LineController as re, LineElement as ie, LinearScale as ae, PieController as v, PointElement as y, Tooltip as b } from "chart.js";
|
|
5
|
+
//#region src/components/SChartSkeletonHost/SChartSkeletonHost.types.ts
|
|
6
|
+
var x = /* @__PURE__ */ function(e) {
|
|
7
|
+
return e.CARTESIAN = "cartesian", e.PIE = "pie", e;
|
|
8
|
+
}({}), S = /* @__PURE__ */ n({
|
|
9
|
+
__name: "SChartSkeletonHost",
|
|
10
|
+
props: {
|
|
11
|
+
loading: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: !1
|
|
14
|
+
},
|
|
15
|
+
type: { default: () => x.CARTESIAN }
|
|
16
|
+
},
|
|
17
|
+
setup(n) {
|
|
18
|
+
let r = e(() => n.type === x.PIE ? d.CHART_PIE : d.CHART_CARTESIAN);
|
|
19
|
+
return (e, i) => n.loading ? (a(), t(l(f), {
|
|
20
|
+
key: 0,
|
|
21
|
+
type: r.value,
|
|
22
|
+
class: "s-ui-chart-skeleton-host"
|
|
23
|
+
}, {
|
|
24
|
+
default: ee(() => [o(e.$slots, "default")]),
|
|
25
|
+
_: 3
|
|
26
|
+
}, 8, ["type"])) : o(e.$slots, "default", { key: 1 });
|
|
27
|
+
}
|
|
28
|
+
}), C = (e, t) => {
|
|
7
29
|
if (typeof window > "u") return "";
|
|
8
30
|
let n = t ?? document.documentElement;
|
|
9
31
|
return getComputedStyle(n).getPropertyValue(e).trim();
|
|
10
|
-
},
|
|
32
|
+
}, w = {
|
|
11
33
|
axisLabel: "--s-ui-chart-axis-label",
|
|
12
34
|
grid: "--s-ui-chart-grid",
|
|
13
35
|
crosshair: "--s-ui-chart-crosshair",
|
|
@@ -86,70 +108,70 @@ var b = (e, t) => {
|
|
|
86
108
|
burnupFactFillEnd: "--s-ui-chart-burnup-fact-fill-end",
|
|
87
109
|
burnupToday: "--s-ui-chart-burnup-today",
|
|
88
110
|
burnupTagBackground: "--s-ui-chart-burnup-tag-background"
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
|
111
|
+
}, T = [
|
|
112
|
+
w.stackedPalette1,
|
|
113
|
+
w.stackedPalette2,
|
|
114
|
+
w.stackedPalette3,
|
|
115
|
+
w.stackedPalette4,
|
|
116
|
+
w.stackedPalette5,
|
|
117
|
+
w.stackedPalette6
|
|
117
118
|
], E = [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
x.piePalette7,
|
|
125
|
-
x.piePalette8
|
|
119
|
+
w.skeletonPalette1,
|
|
120
|
+
w.skeletonPalette2,
|
|
121
|
+
w.skeletonPalette3,
|
|
122
|
+
w.skeletonPalette4,
|
|
123
|
+
w.skeletonPalette5,
|
|
124
|
+
w.skeletonPalette6
|
|
126
125
|
], D = [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
x.pieSkeletonPalette7,
|
|
134
|
-
x.pieSkeletonPalette8
|
|
126
|
+
w.barStackedPalette1,
|
|
127
|
+
w.barStackedPalette2,
|
|
128
|
+
w.barStackedPalette3,
|
|
129
|
+
w.barStackedPalette4,
|
|
130
|
+
w.barStackedPalette5,
|
|
131
|
+
w.barStackedPalette6
|
|
135
132
|
], O = [
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
133
|
+
w.barSkeletonPalette1,
|
|
134
|
+
w.barSkeletonPalette2,
|
|
135
|
+
w.barSkeletonPalette3,
|
|
136
|
+
w.barSkeletonPalette4,
|
|
137
|
+
w.barSkeletonPalette5,
|
|
138
|
+
w.barSkeletonPalette6
|
|
139
|
+
], k = [
|
|
140
|
+
w.piePalette1,
|
|
141
|
+
w.piePalette2,
|
|
142
|
+
w.piePalette3,
|
|
143
|
+
w.piePalette4,
|
|
144
|
+
w.piePalette5,
|
|
145
|
+
w.piePalette6,
|
|
146
|
+
w.piePalette7,
|
|
147
|
+
w.piePalette8
|
|
148
|
+
], A = [
|
|
149
|
+
w.pieSkeletonPalette1,
|
|
150
|
+
w.pieSkeletonPalette2,
|
|
151
|
+
w.pieSkeletonPalette3,
|
|
152
|
+
w.pieSkeletonPalette4,
|
|
153
|
+
w.pieSkeletonPalette5,
|
|
154
|
+
w.pieSkeletonPalette6,
|
|
155
|
+
w.pieSkeletonPalette7,
|
|
156
|
+
w.pieSkeletonPalette8
|
|
157
|
+
], j = [
|
|
158
|
+
w.multiLinePalette1,
|
|
159
|
+
w.multiLinePalette2,
|
|
160
|
+
w.multiLinePalette3
|
|
161
|
+
], M = (e) => "captions" in e, N = (e, t) => {
|
|
140
162
|
let n = e.data.datasets[0];
|
|
141
|
-
if (!n || !
|
|
163
|
+
if (!n || !M(n)) return;
|
|
142
164
|
let r = n.captions?.[t];
|
|
143
165
|
if (r) return r;
|
|
144
|
-
},
|
|
166
|
+
}, P = () => ({
|
|
145
167
|
title: (e) => {
|
|
146
168
|
let t = e[0];
|
|
147
169
|
if (!t) return "";
|
|
148
|
-
let n =
|
|
170
|
+
let n = N(t.chart, t.dataIndex), r = [`${t.label}`];
|
|
149
171
|
return n && r.push(n), r;
|
|
150
172
|
},
|
|
151
173
|
label: (e) => `${e.dataset.label ?? ""} – ${e.parsed.y ?? 0}`
|
|
152
|
-
}),
|
|
174
|
+
}), F = "stackedBarTop", I = function(e, t) {
|
|
153
175
|
if (e.length === 0) return {
|
|
154
176
|
x: t.x,
|
|
155
177
|
y: t.y
|
|
@@ -167,13 +189,13 @@ var b = (e, t) => {
|
|
|
167
189
|
x: (r + i) / 2,
|
|
168
190
|
y: n
|
|
169
191
|
};
|
|
170
|
-
},
|
|
192
|
+
}, L = () => ({
|
|
171
193
|
title: (e) => {
|
|
172
194
|
let t = e[0];
|
|
173
195
|
return t ? `${t.label}` : "";
|
|
174
196
|
},
|
|
175
197
|
label: (e) => `${e.dataset.label ?? ""}: ${e.parsed.y ?? 0}`
|
|
176
|
-
}),
|
|
198
|
+
}), R = "multiLineTop", z = function(e, t) {
|
|
177
199
|
let n = this.chart.chartArea;
|
|
178
200
|
return !n || e.length === 0 ? {
|
|
179
201
|
x: t.x,
|
|
@@ -182,22 +204,22 @@ var b = (e, t) => {
|
|
|
182
204
|
x: t.x,
|
|
183
205
|
y: n.top
|
|
184
206
|
};
|
|
185
|
-
},
|
|
186
|
-
let n = e.data.datasets[
|
|
207
|
+
}, B = "progressChartPoint", V = 1, H = (e, t) => {
|
|
208
|
+
let n = e.data.datasets[V]?.data[t];
|
|
187
209
|
return typeof n == "number" ? n : null;
|
|
188
|
-
},
|
|
189
|
-
let t = e.find((e) => e.datasetIndex ===
|
|
210
|
+
}, U = function(e) {
|
|
211
|
+
let t = e.find((e) => e.datasetIndex === V) ?? e[0];
|
|
190
212
|
if (!t) return !1;
|
|
191
213
|
let n = this.chart.scales.y;
|
|
192
214
|
if (!n) return !1;
|
|
193
|
-
let r =
|
|
215
|
+
let r = H(this.chart, t.index);
|
|
194
216
|
return r === null ? !1 : {
|
|
195
217
|
x: t.element.x,
|
|
196
218
|
y: n.getPixelForValue(r),
|
|
197
219
|
xAlign: "center",
|
|
198
220
|
yAlign: "bottom"
|
|
199
221
|
};
|
|
200
|
-
},
|
|
222
|
+
}, W = ({ total: e } = {}) => ({
|
|
201
223
|
title: (e) => {
|
|
202
224
|
let t = e[0];
|
|
203
225
|
return t ? `${t.label}` : "";
|
|
@@ -207,7 +229,7 @@ var b = (e, t) => {
|
|
|
207
229
|
let n = t.reduce((e, t) => e + (t.parsed.y ?? 0), 0);
|
|
208
230
|
return e ? `${e} – ${n}` : `${n}`;
|
|
209
231
|
}
|
|
210
|
-
}),
|
|
232
|
+
}), G = "stackedAreaTop", oe = function(e, t) {
|
|
211
233
|
let n = this.chart.chartArea;
|
|
212
234
|
return !n || e.length === 0 ? {
|
|
213
235
|
x: t.x,
|
|
@@ -216,34 +238,34 @@ var b = (e, t) => {
|
|
|
216
238
|
x: t.x,
|
|
217
239
|
y: n.top
|
|
218
240
|
};
|
|
219
|
-
},
|
|
220
|
-
|
|
221
|
-
}, ue = () => {
|
|
222
|
-
G ||= (y.positioners.stackedBarTop = N, !0);
|
|
241
|
+
}, K = !1, q = !1, se = !1, ce = !1, le = !1, ue = () => {
|
|
242
|
+
q ||= (b.positioners.stackedAreaTop = oe, !0);
|
|
223
243
|
}, de = () => {
|
|
224
|
-
|
|
244
|
+
se ||= (b.positioners.stackedBarTop = I, !0);
|
|
225
245
|
}, fe = () => {
|
|
226
|
-
ce ||= (
|
|
246
|
+
ce ||= (b.positioners.progressChartPoint = U, !0);
|
|
227
247
|
}, pe = () => {
|
|
228
|
-
|
|
229
|
-
}, me = (
|
|
248
|
+
le ||= (b.positioners.multiLineTop = z, !0);
|
|
249
|
+
}, me = () => {
|
|
250
|
+
K ||= (_.register(re, ie, y, h, g, v, m, ae, te, b, ne), ue(), de(), fe(), pe(), !0);
|
|
251
|
+
}, he = (e, t) => e ? {
|
|
230
252
|
mode: "nearest",
|
|
231
253
|
intersect: !1
|
|
232
|
-
} : t,
|
|
254
|
+
} : t, ge = (e) => !e, _e = (e, t) => e ? [] : t, J = /* @__PURE__ */ new WeakMap(), ve = (e, t) => e === null ? null : typeof e == "number" ? t === "series" ? {
|
|
233
255
|
index: 0,
|
|
234
256
|
datasetIndex: e
|
|
235
257
|
} : {
|
|
236
258
|
index: e,
|
|
237
259
|
datasetIndex: 0
|
|
238
|
-
} : e,
|
|
260
|
+
} : e, ye = (e, t) => e === null || t === null ? e === t : e.index === t.index && e.datasetIndex === t.datasetIndex, be = (e, t, n) => {
|
|
239
261
|
let r = e.data.datasets[0], i = r?.hoverBackgroundColor;
|
|
240
262
|
!r || !Array.isArray(i) || (r.backgroundColor = t === null ? [...i] : i.map((e, r) => r === t.index ? e : n));
|
|
241
|
-
},
|
|
242
|
-
element:
|
|
263
|
+
}, Y = (e, t, n) => Array.isArray(t) ? (e.data ?? []).map(() => n) : n, X = {
|
|
264
|
+
element: be,
|
|
243
265
|
series: (e, t, n) => {
|
|
244
266
|
e.data.datasets.forEach((e, r) => {
|
|
245
267
|
let i = t === null || r === t.datasetIndex, { hoverBackgroundColor: a, hoverBorderColor: o } = e;
|
|
246
|
-
a !== void 0 && !Array.isArray(a) && (e.backgroundColor =
|
|
268
|
+
a !== void 0 && !Array.isArray(a) && (e.backgroundColor = Y(e, e.backgroundColor, i ? a : n)), o !== void 0 && !Array.isArray(o) && (e.borderColor = Y(e, e.borderColor, i ? o : n));
|
|
247
269
|
});
|
|
248
270
|
},
|
|
249
271
|
segment: (e, t, n) => {
|
|
@@ -252,58 +274,58 @@ var b = (e, t) => {
|
|
|
252
274
|
i === void 0 || Array.isArray(i) || (e.backgroundColor = (e.data ?? []).map((e, a) => t === null || r === t.datasetIndex && a === t.index ? i : n));
|
|
253
275
|
});
|
|
254
276
|
}
|
|
255
|
-
},
|
|
256
|
-
let o =
|
|
257
|
-
|
|
277
|
+
}, Z = (e, t, n, r, i = !1, a = "external") => {
|
|
278
|
+
let o = ve(n, t);
|
|
279
|
+
ye(J.get(e)?.hovered ?? null, o) || (J.set(e, {
|
|
258
280
|
hovered: o,
|
|
259
281
|
kind: t,
|
|
260
282
|
mutedColor: r,
|
|
261
283
|
source: a
|
|
262
|
-
}),
|
|
263
|
-
},
|
|
264
|
-
let n =
|
|
265
|
-
!n || n.hovered === null || t !== void 0 && n.source !== t || (
|
|
284
|
+
}), X[t](e, o, r), e.canvas.style.cursor = o !== null && i ? "pointer" : "", e.update());
|
|
285
|
+
}, xe = (e, t) => {
|
|
286
|
+
let n = J.get(e);
|
|
287
|
+
!n || n.hovered === null || t !== void 0 && n.source !== t || (J.set(e, {
|
|
266
288
|
...n,
|
|
267
289
|
hovered: null
|
|
268
|
-
}),
|
|
269
|
-
},
|
|
290
|
+
}), X[n.kind](e, null, n.mutedColor), e.canvas.style.cursor = "", e.update());
|
|
291
|
+
}, Se = {
|
|
270
292
|
id: "sChartHoverDimReset",
|
|
271
|
-
beforeEvent: (e, t) => t.replay &&
|
|
293
|
+
beforeEvent: (e, t) => t.replay && J.get(e)?.source === "external" ? !1 : void 0,
|
|
272
294
|
afterEvent: (e, t) => {
|
|
273
|
-
t.event.type === "mouseout" &&
|
|
295
|
+
t.event.type === "mouseout" && xe(e, "canvas");
|
|
274
296
|
}
|
|
275
|
-
},
|
|
297
|
+
}, Ce = (e, t) => {
|
|
276
298
|
let n = e[0];
|
|
277
299
|
return n ? t === "element" ? n.index : n.datasetIndex : null;
|
|
278
|
-
},
|
|
300
|
+
}, we = (e) => {
|
|
279
301
|
let t = e[0];
|
|
280
302
|
return t ? {
|
|
281
303
|
index: t.index,
|
|
282
304
|
datasetIndex: t.datasetIndex
|
|
283
305
|
} : null;
|
|
284
|
-
},
|
|
306
|
+
}, Q = ({ kind: e, skeleton: t, colorHostElement: n, onIndexClick: r, onElementIndexClick: i }) => {
|
|
285
307
|
if (t) return { plugins: [] };
|
|
286
|
-
let a =
|
|
308
|
+
let a = $(n), o = !!(r || i), s = {
|
|
287
309
|
onHover: (t, n, r) => {
|
|
288
|
-
|
|
310
|
+
Z(r, e, we(n), a, o, "canvas");
|
|
289
311
|
},
|
|
290
|
-
plugins: [
|
|
312
|
+
plugins: [Se]
|
|
291
313
|
};
|
|
292
314
|
return (r || i) && (s.onClick = (t, n) => {
|
|
293
315
|
if (r) {
|
|
294
|
-
let t =
|
|
316
|
+
let t = Ce(n, e);
|
|
295
317
|
t !== null && r(t);
|
|
296
318
|
}
|
|
297
319
|
let a = n[0];
|
|
298
320
|
a && i && i(a.index, a.datasetIndex);
|
|
299
321
|
}), s;
|
|
300
|
-
},
|
|
322
|
+
}, $ = (e) => C(w.fillMuted, e), Te = (e, t) => {
|
|
301
323
|
if (!e.canvas.width || !e.canvas.height) return;
|
|
302
324
|
let n = document.createElement("canvas");
|
|
303
325
|
n.width = e.canvas.width, n.height = e.canvas.height;
|
|
304
326
|
let r = n.getContext("2d");
|
|
305
|
-
if (r) return r.fillStyle =
|
|
306
|
-
},
|
|
327
|
+
if (r) return r.fillStyle = C(w.exportBackground, t) || "#ffffff", r.fillRect(0, 0, n.width, n.height), r.drawImage(e.canvas, 0, 0), n.toDataURL("image/png");
|
|
328
|
+
}, Ee = ({ canvasRef: e, config: t, enabled: n }) => {
|
|
307
329
|
let a = s(), o = () => {
|
|
308
330
|
a.value &&= (a.value.destroy(), void 0);
|
|
309
331
|
}, l = () => {
|
|
@@ -316,7 +338,7 @@ var b = (e, t) => {
|
|
|
316
338
|
o();
|
|
317
339
|
return;
|
|
318
340
|
}
|
|
319
|
-
|
|
341
|
+
me(), a.value &&= (a.value.destroy(), void 0), a.value = new _(r, i);
|
|
320
342
|
};
|
|
321
343
|
return i(() => {
|
|
322
344
|
l();
|
|
@@ -331,38 +353,16 @@ var b = (e, t) => {
|
|
|
331
353
|
}), r(() => {
|
|
332
354
|
o();
|
|
333
355
|
}), { chartInstance: a };
|
|
334
|
-
},
|
|
356
|
+
}, De = ({ chartInstance: e, canvasRef: t, colorHostElement: n, legendDimKind: r = "series" }) => (u(e, () => {
|
|
335
357
|
let e = c(t);
|
|
336
358
|
e?.style.cursor && (e.style.cursor = "");
|
|
337
359
|
}), {
|
|
338
360
|
exportImage: () => {
|
|
339
|
-
if (e.value) return
|
|
361
|
+
if (e.value) return Te(e.value, c(n));
|
|
340
362
|
},
|
|
341
363
|
handleLegendItemHover: (t) => {
|
|
342
|
-
e.value &&
|
|
343
|
-
}
|
|
344
|
-
}), $ = /* @__PURE__ */ function(e) {
|
|
345
|
-
return e.CARTESIAN = "cartesian", e.PIE = "pie", e;
|
|
346
|
-
}({}), De = /* @__PURE__ */ n({
|
|
347
|
-
__name: "SChartSkeletonHost",
|
|
348
|
-
props: {
|
|
349
|
-
loading: {
|
|
350
|
-
type: Boolean,
|
|
351
|
-
default: !1
|
|
352
|
-
},
|
|
353
|
-
type: { default: () => $.CARTESIAN }
|
|
354
|
-
},
|
|
355
|
-
setup(n) {
|
|
356
|
-
let r = e(() => n.type === $.PIE ? d.CHART_PIE : d.CHART_CARTESIAN);
|
|
357
|
-
return (e, i) => n.loading ? (a(), t(l(f), {
|
|
358
|
-
key: 0,
|
|
359
|
-
type: r.value,
|
|
360
|
-
class: "s-ui-chart-skeleton-host"
|
|
361
|
-
}, {
|
|
362
|
-
default: ee(() => [o(e.$slots, "default")]),
|
|
363
|
-
_: 3
|
|
364
|
-
}, 8, ["type"])) : o(e.$slots, "default", { key: 1 });
|
|
364
|
+
e.value && Z(e.value, r, t, $(c(n)));
|
|
365
365
|
}
|
|
366
366
|
});
|
|
367
367
|
//#endregion
|
|
368
|
-
export { S as C, C as S,
|
|
368
|
+
export { S as C, C as S, j as _, ge as a, E as b, W as c, L as d, F as f, w as g, D as h, he as i, B as l, O as m, Ee as n, _e as o, P as p, Q as r, G as s, De as t, R as u, A as v, x as w, T as x, k as y };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("vue"),t=require("@shtabapp/ui-kit-primitives"),n=require("@vueuse/core"),r=require("chart.js");var i=function(e){return e.CARTESIAN=`cartesian`,e.PIE=`pie`,e}({}),a=(0,e.defineComponent)({__name:`SChartSkeletonHost`,props:{loading:{type:Boolean,default:!1},type:{default:()=>i.CARTESIAN}},setup(n){let r=(0,e.computed)(()=>n.type===i.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})}}),o=(e,t)=>{if(typeof window>`u`)return``;let n=t??document.documentElement;return getComputedStyle(n).getPropertyValue(e).trim()},s={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`},c=[s.stackedPalette1,s.stackedPalette2,s.stackedPalette3,s.stackedPalette4,s.stackedPalette5,s.stackedPalette6],l=[s.skeletonPalette1,s.skeletonPalette2,s.skeletonPalette3,s.skeletonPalette4,s.skeletonPalette5,s.skeletonPalette6],u=[s.barStackedPalette1,s.barStackedPalette2,s.barStackedPalette3,s.barStackedPalette4,s.barStackedPalette5,s.barStackedPalette6],d=[s.barSkeletonPalette1,s.barSkeletonPalette2,s.barSkeletonPalette3,s.barSkeletonPalette4,s.barSkeletonPalette5,s.barSkeletonPalette6],f=[s.piePalette1,s.piePalette2,s.piePalette3,s.piePalette4,s.piePalette5,s.piePalette6,s.piePalette7,s.piePalette8],p=[s.pieSkeletonPalette1,s.pieSkeletonPalette2,s.pieSkeletonPalette3,s.pieSkeletonPalette4,s.pieSkeletonPalette5,s.pieSkeletonPalette6,s.pieSkeletonPalette7,s.pieSkeletonPalette8],m=[s.multiLinePalette1,s.multiLinePalette2,s.multiLinePalette3],h=e=>`captions`in e,ee=(e,t)=>{let n=e.data.datasets[0];if(!n||!h(n))return;let r=n.captions?.[t];if(r)return r},g=()=>({title:e=>{let t=e[0];if(!t)return``;let n=ee(t.chart,t.dataIndex),r=[`${t.label}`];return n&&r.push(n),r},label:e=>`${e.dataset.label??``} – ${e.parsed.y??0}`}),_=`stackedBarTop`,v=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}},y=()=>({title:e=>{let t=e[0];return t?`${t.label}`:``},label:e=>`${e.dataset.label??``}: ${e.parsed.y??0}`}),b=`multiLineTop`,x=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}},S=`progressChartPoint`,C=1,w=(e,t)=>{let n=e.data.datasets[C]?.data[t];return typeof n==`number`?n:null},T=function(e){let t=e.find(e=>e.datasetIndex===C)??e[0];if(!t)return!1;let n=this.chart.scales.y;if(!n)return!1;let r=w(this.chart,t.index);return r===null?!1:{x:t.element.x,y:n.getPixelForValue(r),xAlign:`center`,yAlign:`bottom`}},E=({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}`}}),D=`stackedAreaTop`,O=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}},k=!1,A=!1,j=!1,M=!1,N=!1,P=()=>{A||=(r.Tooltip.positioners.stackedAreaTop=O,!0)},te=()=>{j||=(r.Tooltip.positioners.stackedBarTop=v,!0)},F=()=>{M||=(r.Tooltip.positioners.progressChartPoint=T,!0)},I=()=>{N||=(r.Tooltip.positioners.multiLineTop=x,!0)},L=()=>{k||=(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),P(),te(),F(),I(),!0)},R=(e,t)=>e?{mode:`nearest`,intersect:!1}:t,z=e=>!e,B=(e,t)=>e?[]:t,V=new WeakMap,H=(e,t)=>e===null?null:typeof e==`number`?t===`series`?{index:0,datasetIndex:e}:{index:e,datasetIndex:0}:e,U=(e,t)=>e===null||t===null?e===t:e.index===t.index&&e.datasetIndex===t.datasetIndex,W=(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))},G=(e,t,n)=>Array.isArray(t)?(e.data??[]).map(()=>n):n,K={element:W,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=G(e,e.backgroundColor,i?a:n)),o!==void 0&&!Array.isArray(o)&&(e.borderColor=G(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))})}},q=(e,t,n,r,i=!1,a=`external`)=>{let o=H(n,t);U(V.get(e)?.hovered??null,o)||(V.set(e,{hovered:o,kind:t,mutedColor:r,source:a}),K[t](e,o,r),e.canvas.style.cursor=o!==null&&i?`pointer`:``,e.update())},J=(e,t)=>{let n=V.get(e);!n||n.hovered===null||t!==void 0&&n.source!==t||(V.set(e,{...n,hovered:null}),K[n.kind](e,null,n.mutedColor),e.canvas.style.cursor=``,e.update())},Y={id:`sChartHoverDimReset`,beforeEvent:(e,t)=>t.replay&&V.get(e)?.source===`external`?!1:void 0,afterEvent:(e,t)=>{t.event.type===`mouseout`&&J(e,`canvas`)}},X=(e,t)=>{let n=e[0];return n?t===`element`?n.index:n.datasetIndex:null},Z=e=>{let t=e[0];return t?{index:t.index,datasetIndex:t.datasetIndex}:null},Q=({kind:e,skeleton:t,colorHostElement:n,onIndexClick:r,onElementIndexClick:i})=>{if(t)return{plugins:[]};let a=$(n),o=!!(r||i),s={onHover:(t,n,r)=>{q(r,e,Z(n),a,o,`canvas`)},plugins:[Y]};return(r||i)&&(s.onClick=(t,n)=>{if(r){let t=X(n,e);t!==null&&r(t)}let a=n[0];a&&i&&i(a.index,a.datasetIndex)}),s},$=e=>o(s.fillMuted,e),ne=(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=o(s.exportBackground,t)||`#ffffff`,r.fillRect(0,0,n.width,n.height),r.drawImage(e.canvas,0,0),n.toDataURL(`image/png`)},re=({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}L(),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}},ie=({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 ne(t.value,(0,e.toValue)(r))},handleLegendItemHover:n=>{t.value&&q(t.value,i,n,$((0,e.toValue)(r)))}});Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return f}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shtabapp/ui-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.64.0",
|
|
4
4
|
"description": "Vue 3 component library by Shtab — 30+ typed components, design tokens, light/dark themes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shtab",
|
|
@@ -188,6 +188,11 @@
|
|
|
188
188
|
"import": "./dist/entries/chart-stacked-area.js",
|
|
189
189
|
"require": "./dist/entries/chart-stacked-area.cjs"
|
|
190
190
|
},
|
|
191
|
+
"./chart-bar": {
|
|
192
|
+
"types": "./dist/entries/chart-bar.d.ts",
|
|
193
|
+
"import": "./dist/entries/chart-bar.js",
|
|
194
|
+
"require": "./dist/entries/chart-bar.cjs"
|
|
195
|
+
},
|
|
191
196
|
"./chart-stacked-bar": {
|
|
192
197
|
"types": "./dist/entries/chart-stacked-bar.d.ts",
|
|
193
198
|
"import": "./dist/entries/chart-stacked-bar.js",
|
|
@@ -253,6 +258,11 @@
|
|
|
253
258
|
"import": "./dist/entries/separator.js",
|
|
254
259
|
"require": "./dist/entries/separator.cjs"
|
|
255
260
|
},
|
|
261
|
+
"./table": {
|
|
262
|
+
"types": "./dist/entries/table.d.ts",
|
|
263
|
+
"import": "./dist/entries/table.js",
|
|
264
|
+
"require": "./dist/entries/table.cjs"
|
|
265
|
+
},
|
|
256
266
|
"./tokens": {
|
|
257
267
|
"types": "./dist/entries/tokens.d.ts",
|
|
258
268
|
"import": "./dist/entries/tokens.js",
|
|
@@ -264,10 +274,13 @@
|
|
|
264
274
|
"dependencies": {
|
|
265
275
|
"chart.js": "^4.5.0",
|
|
266
276
|
"vue-i18n": "^9.14.5",
|
|
267
|
-
"@shtabapp/ui-kit-
|
|
268
|
-
"@shtabapp/ui-kit-
|
|
277
|
+
"@shtabapp/ui-kit-primitives": "^1.32.0",
|
|
278
|
+
"@shtabapp/ui-kit-tokens": "^1.20.0"
|
|
269
279
|
},
|
|
270
280
|
"devDependencies": {
|
|
281
|
+
"@atlaskit/pragmatic-drag-and-drop": "^3.0.0",
|
|
282
|
+
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.1.0",
|
|
283
|
+
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^2.1.0",
|
|
271
284
|
"@storybook/vue3-vite": "^10.4.1",
|
|
272
285
|
"@tanstack/vue-virtual": "^3.13.25",
|
|
273
286
|
"@vueuse/core": "^14.2.1",
|
|
@@ -277,6 +290,9 @@
|
|
|
277
290
|
"@shtabapp/ui-kit-shared-config": "0.1.0"
|
|
278
291
|
},
|
|
279
292
|
"peerDependencies": {
|
|
293
|
+
"@atlaskit/pragmatic-drag-and-drop": "^3.0.0",
|
|
294
|
+
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.1.0",
|
|
295
|
+
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^2.1.0",
|
|
280
296
|
"@tanstack/vue-virtual": "^3.0.0",
|
|
281
297
|
"@vueuse/core": "^14.0.0",
|
|
282
298
|
"chart.js": "^4.4.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./createChartAreaFillGradient-BwsojVzU.cjs"),t=require("./SChartSkeletonHost-Dt5EjQr5.cjs"),n=require("./createChartCrosshairPlugin-ZZwKUQm8.cjs"),r=require("./buildMultiLineChartScales-7mcIfRVG.cjs"),i=require("./SChartLegend-DGtjd6zV.cjs");let a=require("vue");var o=(e,n)=>({id:`sUiChartBurnupTodayLine`,beforeDatasetsDraw(r){if(e<0)return;let{ctx:i,chartArea:a}=r,o=r.scales.x;if(!a||!o)return;let s=t.w(t.v.burnupToday,n),c=o.getPixelForValue(e);i.save(),i.beginPath(),i.moveTo(c,a.top),i.lineTo(c,a.bottom),i.lineWidth=1,i.strokeStyle=s,i.stroke(),i.restore()}}),s=8,c=4,l=5,u=12,d=12,f=60,p=12,m=e=>{if(typeof window>`u`)return`500 10px sans-serif`;let t=e??document.documentElement;return`500 10px ${getComputedStyle(t).getPropertyValue(`--s-ui-font-family-label`).trim()||`sans-serif`}`},h=(e,t,n,r,i,a)=>{let o=Math.min(a,r/2,i/2);e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.arcTo(t+r,n,t+r,n+o,o),e.lineTo(t+r,n+i-o),e.arcTo(t+r,n+i,t+r-o,n+i,o),e.lineTo(t+o,n+i),e.arcTo(t,n+i,t,n+i-o,o),e.lineTo(t,n+o),e.arcTo(t,n,t+o,n,o),e.closePath()},g=({tagLines:e,factDatasetIndex:n,todayIndex:r},i)=>({id:`sUiChartBurnupTag`,afterDatasetsDraw(a){if(r<0||e.length===0)return;let o=a.getDatasetMeta(n)?.data[r],{chartArea:g}=a;if(!o||!g)return;let _=t.w(t.v.burnupToday,i),v=t.w(t.v.burnupTagBackground,i),{ctx:y}=a;y.save(),y.font=m(i),y.textAlign=`center`,y.textBaseline=`middle`;let b=e.reduce((e,t)=>Math.max(e,y.measureText(t).width),0),x=Math.max(f,b+s*2),S=e.length*d+c+l,C=Math.min(Math.max(o.x-x/2,g.left),g.right-x),w=Math.max(o.y-p-S,g.top);h(y,C,w,x,S,u),y.fillStyle=v,y.fill(),y.lineWidth=1,y.strokeStyle=_,y.stroke(),y.fillStyle=_,e.forEach((e,t)=>{y.fillText(e,C+x/2,w+c+d*(t+.5))}),y.restore()}}),_=(e,t)=>t>=0&&e>t,v=({todayIndex:e,futureLabel:t})=>({title:t=>{let n=t[0];return!n||_(n.dataIndex,e)?``:`${n.label}`},label:n=>_(n.dataIndex,e)?t:`${n.dataset.label??``}: ${n.parsed.y??0}%`}),y=e=>t=>!_(t.dataIndex,e)||t.datasetIndex===0,b=1,x=1,S=2,C=[8,8],w=[9,9],T=2,E=25,D=e=>e.reduce((e,t,n)=>t.fact===null?e:n,-1),O=(e,t,n)=>{let r=e.reduce((e,t)=>Math.max(e,t.plan,t.fact??0),t);return Math.ceil(r/n)*n},k=({points:i,colorHostElement:a,goalValue:s=100,goalLabel:c=`Цель`,planLabel:l=`План`,factLabel:u=`Факт`,futureLabel:d=`Этот день ещё не наступил`,yStep:f=E,mirrorYAxis:p=!0,showTag:m=!0,skeleton:h=!1})=>{if(i.length===0)return null;let _=t.w(t.v.axisLabel,a),k=t.w(t.v.grid,a),A=t.w(t.v.tooltipBackground,a),j=t.w(t.v.tooltipText,a),M=t.w(t.v.skeletonSeries,a),N=h?M:t.w(t.v.burnupGoal,a),P=h?M:t.w(t.v.burnupPlan,a),F=h?M:t.w(t.v.burnupFact,a),I=t.w(t.v.burnupFactFillStart,a),L=t.w(t.v.burnupFactFillEnd,a),R=D(i),z=R>=0?i[R]:void 0,B=z?[`${u.toLowerCase()} ${z.fact}%`,`${l.toLowerCase()} ${z.plan}%`]:[];return{type:`line`,data:{labels:i.map(e=>e.label),datasets:[{label:c,data:i.map(()=>s),borderColor:N,backgroundColor:N,borderWidth:b,borderDash:C,fill:!1,pointRadius:0,pointHoverRadius:0,tension:0},{label:l,data:i.map(e=>e.plan),borderColor:P,backgroundColor:P,borderWidth:x,borderDash:w,fill:!1,pointRadius:0,pointHoverRadius:0,tension:.4},{label:u,data:i.map(e=>e.fact??null),borderColor:F,backgroundColor:h?F:t=>e.t(t,I,L),borderWidth:S,fill:!h,spanGaps:!1,pointRadius:0,pointHoverRadius:4,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:t.o(h,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:t.s(h),backgroundColor:A,titleColor:j,bodyColor:j,displayColors:!1,position:t.f,yAlign:`bottom`,xAlign:`center`,caretPadding:8,filter:y(R),callbacks:v({todayIndex:R,futureLabel:d})}},scales:r.t({axisLabelColor:_,gridColor:k,yMin:0,yMax:O(i,s,f),yStep:f,mirrorYAxis:p,formatYAxisTick:e=>`${e}%`})},plugins:t.c(h,[n.t(a),o(R,a),...m?[g({tagLines:B,factDatasetIndex:T,todayIndex:R},a)]:[]])}},A=[8,15,23,31,38,46,54,62,69,77,85,92,96,100],j=[5,10,16,22,28,34,40,45,50,54,57,60,null,null],M=A.map((e,t)=>({label:`Д${t+1}`,plan:e,fact:j[t]})),N={class:`s-ui-chart-burnup__canvas-wrap`},P=(0,a.defineComponent)({__name:`SChartBurnup`,props:{points:{default:()=>[]},loading:{type:Boolean,default:!1},goalValue:{default:100},goalLabel:{default:`Цель`},planLabel:{default:`План`},factLabel:{default:`Факт`},futureLabel:{default:`Этот день ещё не наступил`},yStep:{default:25},mirrorYAxis:{type:Boolean,default:!0},showTag:{type:Boolean,default:!0}},setup(e,{expose:n}){let r=(0,a.useTemplateRef)(`chartRootRef`),o=(0,a.useTemplateRef)(`chartCanvasRef`),s=(0,a.computed)(()=>e.loading?M:e.points),c=(0,a.computed)(()=>!e.loading&&e.points.length===0?null:k({points:s.value,colorHostElement:r.value,goalValue:e.goalValue,goalLabel:e.goalLabel,planLabel:e.planLabel,factLabel:e.factLabel,futureLabel:e.futureLabel,yStep:e.yStep,mirrorYAxis:e.mirrorYAxis,showTag:e.showTag,skeleton:e.loading})),l=(0,a.computed)(()=>[{label:e.goalLabel,cssVariable:t.v.burnupGoal},{label:e.planLabel,cssVariable:t.v.burnupPlan},{label:e.factLabel,cssVariable:t.v.burnupFact}].map(n=>({label:n.label.toLowerCase(),color:t.w(e.loading?t.v.skeletonSeries:n.cssVariable,r.value)}))),{chartInstance:u}=t.i({canvasRef:o,config:c,enabled:(0,a.computed)(()=>e.loading||e.points.length>0)}),{exportImage:d}=t.r({chartInstance:u,canvasRef:o,colorHostElement:r});return n({exportImage:d}),(n,s)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:r,class:(0,a.normalizeClass)([`s-ui-chart-burnup`,{"s-ui-chart-burnup--skeleton":e.loading}])},[(0,a.createElementVNode)(`div`,N,[(0,a.createVNode)((0,a.unref)(t.t),{loading:e.loading},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:o,class:`s-ui-chart-burnup__canvas`},null,512)]),_:1},8,[`loading`])]),(0,a.createVNode)((0,a.unref)(i.t),{items:l.value,disabled:e.loading},null,8,[`items`,`disabled`])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return P}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SChartSkeletonHost-Dt5EjQr5.cjs"),t=require("./useHasListener-BPgtbbo6.cjs");let n=require("vue");var r=10,i=14,a=({axisLabelColor:e,categoryLabelColor:t,gridColor:n,xMin:a,xMax:o,xStep:s})=>({x:{type:`linear`,min:a,max:o,border:{display:!1},grid:{color:n,drawTicks:!1},ticks:{color:e,stepSize:s,font:{size:r,weight:500},padding:8}},y:{border:{display:!1},grid:{display:!1},ticks:{color:t,font:{size:i,weight:400},padding:8,crossAlign:`far`,autoSkip:!1}}}),o=(t,n,r)=>r?e.w(e.v.barHorizontalSkeletonFill,n):t?e.w(t,n):e.w(e.v.barHorizontalFillDefault,n),s=(e,t,n)=>{if(t)return t;let r=0;for(let t of e)r=Math.max(r,t.value);let i=Math.ceil(r/n)*n;return i>0?i:n*6},c=10,l=0,u=36,d=4,f=({items:t,colorHostElement:n,xMax:r,xMin:i=l,xStep:f=c,skeleton:p=!1,onBarClick:m})=>{if(t.length===0)return null;let h=e.w(e.v.axisLabel,n),g=e.w(e.v.grid,n),_=e.w(e.v.tooltipBackground,n),v=e.w(e.v.tooltipText,n),y=e.w(p?e.v.barHorizontalCategoryLabelSkeleton:e.v.barHorizontalCategoryLabel,n),b=s(t,r,f),x=t.map(e=>o(e.color,n,p)),S=e.a({kind:`element`,skeleton:p,colorHostElement:n,onIndexClick:m});return{type:`bar`,data:{labels:t.map(e=>e.label),datasets:[{data:t.map(e=>e.value),backgroundColor:x,hoverBackgroundColor:x,borderWidth:0,hoverBorderWidth:0,barThickness:u,borderRadius:{topRight:d,bottomRight:d}}]},options:{indexAxis:`y`,responsive:!0,maintainAspectRatio:!1,onHover:S.onHover,onClick:S.onClick,interaction:e.o(p,{mode:`index`,axis:`y`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:e.s(p),backgroundColor:_,titleColor:v,bodyColor:v}},scales:a({axisLabelColor:h,categoryLabelColor:y,gridColor:g,xMin:i,xMax:b,xStep:f})},plugins:S.plugins}},p=e=>f(e),m=[{label:`Открыта`,value:48},{label:`В процессе`,value:32},{label:`Ревью`,value:53},{label:`Готова для QA`,value:18},{label:`QA`,value:25},{label:`Готова`,value:0}],h={class:`s-ui-chart-horizontal-bar__canvas-wrap`},g=(0,n.defineComponent)({__name:`SChartHorizontalBar`,props:{items:{default:()=>[]},loading:{type:Boolean,default:!1},xMin:{},xMax:{},xStep:{}},emits:[`barClick`],setup(r,{expose:i,emit:a}){let o=a,s=(0,n.useTemplateRef)(`chartRootRef`),c=(0,n.useTemplateRef)(`chartCanvasRef`),l=(0,n.computed)(()=>r.loading?m:r.items),u=e=>{let t=r.items[e];t&&o(`barClick`,e,t)},d=t.t(`onBarClick`),{chartInstance:f}=e.i({canvasRef:c,config:(0,n.computed)(()=>!r.loading&&r.items.length===0?null:p({items:l.value,colorHostElement:s.value,xMax:r.loading?60:r.xMax,xMin:r.loading?0:r.xMin,xStep:r.loading?10:r.xStep,skeleton:r.loading,onBarClick:d()?u:void 0})),enabled:(0,n.computed)(()=>r.loading||r.items.length>0)}),{exportImage:g}=e.r({chartInstance:f,canvasRef:c,colorHostElement:s});return i({exportImage:g}),(t,i)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:s,class:(0,n.normalizeClass)([`s-ui-chart-horizontal-bar`,{"s-ui-chart-horizontal-bar--skeleton":r.loading}])},[(0,n.createElementVNode)(`div`,h,[(0,n.createVNode)((0,n.unref)(e.t),{loading:r.loading},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:c,class:`s-ui-chart-horizontal-bar__canvas`},null,512)]),_:1},8,[`loading`])])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return g}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./createChartAreaFillGradient-BwsojVzU.cjs"),t=require("./SChartSkeletonHost-Dt5EjQr5.cjs"),n=require("./buildCartesianChartScales-Dck5yBMo.cjs");let r=require("vue");var i=(e,t,n=1)=>{if(typeof window>`u`)return n;let r=t??document.documentElement,i=getComputedStyle(r).getPropertyValue(e).trim(),a=Number.parseFloat(i);return Number.isNaN(a)?n:a},a=5,o=5,s=(e,t,n)=>{if(t)return t;let r=e.reduce((e,t)=>Math.max(e,t.value),0),i=Math.ceil(r/n)*n;return i>0?i:n*5},c=(e,t)=>!t||typeof e!=`number`?e:`${e}%`,l=({points:r,seriesLabel:l,colorHostElement:u,yMax:d,yMin:f,yStep:p=o,skeleton:m=!1})=>{let h=t.w(t.v.axisLabel,u),g=t.w(t.v.grid,u),_=t.w(m?t.v.skeletonSeries:t.v.seriesPrimary,u),v=t.w(m?t.v.skeletonFillStart:t.v.seriesFillStart,u),y=t.w(m?t.v.skeletonFillEnd:t.v.seriesFillEnd,u),b=t.w(t.v.tooltipBackground,u),x=t.w(t.v.tooltipText,u),S=i(m?t.v.skeletonFillOpacity:t.v.seriesFillOpacity,u,.8),C=m&&d?d:s(r,d,p),w=m&&f!==void 0?f:0;return{type:`line`,data:{labels:r.map(e=>e.label),datasets:[{label:l,data:r.map(e=>e.value),borderColor:_,backgroundColor:t=>e.t(t,v,y,S),borderWidth:a,fill:!0,pointRadius:0,pointHoverRadius:4,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:t.o(m,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:t.s(m),backgroundColor:b,titleColor:x,bodyColor:x,displayColors:!1}},scales:n.t({axisLabelColor:h,gridColor:g,yMin:w,yMax:C,yStep:p,formatYAxisTick:e=>c(e,m)})}}},u=[{label:`ноябрь 2025`,value:63},{label:`декабрь 2025`,value:77},{label:`январь 2026`,value:75},{label:`февраль 2026`,value:81},{label:`март 2026`,value:91},{label:`апрель 2026`,value:87}],d={class:`s-ui-chart-line__canvas-wrap`},f=(0,r.defineComponent)({__name:`SChartLine`,props:{points:{default:()=>[]},seriesLabel:{default:`Series`},loading:{type:Boolean,default:!1},yMax:{},yStep:{}},setup(e,{expose:n}){let i=(0,r.useTemplateRef)(`chartRootRef`),a=(0,r.useTemplateRef)(`chartCanvasRef`),o=(0,r.computed)(()=>e.loading?u:e.points),{chartInstance:s}=t.i({canvasRef:a,config:(0,r.computed)(()=>!e.loading&&e.points.length===0?null:l({points:o.value,seriesLabel:e.seriesLabel,colorHostElement:i.value,yMax:e.loading?100:e.yMax,yMin:e.loading?50:void 0,yStep:e.loading?10:e.yStep,skeleton:e.loading})),enabled:(0,r.computed)(()=>e.loading||e.points.length>0)}),{exportImage:c}=t.r({chartInstance:s,canvasRef:a,colorHostElement:i});return n({exportImage:c}),(n,o)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:i,class:(0,r.normalizeClass)([`s-ui-chart-line`,{"s-ui-chart-line--skeleton":e.loading}])},[(0,r.createElementVNode)(`div`,d,[(0,r.createVNode)((0,r.unref)(t.t),{loading:e.loading},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:a,class:`s-ui-chart-line__canvas`},null,512)]),_:1},8,[`loading`])])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|