@shtabapp/ui-kit 1.35.0 → 1.37.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 +16 -0
- package/dist/SPhotoEdit-VW9-n1yU.cjs +1 -0
- package/dist/SPhotoEdit-bXKHcP3x.js +123 -0
- package/dist/components/SBanner/SBanner.types.d.ts +55 -0
- package/dist/components/SBanner/SBanner.types.d.ts.map +1 -0
- package/dist/components/SBanner/SBanner.vue.d.ts +27 -0
- package/dist/components/SBanner/SBanner.vue.d.ts.map +1 -0
- package/dist/components/SBanner/index.d.ts +3 -0
- package/dist/components/SBanner/index.d.ts.map +1 -0
- package/dist/components/SNotification/SNotification.types.d.ts +120 -0
- package/dist/components/SNotification/SNotification.types.d.ts.map +1 -0
- package/dist/components/SNotification/SNotification.vue.d.ts +27 -0
- package/dist/components/SNotification/SNotification.vue.d.ts.map +1 -0
- package/dist/components/SNotification/index.d.ts +3 -0
- package/dist/components/SNotification/index.d.ts.map +1 -0
- package/dist/components/SNotification/resolveNotificationIcon.d.ts +4 -0
- package/dist/components/SNotification/resolveNotificationIcon.d.ts.map +1 -0
- package/dist/components/SPhotoEdit/SPhotoEdit.types.d.ts +27 -0
- package/dist/components/SPhotoEdit/SPhotoEdit.types.d.ts.map +1 -0
- package/dist/components/SPhotoEdit/SPhotoEdit.vue.d.ts +18 -0
- package/dist/components/SPhotoEdit/SPhotoEdit.vue.d.ts.map +1 -0
- package/dist/components/SPhotoEdit/index.d.ts +4 -0
- package/dist/components/SPhotoEdit/index.d.ts.map +1 -0
- package/dist/components/SToast/SToast.types.d.ts +58 -0
- package/dist/components/SToast/SToast.types.d.ts.map +1 -0
- package/dist/components/SToast/SToast.vue.d.ts +27 -0
- package/dist/components/SToast/SToast.vue.d.ts.map +1 -0
- package/dist/components/SToast/index.d.ts +3 -0
- package/dist/components/SToast/index.d.ts.map +1 -0
- package/dist/components/SToastProvider/SToastProvider.vue.d.ts +17 -0
- package/dist/components/SToastProvider/SToastProvider.vue.d.ts.map +1 -0
- package/dist/components/SToastProvider/SToastProviderToast.vue.d.ts +27 -0
- package/dist/components/SToastProvider/SToastProviderToast.vue.d.ts.map +1 -0
- package/dist/components/SToastProvider/index.d.ts +5 -0
- package/dist/components/SToastProvider/index.d.ts.map +1 -0
- package/dist/components/SToastProvider/useToast.d.ts +16 -0
- package/dist/components/SToastProvider/useToast.d.ts.map +1 -0
- package/dist/components/SToastProvider/utils/computeAutoDuration.d.ts +5 -0
- package/dist/components/SToastProvider/utils/computeAutoDuration.d.ts.map +1 -0
- package/dist/components/SToastProvider/utils/toastProviderConstants.d.ts +6 -0
- package/dist/components/SToastProvider/utils/toastProviderConstants.d.ts.map +1 -0
- package/dist/entries/photo-edit.cjs +1 -0
- package/dist/entries/photo-edit.d.ts +4 -0
- package/dist/entries/photo-edit.d.ts.map +1 -0
- package/dist/entries/photo-edit.js +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +626 -35
- package/dist/uikit-components.css +1 -1
- package/package.json +8 -3
package/dist/index.js
CHANGED
|
@@ -2,40 +2,631 @@ import { n as e, r as t, t as n } from "./SBadge-BDxQJh6c.js";
|
|
|
2
2
|
import { a as r, i, n as a, o, r as s, t as c } from "./SAvatar-q1HSZPqy.js";
|
|
3
3
|
import { i as l, n as u, r as d, t as f } from "./SColorPicker-BnfGvKy4.js";
|
|
4
4
|
import { a as p, i as m, n as h, o as g, r as _, t as v } from "./SColorPalette-D2WCADDX.js";
|
|
5
|
-
import { a as y, i as b, r as
|
|
6
|
-
import { n as
|
|
7
|
-
import { n as
|
|
8
|
-
import { t as
|
|
9
|
-
import { a as
|
|
10
|
-
import { n as
|
|
11
|
-
import { n as
|
|
12
|
-
import { n as
|
|
13
|
-
import { n as
|
|
14
|
-
import { t as
|
|
15
|
-
import { n as
|
|
16
|
-
import { t as
|
|
17
|
-
import { i as
|
|
18
|
-
import { n as
|
|
19
|
-
import { t as
|
|
20
|
-
import { n as
|
|
21
|
-
import { t as
|
|
22
|
-
import { n as
|
|
23
|
-
import { n as
|
|
24
|
-
import { n as
|
|
25
|
-
import { n as
|
|
26
|
-
import { a as
|
|
27
|
-
import { n as
|
|
28
|
-
import { n as
|
|
29
|
-
import { n as
|
|
30
|
-
import { n as
|
|
31
|
-
import { t as
|
|
32
|
-
import { t as
|
|
33
|
-
import { t as
|
|
34
|
-
import { t as
|
|
35
|
-
import { t as
|
|
36
|
-
import { t as
|
|
37
|
-
import { t as
|
|
38
|
-
import {
|
|
5
|
+
import { a as y, i as b, r as ee } from "./colorValue-CSh0chxp.js";
|
|
6
|
+
import { n as te, t as ne } from "./SAvatarGroup-By-5Ub6i.js";
|
|
7
|
+
import { n as x, r as S, t as C } from "./SButton.types-CpdHQtyx.js";
|
|
8
|
+
import { t as w } from "./SButton-DnU_XZ1C.js";
|
|
9
|
+
import { a as re, n as ie, o as ae, r as oe, t as se } from "./useSelectionGroup-cKj38lEN.js";
|
|
10
|
+
import { n as ce } from "./useSelectLink-DClG5hGA.js";
|
|
11
|
+
import { n as le, t as ue } from "./SButtonGroup-CmSlYnSv.js";
|
|
12
|
+
import { n as de, r as fe, t as pe } from "./SCheckbox-BMKYFfrB.js";
|
|
13
|
+
import { n as me, t as he } from "./SCard-CrU67ok0.js";
|
|
14
|
+
import { t as ge } from "./SSegmentControl-CmJEjfSR.js";
|
|
15
|
+
import { n as _e, r as ve, t as ye } from "./STab-DY1TGadw.js";
|
|
16
|
+
import { t as be } from "./STabs-CTM8Nji_.js";
|
|
17
|
+
import { i as xe, n as Se, r as Ce, t as we } from "./useFloatingOverlay-QcumEYEq.js";
|
|
18
|
+
import { n as Te, r as Ee, t as De } from "./STag-CluIVRKi.js";
|
|
19
|
+
import { t as Oe } from "./STagGroup-wSpc3guU.js";
|
|
20
|
+
import { n as ke, r as Ae, t as je } from "./SChip-TxpPE0VS.js";
|
|
21
|
+
import { t as Me } from "./SDropdown-CTQ5Qlez.js";
|
|
22
|
+
import { n as Ne, r as Pe, t as Fe } from "./SSelect-XSZjYLBA.js";
|
|
23
|
+
import { n as Ie, t as Le } from "./SInput-CkanJfLx.js";
|
|
24
|
+
import { n as Re, t as ze } from "./SInlineMessage-Dirk5RwO.js";
|
|
25
|
+
import { n as Be, r as Ve, t as He } from "./SLabel-yzcX4qp5.js";
|
|
26
|
+
import { a as Ue, o as We, s as Ge, t as Ke } from "./SList-B40rJ-PZ.js";
|
|
27
|
+
import { n as qe, t as Je } from "./SListItem-DKrpL2SS.js";
|
|
28
|
+
import { n as Ye, t as Xe } from "./SRadio-Db_YLcne.js";
|
|
29
|
+
import { n as Ze, t as Qe } from "./SToggle-T7FKzMSo.js";
|
|
30
|
+
import { n as $e, t as et } from "./SInlineInput-DHq5BNPn.js";
|
|
31
|
+
import { t as tt } from "./STextarea-ASdLqfpC.js";
|
|
32
|
+
import { n as nt, r as rt, t as it } from "./SPhotoEdit-bXKHcP3x.js";
|
|
33
|
+
import { t as at } from "./SChartLine-G5CeC01A.js";
|
|
34
|
+
import { t as ot } from "./SChartStackedArea-RKK7aT7x.js";
|
|
35
|
+
import { t as st } from "./SChartStackedBar-CJunMhyb.js";
|
|
36
|
+
import { t as ct } from "./SChartHorizontalBar-DIn1sVoi.js";
|
|
37
|
+
import { t as lt } from "./SChartPie-_6ij1EVn.js";
|
|
38
|
+
import { t as ut } from "./SChartProgress-CofVafO6.js";
|
|
39
|
+
import { Fragment as dt, Teleport as ft, computed as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createSlots as A, createTextVNode as j, createVNode as pt, defineComponent as M, mergeProps as mt, normalizeClass as ht, normalizeStyle as N, onMounted as gt, openBlock as P, ref as F, renderList as _t, renderSlot as I, resolveDynamicComponent as vt, shallowRef as L, toDisplayString as R, unref as z, useSlots as B, watch as yt, withCtx as V } from "vue";
|
|
40
|
+
import { ESIconName as H, SIcon as bt, createUiKit as xt, setUiKitLocale as St, uiKitLocaleEn as Ct, uiKitLocaleRu as wt, useUiKitI18n as Tt } from "@shtabapp/ui-kit-primitives";
|
|
41
|
+
import { useResizeObserver as Et } from "@vueuse/core";
|
|
39
42
|
export * from "@shtabapp/ui-kit-primitives";
|
|
40
43
|
export * from "@shtabapp/ui-kit-tokens";
|
|
41
|
-
|
|
44
|
+
//#region src/components/SNotification/SNotification.types.ts
|
|
45
|
+
var U = /* @__PURE__ */ function(e) {
|
|
46
|
+
return e.INFO_ACCENT = "info-accent", e.INFO_NORMAL = "info-normal", e.SUCCESS = "success", e.WARNING = "warning", e.DANGER = "danger", e.BILLING = "billing", e;
|
|
47
|
+
}({}), W = /* @__PURE__ */ function(e) {
|
|
48
|
+
return e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e;
|
|
49
|
+
}({}), G = /* @__PURE__ */ function(e) {
|
|
50
|
+
return e.ICON = "icon", e.AVATAR = "avatar", e;
|
|
51
|
+
}({}), K = /* @__PURE__ */ function(e) {
|
|
52
|
+
return e.BANNER = "banner", e.TOAST = "toast", e;
|
|
53
|
+
}({}), Dt = {
|
|
54
|
+
[U.INFO_ACCENT]: H.infoCircle,
|
|
55
|
+
[U.INFO_NORMAL]: H.infoCircle,
|
|
56
|
+
[U.SUCCESS]: H.checkCircle,
|
|
57
|
+
[U.WARNING]: H.alertCircle,
|
|
58
|
+
[U.DANGER]: H.dangerCircleFill,
|
|
59
|
+
[U.BILLING]: H.infoCircle
|
|
60
|
+
}, Ot = (e, t) => t || Dt[e], kt = ["role"], At = { class: "s-ui-notification__body" }, jt = {
|
|
61
|
+
key: 0,
|
|
62
|
+
class: "s-ui-notification__leftside"
|
|
63
|
+
}, Mt = {
|
|
64
|
+
key: 0,
|
|
65
|
+
class: "s-ui-notification__icon"
|
|
66
|
+
}, Nt = { class: "s-ui-notification__content" }, Pt = { class: "s-ui-notification__title-row" }, Ft = { class: "s-ui-notification__title s-ui-typography-label-14-medium" }, It = {
|
|
67
|
+
key: 0,
|
|
68
|
+
class: "s-ui-notification__description-block"
|
|
69
|
+
}, Lt = {
|
|
70
|
+
key: 0,
|
|
71
|
+
class: "s-ui-notification__description s-ui-typography-label-12-medium"
|
|
72
|
+
}, Rt = {
|
|
73
|
+
key: 1,
|
|
74
|
+
class: "s-ui-notification__actions-stack"
|
|
75
|
+
}, zt = {
|
|
76
|
+
key: 1,
|
|
77
|
+
class: "s-ui-notification__actions-row"
|
|
78
|
+
}, q = /* @__PURE__ */ M({
|
|
79
|
+
__name: "SNotification",
|
|
80
|
+
props: {
|
|
81
|
+
type: { default: () => U.INFO_ACCENT },
|
|
82
|
+
layout: { default: () => W.HORIZONTAL },
|
|
83
|
+
leftside: { default: () => G.ICON },
|
|
84
|
+
surface: { default: () => K.BANNER },
|
|
85
|
+
title: {},
|
|
86
|
+
description: {},
|
|
87
|
+
linkText: {},
|
|
88
|
+
primaryButtonText: {},
|
|
89
|
+
secondaryButtonText: {},
|
|
90
|
+
showPrimaryButton: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: !1
|
|
93
|
+
},
|
|
94
|
+
closable: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: !0
|
|
97
|
+
},
|
|
98
|
+
closeAriaLabel: { default: "" },
|
|
99
|
+
icon: {},
|
|
100
|
+
avatar: {},
|
|
101
|
+
width: {},
|
|
102
|
+
maxWidth: {}
|
|
103
|
+
},
|
|
104
|
+
emits: [
|
|
105
|
+
"close",
|
|
106
|
+
"linkClick",
|
|
107
|
+
"primaryAction",
|
|
108
|
+
"secondaryAction"
|
|
109
|
+
],
|
|
110
|
+
setup(e, { emit: t }) {
|
|
111
|
+
let n = t, r = B(), i = T(() => [
|
|
112
|
+
`s-ui-notification--type-${e.type}`,
|
|
113
|
+
`s-ui-notification--layout-${e.layout}`,
|
|
114
|
+
`s-ui-notification--surface-${e.surface}`
|
|
115
|
+
]), a = T(() => {
|
|
116
|
+
let t = {};
|
|
117
|
+
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;
|
|
118
|
+
}), s = T(() => e.type === U.DANGER ? "alert" : "status"), l = T(() => Ot(e.type, e.icon)), u = T(() => e.type === U.BILLING), d = T(() => !!(e.leftside === G.AVATAR && e.avatar || e.leftside === G.ICON)), f = T(() => !!(e.description || e.linkText || r.description)), p = T(() => e.showPrimaryButton && (e.primaryButtonText || e.secondaryButtonText)), m = T(() => e.showPrimaryButton && e.primaryButtonText || e.closable), h = T(() => e.type === U.BILLING ? C.MAJOR : C.OUTLINED), g = T(() => e.type === U.BILLING ? S.BILLING : S.MAIN), _ = () => {
|
|
119
|
+
n("close");
|
|
120
|
+
}, v = () => {
|
|
121
|
+
n("linkClick");
|
|
122
|
+
}, y = () => {
|
|
123
|
+
n("primaryAction");
|
|
124
|
+
}, b = () => {
|
|
125
|
+
n("secondaryAction");
|
|
126
|
+
};
|
|
127
|
+
return (t, n) => (P(), O("div", {
|
|
128
|
+
class: ht(["s-ui-notification", i.value]),
|
|
129
|
+
style: N(a.value),
|
|
130
|
+
role: s.value
|
|
131
|
+
}, [k("div", At, [
|
|
132
|
+
d.value ? (P(), O("div", jt, [e.leftside === z(G).ICON ? (P(), O("div", Mt, [pt(z(bt), {
|
|
133
|
+
name: l.value,
|
|
134
|
+
size: 16,
|
|
135
|
+
billing: u.value
|
|
136
|
+
}, null, 8, ["name", "billing"])])) : e.leftside === z(G).AVATAR && e.avatar ? (P(), E(z(c), {
|
|
137
|
+
key: 1,
|
|
138
|
+
name: e.avatar.name,
|
|
139
|
+
src: e.avatar.src,
|
|
140
|
+
badge: e.avatar.badge,
|
|
141
|
+
size: z(o).SIZE_20,
|
|
142
|
+
showName: !1
|
|
143
|
+
}, null, 8, [
|
|
144
|
+
"name",
|
|
145
|
+
"src",
|
|
146
|
+
"badge",
|
|
147
|
+
"size"
|
|
148
|
+
])) : D("", !0)])) : D("", !0),
|
|
149
|
+
k("div", Nt, [
|
|
150
|
+
k("div", Pt, [k("span", Ft, [I(t.$slots, "title", {}, () => [j(R(e.title), 1)])]), e.layout === z(W).VERTICAL && e.closable ? (P(), E(z(w), {
|
|
151
|
+
key: 0,
|
|
152
|
+
class: "s-ui-notification__close",
|
|
153
|
+
appearance: z(C).BARE,
|
|
154
|
+
variant: z(S).NEUTRAL,
|
|
155
|
+
size: z(x).SMALL,
|
|
156
|
+
"aria-label": e.closeAriaLabel,
|
|
157
|
+
icon: "closeMini",
|
|
158
|
+
onClick: _
|
|
159
|
+
}, null, 8, [
|
|
160
|
+
"appearance",
|
|
161
|
+
"variant",
|
|
162
|
+
"size",
|
|
163
|
+
"aria-label"
|
|
164
|
+
])) : D("", !0)]),
|
|
165
|
+
f.value ? (P(), O("div", It, [e.description || z(r).description ? (P(), O("span", Lt, [I(t.$slots, "description", {}, () => [j(R(e.description), 1)])])) : D("", !0), e.linkText ? (P(), E(z(w), {
|
|
166
|
+
key: 1,
|
|
167
|
+
class: "s-ui-notification__link",
|
|
168
|
+
appearance: z(C).BARE,
|
|
169
|
+
variant: z(S).MAIN,
|
|
170
|
+
size: z(x).SMALL,
|
|
171
|
+
onClick: v
|
|
172
|
+
}, {
|
|
173
|
+
default: V(() => [j(R(e.linkText), 1)]),
|
|
174
|
+
_: 1
|
|
175
|
+
}, 8, [
|
|
176
|
+
"appearance",
|
|
177
|
+
"variant",
|
|
178
|
+
"size"
|
|
179
|
+
])) : D("", !0)])) : D("", !0),
|
|
180
|
+
e.layout === z(W).VERTICAL && p.value ? (P(), O("div", Rt, [e.showPrimaryButton && e.primaryButtonText ? (P(), E(z(w), {
|
|
181
|
+
key: 0,
|
|
182
|
+
appearance: h.value,
|
|
183
|
+
variant: g.value,
|
|
184
|
+
size: z(x).SMALL,
|
|
185
|
+
onClick: y
|
|
186
|
+
}, {
|
|
187
|
+
default: V(() => [j(R(e.primaryButtonText), 1)]),
|
|
188
|
+
_: 1
|
|
189
|
+
}, 8, [
|
|
190
|
+
"appearance",
|
|
191
|
+
"variant",
|
|
192
|
+
"size"
|
|
193
|
+
])) : D("", !0), e.showPrimaryButton && e.secondaryButtonText ? (P(), E(z(w), {
|
|
194
|
+
key: 1,
|
|
195
|
+
appearance: z(C).BARE,
|
|
196
|
+
variant: z(S).NEUTRAL,
|
|
197
|
+
size: z(x).SMALL,
|
|
198
|
+
onClick: b
|
|
199
|
+
}, {
|
|
200
|
+
default: V(() => [j(R(e.secondaryButtonText), 1)]),
|
|
201
|
+
_: 1
|
|
202
|
+
}, 8, [
|
|
203
|
+
"appearance",
|
|
204
|
+
"variant",
|
|
205
|
+
"size"
|
|
206
|
+
])) : D("", !0)])) : D("", !0)
|
|
207
|
+
]),
|
|
208
|
+
e.layout === z(W).HORIZONTAL && m.value ? (P(), O("div", zt, [e.showPrimaryButton && e.primaryButtonText ? (P(), E(z(w), {
|
|
209
|
+
key: 0,
|
|
210
|
+
appearance: h.value,
|
|
211
|
+
variant: g.value,
|
|
212
|
+
size: z(x).SMALL,
|
|
213
|
+
onClick: y
|
|
214
|
+
}, {
|
|
215
|
+
default: V(() => [j(R(e.primaryButtonText), 1)]),
|
|
216
|
+
_: 1
|
|
217
|
+
}, 8, [
|
|
218
|
+
"appearance",
|
|
219
|
+
"variant",
|
|
220
|
+
"size"
|
|
221
|
+
])) : D("", !0), e.layout === z(W).HORIZONTAL && e.closable ? (P(), E(z(w), {
|
|
222
|
+
key: 1,
|
|
223
|
+
class: "s-ui-notification__close",
|
|
224
|
+
appearance: z(C).BARE,
|
|
225
|
+
variant: z(S).NEUTRAL,
|
|
226
|
+
size: z(x).SMALL,
|
|
227
|
+
"aria-label": e.closeAriaLabel,
|
|
228
|
+
icon: "closeMini",
|
|
229
|
+
onClick: _
|
|
230
|
+
}, null, 8, [
|
|
231
|
+
"appearance",
|
|
232
|
+
"variant",
|
|
233
|
+
"size",
|
|
234
|
+
"aria-label"
|
|
235
|
+
])) : D("", !0)])) : D("", !0)
|
|
236
|
+
])], 14, kt));
|
|
237
|
+
}
|
|
238
|
+
}), Bt = /* @__PURE__ */ M({
|
|
239
|
+
__name: "SBanner",
|
|
240
|
+
props: {
|
|
241
|
+
type: { default: () => U.INFO_ACCENT },
|
|
242
|
+
layout: { default: () => W.HORIZONTAL },
|
|
243
|
+
leftside: { default: () => G.ICON },
|
|
244
|
+
title: {},
|
|
245
|
+
description: {},
|
|
246
|
+
linkText: {},
|
|
247
|
+
primaryButtonText: {},
|
|
248
|
+
secondaryButtonText: {},
|
|
249
|
+
showPrimaryButton: {
|
|
250
|
+
type: Boolean,
|
|
251
|
+
default: !1
|
|
252
|
+
},
|
|
253
|
+
closable: {
|
|
254
|
+
type: Boolean,
|
|
255
|
+
default: !0
|
|
256
|
+
},
|
|
257
|
+
closeAriaLabel: { default: "" },
|
|
258
|
+
icon: {},
|
|
259
|
+
avatar: {},
|
|
260
|
+
maxWidth: {}
|
|
261
|
+
},
|
|
262
|
+
emits: [
|
|
263
|
+
"close",
|
|
264
|
+
"linkClick",
|
|
265
|
+
"primaryAction",
|
|
266
|
+
"secondaryAction"
|
|
267
|
+
],
|
|
268
|
+
setup(e, { emit: t }) {
|
|
269
|
+
let n = t, r = B();
|
|
270
|
+
return (t, i) => (P(), E(q, {
|
|
271
|
+
class: "s-ui-banner",
|
|
272
|
+
"data-qa": "ui:banner",
|
|
273
|
+
type: e.type,
|
|
274
|
+
layout: e.layout,
|
|
275
|
+
leftside: e.leftside,
|
|
276
|
+
surface: z(K).BANNER,
|
|
277
|
+
title: e.title,
|
|
278
|
+
description: e.description,
|
|
279
|
+
linkText: e.linkText,
|
|
280
|
+
primaryButtonText: e.primaryButtonText,
|
|
281
|
+
secondaryButtonText: e.secondaryButtonText,
|
|
282
|
+
showPrimaryButton: e.showPrimaryButton,
|
|
283
|
+
closable: e.closable,
|
|
284
|
+
closeAriaLabel: e.closeAriaLabel,
|
|
285
|
+
icon: e.icon,
|
|
286
|
+
avatar: e.avatar,
|
|
287
|
+
maxWidth: e.maxWidth,
|
|
288
|
+
onClose: i[0] ||= (e) => n("close"),
|
|
289
|
+
onLinkClick: i[1] ||= (e) => n("linkClick"),
|
|
290
|
+
onPrimaryAction: i[2] ||= (e) => n("primaryAction"),
|
|
291
|
+
onSecondaryAction: i[3] ||= (e) => n("secondaryAction")
|
|
292
|
+
}, A({ _: 2 }, [z(r).title ? {
|
|
293
|
+
name: "title",
|
|
294
|
+
fn: V(() => [I(t.$slots, "title")]),
|
|
295
|
+
key: "0"
|
|
296
|
+
} : void 0, z(r).description ? {
|
|
297
|
+
name: "description",
|
|
298
|
+
fn: V(() => [I(t.$slots, "description")]),
|
|
299
|
+
key: "1"
|
|
300
|
+
} : void 0]), 1032, [
|
|
301
|
+
"type",
|
|
302
|
+
"layout",
|
|
303
|
+
"leftside",
|
|
304
|
+
"surface",
|
|
305
|
+
"title",
|
|
306
|
+
"description",
|
|
307
|
+
"linkText",
|
|
308
|
+
"primaryButtonText",
|
|
309
|
+
"secondaryButtonText",
|
|
310
|
+
"showPrimaryButton",
|
|
311
|
+
"closable",
|
|
312
|
+
"closeAriaLabel",
|
|
313
|
+
"icon",
|
|
314
|
+
"avatar",
|
|
315
|
+
"maxWidth"
|
|
316
|
+
]));
|
|
317
|
+
}
|
|
318
|
+
}), J = /* @__PURE__ */ M({
|
|
319
|
+
__name: "SToast",
|
|
320
|
+
props: {
|
|
321
|
+
type: { default: () => U.INFO_ACCENT },
|
|
322
|
+
layout: { default: () => W.HORIZONTAL },
|
|
323
|
+
leftside: { default: () => G.ICON },
|
|
324
|
+
title: {},
|
|
325
|
+
description: {},
|
|
326
|
+
linkText: {},
|
|
327
|
+
primaryButtonText: {},
|
|
328
|
+
secondaryButtonText: {},
|
|
329
|
+
showPrimaryButton: {
|
|
330
|
+
type: Boolean,
|
|
331
|
+
default: !1
|
|
332
|
+
},
|
|
333
|
+
closable: {
|
|
334
|
+
type: Boolean,
|
|
335
|
+
default: !0
|
|
336
|
+
},
|
|
337
|
+
closeAriaLabel: { default: "" },
|
|
338
|
+
icon: {},
|
|
339
|
+
avatar: {},
|
|
340
|
+
width: {}
|
|
341
|
+
},
|
|
342
|
+
emits: [
|
|
343
|
+
"close",
|
|
344
|
+
"linkClick",
|
|
345
|
+
"primaryAction",
|
|
346
|
+
"secondaryAction"
|
|
347
|
+
],
|
|
348
|
+
setup(e, { emit: t }) {
|
|
349
|
+
let n = t, r = B(), i = T(() => e.width ?? 360);
|
|
350
|
+
return (t, a) => (P(), E(q, {
|
|
351
|
+
class: "s-ui-toast",
|
|
352
|
+
"data-qa": "ui:toast",
|
|
353
|
+
type: e.type,
|
|
354
|
+
layout: e.layout,
|
|
355
|
+
leftside: e.leftside,
|
|
356
|
+
surface: z(K).TOAST,
|
|
357
|
+
title: e.title,
|
|
358
|
+
description: e.description,
|
|
359
|
+
linkText: e.linkText,
|
|
360
|
+
primaryButtonText: e.primaryButtonText,
|
|
361
|
+
secondaryButtonText: e.secondaryButtonText,
|
|
362
|
+
showPrimaryButton: e.showPrimaryButton,
|
|
363
|
+
closable: e.closable,
|
|
364
|
+
closeAriaLabel: e.closeAriaLabel,
|
|
365
|
+
icon: e.icon,
|
|
366
|
+
avatar: e.avatar,
|
|
367
|
+
width: i.value,
|
|
368
|
+
onClose: a[0] ||= (e) => n("close"),
|
|
369
|
+
onLinkClick: a[1] ||= (e) => n("linkClick"),
|
|
370
|
+
onPrimaryAction: a[2] ||= (e) => n("primaryAction"),
|
|
371
|
+
onSecondaryAction: a[3] ||= (e) => n("secondaryAction")
|
|
372
|
+
}, A({ _: 2 }, [z(r).title ? {
|
|
373
|
+
name: "title",
|
|
374
|
+
fn: V(() => [I(t.$slots, "title")]),
|
|
375
|
+
key: "0"
|
|
376
|
+
} : void 0, z(r).description ? {
|
|
377
|
+
name: "description",
|
|
378
|
+
fn: V(() => [I(t.$slots, "description")]),
|
|
379
|
+
key: "1"
|
|
380
|
+
} : void 0]), 1032, [
|
|
381
|
+
"type",
|
|
382
|
+
"layout",
|
|
383
|
+
"leftside",
|
|
384
|
+
"surface",
|
|
385
|
+
"title",
|
|
386
|
+
"description",
|
|
387
|
+
"linkText",
|
|
388
|
+
"primaryButtonText",
|
|
389
|
+
"secondaryButtonText",
|
|
390
|
+
"showPrimaryButton",
|
|
391
|
+
"closable",
|
|
392
|
+
"closeAriaLabel",
|
|
393
|
+
"icon",
|
|
394
|
+
"avatar",
|
|
395
|
+
"width"
|
|
396
|
+
]));
|
|
397
|
+
}
|
|
398
|
+
}), Vt = .05, Ht = [
|
|
399
|
+
"data-mounted",
|
|
400
|
+
"data-front",
|
|
401
|
+
"data-expanded",
|
|
402
|
+
"data-removed",
|
|
403
|
+
"data-visible"
|
|
404
|
+
], Ut = /* @__PURE__ */ M({
|
|
405
|
+
__name: "SToastProviderToast",
|
|
406
|
+
props: {
|
|
407
|
+
index: {},
|
|
408
|
+
expanded: { type: Boolean },
|
|
409
|
+
frontToastHeight: {},
|
|
410
|
+
stackPeek: {},
|
|
411
|
+
removed: { type: Boolean },
|
|
412
|
+
visible: { type: Boolean },
|
|
413
|
+
offsetY: {}
|
|
414
|
+
},
|
|
415
|
+
emits: ["heightChange"],
|
|
416
|
+
setup(e, { emit: t }) {
|
|
417
|
+
let n = t, r = F(null), i = F(0), a = F(!1), o = T(() => e.index === 0), s = T(() => 1 - e.index * Vt), c = T(() => ({
|
|
418
|
+
"--s-ui-toast-provider-toasts-before": String(e.index),
|
|
419
|
+
"--s-ui-toast-provider-lift-amount": `${e.stackPeek * -1}px`,
|
|
420
|
+
"--s-ui-toast-provider-front-toast-height": `${e.frontToastHeight}px`,
|
|
421
|
+
"--s-ui-toast-provider-offset-y": `${e.offsetY}px`,
|
|
422
|
+
"--s-ui-toast-provider-initial-height": `${i.value}px`,
|
|
423
|
+
"--s-ui-toast-provider-stack-scale": String(s.value),
|
|
424
|
+
zIndex: String(1e3 - e.index)
|
|
425
|
+
}));
|
|
426
|
+
return Et(r, (e) => {
|
|
427
|
+
let t = e[0]?.contentRect.height ?? 0;
|
|
428
|
+
t !== i.value && (i.value = t, n("heightChange", t));
|
|
429
|
+
}), gt(() => {
|
|
430
|
+
requestAnimationFrame(() => {
|
|
431
|
+
requestAnimationFrame(() => {
|
|
432
|
+
a.value = !0;
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
}), (t, n) => (P(), O("div", {
|
|
436
|
+
class: "s-ui-toast-provider__toast",
|
|
437
|
+
"data-mounted": a.value,
|
|
438
|
+
"data-front": o.value,
|
|
439
|
+
"data-expanded": e.expanded,
|
|
440
|
+
"data-removed": e.removed,
|
|
441
|
+
"data-visible": e.visible,
|
|
442
|
+
style: N(c.value)
|
|
443
|
+
}, [k("div", {
|
|
444
|
+
ref_key: "contentRef",
|
|
445
|
+
ref: r,
|
|
446
|
+
class: "s-ui-toast-provider__toast-content"
|
|
447
|
+
}, [I(t.$slots, "default")], 512)], 12, Ht));
|
|
448
|
+
}
|
|
449
|
+
}), Y = 4e3, X = 1e4, Wt = 50, Gt = (e, t) => {
|
|
450
|
+
let n = Y + (e.length + (t?.length ?? 0)) * 50;
|
|
451
|
+
return n > 1e4 ? X : n;
|
|
452
|
+
}, Z = L([]), Q = /* @__PURE__ */ new Map(), Kt = 0, qt = {
|
|
453
|
+
type: U.INFO_ACCENT,
|
|
454
|
+
layout: W.HORIZONTAL,
|
|
455
|
+
leftside: G.ICON,
|
|
456
|
+
showPrimaryButton: !1,
|
|
457
|
+
closable: !0
|
|
458
|
+
}, Jt = () => `toast-${Date.now()}-${++Kt}`, $ = (e) => {
|
|
459
|
+
let t = Q.get(e);
|
|
460
|
+
t && (window.clearTimeout(t), Q.delete(e));
|
|
461
|
+
}, Yt = (e) => {
|
|
462
|
+
$(e.id);
|
|
463
|
+
let t = e.duration === void 0 ? Gt(e.title, e.description) : e.duration;
|
|
464
|
+
if (t > 0) {
|
|
465
|
+
let n = window.setTimeout(() => {
|
|
466
|
+
Xt(e.id);
|
|
467
|
+
}, t);
|
|
468
|
+
Q.set(e.id, n);
|
|
469
|
+
}
|
|
470
|
+
}, Xt = (e) => {
|
|
471
|
+
let t = Z.value.findIndex((t) => t.id === e);
|
|
472
|
+
if (t === -1) return;
|
|
473
|
+
let n = Z.value[t];
|
|
474
|
+
n && ($(e), n.onClose && n.onClose(), Z.value = Z.value.filter((t) => t.id !== e));
|
|
475
|
+
}, Zt = () => {
|
|
476
|
+
Q.forEach((e) => window.clearTimeout(e)), Q.clear(), Z.value = [];
|
|
477
|
+
}, Qt = (e) => e.length <= 3 ? e : (e.slice(3).forEach((e) => {
|
|
478
|
+
$(e.id);
|
|
479
|
+
}), e.slice(0, 3)), $t = (e) => {
|
|
480
|
+
let t = e.id ?? Jt(), n = {
|
|
481
|
+
...qt,
|
|
482
|
+
...e,
|
|
483
|
+
id: t
|
|
484
|
+
}, r = Z.value.findIndex((e) => e.id === t);
|
|
485
|
+
if (r > -1) {
|
|
486
|
+
let e = [...Z.value];
|
|
487
|
+
e[r] = n, Z.value = Qt(e);
|
|
488
|
+
} else Z.value = Qt([n, ...Z.value]);
|
|
489
|
+
return Yt(n), t;
|
|
490
|
+
}, en = (e, t) => {
|
|
491
|
+
let n = Z.value.findIndex((t) => t.id === e);
|
|
492
|
+
if (n === -1) return;
|
|
493
|
+
let r = Z.value[n];
|
|
494
|
+
if (!r) return;
|
|
495
|
+
let i = {
|
|
496
|
+
...r,
|
|
497
|
+
...t,
|
|
498
|
+
id: r.id
|
|
499
|
+
}, a = [...Z.value];
|
|
500
|
+
a[n] = i, Z.value = a, Yt(i);
|
|
501
|
+
}, tn = () => ({
|
|
502
|
+
toasts: Z,
|
|
503
|
+
show: $t,
|
|
504
|
+
hide: Xt,
|
|
505
|
+
hideAll: Zt,
|
|
506
|
+
update: en
|
|
507
|
+
}), nn = /* @__PURE__ */ M({
|
|
508
|
+
__name: "SToastProvider",
|
|
509
|
+
setup(e) {
|
|
510
|
+
let { toasts: t, hide: n } = tn(), r = T(() => t.value.slice(0, 3)), i = F(!1), a = L({}), o = F(/* @__PURE__ */ new Set()), s = T(() => t.value[0] ?? null), c = T(() => s.value ? a.value[s.value.id] ?? 0 : 0), l = F(0), u = T(() => c.value > 0 ? c.value : l.value);
|
|
511
|
+
yt(c, (e) => {
|
|
512
|
+
e > 0 && (l.value = e);
|
|
513
|
+
});
|
|
514
|
+
let d = T(() => {
|
|
515
|
+
if (r.value.length === 0) return {};
|
|
516
|
+
if (i.value) return { height: `${r.value.reduce((e, t, n) => {
|
|
517
|
+
let r = a.value[t.id] ?? 0, i = n > 0 ? 4 : 0;
|
|
518
|
+
return e + r + i;
|
|
519
|
+
}, 0)}px` };
|
|
520
|
+
let e = Math.min(r.value.length - 1, 2) * 10;
|
|
521
|
+
return { height: `${u.value + e}px` };
|
|
522
|
+
}), f = (e) => {
|
|
523
|
+
let t = 0;
|
|
524
|
+
for (let n = 0; n < e; n += 1) {
|
|
525
|
+
let e = r.value[n];
|
|
526
|
+
e && (t += (a.value[e.id] ?? 0) + 4);
|
|
527
|
+
}
|
|
528
|
+
return t;
|
|
529
|
+
}, p = (e) => o.value.has(e), m = () => {
|
|
530
|
+
r.value.length > 1 && (i.value = !0);
|
|
531
|
+
}, h = () => {
|
|
532
|
+
i.value = !1;
|
|
533
|
+
}, g = (e, t) => {
|
|
534
|
+
a.value = {
|
|
535
|
+
...a.value,
|
|
536
|
+
[e]: t
|
|
537
|
+
};
|
|
538
|
+
}, _ = (e) => {
|
|
539
|
+
o.value.has(e) || (o.value = new Set([...o.value, e]), window.setTimeout(() => {
|
|
540
|
+
n(e);
|
|
541
|
+
let t = new Set(o.value);
|
|
542
|
+
t.delete(e), o.value = t;
|
|
543
|
+
let r = { ...a.value };
|
|
544
|
+
delete r[e], a.value = r;
|
|
545
|
+
}, 200));
|
|
546
|
+
}, v = (e) => {
|
|
547
|
+
e.onLinkClick && e.onLinkClick();
|
|
548
|
+
}, y = (e) => {
|
|
549
|
+
e.onPrimaryAction && e.onPrimaryAction(e.id);
|
|
550
|
+
}, b = (e) => {
|
|
551
|
+
e.onSecondaryAction && e.onSecondaryAction();
|
|
552
|
+
};
|
|
553
|
+
return (e, t) => (P(), E(ft, { to: "body" }, [k("div", {
|
|
554
|
+
class: "s-ui-toast-provider",
|
|
555
|
+
onMouseenter: m,
|
|
556
|
+
onMouseleave: h
|
|
557
|
+
}, [r.value.length > 0 ? (P(), O("div", {
|
|
558
|
+
key: 0,
|
|
559
|
+
class: "s-ui-toast-provider__list",
|
|
560
|
+
style: N(d.value)
|
|
561
|
+
}, [(P(!0), O(dt, null, _t(r.value, (t, n) => (P(), E(Ut, {
|
|
562
|
+
key: t.id,
|
|
563
|
+
index: n,
|
|
564
|
+
expanded: i.value,
|
|
565
|
+
"front-toast-height": u.value,
|
|
566
|
+
"stack-peek": z(10),
|
|
567
|
+
removed: p(t.id),
|
|
568
|
+
visible: n < z(3),
|
|
569
|
+
"offset-y": f(n),
|
|
570
|
+
onHeightChange: (e) => g(t.id, e)
|
|
571
|
+
}, {
|
|
572
|
+
default: V(() => [I(e.$slots, "toast", { toast: t }, () => [t.component ? (P(), E(vt(t.component), mt({
|
|
573
|
+
key: 0,
|
|
574
|
+
ref_for: !0
|
|
575
|
+
}, t.componentProps, {
|
|
576
|
+
toast: t,
|
|
577
|
+
onClose: (e) => _(t.id)
|
|
578
|
+
}), null, 16, ["toast", "onClose"])) : (P(), E(z(J), {
|
|
579
|
+
key: 1,
|
|
580
|
+
type: t.type,
|
|
581
|
+
layout: t.layout,
|
|
582
|
+
leftside: t.leftside,
|
|
583
|
+
title: t.title,
|
|
584
|
+
description: t.description,
|
|
585
|
+
linkText: t.linkText,
|
|
586
|
+
primaryButtonText: t.primaryButtonText,
|
|
587
|
+
secondaryButtonText: t.secondaryButtonText,
|
|
588
|
+
showPrimaryButton: t.showPrimaryButton,
|
|
589
|
+
closable: t.closable,
|
|
590
|
+
closeAriaLabel: t.closeAriaLabel,
|
|
591
|
+
icon: t.icon,
|
|
592
|
+
avatar: t.avatar,
|
|
593
|
+
width: t.width,
|
|
594
|
+
onClose: (e) => _(t.id),
|
|
595
|
+
onLinkClick: (e) => v(t),
|
|
596
|
+
onPrimaryAction: (e) => y(t),
|
|
597
|
+
onSecondaryAction: (e) => b(t)
|
|
598
|
+
}, null, 8, [
|
|
599
|
+
"type",
|
|
600
|
+
"layout",
|
|
601
|
+
"leftside",
|
|
602
|
+
"title",
|
|
603
|
+
"description",
|
|
604
|
+
"linkText",
|
|
605
|
+
"primaryButtonText",
|
|
606
|
+
"secondaryButtonText",
|
|
607
|
+
"showPrimaryButton",
|
|
608
|
+
"closable",
|
|
609
|
+
"closeAriaLabel",
|
|
610
|
+
"icon",
|
|
611
|
+
"avatar",
|
|
612
|
+
"width",
|
|
613
|
+
"onClose",
|
|
614
|
+
"onLinkClick",
|
|
615
|
+
"onPrimaryAction",
|
|
616
|
+
"onSecondaryAction"
|
|
617
|
+
]))])]),
|
|
618
|
+
_: 2
|
|
619
|
+
}, 1032, [
|
|
620
|
+
"index",
|
|
621
|
+
"expanded",
|
|
622
|
+
"front-toast-height",
|
|
623
|
+
"stack-peek",
|
|
624
|
+
"removed",
|
|
625
|
+
"visible",
|
|
626
|
+
"offset-y",
|
|
627
|
+
"onHeightChange"
|
|
628
|
+
]))), 128))], 4)) : D("", !0)], 32)]));
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
//#endregion
|
|
632
|
+
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, W as ENotificationLayout, G as ENotificationLeftside, U 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, Bt as SBanner, w as SButton, ue as SButtonGroup, he as SCard, ct as SChartHorizontalBar, at as SChartLine, lt as SChartPie, ut as SChartProgress, ot as SChartStackedArea, st as SChartStackedBar, 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, J as SToast, nn as SToastProvider, Qe as SToggle, X as TOAST_AUTO_DURATION_MAX_MS, Y as TOAST_AUTO_DURATION_MIN_MS, Wt as TOAST_AUTO_DURATION_MS_PER_CHAR, Gt as computeAutoDuration, Se as computeConnectedPosition, xt as createUiKit, ee as isSameColor, b as normalizeColorValue, y as resolveColorPreview, re as resolveOwnPropOrGroupedOrFallback, St as setUiKitLocale, Ct as uiKitLocaleEn, wt as uiKitLocaleRu, Ge as useFlatTreeList, we as useFloatingOverlay, We as useSListEndReached, ae as useSelectionGroup, ce as useSelectionGroupItem, tn as useToast, Tt as useUiKitI18n };
|