@shtabapp/ui-kit 1.44.0 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/{SChartBurnup-DhuCNXhU.cjs → SChartBurnup-BhCS06uF.cjs} +1 -1
- package/dist/SChartBurnup-CG239MJx.js +251 -0
- package/dist/SChartHorizontalBar-DnKbf_9E.cjs +1 -0
- package/dist/SChartHorizontalBar-DqTZ4H-9.js +175 -0
- package/dist/SChartLegend-DGtjd6zV.cjs +1 -0
- package/dist/SChartLegend-oZoF8XK7.js +42 -0
- package/dist/SChartLine-CEnRbnVo.cjs +1 -0
- package/dist/SChartLine-CQhbtAjJ.js +129 -0
- package/dist/SChartMultiLine-B6GldTYv.cjs +1 -0
- package/dist/SChartMultiLine-CPEglksk.js +198 -0
- package/dist/SChartPie-CQyENNM6.cjs +1 -0
- package/dist/SChartPie-DXHCXNEs.js +168 -0
- package/dist/{SChartProgress-Zdphet8I.js → SChartProgress-BwDuidgB.js} +54 -50
- package/dist/{SChartProgress-QsGTZ8kT.cjs → SChartProgress-CMcM6yvT.cjs} +1 -1
- package/dist/SChartSkeletonHost-BlIYGj-7.cjs +1 -0
- package/dist/{SChartSkeletonHost-CecfQ3Ye.js → SChartSkeletonHost-DSFyP_DN.js} +150 -89
- package/dist/SChartStackedArea-BR7W44h6.js +254 -0
- package/dist/SChartStackedArea-DHSamqau.cjs +1 -0
- package/dist/SChartStackedBar-B3HcO4UQ.cjs +1 -0
- package/dist/SChartStackedBar-BbYna5KB.js +245 -0
- package/dist/components/SChartBurnup/SChartBurnup.vue.d.ts +4 -1
- package/dist/components/SChartBurnup/SChartBurnup.vue.d.ts.map +1 -1
- package/dist/components/SChartHorizontalBar/SChartHorizontalBar.vue.d.ts +9 -2
- package/dist/components/SChartHorizontalBar/SChartHorizontalBar.vue.d.ts.map +1 -1
- package/dist/components/SChartHorizontalBar/utils/buildSChartHorizontalBarConfig.d.ts +1 -0
- package/dist/components/SChartHorizontalBar/utils/buildSChartHorizontalBarConfig.d.ts.map +1 -1
- package/dist/components/SChartLegend/SChartLegend.types.d.ts +2 -0
- package/dist/components/SChartLegend/SChartLegend.types.d.ts.map +1 -1
- package/dist/components/SChartLegend/SChartLegend.vue.d.ts +5 -1
- package/dist/components/SChartLegend/SChartLegend.vue.d.ts.map +1 -1
- package/dist/components/SChartLine/SChartLine.vue.d.ts +4 -1
- package/dist/components/SChartLine/SChartLine.vue.d.ts.map +1 -1
- package/dist/components/SChartMultiLine/SChartMultiLine.vue.d.ts +9 -2
- package/dist/components/SChartMultiLine/SChartMultiLine.vue.d.ts.map +1 -1
- package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts +2 -1
- package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts.map +1 -1
- package/dist/components/SChartPie/SChartPie.vue.d.ts +9 -2
- package/dist/components/SChartPie/SChartPie.vue.d.ts.map +1 -1
- package/dist/components/SChartPie/utils/buildPieChartConfig.d.ts +2 -1
- package/dist/components/SChartPie/utils/buildPieChartConfig.d.ts.map +1 -1
- package/dist/components/SChartProgress/SChartProgress.vue.d.ts +4 -1
- package/dist/components/SChartProgress/SChartProgress.vue.d.ts.map +1 -1
- package/dist/components/SChartSegmentedBar/SChartSegmentedBar.types.d.ts +11 -0
- package/dist/components/SChartSegmentedBar/SChartSegmentedBar.types.d.ts.map +1 -0
- package/dist/components/SChartSegmentedBar/SChartSegmentedBar.vue.d.ts +12 -0
- package/dist/components/SChartSegmentedBar/SChartSegmentedBar.vue.d.ts.map +1 -0
- package/dist/components/SChartSegmentedBar/index.d.ts +3 -0
- package/dist/components/SChartSegmentedBar/index.d.ts.map +1 -0
- package/dist/components/SChartSegmentedBar/utils/buildSegmentedBarChartConfig.d.ts +11 -0
- package/dist/components/SChartSegmentedBar/utils/buildSegmentedBarChartConfig.d.ts.map +1 -0
- package/dist/components/SChartSegmentedBar/utils/createSegmentedBarBadgePlugin.d.ts +3 -0
- package/dist/components/SChartSegmentedBar/utils/createSegmentedBarBadgePlugin.d.ts.map +1 -0
- package/dist/components/SChartSegmentedBar/utils/skeletonSegments.d.ts +3 -0
- package/dist/components/SChartSegmentedBar/utils/skeletonSegments.d.ts.map +1 -0
- package/dist/components/SChartStackedArea/SChartStackedArea.vue.d.ts +9 -2
- package/dist/components/SChartStackedArea/SChartStackedArea.vue.d.ts.map +1 -1
- package/dist/components/SChartStackedArea/utils/buildStackedAreaChartConfig.d.ts +2 -1
- package/dist/components/SChartStackedArea/utils/buildStackedAreaChartConfig.d.ts.map +1 -1
- package/dist/components/SChartStackedBar/SChartStackedBar.vue.d.ts +9 -2
- package/dist/components/SChartStackedBar/SChartStackedBar.vue.d.ts.map +1 -1
- package/dist/components/SChartStackedBar/utils/buildStackedBarChartConfig.d.ts +2 -1
- package/dist/components/SChartStackedBar/utils/buildStackedBarChartConfig.d.ts.map +1 -1
- package/dist/components/SChartWidget/SChartWidget.types.d.ts +11 -0
- package/dist/components/SChartWidget/SChartWidget.types.d.ts.map +1 -0
- package/dist/components/SChartWidget/SChartWidget.vue.d.ts +28 -0
- package/dist/components/SChartWidget/SChartWidget.vue.d.ts.map +1 -0
- package/dist/components/SChartWidget/index.d.ts +3 -0
- package/dist/components/SChartWidget/index.d.ts.map +1 -0
- package/dist/composables/useChartInteractivity.d.ts +14 -0
- package/dist/composables/useChartInteractivity.d.ts.map +1 -0
- package/dist/composables/useHasListener.d.ts +2 -0
- package/dist/composables/useHasListener.d.ts.map +1 -0
- package/dist/{createChartCrosshairPlugin-HfMMUP5O.cjs → createChartCrosshairPlugin-DdLyEWI0.cjs} +1 -1
- package/dist/{createChartCrosshairPlugin-BC0IDCn3.js → createChartCrosshairPlugin-q3U4ePnf.js} +2 -2
- package/dist/entries/chart-burnup.cjs +1 -1
- package/dist/entries/chart-burnup.js +1 -1
- package/dist/entries/chart-horizontal-bar.cjs +1 -1
- package/dist/entries/chart-horizontal-bar.js +1 -1
- package/dist/entries/chart-line.cjs +1 -1
- package/dist/entries/chart-line.js +1 -1
- package/dist/entries/chart-multi-line.cjs +1 -1
- package/dist/entries/chart-multi-line.js +1 -1
- package/dist/entries/chart-pie.cjs +1 -1
- package/dist/entries/chart-pie.js +1 -1
- package/dist/entries/chart-progress.cjs +1 -1
- package/dist/entries/chart-progress.js +1 -1
- package/dist/entries/chart-stacked-area.cjs +1 -1
- package/dist/entries/chart-stacked-area.js +1 -1
- package/dist/entries/chart-stacked-bar.cjs +1 -1
- package/dist/entries/chart-stacked-bar.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +434 -162
- package/dist/resolveSeriesPaletteColor-YACKW1NO.cjs +1 -0
- package/dist/{resolveSeriesPaletteColor-m8HQ9qwV.js → resolveSeriesPaletteColor-fuhGbjFO.js} +1 -1
- package/dist/{resolveStackedChartContext-DdraOueU.js → resolveStackedChartContext-BiIGZ2or.js} +5 -5
- package/dist/{resolveStackedChartContext-BywAnZUu.cjs → resolveStackedChartContext-Bp75eU_I.cjs} +1 -1
- package/dist/uikit-components.css +1 -1
- package/dist/useHasListener-BPgtbbo6.cjs +1 -0
- package/dist/useHasListener-RSjlUyqH.js +8 -0
- package/dist/utils/chart/core/chartCssVariables.d.ts +2 -0
- package/dist/utils/chart/core/chartCssVariables.d.ts.map +1 -1
- package/dist/utils/chart/core/chartInteractivity.d.ts +41 -0
- package/dist/utils/chart/core/chartInteractivity.d.ts.map +1 -0
- package/dist/utils/chart/horizontalBar/buildHorizontalBarChartConfig.d.ts +2 -1
- package/dist/utils/chart/horizontalBar/buildHorizontalBarChartConfig.d.ts.map +1 -1
- package/dist/utils/chart/index.d.ts +1 -0
- package/dist/utils/chart/index.d.ts.map +1 -1
- package/dist/utils/chart/segmentedBar/resolveSegmentedBarSegmentColor.d.ts +2 -0
- package/dist/utils/chart/segmentedBar/resolveSegmentedBarSegmentColor.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/SChartBurnup-DYBnJMnm.js +0 -247
- package/dist/SChartHorizontalBar-DMBzyz9x.cjs +0 -1
- package/dist/SChartHorizontalBar-bm3Jexa3.js +0 -156
- package/dist/SChartLegend-Chr0IZWN.js +0 -30
- package/dist/SChartLegend-DXFXKXCm.cjs +0 -1
- package/dist/SChartLine-CiREb4H_.js +0 -125
- package/dist/SChartLine-P57XRR2o.cjs +0 -1
- package/dist/SChartMultiLine-3cdB0U12.js +0 -166
- package/dist/SChartMultiLine-BW1kITlR.cjs +0 -1
- package/dist/SChartPie-55wx2zRi.cjs +0 -1
- package/dist/SChartPie-Dc_gjzIl.js +0 -143
- package/dist/SChartSkeletonHost-CfM0zolj.cjs +0 -1
- package/dist/SChartStackedArea-BaJ963lU.cjs +0 -1
- package/dist/SChartStackedArea-cjN9gECV.js +0 -219
- package/dist/SChartStackedBar-0jGICBA0.js +0 -217
- package/dist/SChartStackedBar-j9WyOnsL.cjs +0 -1
- package/dist/resolveSeriesPaletteColor-BcFyrhh0.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -30,60 +30,87 @@ import { n as Ze, t as Qe } from "./SToggle-T7FKzMSo.js";
|
|
|
30
30
|
import { n as $e, t as et } from "./SInlineInput-DHq5BNPn.js";
|
|
31
31
|
import { t as tt } from "./STextarea-ASdLqfpC.js";
|
|
32
32
|
import { n as nt, r as rt, t as it } from "./SPhotoEdit-bXKHcP3x.js";
|
|
33
|
-
import {
|
|
34
|
-
import { t as
|
|
35
|
-
import { t as
|
|
36
|
-
import { t as
|
|
37
|
-
import { t as
|
|
38
|
-
import { t as
|
|
39
|
-
import { t as
|
|
40
|
-
import { t as
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
33
|
+
import { a as at, i as ot, n as st, r as ct, t as lt, v as T, w as E } from "./SChartSkeletonHost-DSFyP_DN.js";
|
|
34
|
+
import { t as ut } from "./SChartLine-CQhbtAjJ.js";
|
|
35
|
+
import { t as dt } from "./resolveSeriesPaletteColor-fuhGbjFO.js";
|
|
36
|
+
import { t as ft } from "./SChartStackedArea-BR7W44h6.js";
|
|
37
|
+
import { t as pt } from "./SChartStackedBar-BbYna5KB.js";
|
|
38
|
+
import { t as mt } from "./SChartHorizontalBar-DqTZ4H-9.js";
|
|
39
|
+
import { t as ht } from "./SChartPie-DXHCXNEs.js";
|
|
40
|
+
import { t as gt } from "./SChartMultiLine-CPEglksk.js";
|
|
41
|
+
import { t as _t } from "./SChartBurnup-CG239MJx.js";
|
|
42
|
+
import { t as vt } from "./SChartProgress-BwDuidgB.js";
|
|
43
|
+
import { t as yt } from "./SChartLegend-oZoF8XK7.js";
|
|
44
|
+
import { t as bt } from "./useHasListener-RSjlUyqH.js";
|
|
45
|
+
import { Fragment as xt, Teleport as St, computed as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createSlots as M, createTextVNode as N, createVNode as P, defineComponent as F, mergeModels as Ct, mergeProps as wt, normalizeClass as I, normalizeStyle as L, onMounted as Tt, openBlock as R, ref as z, renderList as Et, renderSlot as B, resolveDynamicComponent as Dt, shallowRef as Ot, toDisplayString as V, unref as H, useModel as kt, useSlots as U, useTemplateRef as At, watch as jt, withCtx as W } from "vue";
|
|
46
|
+
import { ESIconName as G, SIcon as Mt, createUiKit as Nt, setUiKitLocale as Pt, uiKitLocaleEn as Ft, uiKitLocaleRu as It, useUiKitI18n as Lt, useUiKitI18n as Rt } from "@shtabapp/ui-kit-primitives";
|
|
47
|
+
import { useResizeObserver as zt } from "@vueuse/core";
|
|
44
48
|
export * from "@shtabapp/ui-kit-primitives";
|
|
45
49
|
export * from "@shtabapp/ui-kit-tokens";
|
|
46
|
-
//#region src/
|
|
47
|
-
var
|
|
50
|
+
//#region src/utils/chart/segmentedBar/resolveSegmentedBarSegmentColor.ts
|
|
51
|
+
var Bt = [
|
|
52
|
+
"--s-ui-chart-segmented-bar-palette-1",
|
|
53
|
+
"--s-ui-chart-segmented-bar-palette-2",
|
|
54
|
+
"--s-ui-chart-segmented-bar-palette-3",
|
|
55
|
+
"--s-ui-chart-segmented-bar-palette-4",
|
|
56
|
+
"--s-ui-chart-segmented-bar-palette-5",
|
|
57
|
+
"--s-ui-chart-segmented-bar-palette-6",
|
|
58
|
+
"--s-ui-chart-segmented-bar-palette-7",
|
|
59
|
+
"--s-ui-chart-segmented-bar-palette-8"
|
|
60
|
+
], Vt = [
|
|
61
|
+
"--s-ui-chart-segmented-bar-skeleton-palette-1",
|
|
62
|
+
"--s-ui-chart-segmented-bar-skeleton-palette-2",
|
|
63
|
+
"--s-ui-chart-segmented-bar-skeleton-palette-3",
|
|
64
|
+
"--s-ui-chart-segmented-bar-skeleton-palette-4",
|
|
65
|
+
"--s-ui-chart-segmented-bar-skeleton-palette-5",
|
|
66
|
+
"--s-ui-chart-segmented-bar-skeleton-palette-6",
|
|
67
|
+
"--s-ui-chart-segmented-bar-skeleton-palette-7",
|
|
68
|
+
"--s-ui-chart-segmented-bar-skeleton-palette-8"
|
|
69
|
+
], Ht = (e, t, n, r = !1) => dt(e, t, n, r, {
|
|
70
|
+
palette: Bt,
|
|
71
|
+
paletteFallback: Bt[0],
|
|
72
|
+
skeletonPalette: Vt,
|
|
73
|
+
skeletonFallback: Vt[0]
|
|
74
|
+
}), K = /* @__PURE__ */ function(e) {
|
|
48
75
|
return e.INFO_ACCENT = "info-accent", e.INFO_NORMAL = "info-normal", e.SUCCESS = "success", e.WARNING = "warning", e.DANGER = "danger", e.BILLING = "billing", e;
|
|
49
|
-
}({}),
|
|
76
|
+
}({}), q = /* @__PURE__ */ function(e) {
|
|
50
77
|
return e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e;
|
|
51
|
-
}({}),
|
|
78
|
+
}({}), J = /* @__PURE__ */ function(e) {
|
|
52
79
|
return e.ICON = "icon", e.AVATAR = "avatar", e;
|
|
53
|
-
}({}),
|
|
80
|
+
}({}), Y = /* @__PURE__ */ function(e) {
|
|
54
81
|
return e.BANNER = "banner", e.TOAST = "toast", e;
|
|
55
|
-
}({}),
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
},
|
|
82
|
+
}({}), Ut = {
|
|
83
|
+
[K.INFO_ACCENT]: G.infoCircle,
|
|
84
|
+
[K.INFO_NORMAL]: G.infoCircle,
|
|
85
|
+
[K.SUCCESS]: G.checkCircle,
|
|
86
|
+
[K.WARNING]: G.alertCircle,
|
|
87
|
+
[K.DANGER]: G.dangerCircleFill,
|
|
88
|
+
[K.BILLING]: G.infoCircle
|
|
89
|
+
}, Wt = (e, t) => t || Ut[e], Gt = ["role"], Kt = { class: "s-ui-notification__body" }, qt = {
|
|
63
90
|
key: 0,
|
|
64
91
|
class: "s-ui-notification__leftside"
|
|
65
|
-
},
|
|
92
|
+
}, Jt = {
|
|
66
93
|
key: 0,
|
|
67
94
|
class: "s-ui-notification__icon"
|
|
68
|
-
},
|
|
95
|
+
}, Yt = { class: "s-ui-notification__content" }, Xt = { class: "s-ui-notification__title-row" }, Zt = { class: "s-ui-notification__title s-ui-typography-label-14-medium" }, Qt = {
|
|
69
96
|
key: 0,
|
|
70
97
|
class: "s-ui-notification__description-block"
|
|
71
|
-
},
|
|
98
|
+
}, $t = {
|
|
72
99
|
key: 0,
|
|
73
100
|
class: "s-ui-notification__description s-ui-typography-label-12-medium"
|
|
74
|
-
},
|
|
101
|
+
}, en = {
|
|
75
102
|
key: 1,
|
|
76
103
|
class: "s-ui-notification__actions-stack"
|
|
77
|
-
},
|
|
104
|
+
}, tn = {
|
|
78
105
|
key: 1,
|
|
79
106
|
class: "s-ui-notification__actions-row"
|
|
80
|
-
},
|
|
107
|
+
}, nn = /* @__PURE__ */ F({
|
|
81
108
|
__name: "SNotification",
|
|
82
109
|
props: {
|
|
83
|
-
type: { default: () =>
|
|
84
|
-
layout: { default: () =>
|
|
85
|
-
leftside: { default: () =>
|
|
86
|
-
surface: { default: () =>
|
|
110
|
+
type: { default: () => K.INFO_ACCENT },
|
|
111
|
+
layout: { default: () => q.HORIZONTAL },
|
|
112
|
+
leftside: { default: () => J.ICON },
|
|
113
|
+
surface: { default: () => Y.BANNER },
|
|
87
114
|
title: {},
|
|
88
115
|
description: {},
|
|
89
116
|
linkText: {},
|
|
@@ -110,14 +137,14 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
110
137
|
"secondaryAction"
|
|
111
138
|
],
|
|
112
139
|
setup(e, { emit: t }) {
|
|
113
|
-
let n = t, r =
|
|
140
|
+
let n = t, r = U(), i = D(() => [
|
|
114
141
|
`s-ui-notification--type-${e.type}`,
|
|
115
142
|
`s-ui-notification--layout-${e.layout}`,
|
|
116
143
|
`s-ui-notification--surface-${e.surface}`
|
|
117
|
-
]), a =
|
|
144
|
+
]), a = D(() => {
|
|
118
145
|
let t = {};
|
|
119
146
|
return e.width && (t.width = typeof e.width == "number" ? `${e.width}px` : e.width), e.maxWidth && (t.maxWidth = typeof e.maxWidth == "number" ? `${e.maxWidth}px` : e.maxWidth), t;
|
|
120
|
-
}), s =
|
|
147
|
+
}), s = D(() => e.type === K.DANGER ? "alert" : "status"), l = D(() => Wt(e.type, e.icon)), u = D(() => e.type === K.BILLING), d = D(() => !!(e.leftside === J.AVATAR && e.avatar || e.leftside === J.ICON)), f = D(() => !!(e.description || e.linkText || r.description)), p = D(() => e.showPrimaryButton && (e.primaryButtonText || e.secondaryButtonText)), m = D(() => e.showPrimaryButton && e.primaryButtonText || e.closable), h = D(() => e.type === K.BILLING ? C.MAJOR : C.OUTLINED), g = D(() => e.type === K.BILLING ? S.BILLING : S.MAIN), _ = () => {
|
|
121
148
|
n("close");
|
|
122
149
|
}, v = () => {
|
|
123
150
|
n("linkClick");
|
|
@@ -126,35 +153,35 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
126
153
|
}, b = () => {
|
|
127
154
|
n("secondaryAction");
|
|
128
155
|
};
|
|
129
|
-
return (t, n) => (
|
|
130
|
-
class:
|
|
131
|
-
style:
|
|
156
|
+
return (t, n) => (R(), A("div", {
|
|
157
|
+
class: I(["s-ui-notification", i.value]),
|
|
158
|
+
style: L(a.value),
|
|
132
159
|
role: s.value
|
|
133
|
-
}, [
|
|
134
|
-
d.value ? (
|
|
160
|
+
}, [j("div", Kt, [
|
|
161
|
+
d.value ? (R(), A("div", qt, [e.leftside === H(J).ICON ? (R(), A("div", Jt, [P(H(Mt), {
|
|
135
162
|
name: l.value,
|
|
136
163
|
size: 16,
|
|
137
164
|
billing: u.value
|
|
138
|
-
}, null, 8, ["name", "billing"])])) : e.leftside ===
|
|
165
|
+
}, null, 8, ["name", "billing"])])) : e.leftside === H(J).AVATAR && e.avatar ? (R(), O(H(c), {
|
|
139
166
|
key: 1,
|
|
140
167
|
name: e.avatar.name,
|
|
141
168
|
src: e.avatar.src,
|
|
142
169
|
badge: e.avatar.badge,
|
|
143
|
-
size:
|
|
170
|
+
size: H(o).SIZE_20,
|
|
144
171
|
showName: !1
|
|
145
172
|
}, null, 8, [
|
|
146
173
|
"name",
|
|
147
174
|
"src",
|
|
148
175
|
"badge",
|
|
149
176
|
"size"
|
|
150
|
-
])) :
|
|
151
|
-
|
|
152
|
-
|
|
177
|
+
])) : k("", !0)])) : k("", !0),
|
|
178
|
+
j("div", Yt, [
|
|
179
|
+
j("div", Xt, [j("span", Zt, [B(t.$slots, "title", {}, () => [N(V(e.title), 1)])]), e.layout === H(q).VERTICAL && e.closable ? (R(), O(H(w), {
|
|
153
180
|
key: 0,
|
|
154
181
|
class: "s-ui-notification__close",
|
|
155
|
-
appearance:
|
|
156
|
-
variant:
|
|
157
|
-
size:
|
|
182
|
+
appearance: H(C).BARE,
|
|
183
|
+
variant: H(S).NEUTRAL,
|
|
184
|
+
size: H(x).SMALL,
|
|
158
185
|
"aria-label": e.closeAriaLabel,
|
|
159
186
|
icon: "closeMini",
|
|
160
187
|
onClick: _
|
|
@@ -163,69 +190,69 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
163
190
|
"variant",
|
|
164
191
|
"size",
|
|
165
192
|
"aria-label"
|
|
166
|
-
])) :
|
|
167
|
-
f.value ? (
|
|
193
|
+
])) : k("", !0)]),
|
|
194
|
+
f.value ? (R(), A("div", Qt, [e.description || H(r).description ? (R(), A("span", $t, [B(t.$slots, "description", {}, () => [N(V(e.description), 1)])])) : k("", !0), e.linkText ? (R(), O(H(w), {
|
|
168
195
|
key: 1,
|
|
169
196
|
class: "s-ui-notification__link",
|
|
170
|
-
appearance:
|
|
171
|
-
variant:
|
|
172
|
-
size:
|
|
197
|
+
appearance: H(C).BARE,
|
|
198
|
+
variant: H(S).MAIN,
|
|
199
|
+
size: H(x).SMALL,
|
|
173
200
|
onClick: v
|
|
174
201
|
}, {
|
|
175
|
-
default:
|
|
202
|
+
default: W(() => [N(V(e.linkText), 1)]),
|
|
176
203
|
_: 1
|
|
177
204
|
}, 8, [
|
|
178
205
|
"appearance",
|
|
179
206
|
"variant",
|
|
180
207
|
"size"
|
|
181
|
-
])) :
|
|
182
|
-
e.layout ===
|
|
208
|
+
])) : k("", !0)])) : k("", !0),
|
|
209
|
+
e.layout === H(q).VERTICAL && p.value ? (R(), A("div", en, [e.showPrimaryButton && e.primaryButtonText ? (R(), O(H(w), {
|
|
183
210
|
key: 0,
|
|
184
211
|
appearance: h.value,
|
|
185
212
|
variant: g.value,
|
|
186
|
-
size:
|
|
213
|
+
size: H(x).SMALL,
|
|
187
214
|
onClick: y
|
|
188
215
|
}, {
|
|
189
|
-
default:
|
|
216
|
+
default: W(() => [N(V(e.primaryButtonText), 1)]),
|
|
190
217
|
_: 1
|
|
191
218
|
}, 8, [
|
|
192
219
|
"appearance",
|
|
193
220
|
"variant",
|
|
194
221
|
"size"
|
|
195
|
-
])) :
|
|
222
|
+
])) : k("", !0), e.showPrimaryButton && e.secondaryButtonText ? (R(), O(H(w), {
|
|
196
223
|
key: 1,
|
|
197
|
-
appearance:
|
|
198
|
-
variant:
|
|
199
|
-
size:
|
|
224
|
+
appearance: H(C).BARE,
|
|
225
|
+
variant: H(S).NEUTRAL,
|
|
226
|
+
size: H(x).SMALL,
|
|
200
227
|
onClick: b
|
|
201
228
|
}, {
|
|
202
|
-
default:
|
|
229
|
+
default: W(() => [N(V(e.secondaryButtonText), 1)]),
|
|
203
230
|
_: 1
|
|
204
231
|
}, 8, [
|
|
205
232
|
"appearance",
|
|
206
233
|
"variant",
|
|
207
234
|
"size"
|
|
208
|
-
])) :
|
|
235
|
+
])) : k("", !0)])) : k("", !0)
|
|
209
236
|
]),
|
|
210
|
-
e.layout ===
|
|
237
|
+
e.layout === H(q).HORIZONTAL && m.value ? (R(), A("div", tn, [e.showPrimaryButton && e.primaryButtonText ? (R(), O(H(w), {
|
|
211
238
|
key: 0,
|
|
212
239
|
appearance: h.value,
|
|
213
240
|
variant: g.value,
|
|
214
|
-
size:
|
|
241
|
+
size: H(x).SMALL,
|
|
215
242
|
onClick: y
|
|
216
243
|
}, {
|
|
217
|
-
default:
|
|
244
|
+
default: W(() => [N(V(e.primaryButtonText), 1)]),
|
|
218
245
|
_: 1
|
|
219
246
|
}, 8, [
|
|
220
247
|
"appearance",
|
|
221
248
|
"variant",
|
|
222
249
|
"size"
|
|
223
|
-
])) :
|
|
250
|
+
])) : k("", !0), e.layout === H(q).HORIZONTAL && e.closable ? (R(), O(H(w), {
|
|
224
251
|
key: 1,
|
|
225
252
|
class: "s-ui-notification__close",
|
|
226
|
-
appearance:
|
|
227
|
-
variant:
|
|
228
|
-
size:
|
|
253
|
+
appearance: H(C).BARE,
|
|
254
|
+
variant: H(S).NEUTRAL,
|
|
255
|
+
size: H(x).SMALL,
|
|
229
256
|
"aria-label": e.closeAriaLabel,
|
|
230
257
|
icon: "closeMini",
|
|
231
258
|
onClick: _
|
|
@@ -234,15 +261,15 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
234
261
|
"variant",
|
|
235
262
|
"size",
|
|
236
263
|
"aria-label"
|
|
237
|
-
])) :
|
|
238
|
-
])], 14,
|
|
264
|
+
])) : k("", !0)])) : k("", !0)
|
|
265
|
+
])], 14, Gt));
|
|
239
266
|
}
|
|
240
|
-
}),
|
|
267
|
+
}), rn = /* @__PURE__ */ F({
|
|
241
268
|
__name: "SBanner",
|
|
242
269
|
props: {
|
|
243
|
-
type: { default: () =>
|
|
244
|
-
layout: { default: () =>
|
|
245
|
-
leftside: { default: () =>
|
|
270
|
+
type: { default: () => K.INFO_ACCENT },
|
|
271
|
+
layout: { default: () => q.HORIZONTAL },
|
|
272
|
+
leftside: { default: () => J.ICON },
|
|
246
273
|
title: {},
|
|
247
274
|
description: {},
|
|
248
275
|
linkText: {},
|
|
@@ -268,14 +295,14 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
268
295
|
"secondaryAction"
|
|
269
296
|
],
|
|
270
297
|
setup(e, { emit: t }) {
|
|
271
|
-
let n = t, r =
|
|
272
|
-
return (t, i) => (
|
|
298
|
+
let n = t, r = U();
|
|
299
|
+
return (t, i) => (R(), O(nn, {
|
|
273
300
|
class: "s-ui-banner",
|
|
274
301
|
"data-qa": "ui:banner",
|
|
275
302
|
type: e.type,
|
|
276
303
|
layout: e.layout,
|
|
277
304
|
leftside: e.leftside,
|
|
278
|
-
surface:
|
|
305
|
+
surface: H(Y).BANNER,
|
|
279
306
|
title: e.title,
|
|
280
307
|
description: e.description,
|
|
281
308
|
linkText: e.linkText,
|
|
@@ -291,13 +318,13 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
291
318
|
onLinkClick: i[1] ||= (e) => n("linkClick"),
|
|
292
319
|
onPrimaryAction: i[2] ||= (e) => n("primaryAction"),
|
|
293
320
|
onSecondaryAction: i[3] ||= (e) => n("secondaryAction")
|
|
294
|
-
},
|
|
321
|
+
}, M({ _: 2 }, [H(r).title ? {
|
|
295
322
|
name: "title",
|
|
296
|
-
fn:
|
|
323
|
+
fn: W(() => [B(t.$slots, "title")]),
|
|
297
324
|
key: "0"
|
|
298
|
-
} : void 0,
|
|
325
|
+
} : void 0, H(r).description ? {
|
|
299
326
|
name: "description",
|
|
300
|
-
fn:
|
|
327
|
+
fn: W(() => [B(t.$slots, "description")]),
|
|
301
328
|
key: "1"
|
|
302
329
|
} : void 0]), 1032, [
|
|
303
330
|
"type",
|
|
@@ -317,12 +344,12 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
317
344
|
"maxWidth"
|
|
318
345
|
]));
|
|
319
346
|
}
|
|
320
|
-
}),
|
|
347
|
+
}), an = /* @__PURE__ */ F({
|
|
321
348
|
__name: "SToast",
|
|
322
349
|
props: {
|
|
323
|
-
type: { default: () =>
|
|
324
|
-
layout: { default: () =>
|
|
325
|
-
leftside: { default: () =>
|
|
350
|
+
type: { default: () => K.INFO_ACCENT },
|
|
351
|
+
layout: { default: () => q.HORIZONTAL },
|
|
352
|
+
leftside: { default: () => J.ICON },
|
|
326
353
|
title: {},
|
|
327
354
|
description: {},
|
|
328
355
|
linkText: {},
|
|
@@ -348,14 +375,14 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
348
375
|
"secondaryAction"
|
|
349
376
|
],
|
|
350
377
|
setup(e, { emit: t }) {
|
|
351
|
-
let n = t, r =
|
|
352
|
-
return (t, a) => (
|
|
378
|
+
let n = t, r = U(), i = D(() => e.width ?? 360);
|
|
379
|
+
return (t, a) => (R(), O(nn, {
|
|
353
380
|
class: "s-ui-toast",
|
|
354
381
|
"data-qa": "ui:toast",
|
|
355
382
|
type: e.type,
|
|
356
383
|
layout: e.layout,
|
|
357
384
|
leftside: e.leftside,
|
|
358
|
-
surface:
|
|
385
|
+
surface: H(Y).TOAST,
|
|
359
386
|
title: e.title,
|
|
360
387
|
description: e.description,
|
|
361
388
|
linkText: e.linkText,
|
|
@@ -371,13 +398,13 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
371
398
|
onLinkClick: a[1] ||= (e) => n("linkClick"),
|
|
372
399
|
onPrimaryAction: a[2] ||= (e) => n("primaryAction"),
|
|
373
400
|
onSecondaryAction: a[3] ||= (e) => n("secondaryAction")
|
|
374
|
-
},
|
|
401
|
+
}, M({ _: 2 }, [H(r).title ? {
|
|
375
402
|
name: "title",
|
|
376
|
-
fn:
|
|
403
|
+
fn: W(() => [B(t.$slots, "title")]),
|
|
377
404
|
key: "0"
|
|
378
|
-
} : void 0,
|
|
405
|
+
} : void 0, H(r).description ? {
|
|
379
406
|
name: "description",
|
|
380
|
-
fn:
|
|
407
|
+
fn: W(() => [B(t.$slots, "description")]),
|
|
381
408
|
key: "1"
|
|
382
409
|
} : void 0]), 1032, [
|
|
383
410
|
"type",
|
|
@@ -397,13 +424,13 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
397
424
|
"width"
|
|
398
425
|
]));
|
|
399
426
|
}
|
|
400
|
-
}),
|
|
427
|
+
}), on = .05, sn = [
|
|
401
428
|
"data-mounted",
|
|
402
429
|
"data-front",
|
|
403
430
|
"data-expanded",
|
|
404
431
|
"data-removed",
|
|
405
432
|
"data-visible"
|
|
406
|
-
],
|
|
433
|
+
], cn = /* @__PURE__ */ F({
|
|
407
434
|
__name: "SToastProviderToast",
|
|
408
435
|
props: {
|
|
409
436
|
index: {},
|
|
@@ -416,7 +443,7 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
416
443
|
},
|
|
417
444
|
emits: ["heightChange"],
|
|
418
445
|
setup(e, { emit: t }) {
|
|
419
|
-
let n = t, r =
|
|
446
|
+
let n = t, r = z(null), i = z(0), a = z(!1), o = D(() => e.index === 0), s = D(() => 1 - e.index * on), c = D(() => ({
|
|
420
447
|
"--s-ui-toast-provider-toasts-before": String(e.index),
|
|
421
448
|
"--s-ui-toast-provider-lift-amount": `${e.stackPeek * -1}px`,
|
|
422
449
|
"--s-ui-toast-provider-front-toast-height": `${e.frontToastHeight}px`,
|
|
@@ -425,95 +452,95 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
425
452
|
"--s-ui-toast-provider-stack-scale": String(s.value),
|
|
426
453
|
zIndex: String(1e3 - e.index)
|
|
427
454
|
}));
|
|
428
|
-
return
|
|
455
|
+
return zt(r, (e) => {
|
|
429
456
|
let t = e[0]?.contentRect.height ?? 0;
|
|
430
457
|
t !== i.value && (i.value = t, n("heightChange", t));
|
|
431
|
-
}),
|
|
458
|
+
}), Tt(() => {
|
|
432
459
|
requestAnimationFrame(() => {
|
|
433
460
|
requestAnimationFrame(() => {
|
|
434
461
|
a.value = !0;
|
|
435
462
|
});
|
|
436
463
|
});
|
|
437
|
-
}), (t, n) => (
|
|
464
|
+
}), (t, n) => (R(), A("div", {
|
|
438
465
|
class: "s-ui-toast-provider__toast",
|
|
439
466
|
"data-mounted": a.value,
|
|
440
467
|
"data-front": o.value,
|
|
441
468
|
"data-expanded": e.expanded,
|
|
442
469
|
"data-removed": e.removed,
|
|
443
470
|
"data-visible": e.visible,
|
|
444
|
-
style:
|
|
445
|
-
}, [
|
|
471
|
+
style: L(c.value)
|
|
472
|
+
}, [j("div", {
|
|
446
473
|
ref_key: "contentRef",
|
|
447
474
|
ref: r,
|
|
448
475
|
class: "s-ui-toast-provider__toast-content"
|
|
449
|
-
}, [
|
|
476
|
+
}, [B(t.$slots, "default")], 512)], 12, sn));
|
|
450
477
|
}
|
|
451
|
-
}),
|
|
452
|
-
let n =
|
|
453
|
-
return n > 1e4 ?
|
|
454
|
-
},
|
|
455
|
-
type:
|
|
456
|
-
layout:
|
|
457
|
-
leftside:
|
|
478
|
+
}), ln = 4e3, un = 1e4, dn = 50, fn = (e, t) => {
|
|
479
|
+
let n = ln + (e.length + (t?.length ?? 0)) * 50;
|
|
480
|
+
return n > 1e4 ? un : n;
|
|
481
|
+
}, X = Ot([]), Z = /* @__PURE__ */ new Map(), pn = 0, mn = {
|
|
482
|
+
type: K.INFO_ACCENT,
|
|
483
|
+
layout: q.HORIZONTAL,
|
|
484
|
+
leftside: J.ICON,
|
|
458
485
|
showPrimaryButton: !1,
|
|
459
486
|
closable: !0
|
|
460
|
-
},
|
|
461
|
-
let t =
|
|
462
|
-
t && (window.clearTimeout(t),
|
|
463
|
-
},
|
|
464
|
-
|
|
465
|
-
let t = e.duration === void 0 ?
|
|
487
|
+
}, hn = () => `toast-${Date.now()}-${++pn}`, Q = (e) => {
|
|
488
|
+
let t = Z.get(e);
|
|
489
|
+
t && (window.clearTimeout(t), Z.delete(e));
|
|
490
|
+
}, gn = (e) => {
|
|
491
|
+
Q(e.id);
|
|
492
|
+
let t = e.duration === void 0 ? fn(e.title, e.description) : e.duration;
|
|
466
493
|
if (t > 0) {
|
|
467
494
|
let n = window.setTimeout(() => {
|
|
468
|
-
|
|
495
|
+
_n(e.id);
|
|
469
496
|
}, t);
|
|
470
|
-
|
|
497
|
+
Z.set(e.id, n);
|
|
471
498
|
}
|
|
472
|
-
},
|
|
473
|
-
let t =
|
|
499
|
+
}, _n = (e) => {
|
|
500
|
+
let t = X.value.findIndex((t) => t.id === e);
|
|
474
501
|
if (t === -1) return;
|
|
475
|
-
let n =
|
|
476
|
-
n && (
|
|
477
|
-
},
|
|
478
|
-
|
|
479
|
-
},
|
|
480
|
-
|
|
481
|
-
}), e.slice(0, 3)),
|
|
482
|
-
let t = e.id ??
|
|
483
|
-
...
|
|
502
|
+
let n = X.value[t];
|
|
503
|
+
n && (Q(e), n.onClose && n.onClose(), X.value = X.value.filter((t) => t.id !== e));
|
|
504
|
+
}, vn = () => {
|
|
505
|
+
Z.forEach((e) => window.clearTimeout(e)), Z.clear(), X.value = [];
|
|
506
|
+
}, yn = (e) => e.length <= 3 ? e : (e.slice(3).forEach((e) => {
|
|
507
|
+
Q(e.id);
|
|
508
|
+
}), e.slice(0, 3)), bn = (e) => {
|
|
509
|
+
let t = e.id ?? hn(), n = {
|
|
510
|
+
...mn,
|
|
484
511
|
...e,
|
|
485
512
|
id: t
|
|
486
|
-
}, r =
|
|
513
|
+
}, r = X.value.findIndex((e) => e.id === t);
|
|
487
514
|
if (r > -1) {
|
|
488
|
-
let e = [...
|
|
489
|
-
e[r] = n,
|
|
490
|
-
} else
|
|
491
|
-
return
|
|
492
|
-
},
|
|
493
|
-
let n =
|
|
515
|
+
let e = [...X.value];
|
|
516
|
+
e[r] = n, X.value = yn(e);
|
|
517
|
+
} else X.value = yn([n, ...X.value]);
|
|
518
|
+
return gn(n), t;
|
|
519
|
+
}, xn = (e, t) => {
|
|
520
|
+
let n = X.value.findIndex((t) => t.id === e);
|
|
494
521
|
if (n === -1) return;
|
|
495
|
-
let r =
|
|
522
|
+
let r = X.value[n];
|
|
496
523
|
if (!r) return;
|
|
497
524
|
let i = {
|
|
498
525
|
...r,
|
|
499
526
|
...t,
|
|
500
527
|
id: r.id
|
|
501
|
-
}, a = [...
|
|
502
|
-
a[n] = i,
|
|
503
|
-
},
|
|
504
|
-
toasts:
|
|
505
|
-
show:
|
|
506
|
-
hide:
|
|
507
|
-
hideAll:
|
|
508
|
-
update:
|
|
509
|
-
}),
|
|
528
|
+
}, a = [...X.value];
|
|
529
|
+
a[n] = i, X.value = a, gn(i);
|
|
530
|
+
}, Sn = () => ({
|
|
531
|
+
toasts: X,
|
|
532
|
+
show: bn,
|
|
533
|
+
hide: _n,
|
|
534
|
+
hideAll: vn,
|
|
535
|
+
update: xn
|
|
536
|
+
}), Cn = /* @__PURE__ */ F({
|
|
510
537
|
__name: "SToastProvider",
|
|
511
538
|
setup(e) {
|
|
512
|
-
let { toasts: t, hide: n } =
|
|
513
|
-
|
|
539
|
+
let { toasts: t, hide: n } = Sn(), r = D(() => t.value.slice(0, 3)), i = z(!1), a = Ot({}), o = z(/* @__PURE__ */ new Set()), s = D(() => t.value[0] ?? null), c = D(() => s.value ? a.value[s.value.id] ?? 0 : 0), l = z(0), u = D(() => c.value > 0 ? c.value : l.value);
|
|
540
|
+
jt(c, (e) => {
|
|
514
541
|
e > 0 && (l.value = e);
|
|
515
542
|
});
|
|
516
|
-
let d =
|
|
543
|
+
let d = D(() => {
|
|
517
544
|
if (r.value.length === 0) return {};
|
|
518
545
|
if (i.value) return { height: `${r.value.reduce((e, t, n) => {
|
|
519
546
|
let r = a.value[t.id] ?? 0, i = n > 0 ? 4 : 0;
|
|
@@ -552,32 +579,32 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
552
579
|
}, b = (e) => {
|
|
553
580
|
e.onSecondaryAction && e.onSecondaryAction();
|
|
554
581
|
};
|
|
555
|
-
return (e, t) => (
|
|
582
|
+
return (e, t) => (R(), O(St, { to: "body" }, [j("div", {
|
|
556
583
|
class: "s-ui-toast-provider",
|
|
557
584
|
onMouseenter: m,
|
|
558
585
|
onMouseleave: h
|
|
559
|
-
}, [r.value.length > 0 ? (
|
|
586
|
+
}, [r.value.length > 0 ? (R(), A("div", {
|
|
560
587
|
key: 0,
|
|
561
588
|
class: "s-ui-toast-provider__list",
|
|
562
|
-
style:
|
|
563
|
-
}, [(
|
|
589
|
+
style: L(d.value)
|
|
590
|
+
}, [(R(!0), A(xt, null, Et(r.value, (t, n) => (R(), O(cn, {
|
|
564
591
|
key: t.id,
|
|
565
592
|
index: n,
|
|
566
593
|
expanded: i.value,
|
|
567
594
|
"front-toast-height": u.value,
|
|
568
|
-
"stack-peek":
|
|
595
|
+
"stack-peek": H(10),
|
|
569
596
|
removed: p(t.id),
|
|
570
|
-
visible: n <
|
|
597
|
+
visible: n < H(3),
|
|
571
598
|
"offset-y": f(n),
|
|
572
599
|
onHeightChange: (e) => g(t.id, e)
|
|
573
600
|
}, {
|
|
574
|
-
default:
|
|
601
|
+
default: W(() => [B(e.$slots, "toast", { toast: t }, () => [t.component ? (R(), O(Dt(t.component), wt({
|
|
575
602
|
key: 0,
|
|
576
603
|
ref_for: !0
|
|
577
604
|
}, t.componentProps, {
|
|
578
605
|
toast: t,
|
|
579
606
|
onClose: (e) => _(t.id)
|
|
580
|
-
}), null, 16, ["toast", "onClose"])) : (
|
|
607
|
+
}), null, 16, ["toast", "onClose"])) : (R(), O(H(an), {
|
|
581
608
|
key: 1,
|
|
582
609
|
type: t.type,
|
|
583
610
|
layout: t.layout,
|
|
@@ -627,8 +654,253 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
627
654
|
"visible",
|
|
628
655
|
"offset-y",
|
|
629
656
|
"onHeightChange"
|
|
630
|
-
]))), 128))], 4)) :
|
|
657
|
+
]))), 128))], 4)) : k("", !0)], 32)]));
|
|
658
|
+
}
|
|
659
|
+
}), wn = 4, Tn = 4, En = 1, Dn = "400 12px var(--s-ui-font-family-label)", On = 4, kn = (e, t, n, r, i, a) => {
|
|
660
|
+
let o = Math.min(a, r / 2, i / 2);
|
|
661
|
+
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();
|
|
662
|
+
}, An = (e) => {
|
|
663
|
+
let t = e.getProps([
|
|
664
|
+
"x",
|
|
665
|
+
"y",
|
|
666
|
+
"base"
|
|
667
|
+
], !0), n = Number(t.x), r = Number(t.y), i = Number(t.base);
|
|
668
|
+
return !Number.isFinite(n) || !Number.isFinite(r) || !Number.isFinite(i) ? null : {
|
|
669
|
+
left: Math.min(i, n),
|
|
670
|
+
width: Math.abs(n - i),
|
|
671
|
+
centerY: r
|
|
672
|
+
};
|
|
673
|
+
}, jn = (e, t, n, r) => {
|
|
674
|
+
let i = An(t);
|
|
675
|
+
if (!i) return;
|
|
676
|
+
let a = `${n}`, o = e.measureText(a).width + wn * 2;
|
|
677
|
+
if (i.width < o + On * 2) return;
|
|
678
|
+
let s = i.left + i.width / 2;
|
|
679
|
+
kn(e, s - o / 2, i.centerY - 20 / 2, o, 20, Tn), e.fillStyle = r.background, e.fill(), e.lineWidth = En, e.strokeStyle = r.border, e.stroke(), e.fillStyle = r.text, e.fillText(a, s, i.centerY);
|
|
680
|
+
}, Mn = (e) => ({
|
|
681
|
+
id: "segmentedBarBadge",
|
|
682
|
+
afterDatasetsDraw(t) {
|
|
683
|
+
let n = {
|
|
684
|
+
background: E(T.pieBadgeBackground, e),
|
|
685
|
+
border: E(T.pieBadgeBorder, e),
|
|
686
|
+
text: E(T.pieBadgeText, e)
|
|
687
|
+
}, { ctx: r } = t;
|
|
688
|
+
r.save(), r.font = Dn, r.textAlign = "center", r.textBaseline = "middle", t.data.datasets.forEach((e, i) => {
|
|
689
|
+
let a = t.getDatasetMeta(i)?.data[0], o = e.data[0];
|
|
690
|
+
a && typeof o == "number" && o > 0 && jn(r, a, o, n);
|
|
691
|
+
}), r.restore();
|
|
692
|
+
}
|
|
693
|
+
}), Nn = 40, Pn = 4, $ = 1, Fn = [
|
|
694
|
+
"mousemove",
|
|
695
|
+
"mouseout",
|
|
696
|
+
"click",
|
|
697
|
+
"touchstart",
|
|
698
|
+
"touchmove"
|
|
699
|
+
], In = ({ segments: e, segmentColors: t, colorHostElement: n, skeleton: r = !1, onSegmentClick: i }) => {
|
|
700
|
+
if (e.length === 0) return null;
|
|
701
|
+
let a = E("--s-ui-color-surface-primary", n), o = e.reduce((e, t) => e + t.value, 0), s = at({
|
|
702
|
+
kind: "series",
|
|
703
|
+
skeleton: r,
|
|
704
|
+
colorHostElement: n,
|
|
705
|
+
onIndexClick: i
|
|
706
|
+
});
|
|
707
|
+
return {
|
|
708
|
+
type: "bar",
|
|
709
|
+
data: {
|
|
710
|
+
labels: [""],
|
|
711
|
+
datasets: e.map((e, n) => ({
|
|
712
|
+
label: e.label,
|
|
713
|
+
data: [e.value],
|
|
714
|
+
backgroundColor: t[n],
|
|
715
|
+
hoverBackgroundColor: t[n],
|
|
716
|
+
borderColor: a,
|
|
717
|
+
borderWidth: {
|
|
718
|
+
left: $,
|
|
719
|
+
right: $
|
|
720
|
+
},
|
|
721
|
+
borderSkipped: !1,
|
|
722
|
+
borderRadius: Pn,
|
|
723
|
+
barThickness: Nn,
|
|
724
|
+
stack: "track"
|
|
725
|
+
}))
|
|
726
|
+
},
|
|
727
|
+
options: {
|
|
728
|
+
indexAxis: "y",
|
|
729
|
+
responsive: !0,
|
|
730
|
+
maintainAspectRatio: !1,
|
|
731
|
+
layout: { padding: 0 },
|
|
732
|
+
events: r ? [] : Fn,
|
|
733
|
+
onHover: s.onHover,
|
|
734
|
+
onClick: s.onClick,
|
|
735
|
+
hover: r ? void 0 : {
|
|
736
|
+
mode: "nearest",
|
|
737
|
+
intersect: !0
|
|
738
|
+
},
|
|
739
|
+
elements: r ? void 0 : { bar: { hoverBorderColor: a } },
|
|
740
|
+
plugins: {
|
|
741
|
+
legend: { display: !1 },
|
|
742
|
+
tooltip: { enabled: !1 }
|
|
743
|
+
},
|
|
744
|
+
scales: {
|
|
745
|
+
x: {
|
|
746
|
+
display: !1,
|
|
747
|
+
stacked: !0,
|
|
748
|
+
min: 0,
|
|
749
|
+
max: o
|
|
750
|
+
},
|
|
751
|
+
y: {
|
|
752
|
+
display: !1,
|
|
753
|
+
stacked: !0
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
plugins: [...r ? [] : [Mn(n)], ...s.plugins]
|
|
758
|
+
};
|
|
759
|
+
}, Ln = [
|
|
760
|
+
4,
|
|
761
|
+
1,
|
|
762
|
+
2,
|
|
763
|
+
1,
|
|
764
|
+
3,
|
|
765
|
+
1,
|
|
766
|
+
2,
|
|
767
|
+
1
|
|
768
|
+
].map((e, t) => ({
|
|
769
|
+
label: `Series ${t + 1}`,
|
|
770
|
+
value: e
|
|
771
|
+
})), Rn = { class: "s-ui-chart-segmented-bar__canvas-wrap" }, zn = /* @__PURE__ */ F({
|
|
772
|
+
__name: "SChartSegmentedBar",
|
|
773
|
+
props: {
|
|
774
|
+
segments: { default: () => [] },
|
|
775
|
+
showLegend: {
|
|
776
|
+
type: Boolean,
|
|
777
|
+
default: !0
|
|
778
|
+
},
|
|
779
|
+
loading: {
|
|
780
|
+
type: Boolean,
|
|
781
|
+
default: !1
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
emits: ["segmentClick"],
|
|
785
|
+
setup(e, { expose: t, emit: n }) {
|
|
786
|
+
let r = n, i = st, a = At("chartRootRef"), o = At("chartCanvasRef"), s = D(() => e.loading ? Ln : e.segments), c = D(() => s.value.map((t, n) => Ht(n, a.value, t.fillColor, e.loading))), l = D(() => s.value.map((e, t) => ({
|
|
787
|
+
segment: e,
|
|
788
|
+
segmentIndex: t
|
|
789
|
+
})).filter(({ segment: e }) => e.value > 0)), u = D(() => l.value.map(({ segment: e }) => e)), d = D(() => l.value.map(({ segmentIndex: e }) => c.value[e] ?? "")), f = D(() => {
|
|
790
|
+
let e = /* @__PURE__ */ new Map();
|
|
791
|
+
return l.value.forEach(({ segmentIndex: t }, n) => {
|
|
792
|
+
e.set(t, n);
|
|
793
|
+
}), e;
|
|
794
|
+
}), p = (e) => {
|
|
795
|
+
let t = l.value[e];
|
|
796
|
+
t && r("segmentClick", t.segmentIndex, t.segment);
|
|
797
|
+
}, m = bt("onSegmentClick"), h = D(() => In({
|
|
798
|
+
segments: u.value,
|
|
799
|
+
segmentColors: d.value,
|
|
800
|
+
colorHostElement: a.value,
|
|
801
|
+
skeleton: e.loading,
|
|
802
|
+
onSegmentClick: m() ? p : void 0
|
|
803
|
+
})), g = D(() => s.value.map((e, t) => ({
|
|
804
|
+
label: e.label,
|
|
805
|
+
color: c.value[t] ?? ""
|
|
806
|
+
}))), { chartInstance: _ } = ot({
|
|
807
|
+
canvasRef: o,
|
|
808
|
+
config: h,
|
|
809
|
+
enabled: D(() => e.loading || u.value.length > 0)
|
|
810
|
+
}), { exportImage: v, handleLegendItemHover: y } = ct({
|
|
811
|
+
chartInstance: _,
|
|
812
|
+
canvasRef: o,
|
|
813
|
+
colorHostElement: a
|
|
814
|
+
}), b = (e) => {
|
|
815
|
+
y(e === null ? null : f.value.get(e) ?? null);
|
|
816
|
+
};
|
|
817
|
+
return t({ exportImage: v }), (t, n) => (R(), A("div", {
|
|
818
|
+
ref_key: "chartRootRef",
|
|
819
|
+
ref: a,
|
|
820
|
+
class: I(["s-ui-chart-segmented-bar", { "s-ui-chart-segmented-bar--skeleton": e.loading }]),
|
|
821
|
+
"data-qa": "ui:chart-segmented-bar"
|
|
822
|
+
}, [j("div", Rn, [P(H(lt), {
|
|
823
|
+
loading: e.loading,
|
|
824
|
+
type: H(i).CARTESIAN
|
|
825
|
+
}, {
|
|
826
|
+
default: W(() => [j("canvas", {
|
|
827
|
+
ref_key: "chartCanvasRef",
|
|
828
|
+
ref: o,
|
|
829
|
+
class: "s-ui-chart-segmented-bar__canvas"
|
|
830
|
+
}, null, 512)]),
|
|
831
|
+
_: 1
|
|
832
|
+
}, 8, ["loading", "type"])]), e.showLegend && g.value.length ? (R(), O(H(yt), {
|
|
833
|
+
key: 0,
|
|
834
|
+
items: g.value,
|
|
835
|
+
disabled: e.loading,
|
|
836
|
+
interactive: !e.loading,
|
|
837
|
+
onItemHover: b
|
|
838
|
+
}, null, 8, [
|
|
839
|
+
"items",
|
|
840
|
+
"disabled",
|
|
841
|
+
"interactive"
|
|
842
|
+
])) : k("", !0)], 2));
|
|
843
|
+
}
|
|
844
|
+
}), Bn = {
|
|
845
|
+
key: 0,
|
|
846
|
+
class: "s-ui-chart-widget__header"
|
|
847
|
+
}, Vn = {
|
|
848
|
+
key: 0,
|
|
849
|
+
class: "s-ui-chart-widget__title-skeleton",
|
|
850
|
+
"aria-hidden": "true"
|
|
851
|
+
}, Hn = {
|
|
852
|
+
key: 1,
|
|
853
|
+
class: "s-ui-chart-widget__title s-ui-typography-label-16-medium"
|
|
854
|
+
}, Un = { class: "s-ui-chart-widget__controls" }, Wn = {
|
|
855
|
+
key: 1,
|
|
856
|
+
class: "s-ui-chart-widget__content"
|
|
857
|
+
}, Gn = /* @__PURE__ */ F({
|
|
858
|
+
__name: "SChartWidget",
|
|
859
|
+
props: /*@__PURE__*/ Ct({
|
|
860
|
+
title: { default: "" },
|
|
861
|
+
collapsible: {
|
|
862
|
+
type: Boolean,
|
|
863
|
+
default: !1
|
|
864
|
+
},
|
|
865
|
+
hideContentWhenCollapsed: {
|
|
866
|
+
type: Boolean,
|
|
867
|
+
default: !0
|
|
868
|
+
},
|
|
869
|
+
loading: {
|
|
870
|
+
type: Boolean,
|
|
871
|
+
default: !1
|
|
872
|
+
}
|
|
873
|
+
}, {
|
|
874
|
+
collapsed: {
|
|
875
|
+
type: Boolean,
|
|
876
|
+
default: !1
|
|
877
|
+
},
|
|
878
|
+
collapsedModifiers: {}
|
|
879
|
+
}),
|
|
880
|
+
emits: ["update:collapsed"],
|
|
881
|
+
setup(e) {
|
|
882
|
+
let t = kt(e, "collapsed"), n = U(), { t: r } = Rt(), i = D(() => !!e.title || !!n.title || !!n.actions || e.collapsible), a = D(() => !t.value || !e.collapsible || !e.hideContentWhenCollapsed), o = D(() => r(t.value ? "chartWidget.expand" : "chartWidget.collapse"));
|
|
883
|
+
return (n, r) => (R(), A("div", {
|
|
884
|
+
class: I(["s-ui-chart-widget", { "s-ui-chart-widget--skeleton": e.loading }]),
|
|
885
|
+
"data-qa": "ui:chart-widget"
|
|
886
|
+
}, [i.value ? (R(), A("div", Bn, [e.loading ? (R(), A("span", Vn)) : (R(), A("span", Hn, [B(n.$slots, "title", {}, () => [N(V(e.title), 1)])])), j("div", Un, [B(n.$slots, "actions"), e.collapsible ? (R(), O(H(w), {
|
|
887
|
+
key: 0,
|
|
888
|
+
appearance: H(C).OUTLINED,
|
|
889
|
+
variant: H(S).NEUTRAL,
|
|
890
|
+
size: H(x).SMALL,
|
|
891
|
+
icon: t.value ? H(G).chevronDown : H(G).chevronUp,
|
|
892
|
+
"aria-label": o.value,
|
|
893
|
+
"aria-expanded": !t.value,
|
|
894
|
+
onClick: r[0] ||= (e) => t.value = !t.value
|
|
895
|
+
}, null, 8, [
|
|
896
|
+
"appearance",
|
|
897
|
+
"variant",
|
|
898
|
+
"size",
|
|
899
|
+
"icon",
|
|
900
|
+
"aria-label",
|
|
901
|
+
"aria-expanded"
|
|
902
|
+
])) : k("", !0)])])) : k("", !0), a.value ? (R(), A("div", Wn, [B(n.$slots, "default")])) : k("", !0)], 2));
|
|
631
903
|
}
|
|
632
904
|
});
|
|
633
905
|
//#endregion
|
|
634
|
-
export { m as DEFAULT_COLOR_PALETTE, p as EAccentColor, C as EButtonAppearance, le as EButtonGroupLayout, x as EButtonSize, x as ESSegmentControlSize, S as EButtonVariant, g as EColorFormat, Ce as EConnectedPositionStrategy,
|
|
906
|
+
export { m as DEFAULT_COLOR_PALETTE, p as EAccentColor, C as EButtonAppearance, le as EButtonGroupLayout, x as EButtonSize, x as ESSegmentControlSize, S as EButtonVariant, g as EColorFormat, Ce as EConnectedPositionStrategy, q as ENotificationLayout, J as ENotificationLeftside, K as ENotificationType, a as ESAvatarBadge, s as ESAvatarColor, te as ESAvatarGroupSize, i as ESAvatarIconBackground, r as ESAvatarShape, o as ESAvatarSize, e as ESBadgeColor, t as ESBadgePlacement, me as ESCardLayout, de as ESCheckboxColor, fe as ESCheckboxSize, ke as ESChipColor, Ae as ESChipSize, h as ESColorPaletteLayout, xe as ESDropdownPlacement, $e as ESInlineInputAppearance, Re as ESInlineMessageValidationStatus, Ie as ESInputCustomize, Be as ESLabelSize, Ve as ESLabelVariant, Ue as ESListGap, qe as ESListItemVariant, nt as ESPhotoEditShape, rt as ESPhotoEditSize, Ye as ESRadioLabelPlacement, Ne as ESSelectSearchable, _e as ESTabAppearance, ve as ESTabSize, Te as ESTagColor, Ee as ESTagSize, Ze as ESToggleSize, se as ESelectionFocusMode, ie as ESelectionMode, oe as ESelectionOrientation, l as MAX_RECENT_COLORS, _ as RECOMMENDED_COLOR_PALETTE, c as SAvatar, ne as SAvatarGroup, n as SBadge, rn as SBanner, w as SButton, ue as SButtonGroup, he as SCard, _t as SChartBurnup, mt as SChartHorizontalBar, ut as SChartLine, gt as SChartMultiLine, ht as SChartPie, vt as SChartProgress, zn as SChartSegmentedBar, ft as SChartStackedArea, pt as SChartStackedBar, Gn as SChartWidget, pe as SCheckbox, je as SChip, d as SColorArea, v as SColorPalette, f as SColorPicker, u as SColorValues, Me as SDropdown, Pe as SDropdownMenu, et as SInlineInput, ze as SInlineMessage, Le as SInput, He as SLabel, Ke as SList, Je as SListItem, it as SPhotoEdit, Xe as SRadio, ge as SSegmentControl, Fe as SSelect, ye as STab, be as STabs, De as STag, Oe as STagGroup, tt as STextarea, an as SToast, Cn as SToastProvider, Qe as SToggle, un as TOAST_AUTO_DURATION_MAX_MS, ln as TOAST_AUTO_DURATION_MIN_MS, dn as TOAST_AUTO_DURATION_MS_PER_CHAR, fn as computeAutoDuration, Se as computeConnectedPosition, Nt as createUiKit, ee as isSameColor, b as normalizeColorValue, y as resolveColorPreview, re as resolveOwnPropOrGroupedOrFallback, Pt as setUiKitLocale, Ft as uiKitLocaleEn, It as uiKitLocaleRu, Ge as useFlatTreeList, we as useFloatingOverlay, We as useSListEndReached, ae as useSelectionGroup, ce as useSelectionGroupItem, Sn as useToast, Lt as useUiKitI18n };
|