vitam-uikit-apps 0.1.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/dist/types/components/Accordion/Accordion.stories.d.ts +10 -0
- package/dist/types/components/Accordion/Accordion.vue.d.ts +44 -0
- package/dist/types/components/Accordion/index.d.ts +1 -0
- package/dist/types/components/Avatar/Avatar.stories.d.ts +10 -0
- package/dist/types/components/Avatar/Avatar.vue.d.ts +18 -0
- package/dist/types/components/Avatar/index.d.ts +1 -0
- package/dist/types/components/Badge/Badge.stories.d.ts +11 -0
- package/dist/types/components/Badge/Badge.vue.d.ts +19 -0
- package/dist/types/components/Badge/index.d.ts +1 -0
- package/dist/types/components/Breadcrumb/Breadcrumb.stories.d.ts +9 -0
- package/dist/types/components/Breadcrumb/Breadcrumb.vue.d.ts +27 -0
- package/dist/types/components/Breadcrumb/index.d.ts +1 -0
- package/dist/types/components/BurgerButton/BurgerButton.stories.d.ts +9 -0
- package/dist/types/components/BurgerButton/BurgerButton.vue.d.ts +23 -0
- package/dist/types/components/BurgerButton/index.d.ts +1 -0
- package/dist/types/components/Button/Button.stories.d.ts +19 -0
- package/dist/types/components/Button/Button.vue.d.ts +34 -0
- package/dist/types/components/Button/index.d.ts +2 -0
- package/dist/types/components/Card/Card.stories.d.ts +11 -0
- package/dist/types/components/Card/Card.vue.d.ts +30 -0
- package/dist/types/components/Card/index.d.ts +1 -0
- package/dist/types/components/Checkbox/Checkbox.stories.d.ts +16 -0
- package/dist/types/components/Checkbox/Checkbox.vue.d.ts +28 -0
- package/dist/types/components/Checkbox/index.d.ts +1 -0
- package/dist/types/components/EmptyState/EmptyState.stories.d.ts +9 -0
- package/dist/types/components/EmptyState/EmptyState.vue.d.ts +21 -0
- package/dist/types/components/EmptyState/index.d.ts +1 -0
- package/dist/types/components/Footer/Footer.stories.d.ts +9 -0
- package/dist/types/components/Footer/Footer.vue.d.ts +29 -0
- package/dist/types/components/Footer/index.d.ts +1 -0
- package/dist/types/components/Input/Input.stories.d.ts +12 -0
- package/dist/types/components/Input/Input.vue.d.ts +33 -0
- package/dist/types/components/Input/index.d.ts +1 -0
- package/dist/types/components/Label/Label.stories.d.ts +13 -0
- package/dist/types/components/Label/Label.vue.d.ts +27 -0
- package/dist/types/components/Label/index.d.ts +1 -0
- package/dist/types/components/Modal/Modal.stories.d.ts +9 -0
- package/dist/types/components/Modal/Modal.vue.d.ts +36 -0
- package/dist/types/components/Modal/index.d.ts +1 -0
- package/dist/types/components/NavBar/NavBar.stories.d.ts +10 -0
- package/dist/types/components/NavBar/NavBar.vue.d.ts +39 -0
- package/dist/types/components/NavBar/index.d.ts +1 -0
- package/dist/types/components/NavMenu/NavMenu.stories.d.ts +10 -0
- package/dist/types/components/NavMenu/NavMenu.vue.d.ts +42 -0
- package/dist/types/components/NavMenu/index.d.ts +1 -0
- package/dist/types/components/Overlay/Overlay.stories.d.ts +11 -0
- package/dist/types/components/Overlay/Overlay.vue.d.ts +22 -0
- package/dist/types/components/Overlay/index.d.ts +1 -0
- package/dist/types/components/OverlayLoader/OverlayLoader.stories.d.ts +8 -0
- package/dist/types/components/OverlayLoader/OverlayLoader.vue.d.ts +16 -0
- package/dist/types/components/OverlayLoader/index.d.ts +1 -0
- package/dist/types/components/Pagination/Pagination.stories.d.ts +10 -0
- package/dist/types/components/Pagination/Pagination.vue.d.ts +22 -0
- package/dist/types/components/Pagination/index.d.ts +1 -0
- package/dist/types/components/Pill/Pill.stories.d.ts +8 -0
- package/dist/types/components/Pill/Pill.vue.d.ts +14 -0
- package/dist/types/components/Pill/index.d.ts +1 -0
- package/dist/types/components/RadioGroup/RadioGroup.stories.d.ts +12 -0
- package/dist/types/components/RadioGroup/RadioGroup.vue.d.ts +30 -0
- package/dist/types/components/RadioGroup/index.d.ts +1 -0
- package/dist/types/components/Selector/Selector.stories.d.ts +13 -0
- package/dist/types/components/Selector/Selector.vue.d.ts +33 -0
- package/dist/types/components/Selector/index.d.ts +1 -0
- package/dist/types/components/Switch/Switch.stories.d.ts +13 -0
- package/dist/types/components/Switch/Switch.vue.d.ts +24 -0
- package/dist/types/components/Switch/index.d.ts +1 -0
- package/dist/types/components/Table/Table.stories.d.ts +10 -0
- package/dist/types/components/Table/Table.vue.d.ts +35 -0
- package/dist/types/components/Table/index.d.ts +1 -0
- package/dist/types/components/Tabs/Tabs.stories.d.ts +10 -0
- package/dist/types/components/Tabs/Tabs.vue.d.ts +36 -0
- package/dist/types/components/Tabs/index.d.ts +1 -0
- package/dist/types/components/TextArea/TextArea.stories.d.ts +15 -0
- package/dist/types/components/TextArea/TextArea.vue.d.ts +36 -0
- package/dist/types/components/TextArea/index.d.ts +1 -0
- package/dist/types/components/TitleCard/TitleCard.stories.d.ts +10 -0
- package/dist/types/components/TitleCard/TitleCard.vue.d.ts +25 -0
- package/dist/types/components/TitleCard/index.d.ts +1 -0
- package/dist/types/components/Toast/Toast.stories.d.ts +14 -0
- package/dist/types/components/Toast/Toast.vue.d.ts +21 -0
- package/dist/types/components/Toast/index.d.ts +1 -0
- package/dist/types/components/Tooltip/Tooltip.stories.d.ts +12 -0
- package/dist/types/components/Tooltip/Tooltip.vue.d.ts +28 -0
- package/dist/types/components/Tooltip/index.d.ts +1 -0
- package/dist/types/index.d.ts +29 -0
- package/dist/types/types.d.ts +3 -0
- package/dist/vitam-uikit-apps.cjs.js +2 -0
- package/dist/vitam-uikit-apps.cjs.js.map +1 -0
- package/dist/vitam-uikit-apps.css +1 -0
- package/dist/vitam-uikit-apps.esm.js +1990 -0
- package/dist/vitam-uikit-apps.esm.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,1990 @@
|
|
|
1
|
+
import { defineComponent as I, openBlock as t, createElementBlock as a, normalizeClass as $, createCommentVNode as u, renderSlot as B, createTextVNode as z, toDisplayString as m, computed as S, createElementVNode as o, ref as T, watch as M, normalizeStyle as O, Fragment as p, renderList as V, onMounted as j, onBeforeUnmount as D, createVNode as K, Transition as N, withCtx as A, nextTick as R, createBlock as E, Teleport as P, withDirectives as G, vShow as W, resolveDynamicComponent as U, withKeys as L, withModifiers as F } from "vue";
|
|
2
|
+
const H = ["type", "disabled", "aria-busy"], J = ["src"], Ua = /* @__PURE__ */ I({
|
|
3
|
+
__name: "Button",
|
|
4
|
+
props: {
|
|
5
|
+
label: {},
|
|
6
|
+
variant: { default: "info" },
|
|
7
|
+
size: { default: "md" },
|
|
8
|
+
disabled: { type: Boolean, default: !1 },
|
|
9
|
+
loading: { type: Boolean, default: !1 },
|
|
10
|
+
type: { default: "button" },
|
|
11
|
+
fullWidth: { type: Boolean, default: !1 },
|
|
12
|
+
leftIconSrc: {}
|
|
13
|
+
},
|
|
14
|
+
emits: ["click"],
|
|
15
|
+
setup(e, { emit: c }) {
|
|
16
|
+
const l = e, d = c;
|
|
17
|
+
function n(s) {
|
|
18
|
+
!l.disabled && !l.loading && d("click", s);
|
|
19
|
+
}
|
|
20
|
+
return (s, i) => (t(), a("button", {
|
|
21
|
+
type: e.type,
|
|
22
|
+
disabled: e.disabled || e.loading,
|
|
23
|
+
"aria-busy": e.loading || void 0,
|
|
24
|
+
class: $([
|
|
25
|
+
"vk-button",
|
|
26
|
+
`vk-button--${e.variant}`,
|
|
27
|
+
`vk-button--${e.size}`,
|
|
28
|
+
{ "vk-button--full-width": e.fullWidth },
|
|
29
|
+
{ "vk-button--loading": e.loading },
|
|
30
|
+
{ "vk-button--disabled": e.disabled }
|
|
31
|
+
]),
|
|
32
|
+
onClick: n
|
|
33
|
+
}, [
|
|
34
|
+
e.leftIconSrc ? (t(), a("img", {
|
|
35
|
+
key: 0,
|
|
36
|
+
src: e.leftIconSrc,
|
|
37
|
+
class: "vk-button__icon vk-button__icon--left",
|
|
38
|
+
"aria-hidden": "true",
|
|
39
|
+
alt: ""
|
|
40
|
+
}, null, 8, J)) : u("", !0),
|
|
41
|
+
B(s.$slots, "default", {}, () => [
|
|
42
|
+
z(m(e.label), 1)
|
|
43
|
+
])
|
|
44
|
+
], 10, H));
|
|
45
|
+
}
|
|
46
|
+
}), Q = ["for"], X = {
|
|
47
|
+
key: 0,
|
|
48
|
+
class: "vk-input__required",
|
|
49
|
+
"aria-hidden": "true"
|
|
50
|
+
}, Y = { class: "vk-input__wrapper" }, Z = ["src"], ee = ["id", "type", "value", "placeholder", "disabled", "readonly", "required", "aria-describedby", "aria-invalid"], te = ["id"], ae = ["id"], Ha = /* @__PURE__ */ I({
|
|
51
|
+
__name: "Input",
|
|
52
|
+
props: {
|
|
53
|
+
modelValue: {},
|
|
54
|
+
type: { default: "text" },
|
|
55
|
+
placeholder: {},
|
|
56
|
+
label: {},
|
|
57
|
+
hint: {},
|
|
58
|
+
error: {},
|
|
59
|
+
leftIconSrc: {},
|
|
60
|
+
disabled: { type: Boolean, default: !1 },
|
|
61
|
+
readonly: { type: Boolean, default: !1 },
|
|
62
|
+
required: { type: Boolean, default: !1 },
|
|
63
|
+
size: { default: "md" },
|
|
64
|
+
variant: { default: "info" },
|
|
65
|
+
id: {}
|
|
66
|
+
},
|
|
67
|
+
emits: ["update:modelValue", "blur", "focus"],
|
|
68
|
+
setup(e, { emit: c }) {
|
|
69
|
+
const l = e, d = c, n = S(
|
|
70
|
+
() => l.id ?? `vk-input-${Math.random().toString(36).slice(2, 9)}`
|
|
71
|
+
), s = S(() => l.error ? `${n.value}-error` : l.hint ? `${n.value}-hint` : null);
|
|
72
|
+
function i(f) {
|
|
73
|
+
const v = f.target;
|
|
74
|
+
d("update:modelValue", v.value);
|
|
75
|
+
}
|
|
76
|
+
return (f, v) => (t(), a("div", {
|
|
77
|
+
class: $([
|
|
78
|
+
"vk-input",
|
|
79
|
+
`vk-input--${e.size}`,
|
|
80
|
+
`vk-input--${e.variant}`,
|
|
81
|
+
{ "vk-input--error": !!e.error },
|
|
82
|
+
{ "vk-input--disabled": e.disabled }
|
|
83
|
+
])
|
|
84
|
+
}, [
|
|
85
|
+
e.label ? (t(), a("label", {
|
|
86
|
+
key: 0,
|
|
87
|
+
for: n.value,
|
|
88
|
+
class: "vk-input__label"
|
|
89
|
+
}, [
|
|
90
|
+
z(m(e.label) + " ", 1),
|
|
91
|
+
e.required ? (t(), a("span", X, "*")) : u("", !0)
|
|
92
|
+
], 8, Q)) : u("", !0),
|
|
93
|
+
o("div", Y, [
|
|
94
|
+
e.leftIconSrc ? (t(), a("img", {
|
|
95
|
+
key: 0,
|
|
96
|
+
src: e.leftIconSrc,
|
|
97
|
+
class: "vk-input__icon vk-input__icon--left",
|
|
98
|
+
"aria-hidden": "true",
|
|
99
|
+
alt: ""
|
|
100
|
+
}, null, 8, Z)) : u("", !0),
|
|
101
|
+
o("input", {
|
|
102
|
+
id: n.value,
|
|
103
|
+
type: e.type,
|
|
104
|
+
value: e.modelValue,
|
|
105
|
+
placeholder: e.placeholder,
|
|
106
|
+
disabled: e.disabled,
|
|
107
|
+
readonly: e.readonly,
|
|
108
|
+
required: e.required,
|
|
109
|
+
"aria-describedby": s.value || void 0,
|
|
110
|
+
"aria-invalid": e.error ? "true" : void 0,
|
|
111
|
+
class: $(["vk-input__field", { "vk-input__field--has-icon": !!e.leftIconSrc }]),
|
|
112
|
+
onInput: i,
|
|
113
|
+
onBlur: v[0] || (v[0] = (h) => d("blur", h)),
|
|
114
|
+
onFocus: v[1] || (v[1] = (h) => d("focus", h))
|
|
115
|
+
}, null, 42, ee)
|
|
116
|
+
]),
|
|
117
|
+
e.error ? (t(), a("span", {
|
|
118
|
+
key: 1,
|
|
119
|
+
id: `${n.value}-error`,
|
|
120
|
+
class: "vk-input__message vk-input__message--error",
|
|
121
|
+
role: "alert"
|
|
122
|
+
}, m(e.error), 9, te)) : e.hint ? (t(), a("span", {
|
|
123
|
+
key: 2,
|
|
124
|
+
id: `${n.value}-hint`,
|
|
125
|
+
class: "vk-input__message vk-input__message--hint"
|
|
126
|
+
}, m(e.hint), 9, ae)) : u("", !0)
|
|
127
|
+
], 2));
|
|
128
|
+
}
|
|
129
|
+
}), le = ["for"], ne = {
|
|
130
|
+
key: 0,
|
|
131
|
+
class: "vk-textarea__required",
|
|
132
|
+
"aria-hidden": "true"
|
|
133
|
+
}, ie = { class: "vk-textarea__wrapper" }, se = ["src"], oe = ["id", "value", "placeholder", "rows", "maxlength", "disabled", "readonly", "required", "aria-describedby", "aria-invalid"], re = { class: "vk-textarea__footer" }, ce = ["id"], de = ["id"], ue = ["aria-label"], Ja = /* @__PURE__ */ I({
|
|
134
|
+
__name: "TextArea",
|
|
135
|
+
props: {
|
|
136
|
+
modelValue: {},
|
|
137
|
+
label: {},
|
|
138
|
+
placeholder: {},
|
|
139
|
+
hint: {},
|
|
140
|
+
error: {},
|
|
141
|
+
rows: { default: 4 },
|
|
142
|
+
maxLength: {},
|
|
143
|
+
resize: { default: "vertical" },
|
|
144
|
+
leftIconSrc: {},
|
|
145
|
+
disabled: { type: Boolean, default: !1 },
|
|
146
|
+
readonly: { type: Boolean, default: !1 },
|
|
147
|
+
required: { type: Boolean, default: !1 },
|
|
148
|
+
size: { default: "md" },
|
|
149
|
+
variant: { default: "info" },
|
|
150
|
+
id: {}
|
|
151
|
+
},
|
|
152
|
+
emits: ["update:modelValue", "blur", "focus"],
|
|
153
|
+
setup(e, { emit: c }) {
|
|
154
|
+
var v;
|
|
155
|
+
const l = e, d = c, n = S(
|
|
156
|
+
() => l.id ?? `vk-textarea-${Math.random().toString(36).slice(2, 9)}`
|
|
157
|
+
), s = T(((v = l.modelValue) == null ? void 0 : v.length) ?? 0);
|
|
158
|
+
M(
|
|
159
|
+
() => l.modelValue,
|
|
160
|
+
(h) => {
|
|
161
|
+
s.value = (h == null ? void 0 : h.length) ?? 0;
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
const i = S(() => l.error ? `${n.value}-error` : l.hint ? `${n.value}-hint` : null);
|
|
165
|
+
function f(h) {
|
|
166
|
+
const k = h.target;
|
|
167
|
+
s.value = k.value.length, d("update:modelValue", k.value);
|
|
168
|
+
}
|
|
169
|
+
return (h, k) => (t(), a("div", {
|
|
170
|
+
class: $([
|
|
171
|
+
"vk-textarea",
|
|
172
|
+
`vk-textarea--${e.size}`,
|
|
173
|
+
`vk-textarea--${e.variant}`,
|
|
174
|
+
{ "vk-textarea--error": !!e.error },
|
|
175
|
+
{ "vk-textarea--disabled": e.disabled }
|
|
176
|
+
])
|
|
177
|
+
}, [
|
|
178
|
+
e.label ? (t(), a("label", {
|
|
179
|
+
key: 0,
|
|
180
|
+
for: n.value,
|
|
181
|
+
class: "vk-textarea__label"
|
|
182
|
+
}, [
|
|
183
|
+
z(m(e.label) + " ", 1),
|
|
184
|
+
e.required ? (t(), a("span", ne, "*")) : u("", !0)
|
|
185
|
+
], 8, le)) : u("", !0),
|
|
186
|
+
o("div", ie, [
|
|
187
|
+
e.leftIconSrc ? (t(), a("img", {
|
|
188
|
+
key: 0,
|
|
189
|
+
src: e.leftIconSrc,
|
|
190
|
+
class: "vk-textarea__icon",
|
|
191
|
+
"aria-hidden": "true",
|
|
192
|
+
alt: ""
|
|
193
|
+
}, null, 8, se)) : u("", !0),
|
|
194
|
+
o("textarea", {
|
|
195
|
+
id: n.value,
|
|
196
|
+
value: e.modelValue,
|
|
197
|
+
placeholder: e.placeholder,
|
|
198
|
+
rows: e.rows,
|
|
199
|
+
maxlength: e.maxLength,
|
|
200
|
+
disabled: e.disabled,
|
|
201
|
+
readonly: e.readonly,
|
|
202
|
+
required: e.required,
|
|
203
|
+
"aria-describedby": i.value || void 0,
|
|
204
|
+
"aria-invalid": e.error ? "true" : void 0,
|
|
205
|
+
class: $([
|
|
206
|
+
"vk-textarea__field",
|
|
207
|
+
{ "vk-textarea__field--has-icon": !!e.leftIconSrc }
|
|
208
|
+
]),
|
|
209
|
+
style: O({ resize: e.resize }),
|
|
210
|
+
onInput: f,
|
|
211
|
+
onBlur: k[0] || (k[0] = (r) => d("blur", r)),
|
|
212
|
+
onFocus: k[1] || (k[1] = (r) => d("focus", r))
|
|
213
|
+
}, null, 46, oe)
|
|
214
|
+
]),
|
|
215
|
+
o("div", re, [
|
|
216
|
+
e.error ? (t(), a("span", {
|
|
217
|
+
key: 0,
|
|
218
|
+
id: `${n.value}-error`,
|
|
219
|
+
class: "vk-textarea__message vk-textarea__message--error",
|
|
220
|
+
role: "alert"
|
|
221
|
+
}, m(e.error), 9, ce)) : e.hint ? (t(), a("span", {
|
|
222
|
+
key: 1,
|
|
223
|
+
id: `${n.value}-hint`,
|
|
224
|
+
class: "vk-textarea__message vk-textarea__message--hint"
|
|
225
|
+
}, m(e.hint), 9, de)) : u("", !0),
|
|
226
|
+
e.maxLength ? (t(), a("span", {
|
|
227
|
+
key: 2,
|
|
228
|
+
class: "vk-textarea__char-count",
|
|
229
|
+
"aria-label": `${s.value} of ${e.maxLength} characters used`
|
|
230
|
+
}, m(s.value) + "/" + m(e.maxLength), 9, ue)) : u("", !0)
|
|
231
|
+
])
|
|
232
|
+
], 2));
|
|
233
|
+
}
|
|
234
|
+
}), ve = ["for"], fe = {
|
|
235
|
+
key: 0,
|
|
236
|
+
class: "vk-selector__required",
|
|
237
|
+
"aria-hidden": "true"
|
|
238
|
+
}, ke = { class: "vk-selector__wrapper" }, be = ["src"], he = ["id", "value", "disabled", "required", "aria-describedby", "aria-invalid"], me = ["selected"], _e = ["value", "disabled"], ye = ["id"], Qa = /* @__PURE__ */ I({
|
|
239
|
+
__name: "Selector",
|
|
240
|
+
props: {
|
|
241
|
+
modelValue: {},
|
|
242
|
+
options: {},
|
|
243
|
+
label: {},
|
|
244
|
+
placeholder: { default: "Select an option" },
|
|
245
|
+
leftIconSrc: {},
|
|
246
|
+
disabled: { type: Boolean, default: !1 },
|
|
247
|
+
required: { type: Boolean, default: !1 },
|
|
248
|
+
error: {},
|
|
249
|
+
size: { default: "md" },
|
|
250
|
+
variant: { default: "info" },
|
|
251
|
+
id: {}
|
|
252
|
+
},
|
|
253
|
+
emits: ["update:modelValue", "change"],
|
|
254
|
+
setup(e, { emit: c }) {
|
|
255
|
+
const l = e, d = c, n = S(
|
|
256
|
+
() => l.id ?? `vk-selector-${Math.random().toString(36).slice(2, 9)}`
|
|
257
|
+
);
|
|
258
|
+
function s(i) {
|
|
259
|
+
const v = i.target.value, h = l.options.find((r) => String(r.value) === v), k = h ? h.value : v || null;
|
|
260
|
+
d("update:modelValue", k), d("change", k);
|
|
261
|
+
}
|
|
262
|
+
return (i, f) => (t(), a("div", {
|
|
263
|
+
class: $([
|
|
264
|
+
"vk-selector",
|
|
265
|
+
`vk-selector--${e.size}`,
|
|
266
|
+
`vk-selector--${e.variant}`,
|
|
267
|
+
{ "vk-selector--error": !!e.error },
|
|
268
|
+
{ "vk-selector--disabled": e.disabled }
|
|
269
|
+
])
|
|
270
|
+
}, [
|
|
271
|
+
e.label ? (t(), a("label", {
|
|
272
|
+
key: 0,
|
|
273
|
+
for: n.value,
|
|
274
|
+
class: "vk-selector__label"
|
|
275
|
+
}, [
|
|
276
|
+
z(m(e.label) + " ", 1),
|
|
277
|
+
e.required ? (t(), a("span", fe, "*")) : u("", !0)
|
|
278
|
+
], 8, ve)) : u("", !0),
|
|
279
|
+
o("div", ke, [
|
|
280
|
+
e.leftIconSrc ? (t(), a("img", {
|
|
281
|
+
key: 0,
|
|
282
|
+
src: e.leftIconSrc,
|
|
283
|
+
class: "vk-selector__icon vk-selector__icon--left",
|
|
284
|
+
"aria-hidden": "true",
|
|
285
|
+
alt: ""
|
|
286
|
+
}, null, 8, be)) : u("", !0),
|
|
287
|
+
o("select", {
|
|
288
|
+
id: n.value,
|
|
289
|
+
value: e.modelValue ?? "",
|
|
290
|
+
disabled: e.disabled,
|
|
291
|
+
required: e.required,
|
|
292
|
+
"aria-describedby": e.error ? `${n.value}-error` : void 0,
|
|
293
|
+
"aria-invalid": e.error ? "true" : void 0,
|
|
294
|
+
class: $([
|
|
295
|
+
"vk-selector__field",
|
|
296
|
+
{ "vk-selector__field--has-icon": !!e.leftIconSrc },
|
|
297
|
+
{ "vk-selector__field--placeholder": e.modelValue === null || e.modelValue === void 0 }
|
|
298
|
+
]),
|
|
299
|
+
onChange: s
|
|
300
|
+
}, [
|
|
301
|
+
e.placeholder ? (t(), a("option", {
|
|
302
|
+
key: 0,
|
|
303
|
+
value: "",
|
|
304
|
+
disabled: "",
|
|
305
|
+
selected: e.modelValue === null || e.modelValue === void 0,
|
|
306
|
+
hidden: ""
|
|
307
|
+
}, m(e.placeholder), 9, me)) : u("", !0),
|
|
308
|
+
(t(!0), a(p, null, V(e.options, (v) => (t(), a("option", {
|
|
309
|
+
key: v.value,
|
|
310
|
+
value: v.value,
|
|
311
|
+
disabled: v.disabled
|
|
312
|
+
}, m(v.label), 9, _e))), 128))
|
|
313
|
+
], 42, he),
|
|
314
|
+
f[0] || (f[0] = o("span", {
|
|
315
|
+
class: "vk-selector__caret",
|
|
316
|
+
"aria-hidden": "true"
|
|
317
|
+
}, null, -1))
|
|
318
|
+
]),
|
|
319
|
+
e.error ? (t(), a("span", {
|
|
320
|
+
key: 1,
|
|
321
|
+
id: `${n.value}-error`,
|
|
322
|
+
class: "vk-selector__message vk-selector__message--error",
|
|
323
|
+
role: "alert"
|
|
324
|
+
}, m(e.error), 9, ye)) : u("", !0)
|
|
325
|
+
], 2));
|
|
326
|
+
}
|
|
327
|
+
}), $e = ["for"], ge = { class: "vk-checkbox__control" }, xe = ["id", "checked", "disabled", "required"], we = {
|
|
328
|
+
class: "vk-checkbox__box",
|
|
329
|
+
"aria-hidden": "true"
|
|
330
|
+
}, Ie = {
|
|
331
|
+
key: 0,
|
|
332
|
+
class: "vk-checkbox__mark",
|
|
333
|
+
viewBox: "0 0 12 12",
|
|
334
|
+
fill: "none",
|
|
335
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
336
|
+
}, Se = {
|
|
337
|
+
key: 1,
|
|
338
|
+
class: "vk-checkbox__mark",
|
|
339
|
+
viewBox: "0 0 12 12",
|
|
340
|
+
fill: "none",
|
|
341
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
342
|
+
}, Be = {
|
|
343
|
+
key: 0,
|
|
344
|
+
class: "vk-checkbox__content"
|
|
345
|
+
}, Ce = {
|
|
346
|
+
key: 0,
|
|
347
|
+
class: "vk-checkbox__label"
|
|
348
|
+
}, pe = {
|
|
349
|
+
key: 0,
|
|
350
|
+
class: "vk-checkbox__required",
|
|
351
|
+
"aria-hidden": "true"
|
|
352
|
+
}, Ve = {
|
|
353
|
+
key: 1,
|
|
354
|
+
class: "vk-checkbox__description"
|
|
355
|
+
}, Xa = /* @__PURE__ */ I({
|
|
356
|
+
__name: "Checkbox",
|
|
357
|
+
props: {
|
|
358
|
+
modelValue: { type: Boolean, default: !1 },
|
|
359
|
+
label: {},
|
|
360
|
+
description: {},
|
|
361
|
+
disabled: { type: Boolean, default: !1 },
|
|
362
|
+
required: { type: Boolean, default: !1 },
|
|
363
|
+
indeterminate: { type: Boolean, default: !1 },
|
|
364
|
+
size: { default: "md" },
|
|
365
|
+
variant: { default: "info" },
|
|
366
|
+
id: {}
|
|
367
|
+
},
|
|
368
|
+
emits: ["update:modelValue", "change"],
|
|
369
|
+
setup(e, { emit: c }) {
|
|
370
|
+
const l = e, d = c, n = S(
|
|
371
|
+
() => l.id ?? `vk-checkbox-${Math.random().toString(36).slice(2, 9)}`
|
|
372
|
+
), s = T(null);
|
|
373
|
+
M(
|
|
374
|
+
() => l.indeterminate,
|
|
375
|
+
(f) => {
|
|
376
|
+
s.value && (s.value.indeterminate = f);
|
|
377
|
+
},
|
|
378
|
+
{ immediate: !0 }
|
|
379
|
+
);
|
|
380
|
+
function i(f) {
|
|
381
|
+
const v = f.target.checked;
|
|
382
|
+
d("update:modelValue", v), d("change", v);
|
|
383
|
+
}
|
|
384
|
+
return (f, v) => (t(), a("label", {
|
|
385
|
+
for: n.value,
|
|
386
|
+
class: $([
|
|
387
|
+
"vk-checkbox",
|
|
388
|
+
`vk-checkbox--${e.size}`,
|
|
389
|
+
`vk-checkbox--${e.variant}`,
|
|
390
|
+
{ "vk-checkbox--checked": e.modelValue },
|
|
391
|
+
{ "vk-checkbox--indeterminate": e.indeterminate },
|
|
392
|
+
{ "vk-checkbox--disabled": e.disabled }
|
|
393
|
+
])
|
|
394
|
+
}, [
|
|
395
|
+
o("span", ge, [
|
|
396
|
+
o("input", {
|
|
397
|
+
id: n.value,
|
|
398
|
+
ref_key: "inputRef",
|
|
399
|
+
ref: s,
|
|
400
|
+
type: "checkbox",
|
|
401
|
+
class: "vk-checkbox__input",
|
|
402
|
+
checked: e.modelValue,
|
|
403
|
+
disabled: e.disabled,
|
|
404
|
+
required: e.required,
|
|
405
|
+
onChange: i
|
|
406
|
+
}, null, 40, xe),
|
|
407
|
+
o("span", we, [
|
|
408
|
+
e.modelValue && !e.indeterminate ? (t(), a("svg", Ie, [...v[0] || (v[0] = [
|
|
409
|
+
o("polyline", {
|
|
410
|
+
points: "1.5,6 4.5,9.5 10.5,2.5",
|
|
411
|
+
stroke: "currentColor",
|
|
412
|
+
"stroke-width": "2",
|
|
413
|
+
"stroke-linecap": "round",
|
|
414
|
+
"stroke-linejoin": "round"
|
|
415
|
+
}, null, -1)
|
|
416
|
+
])])) : e.indeterminate ? (t(), a("svg", Se, [...v[1] || (v[1] = [
|
|
417
|
+
o("line", {
|
|
418
|
+
x1: "2",
|
|
419
|
+
y1: "6",
|
|
420
|
+
x2: "10",
|
|
421
|
+
y2: "6",
|
|
422
|
+
stroke: "currentColor",
|
|
423
|
+
"stroke-width": "2",
|
|
424
|
+
"stroke-linecap": "round"
|
|
425
|
+
}, null, -1)
|
|
426
|
+
])])) : u("", !0)
|
|
427
|
+
])
|
|
428
|
+
]),
|
|
429
|
+
e.label || e.description ? (t(), a("span", Be, [
|
|
430
|
+
e.label ? (t(), a("span", Ce, [
|
|
431
|
+
z(m(e.label) + " ", 1),
|
|
432
|
+
e.required ? (t(), a("span", pe, "*")) : u("", !0)
|
|
433
|
+
])) : u("", !0),
|
|
434
|
+
e.description ? (t(), a("span", Ve, m(e.description), 1)) : u("", !0)
|
|
435
|
+
])) : u("", !0)
|
|
436
|
+
], 10, $e));
|
|
437
|
+
}
|
|
438
|
+
}), Te = ["disabled"], qe = {
|
|
439
|
+
key: 0,
|
|
440
|
+
class: "vk-radio-group__legend"
|
|
441
|
+
}, ze = {
|
|
442
|
+
key: 0,
|
|
443
|
+
class: "vk-radio-group__required",
|
|
444
|
+
"aria-hidden": "true"
|
|
445
|
+
}, Me = { class: "vk-radio__control" }, De = ["name", "value", "checked", "disabled", "required", "onChange"], Oe = { class: "vk-radio__content" }, Ae = { class: "vk-radio__label" }, Ee = {
|
|
446
|
+
key: 0,
|
|
447
|
+
class: "vk-radio__description"
|
|
448
|
+
}, Ya = /* @__PURE__ */ I({
|
|
449
|
+
__name: "RadioGroup",
|
|
450
|
+
props: {
|
|
451
|
+
modelValue: {},
|
|
452
|
+
name: {},
|
|
453
|
+
options: {},
|
|
454
|
+
label: {},
|
|
455
|
+
direction: { default: "vertical" },
|
|
456
|
+
disabled: { type: Boolean, default: !1 },
|
|
457
|
+
required: { type: Boolean, default: !1 },
|
|
458
|
+
variant: { default: "info" }
|
|
459
|
+
},
|
|
460
|
+
emits: ["update:modelValue", "change"],
|
|
461
|
+
setup(e, { emit: c }) {
|
|
462
|
+
const l = c;
|
|
463
|
+
function d(n) {
|
|
464
|
+
l("update:modelValue", n), l("change", n);
|
|
465
|
+
}
|
|
466
|
+
return (n, s) => (t(), a("fieldset", {
|
|
467
|
+
class: $([
|
|
468
|
+
"vk-radio-group",
|
|
469
|
+
`vk-radio-group--${e.direction}`,
|
|
470
|
+
{ "vk-radio-group--disabled": e.disabled }
|
|
471
|
+
]),
|
|
472
|
+
disabled: e.disabled
|
|
473
|
+
}, [
|
|
474
|
+
e.label ? (t(), a("legend", qe, [
|
|
475
|
+
z(m(e.label) + " ", 1),
|
|
476
|
+
e.required ? (t(), a("span", ze, "*")) : u("", !0)
|
|
477
|
+
])) : u("", !0),
|
|
478
|
+
(t(!0), a(p, null, V(e.options, (i) => (t(), a("label", {
|
|
479
|
+
key: i.value,
|
|
480
|
+
class: $([
|
|
481
|
+
"vk-radio",
|
|
482
|
+
`vk-radio--${e.variant}`,
|
|
483
|
+
{ "vk-radio--checked": e.modelValue === i.value },
|
|
484
|
+
{ "vk-radio--disabled": e.disabled || i.disabled }
|
|
485
|
+
])
|
|
486
|
+
}, [
|
|
487
|
+
o("span", Me, [
|
|
488
|
+
o("input", {
|
|
489
|
+
type: "radio",
|
|
490
|
+
name: e.name,
|
|
491
|
+
value: i.value,
|
|
492
|
+
checked: e.modelValue === i.value,
|
|
493
|
+
disabled: e.disabled || i.disabled,
|
|
494
|
+
required: e.required,
|
|
495
|
+
class: "vk-radio__input",
|
|
496
|
+
onChange: (f) => d(i.value)
|
|
497
|
+
}, null, 40, De),
|
|
498
|
+
s[0] || (s[0] = o("span", {
|
|
499
|
+
class: "vk-radio__dot",
|
|
500
|
+
"aria-hidden": "true"
|
|
501
|
+
}, null, -1))
|
|
502
|
+
]),
|
|
503
|
+
o("span", Oe, [
|
|
504
|
+
o("span", Ae, m(i.label), 1),
|
|
505
|
+
i.description ? (t(), a("span", Ee, m(i.description), 1)) : u("", !0)
|
|
506
|
+
])
|
|
507
|
+
], 2))), 128))
|
|
508
|
+
], 10, Te));
|
|
509
|
+
}
|
|
510
|
+
}), Le = ["for"], Fe = { class: "vk-switch__control" }, Ke = ["id", "checked", "aria-checked", "disabled"], Ne = {
|
|
511
|
+
key: 0,
|
|
512
|
+
class: "vk-switch__content"
|
|
513
|
+
}, Re = {
|
|
514
|
+
key: 0,
|
|
515
|
+
class: "vk-switch__label"
|
|
516
|
+
}, Pe = {
|
|
517
|
+
key: 1,
|
|
518
|
+
class: "vk-switch__description"
|
|
519
|
+
}, Za = /* @__PURE__ */ I({
|
|
520
|
+
__name: "Switch",
|
|
521
|
+
props: {
|
|
522
|
+
modelValue: { type: Boolean, default: !1 },
|
|
523
|
+
label: {},
|
|
524
|
+
description: {},
|
|
525
|
+
disabled: { type: Boolean, default: !1 },
|
|
526
|
+
size: { default: "md" },
|
|
527
|
+
variant: { default: "info" },
|
|
528
|
+
id: {}
|
|
529
|
+
},
|
|
530
|
+
emits: ["update:modelValue", "change"],
|
|
531
|
+
setup(e, { emit: c }) {
|
|
532
|
+
const l = e, d = c, n = S(
|
|
533
|
+
() => l.id ?? `vk-switch-${Math.random().toString(36).slice(2, 9)}`
|
|
534
|
+
);
|
|
535
|
+
function s(i) {
|
|
536
|
+
const f = i.target.checked;
|
|
537
|
+
d("update:modelValue", f), d("change", f);
|
|
538
|
+
}
|
|
539
|
+
return (i, f) => (t(), a("label", {
|
|
540
|
+
for: n.value,
|
|
541
|
+
class: $([
|
|
542
|
+
"vk-switch",
|
|
543
|
+
`vk-switch--${e.size}`,
|
|
544
|
+
`vk-switch--${e.variant}`,
|
|
545
|
+
{ "vk-switch--checked": e.modelValue },
|
|
546
|
+
{ "vk-switch--disabled": e.disabled }
|
|
547
|
+
])
|
|
548
|
+
}, [
|
|
549
|
+
o("span", Fe, [
|
|
550
|
+
o("input", {
|
|
551
|
+
id: n.value,
|
|
552
|
+
type: "checkbox",
|
|
553
|
+
class: "vk-switch__input",
|
|
554
|
+
role: "switch",
|
|
555
|
+
checked: e.modelValue,
|
|
556
|
+
"aria-checked": e.modelValue ? "true" : "false",
|
|
557
|
+
disabled: e.disabled,
|
|
558
|
+
onChange: s
|
|
559
|
+
}, null, 40, Ke),
|
|
560
|
+
f[0] || (f[0] = o("span", {
|
|
561
|
+
class: "vk-switch__track",
|
|
562
|
+
"aria-hidden": "true"
|
|
563
|
+
}, [
|
|
564
|
+
o("span", { class: "vk-switch__thumb" })
|
|
565
|
+
], -1))
|
|
566
|
+
]),
|
|
567
|
+
e.label || e.description ? (t(), a("span", Ne, [
|
|
568
|
+
e.label ? (t(), a("span", Re, m(e.label), 1)) : u("", !0),
|
|
569
|
+
e.description ? (t(), a("span", Pe, m(e.description), 1)) : u("", !0)
|
|
570
|
+
])) : u("", !0)
|
|
571
|
+
], 10, Le));
|
|
572
|
+
}
|
|
573
|
+
}), je = ["for"], Ge = ["src"], We = {
|
|
574
|
+
key: 1,
|
|
575
|
+
class: "vk-label__required",
|
|
576
|
+
"aria-hidden": "true"
|
|
577
|
+
}, el = /* @__PURE__ */ I({
|
|
578
|
+
__name: "Label",
|
|
579
|
+
props: {
|
|
580
|
+
text: {},
|
|
581
|
+
forId: {},
|
|
582
|
+
variant: { default: "info" },
|
|
583
|
+
size: { default: "md" },
|
|
584
|
+
disabled: { type: Boolean, default: !1 },
|
|
585
|
+
required: { type: Boolean, default: !1 },
|
|
586
|
+
leftIconSrc: {}
|
|
587
|
+
},
|
|
588
|
+
setup(e) {
|
|
589
|
+
return (c, l) => (t(), a("label", {
|
|
590
|
+
for: e.forId,
|
|
591
|
+
class: $([
|
|
592
|
+
"vk-label",
|
|
593
|
+
`vk-label--${e.variant}`,
|
|
594
|
+
`vk-label--${e.size}`,
|
|
595
|
+
{ "vk-label--disabled": e.disabled }
|
|
596
|
+
])
|
|
597
|
+
}, [
|
|
598
|
+
e.leftIconSrc ? (t(), a("img", {
|
|
599
|
+
key: 0,
|
|
600
|
+
src: e.leftIconSrc,
|
|
601
|
+
class: "vk-label__icon",
|
|
602
|
+
"aria-hidden": "true",
|
|
603
|
+
alt: ""
|
|
604
|
+
}, null, 8, Ge)) : u("", !0),
|
|
605
|
+
B(c.$slots, "default", {}, () => [
|
|
606
|
+
z(m(e.text), 1)
|
|
607
|
+
]),
|
|
608
|
+
e.required ? (t(), a("span", We, "*")) : u("", !0)
|
|
609
|
+
], 10, je));
|
|
610
|
+
}
|
|
611
|
+
}), Ue = ["aria-hidden", "aria-label"], He = ["src"], Je = { class: "vk-badge__text" }, tl = /* @__PURE__ */ I({
|
|
612
|
+
__name: "Badge",
|
|
613
|
+
props: {
|
|
614
|
+
text: {},
|
|
615
|
+
count: {},
|
|
616
|
+
max: { default: 99 },
|
|
617
|
+
size: { default: "md" },
|
|
618
|
+
variant: { default: "info" },
|
|
619
|
+
leftIconSrc: {},
|
|
620
|
+
decorative: { type: Boolean, default: !1 },
|
|
621
|
+
ariaLabel: {}
|
|
622
|
+
},
|
|
623
|
+
setup(e) {
|
|
624
|
+
const c = e, l = S(() => typeof c.count == "number" ? c.count > c.max ? `${c.max}+` : String(c.count) : c.text ?? "");
|
|
625
|
+
return (d, n) => (t(), a("span", {
|
|
626
|
+
class: $([
|
|
627
|
+
"vk-badge",
|
|
628
|
+
`vk-badge--${e.size}`,
|
|
629
|
+
`vk-badge--${e.variant}`
|
|
630
|
+
]),
|
|
631
|
+
"aria-hidden": e.decorative ? "true" : void 0,
|
|
632
|
+
"aria-label": !e.decorative && e.ariaLabel ? e.ariaLabel : void 0
|
|
633
|
+
}, [
|
|
634
|
+
e.leftIconSrc ? (t(), a("img", {
|
|
635
|
+
key: 0,
|
|
636
|
+
src: e.leftIconSrc,
|
|
637
|
+
class: "vk-badge__icon",
|
|
638
|
+
alt: "",
|
|
639
|
+
"aria-hidden": "true"
|
|
640
|
+
}, null, 8, He)) : u("", !0),
|
|
641
|
+
o("span", Je, m(l.value), 1)
|
|
642
|
+
], 10, Ue));
|
|
643
|
+
}
|
|
644
|
+
}), al = /* @__PURE__ */ I({
|
|
645
|
+
__name: "Pill",
|
|
646
|
+
props: {
|
|
647
|
+
label: {},
|
|
648
|
+
variant: { default: "info" },
|
|
649
|
+
size: { default: "md" },
|
|
650
|
+
outlined: { type: Boolean, default: !1 }
|
|
651
|
+
},
|
|
652
|
+
setup(e) {
|
|
653
|
+
return (c, l) => (t(), a("span", {
|
|
654
|
+
class: $([
|
|
655
|
+
"vk-pill",
|
|
656
|
+
`vk-pill--${e.variant}`,
|
|
657
|
+
`vk-pill--${e.size}`,
|
|
658
|
+
{ "vk-pill--outlined": e.outlined }
|
|
659
|
+
])
|
|
660
|
+
}, m(e.label), 3));
|
|
661
|
+
}
|
|
662
|
+
}), Qe = ["role"], Xe = ["src"], Ye = { class: "vk-toast__content" }, Ze = {
|
|
663
|
+
key: 0,
|
|
664
|
+
class: "vk-toast__title"
|
|
665
|
+
}, et = { class: "vk-toast__message" }, ll = /* @__PURE__ */ I({
|
|
666
|
+
__name: "Toast",
|
|
667
|
+
props: {
|
|
668
|
+
title: {},
|
|
669
|
+
message: {},
|
|
670
|
+
variant: { default: "info" },
|
|
671
|
+
duration: { default: 4e3 },
|
|
672
|
+
dismissible: { type: Boolean, default: !0 },
|
|
673
|
+
leftIconSrc: {}
|
|
674
|
+
},
|
|
675
|
+
emits: ["close", "timeout"],
|
|
676
|
+
setup(e, { emit: c }) {
|
|
677
|
+
const l = e, d = c, n = S(() => l.variant === "alert" || l.variant === "error" ? "alert" : "status");
|
|
678
|
+
let s = null;
|
|
679
|
+
return j(() => {
|
|
680
|
+
l.duration > 0 && (s = window.setTimeout(() => {
|
|
681
|
+
d("timeout");
|
|
682
|
+
}, l.duration));
|
|
683
|
+
}), D(() => {
|
|
684
|
+
s !== null && window.clearTimeout(s);
|
|
685
|
+
}), (i, f) => (t(), a("div", {
|
|
686
|
+
class: $(["vk-toast", `vk-toast--${e.variant}`]),
|
|
687
|
+
role: n.value,
|
|
688
|
+
"aria-live": "polite"
|
|
689
|
+
}, [
|
|
690
|
+
e.leftIconSrc ? (t(), a("img", {
|
|
691
|
+
key: 0,
|
|
692
|
+
src: e.leftIconSrc,
|
|
693
|
+
class: "vk-toast__icon",
|
|
694
|
+
alt: "",
|
|
695
|
+
"aria-hidden": "true"
|
|
696
|
+
}, null, 8, Xe)) : u("", !0),
|
|
697
|
+
o("div", Ye, [
|
|
698
|
+
e.title ? (t(), a("p", Ze, m(e.title), 1)) : u("", !0),
|
|
699
|
+
o("p", et, m(e.message), 1)
|
|
700
|
+
]),
|
|
701
|
+
e.dismissible ? (t(), a("button", {
|
|
702
|
+
key: 1,
|
|
703
|
+
type: "button",
|
|
704
|
+
class: "vk-toast__close",
|
|
705
|
+
"aria-label": "Dismiss notification",
|
|
706
|
+
onClick: f[0] || (f[0] = (v) => d("close"))
|
|
707
|
+
}, " × ")) : u("", !0)
|
|
708
|
+
], 10, Qe));
|
|
709
|
+
}
|
|
710
|
+
}), tt = ["aria-describedby"], at = ["id"], nl = /* @__PURE__ */ I({
|
|
711
|
+
__name: "Tooltip",
|
|
712
|
+
props: {
|
|
713
|
+
text: {},
|
|
714
|
+
placement: { default: "top" },
|
|
715
|
+
openDelay: { default: 150 },
|
|
716
|
+
closeDelay: { default: 100 },
|
|
717
|
+
variant: { default: "info-inverted" },
|
|
718
|
+
maxWidth: { default: "240px" },
|
|
719
|
+
id: {}
|
|
720
|
+
},
|
|
721
|
+
setup(e) {
|
|
722
|
+
const c = e, l = T(!1), d = S(
|
|
723
|
+
() => c.id ?? `vk-tooltip-${Math.random().toString(36).slice(2, 9)}`
|
|
724
|
+
);
|
|
725
|
+
let n = null, s = null;
|
|
726
|
+
function i() {
|
|
727
|
+
n !== null && (window.clearTimeout(n), n = null), s !== null && (window.clearTimeout(s), s = null);
|
|
728
|
+
}
|
|
729
|
+
function f() {
|
|
730
|
+
s !== null && (window.clearTimeout(s), s = null), !l.value && (n = window.setTimeout(() => {
|
|
731
|
+
l.value = !0, n = null;
|
|
732
|
+
}, c.openDelay));
|
|
733
|
+
}
|
|
734
|
+
function v() {
|
|
735
|
+
n !== null && (window.clearTimeout(n), n = null), s = window.setTimeout(() => {
|
|
736
|
+
l.value = !1, s = null;
|
|
737
|
+
}, c.closeDelay);
|
|
738
|
+
}
|
|
739
|
+
return D(() => {
|
|
740
|
+
i();
|
|
741
|
+
}), (h, k) => (t(), a("span", {
|
|
742
|
+
class: "vk-tooltip",
|
|
743
|
+
onMouseenter: f,
|
|
744
|
+
onMouseleave: v,
|
|
745
|
+
onFocusin: f,
|
|
746
|
+
onFocusout: v
|
|
747
|
+
}, [
|
|
748
|
+
o("span", {
|
|
749
|
+
class: "vk-tooltip__trigger",
|
|
750
|
+
"aria-describedby": l.value ? d.value : void 0
|
|
751
|
+
}, [
|
|
752
|
+
B(h.$slots, "default", {}, () => [
|
|
753
|
+
k[0] || (k[0] = o("button", {
|
|
754
|
+
type: "button",
|
|
755
|
+
class: "vk-tooltip__fallback-trigger"
|
|
756
|
+
}, "?", -1))
|
|
757
|
+
])
|
|
758
|
+
], 8, tt),
|
|
759
|
+
K(N, { name: "vk-tooltip-fade" }, {
|
|
760
|
+
default: A(() => [
|
|
761
|
+
l.value ? (t(), a("span", {
|
|
762
|
+
key: 0,
|
|
763
|
+
id: d.value,
|
|
764
|
+
role: "tooltip",
|
|
765
|
+
class: $([
|
|
766
|
+
"vk-tooltip__content",
|
|
767
|
+
`vk-tooltip__content--${e.placement}`,
|
|
768
|
+
`vk-tooltip__content--${e.variant}`
|
|
769
|
+
]),
|
|
770
|
+
style: O({ maxWidth: e.maxWidth })
|
|
771
|
+
}, m(e.text), 15, at)) : u("", !0)
|
|
772
|
+
]),
|
|
773
|
+
_: 1
|
|
774
|
+
})
|
|
775
|
+
], 32));
|
|
776
|
+
}
|
|
777
|
+
}), lt = {
|
|
778
|
+
class: "vk-navbar__inner",
|
|
779
|
+
"aria-label": "Main navigation"
|
|
780
|
+
}, nt = { class: "vk-navbar__brand" }, it = { class: "vk-navbar__list" }, st = ["href", "aria-current", "aria-disabled", "tabindex", "onClick"], ot = ["disabled", "aria-current", "onClick"], rt = {
|
|
781
|
+
key: 0,
|
|
782
|
+
class: "vk-navbar__actions"
|
|
783
|
+
}, il = /* @__PURE__ */ I({
|
|
784
|
+
__name: "NavBar",
|
|
785
|
+
props: {
|
|
786
|
+
items: {},
|
|
787
|
+
activeValue: {},
|
|
788
|
+
brand: { default: "" },
|
|
789
|
+
sticky: { type: Boolean, default: !1 },
|
|
790
|
+
variant: {}
|
|
791
|
+
},
|
|
792
|
+
emits: ["navigate"],
|
|
793
|
+
setup(e, { emit: c }) {
|
|
794
|
+
const l = c;
|
|
795
|
+
function d(n, s) {
|
|
796
|
+
if (s.disabled) {
|
|
797
|
+
n.preventDefault();
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
l("navigate", { value: s.value }), s.href || n.preventDefault();
|
|
801
|
+
}
|
|
802
|
+
return (n, s) => (t(), a("header", {
|
|
803
|
+
class: $([
|
|
804
|
+
"vk-navbar",
|
|
805
|
+
{ "vk-navbar--sticky": e.sticky },
|
|
806
|
+
e.variant ? `vk-navbar--${e.variant}` : void 0
|
|
807
|
+
])
|
|
808
|
+
}, [
|
|
809
|
+
o("nav", lt, [
|
|
810
|
+
o("div", nt, [
|
|
811
|
+
B(n.$slots, "brand", {}, () => [
|
|
812
|
+
z(m(e.brand), 1)
|
|
813
|
+
])
|
|
814
|
+
]),
|
|
815
|
+
o("ul", it, [
|
|
816
|
+
(t(!0), a(p, null, V(e.items, (i) => (t(), a("li", {
|
|
817
|
+
key: i.value,
|
|
818
|
+
class: "vk-navbar__item"
|
|
819
|
+
}, [
|
|
820
|
+
i.href ? (t(), a("a", {
|
|
821
|
+
key: 0,
|
|
822
|
+
href: i.href,
|
|
823
|
+
class: $([
|
|
824
|
+
"vk-navbar__link",
|
|
825
|
+
{ "vk-navbar__link--active": i.value === e.activeValue },
|
|
826
|
+
{ "vk-navbar__link--disabled": i.disabled }
|
|
827
|
+
]),
|
|
828
|
+
"aria-current": i.value === e.activeValue ? "page" : void 0,
|
|
829
|
+
"aria-disabled": i.disabled ? "true" : void 0,
|
|
830
|
+
tabindex: i.disabled ? -1 : void 0,
|
|
831
|
+
onClick: (f) => d(f, i)
|
|
832
|
+
}, m(i.label), 11, st)) : (t(), a("button", {
|
|
833
|
+
key: 1,
|
|
834
|
+
type: "button",
|
|
835
|
+
class: $([
|
|
836
|
+
"vk-navbar__link",
|
|
837
|
+
"vk-navbar__link--button",
|
|
838
|
+
{ "vk-navbar__link--active": i.value === e.activeValue },
|
|
839
|
+
{ "vk-navbar__link--disabled": i.disabled }
|
|
840
|
+
]),
|
|
841
|
+
disabled: i.disabled,
|
|
842
|
+
"aria-current": i.value === e.activeValue ? "page" : void 0,
|
|
843
|
+
onClick: (f) => d(f, i)
|
|
844
|
+
}, m(i.label), 11, ot))
|
|
845
|
+
]))), 128))
|
|
846
|
+
]),
|
|
847
|
+
n.$slots.actions ? (t(), a("div", rt, [
|
|
848
|
+
B(n.$slots, "actions")
|
|
849
|
+
])) : u("", !0)
|
|
850
|
+
])
|
|
851
|
+
], 2));
|
|
852
|
+
}
|
|
853
|
+
}), ct = {
|
|
854
|
+
key: 0,
|
|
855
|
+
class: "vk-nav-menu__header"
|
|
856
|
+
}, dt = {
|
|
857
|
+
class: "vk-nav-menu__nav",
|
|
858
|
+
"aria-label": "Mobile navigation"
|
|
859
|
+
}, ut = { class: "vk-nav-menu__list" }, vt = ["href", "aria-current", "aria-disabled", "tabindex", "onClick"], ft = ["disabled", "aria-current", "onClick"], kt = {
|
|
860
|
+
key: 1,
|
|
861
|
+
class: "vk-nav-menu__footer"
|
|
862
|
+
}, sl = /* @__PURE__ */ I({
|
|
863
|
+
__name: "NavMenu",
|
|
864
|
+
props: {
|
|
865
|
+
open: { type: Boolean, default: !1 },
|
|
866
|
+
items: {},
|
|
867
|
+
activeValue: {},
|
|
868
|
+
showBackdrop: { type: Boolean, default: !0 },
|
|
869
|
+
variant: { default: "info" }
|
|
870
|
+
},
|
|
871
|
+
emits: ["navigate", "close"],
|
|
872
|
+
setup(e, { emit: c }) {
|
|
873
|
+
const l = e, d = c, n = T(null), s = T(null);
|
|
874
|
+
function i() {
|
|
875
|
+
const r = n.value;
|
|
876
|
+
if (!r) return [];
|
|
877
|
+
const _ = [
|
|
878
|
+
"a[href]",
|
|
879
|
+
"button:not([disabled])",
|
|
880
|
+
"textarea:not([disabled])",
|
|
881
|
+
"input:not([disabled])",
|
|
882
|
+
"select:not([disabled])",
|
|
883
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
884
|
+
].join(",");
|
|
885
|
+
return Array.from(r.querySelectorAll(_));
|
|
886
|
+
}
|
|
887
|
+
function f(r) {
|
|
888
|
+
var x;
|
|
889
|
+
if (r.key !== "Tab") return;
|
|
890
|
+
const _ = i();
|
|
891
|
+
if (_.length === 0) {
|
|
892
|
+
r.preventDefault(), (x = n.value) == null || x.focus();
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
const y = _[0], g = _[_.length - 1], b = document.activeElement;
|
|
896
|
+
r.shiftKey && b === y ? (r.preventDefault(), g.focus()) : !r.shiftKey && b === g && (r.preventDefault(), y.focus());
|
|
897
|
+
}
|
|
898
|
+
function v(r) {
|
|
899
|
+
if (r.key === "Escape") {
|
|
900
|
+
r.preventDefault(), d("close");
|
|
901
|
+
return;
|
|
902
|
+
}
|
|
903
|
+
f(r);
|
|
904
|
+
}
|
|
905
|
+
function h(r, _) {
|
|
906
|
+
if (_.disabled) {
|
|
907
|
+
r.preventDefault();
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
d("navigate", { value: _.value }), d("close"), _.href || r.preventDefault();
|
|
911
|
+
}
|
|
912
|
+
function k(r) {
|
|
913
|
+
document.body.style.overflow = r ? "hidden" : "";
|
|
914
|
+
}
|
|
915
|
+
return M(
|
|
916
|
+
() => l.open,
|
|
917
|
+
async (r) => {
|
|
918
|
+
var _, y;
|
|
919
|
+
r ? (s.value = document.activeElement, k(!0), await R(), (_ = i()[0] ?? n.value) == null || _.focus()) : (k(!1), (y = s.value) == null || y.focus());
|
|
920
|
+
},
|
|
921
|
+
{ immediate: !0 }
|
|
922
|
+
), D(() => {
|
|
923
|
+
k(!1);
|
|
924
|
+
}), (r, _) => (t(), E(P, { to: "body" }, [
|
|
925
|
+
K(N, { name: "vk-nav-menu-fade" }, {
|
|
926
|
+
default: A(() => [
|
|
927
|
+
e.open ? (t(), a("div", {
|
|
928
|
+
key: 0,
|
|
929
|
+
class: "vk-nav-menu",
|
|
930
|
+
role: "dialog",
|
|
931
|
+
"aria-modal": "true",
|
|
932
|
+
"aria-label": "Navigation menu",
|
|
933
|
+
onKeydown: v
|
|
934
|
+
}, [
|
|
935
|
+
e.showBackdrop ? (t(), a("div", {
|
|
936
|
+
key: 0,
|
|
937
|
+
class: "vk-nav-menu__backdrop",
|
|
938
|
+
onClick: _[0] || (_[0] = (y) => d("close"))
|
|
939
|
+
})) : u("", !0),
|
|
940
|
+
o("aside", {
|
|
941
|
+
ref_key: "panelRef",
|
|
942
|
+
ref: n,
|
|
943
|
+
class: $(["vk-nav-menu__panel", `vk-nav-menu__panel--${e.variant}`]),
|
|
944
|
+
tabindex: "-1"
|
|
945
|
+
}, [
|
|
946
|
+
r.$slots.header ? (t(), a("header", ct, [
|
|
947
|
+
B(r.$slots, "header")
|
|
948
|
+
])) : u("", !0),
|
|
949
|
+
o("nav", dt, [
|
|
950
|
+
o("ul", ut, [
|
|
951
|
+
(t(!0), a(p, null, V(e.items, (y) => (t(), a("li", {
|
|
952
|
+
key: y.value,
|
|
953
|
+
class: "vk-nav-menu__item"
|
|
954
|
+
}, [
|
|
955
|
+
y.href ? (t(), a("a", {
|
|
956
|
+
key: 0,
|
|
957
|
+
href: y.href,
|
|
958
|
+
class: $([
|
|
959
|
+
"vk-nav-menu__link",
|
|
960
|
+
{ "vk-nav-menu__link--active": y.value === e.activeValue },
|
|
961
|
+
{ "vk-nav-menu__link--disabled": y.disabled }
|
|
962
|
+
]),
|
|
963
|
+
"aria-current": y.value === e.activeValue ? "page" : void 0,
|
|
964
|
+
"aria-disabled": y.disabled ? "true" : void 0,
|
|
965
|
+
tabindex: y.disabled ? -1 : void 0,
|
|
966
|
+
onClick: (g) => h(g, y)
|
|
967
|
+
}, m(y.label), 11, vt)) : (t(), a("button", {
|
|
968
|
+
key: 1,
|
|
969
|
+
type: "button",
|
|
970
|
+
class: $([
|
|
971
|
+
"vk-nav-menu__link",
|
|
972
|
+
"vk-nav-menu__link--button",
|
|
973
|
+
{ "vk-nav-menu__link--active": y.value === e.activeValue },
|
|
974
|
+
{ "vk-nav-menu__link--disabled": y.disabled }
|
|
975
|
+
]),
|
|
976
|
+
disabled: y.disabled,
|
|
977
|
+
"aria-current": y.value === e.activeValue ? "page" : void 0,
|
|
978
|
+
onClick: (g) => h(g, y)
|
|
979
|
+
}, m(y.label), 11, ft))
|
|
980
|
+
]))), 128))
|
|
981
|
+
])
|
|
982
|
+
]),
|
|
983
|
+
r.$slots.footer ? (t(), a("footer", kt, [
|
|
984
|
+
B(r.$slots, "footer")
|
|
985
|
+
])) : u("", !0)
|
|
986
|
+
], 2)
|
|
987
|
+
], 32)) : u("", !0)
|
|
988
|
+
]),
|
|
989
|
+
_: 3
|
|
990
|
+
})
|
|
991
|
+
]));
|
|
992
|
+
}
|
|
993
|
+
}), bt = ["disabled", "aria-label", "aria-expanded", "aria-controls"], ht = {
|
|
994
|
+
class: "vk-burger-button__icon-wrap",
|
|
995
|
+
"aria-hidden": "true"
|
|
996
|
+
}, mt = ["src"], ol = /* @__PURE__ */ I({
|
|
997
|
+
__name: "BurgerButton",
|
|
998
|
+
props: {
|
|
999
|
+
open: { type: Boolean, default: !1 },
|
|
1000
|
+
labelOpen: { default: "Open menu" },
|
|
1001
|
+
labelClose: { default: "Close menu" },
|
|
1002
|
+
disabled: { type: Boolean, default: !1 },
|
|
1003
|
+
variant: { default: "info" },
|
|
1004
|
+
openIconSrc: {},
|
|
1005
|
+
closedIconSrc: {},
|
|
1006
|
+
ariaControls: {}
|
|
1007
|
+
},
|
|
1008
|
+
emits: ["toggle"],
|
|
1009
|
+
setup(e, { emit: c }) {
|
|
1010
|
+
const l = e, d = [
|
|
1011
|
+
"info",
|
|
1012
|
+
"success",
|
|
1013
|
+
"warning",
|
|
1014
|
+
"alert",
|
|
1015
|
+
"error",
|
|
1016
|
+
"info-alt",
|
|
1017
|
+
"info-inverted",
|
|
1018
|
+
"success-inverted",
|
|
1019
|
+
"warning-inverted",
|
|
1020
|
+
"alert-inverted",
|
|
1021
|
+
"error-inverted",
|
|
1022
|
+
"info-alt-inverted"
|
|
1023
|
+
], n = S(() => typeof l.variant == "string" && d.includes(l.variant) ? l.variant : "info"), s = c;
|
|
1024
|
+
function i() {
|
|
1025
|
+
l.disabled || s("toggle", !l.open);
|
|
1026
|
+
}
|
|
1027
|
+
return (f, v) => (t(), a("button", {
|
|
1028
|
+
type: "button",
|
|
1029
|
+
class: $(["vk-burger-button", [
|
|
1030
|
+
{ "vk-burger-button--open": e.open },
|
|
1031
|
+
`vk-burger-button--${n.value}`
|
|
1032
|
+
]]),
|
|
1033
|
+
disabled: e.disabled,
|
|
1034
|
+
"aria-label": e.open ? e.labelClose : e.labelOpen,
|
|
1035
|
+
"aria-expanded": e.open ? "true" : "false",
|
|
1036
|
+
"aria-controls": e.ariaControls || void 0,
|
|
1037
|
+
onClick: i
|
|
1038
|
+
}, [
|
|
1039
|
+
o("span", ht, [
|
|
1040
|
+
o("img", {
|
|
1041
|
+
src: e.open ? e.openIconSrc : e.closedIconSrc,
|
|
1042
|
+
alt: "",
|
|
1043
|
+
class: "vk-burger-button__icon"
|
|
1044
|
+
}, null, 8, mt)
|
|
1045
|
+
])
|
|
1046
|
+
], 10, bt));
|
|
1047
|
+
}
|
|
1048
|
+
}), _t = { class: "vk-footer__inner" }, yt = { class: "vk-footer__left" }, $t = {
|
|
1049
|
+
key: 0,
|
|
1050
|
+
"aria-label": "Footer links"
|
|
1051
|
+
}, gt = { class: "vk-footer__links" }, xt = ["href", "target", "rel"], wt = { class: "vk-footer__right" }, It = {
|
|
1052
|
+
key: 0,
|
|
1053
|
+
class: "vk-footer__copyright"
|
|
1054
|
+
}, rl = /* @__PURE__ */ I({
|
|
1055
|
+
__name: "Footer",
|
|
1056
|
+
props: {
|
|
1057
|
+
links: { default: () => [] },
|
|
1058
|
+
copyright: {},
|
|
1059
|
+
compact: { type: Boolean, default: !1 },
|
|
1060
|
+
variant: {}
|
|
1061
|
+
},
|
|
1062
|
+
setup(e) {
|
|
1063
|
+
return (c, l) => (t(), a("footer", {
|
|
1064
|
+
class: $([
|
|
1065
|
+
"vk-footer",
|
|
1066
|
+
{ "vk-footer--compact": e.compact },
|
|
1067
|
+
e.variant ? `vk-footer--${e.variant}` : void 0
|
|
1068
|
+
])
|
|
1069
|
+
}, [
|
|
1070
|
+
o("div", _t, [
|
|
1071
|
+
o("div", yt, [
|
|
1072
|
+
B(c.$slots, "left", {}, () => {
|
|
1073
|
+
var d;
|
|
1074
|
+
return [
|
|
1075
|
+
(d = e.links) != null && d.length ? (t(), a("nav", $t, [
|
|
1076
|
+
o("ul", gt, [
|
|
1077
|
+
(t(!0), a(p, null, V(e.links, (n) => (t(), a("li", {
|
|
1078
|
+
key: n.href,
|
|
1079
|
+
class: "vk-footer__link-item"
|
|
1080
|
+
}, [
|
|
1081
|
+
o("a", {
|
|
1082
|
+
href: n.href,
|
|
1083
|
+
class: "vk-footer__link",
|
|
1084
|
+
target: n.external ? "_blank" : void 0,
|
|
1085
|
+
rel: n.external ? "noopener noreferrer" : void 0
|
|
1086
|
+
}, m(n.label), 9, xt)
|
|
1087
|
+
]))), 128))
|
|
1088
|
+
])
|
|
1089
|
+
])) : u("", !0)
|
|
1090
|
+
];
|
|
1091
|
+
})
|
|
1092
|
+
]),
|
|
1093
|
+
o("div", wt, [
|
|
1094
|
+
B(c.$slots, "right", {}, () => [
|
|
1095
|
+
e.copyright ? (t(), a("small", It, m(e.copyright), 1)) : u("", !0)
|
|
1096
|
+
])
|
|
1097
|
+
])
|
|
1098
|
+
])
|
|
1099
|
+
], 2));
|
|
1100
|
+
}
|
|
1101
|
+
}), St = ["aria-orientation"], Bt = ["id", "tabindex", "aria-selected", "aria-controls", "disabled", "onClick"], Ct = ["src"], pt = ["id", "aria-labelledby"], cl = /* @__PURE__ */ I({
|
|
1102
|
+
__name: "Tabs",
|
|
1103
|
+
props: {
|
|
1104
|
+
modelValue: {},
|
|
1105
|
+
items: {},
|
|
1106
|
+
variant: { default: "info" },
|
|
1107
|
+
orientation: { default: "horizontal" }
|
|
1108
|
+
},
|
|
1109
|
+
emits: ["update:modelValue", "change"],
|
|
1110
|
+
setup(e, { emit: c }) {
|
|
1111
|
+
const l = e, d = c, n = T([]);
|
|
1112
|
+
function s() {
|
|
1113
|
+
var b;
|
|
1114
|
+
return ((b = l.items.find((x) => !x.disabled)) == null ? void 0 : b.value) ?? "";
|
|
1115
|
+
}
|
|
1116
|
+
const i = S(() => {
|
|
1117
|
+
const b = l.modelValue ?? s();
|
|
1118
|
+
return l.items.some((w) => w.value === b && !w.disabled) ? b : s();
|
|
1119
|
+
});
|
|
1120
|
+
M(
|
|
1121
|
+
() => l.modelValue,
|
|
1122
|
+
() => {
|
|
1123
|
+
const b = l.items.findIndex((x) => x.value === i.value);
|
|
1124
|
+
k(b);
|
|
1125
|
+
}
|
|
1126
|
+
);
|
|
1127
|
+
function f(b) {
|
|
1128
|
+
return `vk-tab-${b}`;
|
|
1129
|
+
}
|
|
1130
|
+
function v(b) {
|
|
1131
|
+
return `vk-tabpanel-${b}`;
|
|
1132
|
+
}
|
|
1133
|
+
function h(b) {
|
|
1134
|
+
const x = l.items.find((w) => w.value === b);
|
|
1135
|
+
!x || x.disabled || (d("update:modelValue", b), d("change", b));
|
|
1136
|
+
}
|
|
1137
|
+
function k(b) {
|
|
1138
|
+
b < 0 || !n.value[b] || n.value[b].focus();
|
|
1139
|
+
}
|
|
1140
|
+
function r(b, x) {
|
|
1141
|
+
const w = l.items.length;
|
|
1142
|
+
let C = b;
|
|
1143
|
+
for (let q = 0; q < w; q += 1)
|
|
1144
|
+
if (C = (C + x + w) % w, !l.items[C].disabled) return C;
|
|
1145
|
+
return b;
|
|
1146
|
+
}
|
|
1147
|
+
function _() {
|
|
1148
|
+
return l.items.findIndex((b) => !b.disabled);
|
|
1149
|
+
}
|
|
1150
|
+
function y() {
|
|
1151
|
+
for (let b = l.items.length - 1; b >= 0; b -= 1)
|
|
1152
|
+
if (!l.items[b].disabled) return b;
|
|
1153
|
+
return -1;
|
|
1154
|
+
}
|
|
1155
|
+
function g(b) {
|
|
1156
|
+
const x = l.items.findIndex((q) => q.value === i.value);
|
|
1157
|
+
if (x < 0) return;
|
|
1158
|
+
const w = l.orientation === "horizontal";
|
|
1159
|
+
let C = x;
|
|
1160
|
+
if (w && b.key === "ArrowRight" || !w && b.key === "ArrowDown")
|
|
1161
|
+
C = r(x, 1);
|
|
1162
|
+
else if (w && b.key === "ArrowLeft" || !w && b.key === "ArrowUp")
|
|
1163
|
+
C = r(x, -1);
|
|
1164
|
+
else if (b.key === "Home")
|
|
1165
|
+
C = _();
|
|
1166
|
+
else if (b.key === "End")
|
|
1167
|
+
C = y();
|
|
1168
|
+
else
|
|
1169
|
+
return;
|
|
1170
|
+
if (b.preventDefault(), C >= 0) {
|
|
1171
|
+
const q = l.items[C].value;
|
|
1172
|
+
h(q), k(C);
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
return (b, x) => (t(), a("div", {
|
|
1176
|
+
class: $(["vk-tabs", `vk-tabs--${e.orientation}`])
|
|
1177
|
+
}, [
|
|
1178
|
+
o("div", {
|
|
1179
|
+
class: "vk-tabs__list",
|
|
1180
|
+
role: "tablist",
|
|
1181
|
+
"aria-orientation": e.orientation,
|
|
1182
|
+
onKeydown: g
|
|
1183
|
+
}, [
|
|
1184
|
+
(t(!0), a(p, null, V(e.items, (w) => (t(), a("button", {
|
|
1185
|
+
id: f(w.value),
|
|
1186
|
+
key: w.value,
|
|
1187
|
+
ref_for: !0,
|
|
1188
|
+
ref_key: "tabRefs",
|
|
1189
|
+
ref: n,
|
|
1190
|
+
type: "button",
|
|
1191
|
+
role: "tab",
|
|
1192
|
+
tabindex: i.value === w.value ? 0 : -1,
|
|
1193
|
+
"aria-selected": i.value === w.value ? "true" : "false",
|
|
1194
|
+
"aria-controls": v(w.value),
|
|
1195
|
+
disabled: w.disabled,
|
|
1196
|
+
class: $([
|
|
1197
|
+
"vk-tabs__tab",
|
|
1198
|
+
`vk-tabs__tab--${e.variant}`,
|
|
1199
|
+
{ "vk-tabs__tab--active": i.value === w.value },
|
|
1200
|
+
{ "vk-tabs__tab--disabled": w.disabled }
|
|
1201
|
+
]),
|
|
1202
|
+
onClick: (C) => h(w.value)
|
|
1203
|
+
}, [
|
|
1204
|
+
w.leftIconSrc ? (t(), a("img", {
|
|
1205
|
+
key: 0,
|
|
1206
|
+
src: w.leftIconSrc,
|
|
1207
|
+
class: "vk-tabs__icon",
|
|
1208
|
+
alt: "",
|
|
1209
|
+
"aria-hidden": "true"
|
|
1210
|
+
}, null, 8, Ct)) : u("", !0),
|
|
1211
|
+
o("span", null, m(w.label), 1)
|
|
1212
|
+
], 10, Bt))), 128))
|
|
1213
|
+
], 40, St),
|
|
1214
|
+
o("div", {
|
|
1215
|
+
id: v(i.value),
|
|
1216
|
+
class: "vk-tabs__panel",
|
|
1217
|
+
role: "tabpanel",
|
|
1218
|
+
"aria-labelledby": f(i.value),
|
|
1219
|
+
tabindex: "0"
|
|
1220
|
+
}, [
|
|
1221
|
+
B(b.$slots, `panel-${i.value}`, { activeValue: i.value })
|
|
1222
|
+
], 8, pt)
|
|
1223
|
+
], 2));
|
|
1224
|
+
}
|
|
1225
|
+
}), Vt = {
|
|
1226
|
+
class: "vk-breadcrumb",
|
|
1227
|
+
"aria-label": "Breadcrumb"
|
|
1228
|
+
}, Tt = { class: "vk-breadcrumb__list" }, qt = ["href", "onClick"], zt = ["src"], Mt = { class: "vk-breadcrumb__label" }, Dt = ["onClick"], Ot = ["src"], At = { class: "vk-breadcrumb__label" }, Et = {
|
|
1229
|
+
key: 2,
|
|
1230
|
+
class: "vk-breadcrumb__current",
|
|
1231
|
+
"aria-current": "page"
|
|
1232
|
+
}, Lt = ["src"], Ft = { class: "vk-breadcrumb__label" }, Kt = {
|
|
1233
|
+
key: 3,
|
|
1234
|
+
class: "vk-breadcrumb__separator",
|
|
1235
|
+
"aria-hidden": "true"
|
|
1236
|
+
}, dl = /* @__PURE__ */ I({
|
|
1237
|
+
__name: "Breadcrumb",
|
|
1238
|
+
props: {
|
|
1239
|
+
items: {},
|
|
1240
|
+
separator: { default: "/" },
|
|
1241
|
+
variant: { default: "info" }
|
|
1242
|
+
},
|
|
1243
|
+
emits: ["navigate"],
|
|
1244
|
+
setup(e, { emit: c }) {
|
|
1245
|
+
const l = c;
|
|
1246
|
+
function d(n, s) {
|
|
1247
|
+
l("navigate", { value: s.value, href: s.href }), s.href || n.preventDefault();
|
|
1248
|
+
}
|
|
1249
|
+
return (n, s) => (t(), a("nav", Vt, [
|
|
1250
|
+
o("ol", Tt, [
|
|
1251
|
+
(t(!0), a(p, null, V(e.items, (i, f) => (t(), a("li", {
|
|
1252
|
+
key: `${i.label}-${f}`,
|
|
1253
|
+
class: $([
|
|
1254
|
+
"vk-breadcrumb__item",
|
|
1255
|
+
`vk-breadcrumb__item--${e.variant}`,
|
|
1256
|
+
{ "vk-breadcrumb__item--current": f === e.items.length - 1 }
|
|
1257
|
+
])
|
|
1258
|
+
}, [
|
|
1259
|
+
f !== e.items.length - 1 && i.href ? (t(), a("a", {
|
|
1260
|
+
key: 0,
|
|
1261
|
+
href: i.href,
|
|
1262
|
+
class: "vk-breadcrumb__link",
|
|
1263
|
+
onClick: (v) => d(v, i)
|
|
1264
|
+
}, [
|
|
1265
|
+
i.leftIconSrc ? (t(), a("img", {
|
|
1266
|
+
key: 0,
|
|
1267
|
+
src: i.leftIconSrc,
|
|
1268
|
+
class: "vk-breadcrumb__icon",
|
|
1269
|
+
alt: "",
|
|
1270
|
+
"aria-hidden": "true"
|
|
1271
|
+
}, null, 8, zt)) : u("", !0),
|
|
1272
|
+
o("span", Mt, m(i.label), 1)
|
|
1273
|
+
], 8, qt)) : f !== e.items.length - 1 ? (t(), a("button", {
|
|
1274
|
+
key: 1,
|
|
1275
|
+
type: "button",
|
|
1276
|
+
class: "vk-breadcrumb__link vk-breadcrumb__link--button",
|
|
1277
|
+
onClick: (v) => d(v, i)
|
|
1278
|
+
}, [
|
|
1279
|
+
i.leftIconSrc ? (t(), a("img", {
|
|
1280
|
+
key: 0,
|
|
1281
|
+
src: i.leftIconSrc,
|
|
1282
|
+
class: "vk-breadcrumb__icon",
|
|
1283
|
+
alt: "",
|
|
1284
|
+
"aria-hidden": "true"
|
|
1285
|
+
}, null, 8, Ot)) : u("", !0),
|
|
1286
|
+
o("span", At, m(i.label), 1)
|
|
1287
|
+
], 8, Dt)) : (t(), a("span", Et, [
|
|
1288
|
+
i.leftIconSrc ? (t(), a("img", {
|
|
1289
|
+
key: 0,
|
|
1290
|
+
src: i.leftIconSrc,
|
|
1291
|
+
class: "vk-breadcrumb__icon",
|
|
1292
|
+
alt: "",
|
|
1293
|
+
"aria-hidden": "true"
|
|
1294
|
+
}, null, 8, Lt)) : u("", !0),
|
|
1295
|
+
o("span", Ft, m(i.label), 1)
|
|
1296
|
+
])),
|
|
1297
|
+
f !== e.items.length - 1 ? (t(), a("span", Kt, m(e.separator), 1)) : u("", !0)
|
|
1298
|
+
], 2))), 128))
|
|
1299
|
+
])
|
|
1300
|
+
]));
|
|
1301
|
+
}
|
|
1302
|
+
}), Nt = {
|
|
1303
|
+
class: "vk-pagination",
|
|
1304
|
+
"aria-label": "Pagination"
|
|
1305
|
+
}, Rt = { class: "vk-pagination__list" }, Pt = { key: 0 }, jt = ["disabled"], Gt = ["disabled"], Wt = ["src"], Ut = { key: 1 }, Ht = {
|
|
1306
|
+
key: 0,
|
|
1307
|
+
class: "vk-pagination__ellipsis",
|
|
1308
|
+
"aria-hidden": "true"
|
|
1309
|
+
}, Jt = ["aria-current", "aria-label", "onClick"], Qt = ["disabled"], Xt = ["src"], Yt = { key: 1 }, Zt = { key: 1 }, ea = ["disabled"], ul = /* @__PURE__ */ I({
|
|
1310
|
+
__name: "Pagination",
|
|
1311
|
+
props: {
|
|
1312
|
+
page: {},
|
|
1313
|
+
totalPages: {},
|
|
1314
|
+
maxVisible: { default: 7 },
|
|
1315
|
+
showFirstLast: { type: Boolean, default: !0 },
|
|
1316
|
+
variant: { default: "info" },
|
|
1317
|
+
prevIconSrc: {},
|
|
1318
|
+
nextIconSrc: {}
|
|
1319
|
+
},
|
|
1320
|
+
emits: ["update:page", "change"],
|
|
1321
|
+
setup(e, { emit: c }) {
|
|
1322
|
+
const l = e, d = c, n = S(() => Math.max(1, l.totalPages)), s = S(() => Math.min(Math.max(1, l.page), n.value)), i = S(() => {
|
|
1323
|
+
const v = n.value, h = s.value, k = Math.max(5, l.maxVisible);
|
|
1324
|
+
if (v <= k)
|
|
1325
|
+
return Array.from({ length: v }, (b, x) => ({ type: "page", key: `p-${x + 1}`, page: x + 1 }));
|
|
1326
|
+
const r = [], _ = Math.max(1, Math.floor((k - 3) / 2));
|
|
1327
|
+
let y = Math.max(2, h - _), g = Math.min(v - 1, h + _);
|
|
1328
|
+
y <= 2 && (g = Math.min(v - 1, g + (2 - y + 1))), g >= v - 1 && (y = Math.max(2, y - (g - (v - 1) + 1))), r.push({ type: "page", key: "p-1", page: 1 }), y > 2 && r.push({ type: "ellipsis", key: "e-left" });
|
|
1329
|
+
for (let b = y; b <= g; b += 1)
|
|
1330
|
+
r.push({ type: "page", key: `p-${b}`, page: b });
|
|
1331
|
+
return g < v - 1 && r.push({ type: "ellipsis", key: "e-right" }), r.push({ type: "page", key: `p-${v}`, page: v }), r;
|
|
1332
|
+
});
|
|
1333
|
+
function f(v) {
|
|
1334
|
+
const h = Math.min(Math.max(1, v), n.value);
|
|
1335
|
+
h !== s.value && (d("update:page", h), d("change", h));
|
|
1336
|
+
}
|
|
1337
|
+
return (v, h) => (t(), a("nav", Nt, [
|
|
1338
|
+
o("ul", Rt, [
|
|
1339
|
+
e.showFirstLast ? (t(), a("li", Pt, [
|
|
1340
|
+
o("button", {
|
|
1341
|
+
type: "button",
|
|
1342
|
+
class: $(["vk-pagination__btn vk-pagination__btn--nav", `vk-pagination__btn--${e.variant}`]),
|
|
1343
|
+
disabled: s.value <= 1,
|
|
1344
|
+
"aria-label": "Go to first page",
|
|
1345
|
+
onClick: h[0] || (h[0] = (k) => f(1))
|
|
1346
|
+
}, " « ", 10, jt)
|
|
1347
|
+
])) : u("", !0),
|
|
1348
|
+
o("li", null, [
|
|
1349
|
+
o("button", {
|
|
1350
|
+
type: "button",
|
|
1351
|
+
class: $(["vk-pagination__btn vk-pagination__btn--nav", `vk-pagination__btn--${e.variant}`]),
|
|
1352
|
+
disabled: s.value <= 1,
|
|
1353
|
+
"aria-label": "Go to previous page",
|
|
1354
|
+
onClick: h[1] || (h[1] = (k) => f(s.value - 1))
|
|
1355
|
+
}, [
|
|
1356
|
+
e.prevIconSrc ? (t(), a("img", {
|
|
1357
|
+
key: 0,
|
|
1358
|
+
src: e.prevIconSrc,
|
|
1359
|
+
class: "vk-pagination__icon",
|
|
1360
|
+
alt: "",
|
|
1361
|
+
"aria-hidden": "true"
|
|
1362
|
+
}, null, 8, Wt)) : (t(), a("span", Ut, "‹"))
|
|
1363
|
+
], 10, Gt)
|
|
1364
|
+
]),
|
|
1365
|
+
(t(!0), a(p, null, V(i.value, (k) => (t(), a("li", {
|
|
1366
|
+
key: k.key
|
|
1367
|
+
}, [
|
|
1368
|
+
k.type === "ellipsis" ? (t(), a("span", Ht, " … ")) : (t(), a("button", {
|
|
1369
|
+
key: 1,
|
|
1370
|
+
type: "button",
|
|
1371
|
+
class: $(["vk-pagination__btn vk-pagination__btn--page", [
|
|
1372
|
+
`vk-pagination__btn--${e.variant}`,
|
|
1373
|
+
{ "vk-pagination__btn--active": k.page === s.value }
|
|
1374
|
+
]]),
|
|
1375
|
+
"aria-current": k.page === s.value ? "page" : void 0,
|
|
1376
|
+
"aria-label": `Go to page ${k.page}`,
|
|
1377
|
+
onClick: (r) => f(k.page)
|
|
1378
|
+
}, m(k.page), 11, Jt))
|
|
1379
|
+
]))), 128)),
|
|
1380
|
+
o("li", null, [
|
|
1381
|
+
o("button", {
|
|
1382
|
+
type: "button",
|
|
1383
|
+
class: $(["vk-pagination__btn vk-pagination__btn--nav", `vk-pagination__btn--${e.variant}`]),
|
|
1384
|
+
disabled: s.value >= n.value,
|
|
1385
|
+
"aria-label": "Go to next page",
|
|
1386
|
+
onClick: h[2] || (h[2] = (k) => f(s.value + 1))
|
|
1387
|
+
}, [
|
|
1388
|
+
e.nextIconSrc ? (t(), a("img", {
|
|
1389
|
+
key: 0,
|
|
1390
|
+
src: e.nextIconSrc,
|
|
1391
|
+
class: "vk-pagination__icon",
|
|
1392
|
+
alt: "",
|
|
1393
|
+
"aria-hidden": "true"
|
|
1394
|
+
}, null, 8, Xt)) : (t(), a("span", Yt, "›"))
|
|
1395
|
+
], 10, Qt)
|
|
1396
|
+
]),
|
|
1397
|
+
e.showFirstLast ? (t(), a("li", Zt, [
|
|
1398
|
+
o("button", {
|
|
1399
|
+
type: "button",
|
|
1400
|
+
class: $(["vk-pagination__btn vk-pagination__btn--nav", `vk-pagination__btn--${e.variant}`]),
|
|
1401
|
+
disabled: s.value >= n.value,
|
|
1402
|
+
"aria-label": "Go to last page",
|
|
1403
|
+
onClick: h[3] || (h[3] = (k) => f(n.value))
|
|
1404
|
+
}, " » ", 10, ea)
|
|
1405
|
+
])) : u("", !0)
|
|
1406
|
+
])
|
|
1407
|
+
]));
|
|
1408
|
+
}
|
|
1409
|
+
}), ta = { class: "vk-accordion" }, aa = { class: "vk-accordion__heading" }, la = ["disabled", "aria-expanded", "aria-controls", "id", "onClick"], na = { class: "vk-accordion__title-wrap" }, ia = ["src"], sa = { class: "vk-accordion__title" }, oa = {
|
|
1410
|
+
class: "vk-accordion__chevron",
|
|
1411
|
+
"aria-hidden": "true"
|
|
1412
|
+
}, ra = ["id", "aria-labelledby"], ca = {
|
|
1413
|
+
key: 0,
|
|
1414
|
+
class: "vk-accordion__content"
|
|
1415
|
+
}, vl = /* @__PURE__ */ I({
|
|
1416
|
+
__name: "Accordion",
|
|
1417
|
+
props: {
|
|
1418
|
+
items: {},
|
|
1419
|
+
multiple: { type: Boolean, default: !1 },
|
|
1420
|
+
modelValue: { default: () => [] },
|
|
1421
|
+
variant: { default: "info" }
|
|
1422
|
+
},
|
|
1423
|
+
emits: ["update:modelValue", "toggle"],
|
|
1424
|
+
setup(e, { emit: c }) {
|
|
1425
|
+
const l = e, d = c, n = S(() => l.modelValue);
|
|
1426
|
+
function s(h) {
|
|
1427
|
+
return n.value.includes(h);
|
|
1428
|
+
}
|
|
1429
|
+
function i(h) {
|
|
1430
|
+
const k = l.items.find((y) => y.id === h);
|
|
1431
|
+
if (!k || k.disabled) return;
|
|
1432
|
+
const r = s(h);
|
|
1433
|
+
let _;
|
|
1434
|
+
l.multiple ? _ = r ? n.value.filter((y) => y !== h) : [...n.value, h] : _ = r ? [] : [h], d("update:modelValue", _), d("toggle", { id: h, open: !r });
|
|
1435
|
+
}
|
|
1436
|
+
function f(h) {
|
|
1437
|
+
return `vk-accordion-trigger-${h}`;
|
|
1438
|
+
}
|
|
1439
|
+
function v(h) {
|
|
1440
|
+
return `vk-accordion-panel-${h}`;
|
|
1441
|
+
}
|
|
1442
|
+
return (h, k) => (t(), a("div", ta, [
|
|
1443
|
+
(t(!0), a(p, null, V(e.items, (r) => (t(), a("section", {
|
|
1444
|
+
key: r.id,
|
|
1445
|
+
class: $([
|
|
1446
|
+
"vk-accordion__item",
|
|
1447
|
+
`vk-accordion__item--${e.variant}`,
|
|
1448
|
+
{ "vk-accordion__item--open": s(r.id) },
|
|
1449
|
+
{ "vk-accordion__item--disabled": r.disabled }
|
|
1450
|
+
])
|
|
1451
|
+
}, [
|
|
1452
|
+
o("h3", aa, [
|
|
1453
|
+
o("button", {
|
|
1454
|
+
type: "button",
|
|
1455
|
+
class: "vk-accordion__trigger",
|
|
1456
|
+
disabled: r.disabled,
|
|
1457
|
+
"aria-expanded": s(r.id) ? "true" : "false",
|
|
1458
|
+
"aria-controls": v(r.id),
|
|
1459
|
+
id: f(r.id),
|
|
1460
|
+
onClick: (_) => i(r.id)
|
|
1461
|
+
}, [
|
|
1462
|
+
o("span", na, [
|
|
1463
|
+
r.leftIconSrc ? (t(), a("img", {
|
|
1464
|
+
key: 0,
|
|
1465
|
+
src: r.leftIconSrc,
|
|
1466
|
+
class: "vk-accordion__icon",
|
|
1467
|
+
alt: "",
|
|
1468
|
+
"aria-hidden": "true"
|
|
1469
|
+
}, null, 8, ia)) : u("", !0),
|
|
1470
|
+
o("span", sa, m(r.title), 1)
|
|
1471
|
+
]),
|
|
1472
|
+
o("span", oa, m(s(r.id) ? "−" : "+"), 1)
|
|
1473
|
+
], 8, la)
|
|
1474
|
+
]),
|
|
1475
|
+
G(o("div", {
|
|
1476
|
+
id: v(r.id),
|
|
1477
|
+
class: "vk-accordion__panel",
|
|
1478
|
+
role: "region",
|
|
1479
|
+
"aria-labelledby": f(r.id)
|
|
1480
|
+
}, [
|
|
1481
|
+
B(h.$slots, `item-${r.id}`, { item: r }, () => [
|
|
1482
|
+
r.content ? (t(), a("p", ca, m(r.content), 1)) : u("", !0)
|
|
1483
|
+
])
|
|
1484
|
+
], 8, ra), [
|
|
1485
|
+
[W, s(r.id)]
|
|
1486
|
+
])
|
|
1487
|
+
], 2))), 128))
|
|
1488
|
+
]));
|
|
1489
|
+
}
|
|
1490
|
+
}), da = ["tabindex"], ua = {
|
|
1491
|
+
key: 0,
|
|
1492
|
+
class: "vk-card__header"
|
|
1493
|
+
}, va = { class: "vk-card__body" }, fa = {
|
|
1494
|
+
key: 1,
|
|
1495
|
+
class: "vk-card__footer"
|
|
1496
|
+
}, fl = /* @__PURE__ */ I({
|
|
1497
|
+
__name: "Card",
|
|
1498
|
+
props: {
|
|
1499
|
+
variant: { default: "info" },
|
|
1500
|
+
surface: { default: "outlined" },
|
|
1501
|
+
padding: { default: "md" },
|
|
1502
|
+
interactive: { type: Boolean, default: !1 }
|
|
1503
|
+
},
|
|
1504
|
+
setup(e) {
|
|
1505
|
+
return (c, l) => (t(), a("article", {
|
|
1506
|
+
class: $([
|
|
1507
|
+
"vk-card",
|
|
1508
|
+
`vk-card--${e.variant}`,
|
|
1509
|
+
`vk-card--${e.surface}`,
|
|
1510
|
+
`vk-card--pad-${e.padding}`,
|
|
1511
|
+
{ "vk-card--interactive": e.interactive }
|
|
1512
|
+
]),
|
|
1513
|
+
tabindex: e.interactive ? 0 : void 0
|
|
1514
|
+
}, [
|
|
1515
|
+
c.$slots.header ? (t(), a("header", ua, [
|
|
1516
|
+
B(c.$slots, "header")
|
|
1517
|
+
])) : u("", !0),
|
|
1518
|
+
o("div", va, [
|
|
1519
|
+
B(c.$slots, "default")
|
|
1520
|
+
]),
|
|
1521
|
+
c.$slots.footer ? (t(), a("footer", fa, [
|
|
1522
|
+
B(c.$slots, "footer")
|
|
1523
|
+
])) : u("", !0)
|
|
1524
|
+
], 10, da));
|
|
1525
|
+
}
|
|
1526
|
+
}), ka = { class: "vk-title-card__main" }, ba = { class: "vk-title-card__title-row" }, ha = ["src"], ma = {
|
|
1527
|
+
key: 0,
|
|
1528
|
+
class: "vk-title-card__subtitle"
|
|
1529
|
+
}, _a = {
|
|
1530
|
+
key: 0,
|
|
1531
|
+
class: "vk-title-card__actions"
|
|
1532
|
+
}, kl = /* @__PURE__ */ I({
|
|
1533
|
+
__name: "TitleCard",
|
|
1534
|
+
props: {
|
|
1535
|
+
title: {},
|
|
1536
|
+
subtitle: {},
|
|
1537
|
+
align: { default: "left" },
|
|
1538
|
+
variant: { default: "info" },
|
|
1539
|
+
level: { default: 2 },
|
|
1540
|
+
leftIconSrc: {}
|
|
1541
|
+
},
|
|
1542
|
+
setup(e) {
|
|
1543
|
+
const c = e, l = S(() => `h${c.level}`);
|
|
1544
|
+
return (d, n) => (t(), a("section", {
|
|
1545
|
+
class: $(["vk-title-card", `vk-title-card--${e.align}`, `vk-title-card--${e.variant}`])
|
|
1546
|
+
}, [
|
|
1547
|
+
o("div", ka, [
|
|
1548
|
+
o("div", ba, [
|
|
1549
|
+
e.leftIconSrc ? (t(), a("img", {
|
|
1550
|
+
key: 0,
|
|
1551
|
+
src: e.leftIconSrc,
|
|
1552
|
+
class: "vk-title-card__icon",
|
|
1553
|
+
alt: "",
|
|
1554
|
+
"aria-hidden": "true"
|
|
1555
|
+
}, null, 8, ha)) : u("", !0),
|
|
1556
|
+
(t(), E(U(l.value), { class: "vk-title-card__title" }, {
|
|
1557
|
+
default: A(() => [
|
|
1558
|
+
z(m(e.title), 1)
|
|
1559
|
+
]),
|
|
1560
|
+
_: 1
|
|
1561
|
+
}))
|
|
1562
|
+
]),
|
|
1563
|
+
e.subtitle ? (t(), a("p", ma, m(e.subtitle), 1)) : u("", !0)
|
|
1564
|
+
]),
|
|
1565
|
+
d.$slots.actions ? (t(), a("div", _a, [
|
|
1566
|
+
B(d.$slots, "actions")
|
|
1567
|
+
])) : u("", !0)
|
|
1568
|
+
], 2));
|
|
1569
|
+
}
|
|
1570
|
+
}), ya = ["aria-hidden"], $a = ["src", "alt"], ga = ["aria-label"], xa = ["src"], wa = {
|
|
1571
|
+
key: 3,
|
|
1572
|
+
class: "vk-avatar__default-dot",
|
|
1573
|
+
"aria-hidden": "true"
|
|
1574
|
+
}, bl = /* @__PURE__ */ I({
|
|
1575
|
+
__name: "Avatar",
|
|
1576
|
+
props: {
|
|
1577
|
+
src: {},
|
|
1578
|
+
alt: {},
|
|
1579
|
+
name: {},
|
|
1580
|
+
size: { default: "md" },
|
|
1581
|
+
shape: { default: "circle" },
|
|
1582
|
+
fallbackIconSrc: {},
|
|
1583
|
+
variant: { default: "info-inverted" },
|
|
1584
|
+
decorative: { type: Boolean, default: !1 }
|
|
1585
|
+
},
|
|
1586
|
+
setup(e) {
|
|
1587
|
+
const c = e, l = T(!1);
|
|
1588
|
+
M(
|
|
1589
|
+
() => c.src,
|
|
1590
|
+
() => {
|
|
1591
|
+
l.value = !1;
|
|
1592
|
+
}
|
|
1593
|
+
);
|
|
1594
|
+
const d = S(() => !!c.src && !l.value), n = S(() => {
|
|
1595
|
+
var k, r;
|
|
1596
|
+
if (!c.name) return "";
|
|
1597
|
+
const f = c.name.trim().split(/\s+/).filter(Boolean);
|
|
1598
|
+
if (f.length === 0) return "";
|
|
1599
|
+
const v = ((k = f[0]) == null ? void 0 : k[0]) ?? "", h = f.length > 1 ? ((r = f[f.length - 1]) == null ? void 0 : r[0]) ?? "" : "";
|
|
1600
|
+
return `${v}${h}`.toUpperCase();
|
|
1601
|
+
}), s = S(() => c.alt !== void 0 ? c.alt : c.name ? `${c.name} avatar` : "User avatar");
|
|
1602
|
+
function i() {
|
|
1603
|
+
l.value = !0;
|
|
1604
|
+
}
|
|
1605
|
+
return (f, v) => (t(), a("span", {
|
|
1606
|
+
class: $([
|
|
1607
|
+
"vk-avatar",
|
|
1608
|
+
`vk-avatar--${e.size}`,
|
|
1609
|
+
`vk-avatar--${e.shape}`,
|
|
1610
|
+
`vk-avatar--${e.variant}`
|
|
1611
|
+
]),
|
|
1612
|
+
"aria-hidden": e.decorative ? "true" : void 0
|
|
1613
|
+
}, [
|
|
1614
|
+
d.value ? (t(), a("img", {
|
|
1615
|
+
key: 0,
|
|
1616
|
+
src: e.src,
|
|
1617
|
+
alt: e.decorative ? "" : s.value,
|
|
1618
|
+
class: "vk-avatar__image",
|
|
1619
|
+
onError: i
|
|
1620
|
+
}, null, 40, $a)) : n.value ? (t(), a("span", {
|
|
1621
|
+
key: 1,
|
|
1622
|
+
class: "vk-avatar__initials",
|
|
1623
|
+
"aria-label": e.decorative ? void 0 : s.value
|
|
1624
|
+
}, m(n.value), 9, ga)) : e.fallbackIconSrc ? (t(), a("img", {
|
|
1625
|
+
key: 2,
|
|
1626
|
+
src: e.fallbackIconSrc,
|
|
1627
|
+
class: "vk-avatar__icon",
|
|
1628
|
+
alt: "",
|
|
1629
|
+
"aria-hidden": "true"
|
|
1630
|
+
}, null, 8, xa)) : (t(), a("span", wa))
|
|
1631
|
+
], 10, ya));
|
|
1632
|
+
}
|
|
1633
|
+
}), Ia = { class: "vk-empty-state__content" }, Sa = ["src"], Ba = { class: "vk-empty-state__text" }, Ca = { class: "vk-empty-state__title" }, pa = {
|
|
1634
|
+
key: 0,
|
|
1635
|
+
class: "vk-empty-state__description"
|
|
1636
|
+
}, Va = {
|
|
1637
|
+
key: 0,
|
|
1638
|
+
class: "vk-empty-state__actions"
|
|
1639
|
+
}, hl = /* @__PURE__ */ I({
|
|
1640
|
+
__name: "EmptyState",
|
|
1641
|
+
props: {
|
|
1642
|
+
title: {},
|
|
1643
|
+
description: {},
|
|
1644
|
+
variant: { default: "info-inverted" },
|
|
1645
|
+
leftIconSrc: {}
|
|
1646
|
+
},
|
|
1647
|
+
setup(e) {
|
|
1648
|
+
return (c, l) => (t(), a("section", {
|
|
1649
|
+
class: $(["vk-empty-state", `vk-empty-state--${e.variant}`])
|
|
1650
|
+
}, [
|
|
1651
|
+
o("div", Ia, [
|
|
1652
|
+
e.leftIconSrc ? (t(), a("img", {
|
|
1653
|
+
key: 0,
|
|
1654
|
+
src: e.leftIconSrc,
|
|
1655
|
+
class: "vk-empty-state__icon",
|
|
1656
|
+
alt: "",
|
|
1657
|
+
"aria-hidden": "true"
|
|
1658
|
+
}, null, 8, Sa)) : u("", !0),
|
|
1659
|
+
o("div", Ba, [
|
|
1660
|
+
o("h3", Ca, m(e.title), 1),
|
|
1661
|
+
e.description ? (t(), a("p", pa, m(e.description), 1)) : u("", !0)
|
|
1662
|
+
])
|
|
1663
|
+
]),
|
|
1664
|
+
c.$slots.actions ? (t(), a("div", Va, [
|
|
1665
|
+
B(c.$slots, "actions")
|
|
1666
|
+
])) : u("", !0)
|
|
1667
|
+
], 2));
|
|
1668
|
+
}
|
|
1669
|
+
}), Ta = ["aria-sort"], qa = ["onClick"], za = ["src"], Ma = {
|
|
1670
|
+
class: "vk-table__sort-indicator",
|
|
1671
|
+
"aria-hidden": "true"
|
|
1672
|
+
}, Da = {
|
|
1673
|
+
key: 1,
|
|
1674
|
+
class: "vk-table__header-label"
|
|
1675
|
+
}, Oa = ["src"], Aa = ["onClick", "onKeydown"], Ea = {
|
|
1676
|
+
key: 0,
|
|
1677
|
+
class: "vk-table__empty-row"
|
|
1678
|
+
}, La = ["colspan"], ml = /* @__PURE__ */ I({
|
|
1679
|
+
__name: "Table",
|
|
1680
|
+
props: {
|
|
1681
|
+
columns: {},
|
|
1682
|
+
rows: {},
|
|
1683
|
+
rowKey: { type: [String, Function], default: "id" },
|
|
1684
|
+
striped: { type: Boolean, default: !1 },
|
|
1685
|
+
compact: { type: Boolean, default: !1 },
|
|
1686
|
+
variant: { default: "info" }
|
|
1687
|
+
},
|
|
1688
|
+
emits: ["sort", "rowClick"],
|
|
1689
|
+
setup(e, { emit: c }) {
|
|
1690
|
+
const l = e, d = c, n = T(null), s = T("asc");
|
|
1691
|
+
function i(k) {
|
|
1692
|
+
if (typeof l.rowKey == "function")
|
|
1693
|
+
return l.rowKey(k);
|
|
1694
|
+
const r = k[l.rowKey];
|
|
1695
|
+
return typeof r == "string" || typeof r == "number" ? r : JSON.stringify(k);
|
|
1696
|
+
}
|
|
1697
|
+
function f(k) {
|
|
1698
|
+
n.value === k ? s.value = s.value === "asc" ? "desc" : "asc" : (n.value = k, s.value = "asc"), d("sort", { key: k, direction: s.value });
|
|
1699
|
+
}
|
|
1700
|
+
function v(k) {
|
|
1701
|
+
return !k.sortable || n.value !== k.key ? "none" : s.value === "asc" ? "ascending" : "descending";
|
|
1702
|
+
}
|
|
1703
|
+
function h(k) {
|
|
1704
|
+
return n.value !== k ? "↕" : s.value === "asc" ? "↑" : "↓";
|
|
1705
|
+
}
|
|
1706
|
+
return (k, r) => (t(), a("div", {
|
|
1707
|
+
class: $(["vk-table-wrap", `vk-table-wrap--${e.variant}`])
|
|
1708
|
+
}, [
|
|
1709
|
+
o("table", {
|
|
1710
|
+
class: $([
|
|
1711
|
+
"vk-table",
|
|
1712
|
+
{ "vk-table--striped": e.striped },
|
|
1713
|
+
{ "vk-table--compact": e.compact }
|
|
1714
|
+
])
|
|
1715
|
+
}, [
|
|
1716
|
+
o("thead", null, [
|
|
1717
|
+
o("tr", null, [
|
|
1718
|
+
(t(!0), a(p, null, V(e.columns, (_) => (t(), a("th", {
|
|
1719
|
+
key: _.key,
|
|
1720
|
+
scope: "col",
|
|
1721
|
+
"aria-sort": v(_),
|
|
1722
|
+
class: $(["vk-table__th", { "vk-table__th--sortable": _.sortable }])
|
|
1723
|
+
}, [
|
|
1724
|
+
_.sortable ? (t(), a("button", {
|
|
1725
|
+
key: 0,
|
|
1726
|
+
type: "button",
|
|
1727
|
+
class: "vk-table__sort-btn",
|
|
1728
|
+
onClick: (y) => f(_.key)
|
|
1729
|
+
}, [
|
|
1730
|
+
_.leftIconSrc ? (t(), a("img", {
|
|
1731
|
+
key: 0,
|
|
1732
|
+
src: _.leftIconSrc,
|
|
1733
|
+
class: "vk-table__icon",
|
|
1734
|
+
alt: "",
|
|
1735
|
+
"aria-hidden": "true"
|
|
1736
|
+
}, null, 8, za)) : u("", !0),
|
|
1737
|
+
o("span", null, m(_.label), 1),
|
|
1738
|
+
o("span", Ma, m(h(_.key)), 1)
|
|
1739
|
+
], 8, qa)) : (t(), a("span", Da, [
|
|
1740
|
+
_.leftIconSrc ? (t(), a("img", {
|
|
1741
|
+
key: 0,
|
|
1742
|
+
src: _.leftIconSrc,
|
|
1743
|
+
class: "vk-table__icon",
|
|
1744
|
+
alt: "",
|
|
1745
|
+
"aria-hidden": "true"
|
|
1746
|
+
}, null, 8, Oa)) : u("", !0),
|
|
1747
|
+
o("span", null, m(_.label), 1)
|
|
1748
|
+
]))
|
|
1749
|
+
], 10, Ta))), 128))
|
|
1750
|
+
])
|
|
1751
|
+
]),
|
|
1752
|
+
o("tbody", null, [
|
|
1753
|
+
(t(!0), a(p, null, V(e.rows, (_) => (t(), a("tr", {
|
|
1754
|
+
key: i(_),
|
|
1755
|
+
class: "vk-table__tr",
|
|
1756
|
+
tabindex: "0",
|
|
1757
|
+
onClick: (y) => d("rowClick", _),
|
|
1758
|
+
onKeydown: [
|
|
1759
|
+
L(F((y) => d("rowClick", _), ["prevent"]), ["enter"]),
|
|
1760
|
+
L(F((y) => d("rowClick", _), ["prevent"]), ["space"])
|
|
1761
|
+
]
|
|
1762
|
+
}, [
|
|
1763
|
+
(t(!0), a(p, null, V(e.columns, (y) => (t(), a("td", {
|
|
1764
|
+
key: `${i(_)}-${y.key}`,
|
|
1765
|
+
class: "vk-table__td"
|
|
1766
|
+
}, m(String(_[y.key] ?? "")), 1))), 128))
|
|
1767
|
+
], 40, Aa))), 128)),
|
|
1768
|
+
e.rows.length === 0 ? (t(), a("tr", Ea, [
|
|
1769
|
+
o("td", {
|
|
1770
|
+
colspan: e.columns.length,
|
|
1771
|
+
class: "vk-table__empty-cell"
|
|
1772
|
+
}, " No data available. ", 8, La)
|
|
1773
|
+
])) : u("", !0)
|
|
1774
|
+
])
|
|
1775
|
+
], 2)
|
|
1776
|
+
], 2));
|
|
1777
|
+
}
|
|
1778
|
+
}), Fa = ["aria-labelledby"], Ka = {
|
|
1779
|
+
key: 0,
|
|
1780
|
+
class: "vk-modal__header"
|
|
1781
|
+
}, Na = { class: "vk-modal__body" }, Ra = {
|
|
1782
|
+
key: 1,
|
|
1783
|
+
class: "vk-modal__footer"
|
|
1784
|
+
}, _l = /* @__PURE__ */ I({
|
|
1785
|
+
__name: "Modal",
|
|
1786
|
+
props: {
|
|
1787
|
+
open: { type: Boolean, default: !1 },
|
|
1788
|
+
title: {},
|
|
1789
|
+
size: { default: "md" },
|
|
1790
|
+
variant: { default: "info" },
|
|
1791
|
+
closeOnEsc: { type: Boolean, default: !0 },
|
|
1792
|
+
closeOnOverlay: { type: Boolean, default: !0 }
|
|
1793
|
+
},
|
|
1794
|
+
emits: ["close"],
|
|
1795
|
+
setup(e, { emit: c }) {
|
|
1796
|
+
const l = e, d = c, n = T(null), s = `vk-modal-title-${Math.random().toString(36).slice(2, 9)}`, i = T(null), f = S(() => !!l.title || !!(n.value && !1));
|
|
1797
|
+
function v() {
|
|
1798
|
+
d("close");
|
|
1799
|
+
}
|
|
1800
|
+
function h() {
|
|
1801
|
+
l.closeOnOverlay && v();
|
|
1802
|
+
}
|
|
1803
|
+
function k() {
|
|
1804
|
+
const g = n.value;
|
|
1805
|
+
if (!g) return [];
|
|
1806
|
+
const b = [
|
|
1807
|
+
"a[href]",
|
|
1808
|
+
"button:not([disabled])",
|
|
1809
|
+
"textarea:not([disabled])",
|
|
1810
|
+
"input:not([disabled])",
|
|
1811
|
+
"select:not([disabled])",
|
|
1812
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
1813
|
+
].join(",");
|
|
1814
|
+
return Array.from(g.querySelectorAll(b)).filter(
|
|
1815
|
+
(x) => !x.hasAttribute("disabled") && !x.getAttribute("aria-hidden")
|
|
1816
|
+
);
|
|
1817
|
+
}
|
|
1818
|
+
function r(g) {
|
|
1819
|
+
var q;
|
|
1820
|
+
if (g.key !== "Tab") return;
|
|
1821
|
+
const b = k();
|
|
1822
|
+
if (b.length === 0) {
|
|
1823
|
+
g.preventDefault(), (q = n.value) == null || q.focus();
|
|
1824
|
+
return;
|
|
1825
|
+
}
|
|
1826
|
+
const x = b[0], w = b[b.length - 1], C = document.activeElement;
|
|
1827
|
+
g.shiftKey && C === x ? (g.preventDefault(), w.focus()) : !g.shiftKey && C === w && (g.preventDefault(), x.focus());
|
|
1828
|
+
}
|
|
1829
|
+
function _(g) {
|
|
1830
|
+
if (g.key === "Escape" && l.closeOnEsc) {
|
|
1831
|
+
g.preventDefault(), v();
|
|
1832
|
+
return;
|
|
1833
|
+
}
|
|
1834
|
+
r(g);
|
|
1835
|
+
}
|
|
1836
|
+
function y(g) {
|
|
1837
|
+
document.body.style.overflow = g ? "hidden" : "";
|
|
1838
|
+
}
|
|
1839
|
+
return M(
|
|
1840
|
+
() => l.open,
|
|
1841
|
+
async (g) => {
|
|
1842
|
+
var b, x;
|
|
1843
|
+
g ? (i.value = document.activeElement, y(!0), await R(), (b = k()[0] ?? n.value) == null || b.focus()) : (y(!1), (x = i.value) == null || x.focus());
|
|
1844
|
+
},
|
|
1845
|
+
{ immediate: !0 }
|
|
1846
|
+
), D(() => {
|
|
1847
|
+
y(!1);
|
|
1848
|
+
}), (g, b) => (t(), E(P, { to: "body" }, [
|
|
1849
|
+
e.open ? (t(), a("div", {
|
|
1850
|
+
key: 0,
|
|
1851
|
+
class: "vk-modal",
|
|
1852
|
+
onKeydown: _
|
|
1853
|
+
}, [
|
|
1854
|
+
o("div", {
|
|
1855
|
+
class: "vk-modal__overlay",
|
|
1856
|
+
onClick: h
|
|
1857
|
+
}),
|
|
1858
|
+
o("section", {
|
|
1859
|
+
ref_key: "dialogRef",
|
|
1860
|
+
ref: n,
|
|
1861
|
+
class: $([
|
|
1862
|
+
"vk-modal__dialog",
|
|
1863
|
+
`vk-modal__dialog--${e.size}`,
|
|
1864
|
+
`vk-modal__dialog--${e.variant}`
|
|
1865
|
+
]),
|
|
1866
|
+
role: "dialog",
|
|
1867
|
+
"aria-modal": "true",
|
|
1868
|
+
"aria-labelledby": f.value ? s : void 0,
|
|
1869
|
+
tabindex: "-1"
|
|
1870
|
+
}, [
|
|
1871
|
+
g.$slots.header || e.title ? (t(), a("header", Ka, [
|
|
1872
|
+
B(g.$slots, "header", {}, () => [
|
|
1873
|
+
o("h2", {
|
|
1874
|
+
id: s,
|
|
1875
|
+
class: "vk-modal__title"
|
|
1876
|
+
}, m(e.title), 1)
|
|
1877
|
+
]),
|
|
1878
|
+
o("button", {
|
|
1879
|
+
type: "button",
|
|
1880
|
+
class: "vk-modal__close",
|
|
1881
|
+
"aria-label": "Close dialog",
|
|
1882
|
+
onClick: v
|
|
1883
|
+
}, " × ")
|
|
1884
|
+
])) : u("", !0),
|
|
1885
|
+
o("div", Na, [
|
|
1886
|
+
B(g.$slots, "default")
|
|
1887
|
+
]),
|
|
1888
|
+
g.$slots.footer ? (t(), a("footer", Ra, [
|
|
1889
|
+
B(g.$slots, "footer")
|
|
1890
|
+
])) : u("", !0)
|
|
1891
|
+
], 10, Fa)
|
|
1892
|
+
], 32)) : u("", !0)
|
|
1893
|
+
]));
|
|
1894
|
+
}
|
|
1895
|
+
}), yl = /* @__PURE__ */ I({
|
|
1896
|
+
__name: "Overlay",
|
|
1897
|
+
props: {
|
|
1898
|
+
show: { type: Boolean, default: !1 },
|
|
1899
|
+
opacity: { default: "medium" },
|
|
1900
|
+
variant: { default: "info" },
|
|
1901
|
+
blur: { type: Boolean, default: !1 },
|
|
1902
|
+
zIndex: { default: 1e3 },
|
|
1903
|
+
closeOnClick: { type: Boolean, default: !0 }
|
|
1904
|
+
},
|
|
1905
|
+
emits: ["clickOutside"],
|
|
1906
|
+
setup(e, { emit: c }) {
|
|
1907
|
+
const l = e, d = c;
|
|
1908
|
+
function n(s) {
|
|
1909
|
+
l.closeOnClick && d("clickOutside", s);
|
|
1910
|
+
}
|
|
1911
|
+
return (s, i) => e.show ? (t(), a("div", {
|
|
1912
|
+
key: 0,
|
|
1913
|
+
class: $([
|
|
1914
|
+
"vk-overlay",
|
|
1915
|
+
`vk-overlay--${e.opacity}`,
|
|
1916
|
+
`vk-overlay--${e.variant}`,
|
|
1917
|
+
{ "vk-overlay--blur": e.blur }
|
|
1918
|
+
]),
|
|
1919
|
+
style: O({ zIndex: String(e.zIndex) }),
|
|
1920
|
+
"aria-hidden": "true",
|
|
1921
|
+
onClick: n
|
|
1922
|
+
}, null, 6)) : u("", !0);
|
|
1923
|
+
}
|
|
1924
|
+
}), Pa = ["aria-label"], ja = { class: "vk-overlay-loader__content" }, Ga = { class: "vk-overlay-loader__message" }, $l = /* @__PURE__ */ I({
|
|
1925
|
+
__name: "OverlayLoader",
|
|
1926
|
+
props: {
|
|
1927
|
+
show: { type: Boolean, default: !1 },
|
|
1928
|
+
message: { default: "Loading..." },
|
|
1929
|
+
fullscreen: { type: Boolean, default: !1 },
|
|
1930
|
+
size: { default: "md" },
|
|
1931
|
+
variant: { default: "info" }
|
|
1932
|
+
},
|
|
1933
|
+
setup(e) {
|
|
1934
|
+
return (c, l) => e.show ? (t(), a("div", {
|
|
1935
|
+
key: 0,
|
|
1936
|
+
class: $([
|
|
1937
|
+
"vk-overlay-loader",
|
|
1938
|
+
`vk-overlay-loader--${e.size}`,
|
|
1939
|
+
`vk-overlay-loader--${e.variant}`,
|
|
1940
|
+
{ "vk-overlay-loader--fullscreen": e.fullscreen }
|
|
1941
|
+
]),
|
|
1942
|
+
role: "status",
|
|
1943
|
+
"aria-live": "polite",
|
|
1944
|
+
"aria-label": e.message
|
|
1945
|
+
}, [
|
|
1946
|
+
l[1] || (l[1] = o("div", {
|
|
1947
|
+
class: "vk-overlay-loader__backdrop",
|
|
1948
|
+
"aria-hidden": "true"
|
|
1949
|
+
}, null, -1)),
|
|
1950
|
+
o("div", ja, [
|
|
1951
|
+
l[0] || (l[0] = o("span", {
|
|
1952
|
+
class: "vk-overlay-loader__spinner",
|
|
1953
|
+
"aria-hidden": "true"
|
|
1954
|
+
}, null, -1)),
|
|
1955
|
+
o("span", Ga, m(e.message), 1)
|
|
1956
|
+
])
|
|
1957
|
+
], 10, Pa)) : u("", !0);
|
|
1958
|
+
}
|
|
1959
|
+
});
|
|
1960
|
+
export {
|
|
1961
|
+
vl as Accordion,
|
|
1962
|
+
bl as Avatar,
|
|
1963
|
+
tl as Badge,
|
|
1964
|
+
dl as Breadcrumb,
|
|
1965
|
+
ol as BurgerButton,
|
|
1966
|
+
Ua as Button,
|
|
1967
|
+
fl as Card,
|
|
1968
|
+
Xa as Checkbox,
|
|
1969
|
+
hl as EmptyState,
|
|
1970
|
+
rl as Footer,
|
|
1971
|
+
Ha as Input,
|
|
1972
|
+
el as Label,
|
|
1973
|
+
_l as Modal,
|
|
1974
|
+
il as NavBar,
|
|
1975
|
+
sl as NavMenu,
|
|
1976
|
+
yl as Overlay,
|
|
1977
|
+
$l as OverlayLoader,
|
|
1978
|
+
ul as Pagination,
|
|
1979
|
+
al as Pill,
|
|
1980
|
+
Ya as RadioGroup,
|
|
1981
|
+
Qa as Selector,
|
|
1982
|
+
Za as Switch,
|
|
1983
|
+
ml as Table,
|
|
1984
|
+
cl as Tabs,
|
|
1985
|
+
Ja as TextArea,
|
|
1986
|
+
kl as TitleCard,
|
|
1987
|
+
ll as Toast,
|
|
1988
|
+
nl as Tooltip
|
|
1989
|
+
};
|
|
1990
|
+
//# sourceMappingURL=vitam-uikit-apps.esm.js.map
|