@validol4ik/uikit 0.11.12 → 0.11.13
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/{AppButtonCopy-BUlILfPq.js → AppButtonCopy-WPuHiwae.js} +3 -2
- package/dist/AppButtonCopy-eLy6djTq.cjs +1 -0
- package/dist/BottomSheet-CnlDmlV-.cjs +1 -0
- package/dist/{BottomSheet-chlc2Zka.js → BottomSheet-znHa17-p.js} +42 -38
- package/dist/index-BcNnLkUI.js +1123 -0
- package/dist/index-jT4cK_YR.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/types/components/buttons/AppButton/AppButton.vue.d.ts +1 -0
- package/dist/types/components/buttons/AppButton/types.d.ts +1 -0
- package/dist/types/components/buttons/CloseButton/CloseButton.vue.d.ts +1 -0
- package/dist/types/components/buttons/CloseButton/types.d.ts +2 -0
- package/dist/types/components/buttons/DropdownButton/DropdownButton.vue.d.ts +1 -0
- package/dist/types/components/buttons/DropdownButton/types.d.ts +1 -0
- package/dist/types/components/form/AppCodeInput/AppCodeInput.vue.d.ts +1 -0
- package/dist/types/components/form/AppCodeInput/types.d.ts +1 -0
- package/dist/types/components/form/AppSegment/AppSegment.vue.d.ts +1 -1
- package/dist/types/components/form/AppSegment/types.d.ts +3 -2
- package/dist/types/components/form/AppSelect/AppSelect.vue.d.ts +1 -0
- package/dist/types/components/form/AppSelect/types.d.ts +1 -0
- package/dist/types/components/form/AppToggle/AppToggle.vue.d.ts +1 -0
- package/dist/types/components/form/AppToggle/types.d.ts +1 -0
- package/dist/types/components/menu/BottomSheet/BottomSheet.vue.d.ts +1 -0
- package/dist/types/components/menu/BottomSheet/types.d.ts +1 -0
- package/dist/types/components/menu/MenuItem/MenuItem.vue.d.ts +3 -1
- package/dist/types/components/menu/MenuItem/types.d.ts +1 -0
- package/dist/types/components/menu/PopupItem/PopupItem.vue.d.ts +3 -1
- package/dist/types/components/menu/PopupItem/types.d.ts +1 -0
- package/dist/types/components/menu/SystemMenu.vue.d.ts +6 -1
- package/dist/types/components/navigation/AppPagination/AppPagination.vue.d.ts +1 -0
- package/dist/types/components/navigation/AppPagination/types.d.ts +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/uikit.cjs +1 -1
- package/dist/uikit.es.js +1 -1
- package/package.json +1 -1
- package/dist/AppButtonCopy-BB9iCHIn.cjs +0 -1
- package/dist/BottomSheet-czV5T-sw.cjs +0 -1
- package/dist/index-BXIEClXA.js +0 -1068
- package/dist/index-Bj7Ei7Zw.cjs +0 -1
|
@@ -0,0 +1,1123 @@
|
|
|
1
|
+
import { defineComponent as P, computed as M, openBlock as s, createBlock as I, unref as C, normalizeClass as v, withCtx as U, createElementBlock as i, createCommentVNode as b, renderSlot as E, Fragment as L, createTextVNode as W, toDisplayString as S, createElementVNode as w, withModifiers as H, withDirectives as ne, createVNode as G, normalizeStyle as j, ref as N, watch as ee, onMounted as te, renderList as F, withKeys as de, vModelText as ue, nextTick as Q, useModel as X, useTemplateRef as Z, onBeforeUnmount as pe, mergeModels as Y, mergeProps as ce, createSlots as me, defineAsyncComponent as le } from "vue";
|
|
2
|
+
import { boot as fe } from "quasar/wrappers";
|
|
3
|
+
import be from "quasar/src/components/btn/QBtn.js";
|
|
4
|
+
import ve from "quasar/src/components/checkbox/QCheckbox.js";
|
|
5
|
+
import ge from "quasar/src/directives/close-popup/ClosePopup.js";
|
|
6
|
+
import ke from "quasar/src/components/spinner/QSpinner.js";
|
|
7
|
+
import ye from "quasar/src/components/linear-progress/QLinearProgress.js";
|
|
8
|
+
import he from "quasar/src/components/btn-dropdown/QBtnDropdown.js";
|
|
9
|
+
import $e from "quasar/src/components/item/QItem.js";
|
|
10
|
+
import _e from "quasar/src/components/chip/QChip.js";
|
|
11
|
+
import Be from "quasar/src/components/select/QSelect.js";
|
|
12
|
+
import we from "quasar/src/utils/patterns/patterns.js";
|
|
13
|
+
const Bl = fe(({ app: m }) => {
|
|
14
|
+
const r = m.config.globalProperties.$q;
|
|
15
|
+
r.iconMapFn = (o) => {
|
|
16
|
+
if (o.startsWith("icon-kl:"))
|
|
17
|
+
return {
|
|
18
|
+
cls: `icon-kl icon-kl-${o.slice(8)}`
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}), K = {
|
|
22
|
+
PRIMARY: "primary",
|
|
23
|
+
INFO: "info"
|
|
24
|
+
}, A = {
|
|
25
|
+
SM: "sm",
|
|
26
|
+
MD: "md",
|
|
27
|
+
LG: "lg",
|
|
28
|
+
XL: "xl"
|
|
29
|
+
}, Me = {
|
|
30
|
+
[A.SM]: "3px 9px",
|
|
31
|
+
[A.MD]: "5px 12px",
|
|
32
|
+
[A.LG]: "6px 15px",
|
|
33
|
+
[A.XL]: "9px 20px"
|
|
34
|
+
}, Ae = /* @__PURE__ */ P({
|
|
35
|
+
__name: "AppButton",
|
|
36
|
+
props: {
|
|
37
|
+
size: { default: A.MD },
|
|
38
|
+
transparent: { type: Boolean },
|
|
39
|
+
flat: { type: Boolean },
|
|
40
|
+
rounded: { type: Boolean },
|
|
41
|
+
color: { default: K.PRIMARY },
|
|
42
|
+
iconLeft: {},
|
|
43
|
+
iconRight: {},
|
|
44
|
+
iconMiddle: {},
|
|
45
|
+
disabled: { type: Boolean },
|
|
46
|
+
loading: { type: Boolean },
|
|
47
|
+
to: {},
|
|
48
|
+
href: {},
|
|
49
|
+
target: {},
|
|
50
|
+
submit: { type: Boolean },
|
|
51
|
+
ariaLabel: {},
|
|
52
|
+
label: {},
|
|
53
|
+
download: {},
|
|
54
|
+
dark: { type: Boolean, default: void 0 }
|
|
55
|
+
},
|
|
56
|
+
emits: ["click"],
|
|
57
|
+
setup(m) {
|
|
58
|
+
const r = m, o = M(() => [
|
|
59
|
+
"app-btn",
|
|
60
|
+
{
|
|
61
|
+
"app-btn_default": !r.transparent && !r.flat,
|
|
62
|
+
"app-btn_trans": r.transparent,
|
|
63
|
+
"app-btn_flat": r.flat,
|
|
64
|
+
"app-btn_rounded": r.rounded,
|
|
65
|
+
"app-btn_icon-left": r.iconLeft,
|
|
66
|
+
"app-btn_icon-right": r.iconRight,
|
|
67
|
+
"app-btn_icon-middle": r.iconMiddle
|
|
68
|
+
},
|
|
69
|
+
`app-btn_${r.size}`,
|
|
70
|
+
`app-btn_${r.color}`
|
|
71
|
+
]);
|
|
72
|
+
return (e, p) => (s(), I(C(be), {
|
|
73
|
+
"no-caps": "",
|
|
74
|
+
unelevated: "",
|
|
75
|
+
class: v([
|
|
76
|
+
o.value,
|
|
77
|
+
{ "app-btn_theme-dark": e.dark ?? e.$q.dark.isActive }
|
|
78
|
+
]),
|
|
79
|
+
padding: C(Me)[e.size || C(A).MD],
|
|
80
|
+
loading: e.loading,
|
|
81
|
+
disable: e.disabled || void 0,
|
|
82
|
+
to: e.to,
|
|
83
|
+
href: e.href,
|
|
84
|
+
target: e.target,
|
|
85
|
+
type: e.submit ? "submit" : void 0,
|
|
86
|
+
"aria-label": e.ariaLabel,
|
|
87
|
+
download: e.download,
|
|
88
|
+
onClick: p[0] || (p[0] = (n) => e.$emit("click", n))
|
|
89
|
+
}, {
|
|
90
|
+
default: U(() => [
|
|
91
|
+
e.iconLeft || e.iconMiddle ? (s(), i("i", {
|
|
92
|
+
key: 0,
|
|
93
|
+
class: v([
|
|
94
|
+
"icon-kl",
|
|
95
|
+
e.iconLeft ? "icon-kl_left" : "icon-kl_middle",
|
|
96
|
+
`icon-kl-${e.iconLeft || e.iconMiddle}`,
|
|
97
|
+
e.transparent || e.flat ? `text-${e.color}` : "text-secondary"
|
|
98
|
+
])
|
|
99
|
+
}, null, 2)) : b("", !0),
|
|
100
|
+
E(e.$slots, "default", {}, void 0, !0),
|
|
101
|
+
e.label ? (s(), i(L, { key: 1 }, [
|
|
102
|
+
W(S(e.label), 1)
|
|
103
|
+
], 64)) : b("", !0),
|
|
104
|
+
e.iconRight ? (s(), i("i", {
|
|
105
|
+
key: 2,
|
|
106
|
+
class: v([
|
|
107
|
+
"icon-kl",
|
|
108
|
+
"icon-kl_right",
|
|
109
|
+
`icon-kl-${e.iconRight}`,
|
|
110
|
+
e.transparent ? `text-${e.color}` : "text-secondary"
|
|
111
|
+
])
|
|
112
|
+
}, null, 2)) : b("", !0)
|
|
113
|
+
]),
|
|
114
|
+
_: 3
|
|
115
|
+
}, 8, ["class", "padding", "loading", "disable", "to", "href", "target", "type", "aria-label", "download"]));
|
|
116
|
+
}
|
|
117
|
+
}), R = (m, r) => {
|
|
118
|
+
const o = m.__vccOpts || m;
|
|
119
|
+
for (const [e, p] of r)
|
|
120
|
+
o[e] = p;
|
|
121
|
+
return o;
|
|
122
|
+
}, wl = /* @__PURE__ */ R(Ae, [["__scopeId", "data-v-aade6d9b"]]), Ve = /* @__PURE__ */ P({
|
|
123
|
+
__name: "CloseButton",
|
|
124
|
+
props: {
|
|
125
|
+
size: { default: A.MD },
|
|
126
|
+
glass: { type: Boolean },
|
|
127
|
+
dark: { type: Boolean, default: void 0 }
|
|
128
|
+
},
|
|
129
|
+
setup(m) {
|
|
130
|
+
const r = m, o = M(() => ["close-btn", `close-btn_${r.size}`]);
|
|
131
|
+
return (e, p) => (s(), i("button", {
|
|
132
|
+
class: v([
|
|
133
|
+
o.value,
|
|
134
|
+
{
|
|
135
|
+
"close-btn_glass": e.glass,
|
|
136
|
+
"close-btn_dark": e.dark ?? e.$q.dark.isActive
|
|
137
|
+
}
|
|
138
|
+
]),
|
|
139
|
+
type: "button",
|
|
140
|
+
"aria-label": "Close"
|
|
141
|
+
}, [...p[0] || (p[0] = [
|
|
142
|
+
w("i", { class: "icon-kl icon-kl-close" }, null, -1)
|
|
143
|
+
])], 2));
|
|
144
|
+
}
|
|
145
|
+
}), Ml = /* @__PURE__ */ R(Ve, [["__scopeId", "data-v-fa0e7419"]]), Ce = {
|
|
146
|
+
key: 0,
|
|
147
|
+
class: "app-toggle__label app-toggle__label_left"
|
|
148
|
+
}, ze = { class: "app-toggle__container" }, Le = ["checked", "disabled"], Se = { class: "app-toggle__thumb" }, Ie = {
|
|
149
|
+
key: 1,
|
|
150
|
+
class: "app-toggle__label"
|
|
151
|
+
}, Pe = /* @__PURE__ */ P({
|
|
152
|
+
__name: "AppToggle",
|
|
153
|
+
props: {
|
|
154
|
+
modelValue: { type: Boolean },
|
|
155
|
+
size: { default: A.MD },
|
|
156
|
+
label: {},
|
|
157
|
+
disabled: { type: Boolean },
|
|
158
|
+
color: { default: K.PRIMARY },
|
|
159
|
+
iconColor: {},
|
|
160
|
+
icon: {},
|
|
161
|
+
iconActive: {},
|
|
162
|
+
labelLeft: { type: Boolean },
|
|
163
|
+
dark: { type: Boolean, default: void 0 }
|
|
164
|
+
},
|
|
165
|
+
emits: ["update:modelValue"],
|
|
166
|
+
setup(m, { emit: r }) {
|
|
167
|
+
const o = m, e = r, p = M({
|
|
168
|
+
get: () => o.modelValue,
|
|
169
|
+
set: (l) => {
|
|
170
|
+
e("update:modelValue", l);
|
|
171
|
+
}
|
|
172
|
+
}), n = M(() => [
|
|
173
|
+
"app-toggle",
|
|
174
|
+
{
|
|
175
|
+
"app-toggle_active": p.value,
|
|
176
|
+
"app-toggle_disabled": o.disabled
|
|
177
|
+
},
|
|
178
|
+
`app-toggle_${o.size}`,
|
|
179
|
+
`app-toggle_${o.color}`
|
|
180
|
+
]);
|
|
181
|
+
return (l, f) => (s(), i("div", {
|
|
182
|
+
class: v([
|
|
183
|
+
n.value,
|
|
184
|
+
{ "app-toggle_theme-dark": l.dark ?? l.$q.dark.isActive }
|
|
185
|
+
]),
|
|
186
|
+
onClick: f[1] || (f[1] = H(() => {
|
|
187
|
+
}, ["stop"]))
|
|
188
|
+
}, [
|
|
189
|
+
l.label && l.labelLeft ? (s(), i("span", Ce, S(l.label), 1)) : b("", !0),
|
|
190
|
+
w("label", ze, [
|
|
191
|
+
w("input", {
|
|
192
|
+
type: "checkbox",
|
|
193
|
+
checked: p.value,
|
|
194
|
+
onChange: f[0] || (f[0] = (c) => p.value = !p.value),
|
|
195
|
+
disabled: l.disabled,
|
|
196
|
+
class: "app-toggle__input"
|
|
197
|
+
}, null, 40, Le),
|
|
198
|
+
w("span", {
|
|
199
|
+
class: v(["app-toggle__slider", p.value ? `bg-${l.color}` : ""])
|
|
200
|
+
}, [
|
|
201
|
+
w("span", Se, [
|
|
202
|
+
l.icon && !l.modelValue ? (s(), i("i", {
|
|
203
|
+
key: 0,
|
|
204
|
+
class: v(["icon-kl", `icon-kl-${l.icon}`, "app-toggle__icon"])
|
|
205
|
+
}, null, 2)) : b("", !0),
|
|
206
|
+
l.modelValue && (l.iconActive || l.icon) ? (s(), i("i", {
|
|
207
|
+
key: 1,
|
|
208
|
+
class: v([
|
|
209
|
+
"icon-kl",
|
|
210
|
+
`icon-kl-${l.iconActive || l.icon}`,
|
|
211
|
+
"app-toggle__icon",
|
|
212
|
+
p.value ? `text-${l.iconColor}` : ""
|
|
213
|
+
])
|
|
214
|
+
}, null, 2)) : b("", !0)
|
|
215
|
+
])
|
|
216
|
+
], 2),
|
|
217
|
+
E(l.$slots, "default", {}, void 0, !0)
|
|
218
|
+
]),
|
|
219
|
+
l.label && !l.labelLeft ? (s(), i("span", Ie, S(l.label), 1)) : b("", !0)
|
|
220
|
+
], 2));
|
|
221
|
+
}
|
|
222
|
+
}), se = /* @__PURE__ */ R(Pe, [["__scopeId", "data-v-fd8c71b1"]]), Re = {
|
|
223
|
+
key: 0,
|
|
224
|
+
class: "menu-item__loading"
|
|
225
|
+
}, De = {
|
|
226
|
+
key: 0,
|
|
227
|
+
class: "menu-item__checked"
|
|
228
|
+
}, qe = {
|
|
229
|
+
key: 2,
|
|
230
|
+
class: "menu-item__icon"
|
|
231
|
+
}, Oe = { class: "menu-item__label" }, Ne = {
|
|
232
|
+
key: 3,
|
|
233
|
+
class: "menu-item__icon-right icon-kl icon-kl-arrow-right"
|
|
234
|
+
}, Ee = /* @__PURE__ */ P({
|
|
235
|
+
__name: "PopupItem",
|
|
236
|
+
props: {
|
|
237
|
+
label: {},
|
|
238
|
+
icon: {},
|
|
239
|
+
iconSize: {},
|
|
240
|
+
color: {},
|
|
241
|
+
iconRight: {},
|
|
242
|
+
arrow: { type: Boolean },
|
|
243
|
+
toggle: { type: Boolean },
|
|
244
|
+
checkbox: { type: Boolean },
|
|
245
|
+
active: { type: Boolean },
|
|
246
|
+
modelValue: { type: Boolean },
|
|
247
|
+
persistent: { type: Boolean },
|
|
248
|
+
loading: { type: Boolean },
|
|
249
|
+
disabled: { type: Boolean },
|
|
250
|
+
gap: { type: Boolean },
|
|
251
|
+
checked: { type: Boolean },
|
|
252
|
+
isMobile: { type: Boolean },
|
|
253
|
+
dark: { type: Boolean, default: void 0 }
|
|
254
|
+
},
|
|
255
|
+
emits: ["update:modelValue", "closePopup"],
|
|
256
|
+
setup(m, { emit: r }) {
|
|
257
|
+
const o = m, e = r, p = () => {
|
|
258
|
+
o.disabled || (o.toggle || o.checkbox ? e("update:modelValue", !o.modelValue) : o.persistent || e("closePopup"));
|
|
259
|
+
};
|
|
260
|
+
return (n, l) => ne((s(), i("div", {
|
|
261
|
+
class: v(["menu-item", [
|
|
262
|
+
{ "menu-item_gap": n.gap },
|
|
263
|
+
{ "menu-item_disabled": n.disabled },
|
|
264
|
+
{ "menu-item_active": n.active },
|
|
265
|
+
{ "menu-item_mobile": n.isMobile },
|
|
266
|
+
{ "menu-item_dark": n.dark ?? n.$q.dark.isActive }
|
|
267
|
+
]]),
|
|
268
|
+
onClick: p
|
|
269
|
+
}, [
|
|
270
|
+
w("div", {
|
|
271
|
+
class: v(["row items-center no-wrap", `text-${n.color ? n.color : "dark"}`])
|
|
272
|
+
}, [
|
|
273
|
+
n.loading ? (s(), i("div", Re, [
|
|
274
|
+
G(C(ke), {
|
|
275
|
+
size: "19px",
|
|
276
|
+
color: n.color ? n.color : "dark"
|
|
277
|
+
}, null, 8, ["color"])
|
|
278
|
+
])) : (s(), i(L, { key: 1 }, [
|
|
279
|
+
n.checked ? (s(), i("div", De, [...l[3] || (l[3] = [
|
|
280
|
+
w("i", { class: "icon-kl icon-kl-check" }, null, -1)
|
|
281
|
+
])])) : b("", !0),
|
|
282
|
+
n.checkbox ? (s(), I(ve, {
|
|
283
|
+
key: 1,
|
|
284
|
+
class: "menu-item__checkbox",
|
|
285
|
+
size: "34px",
|
|
286
|
+
dark: n.dark ?? n.$q.dark.isActive,
|
|
287
|
+
"model-value": n.modelValue,
|
|
288
|
+
"onUpdate:modelValue": l[0] || (l[0] = (f) => e("update:modelValue", f)),
|
|
289
|
+
onClick: l[1] || (l[1] = H(() => {
|
|
290
|
+
}, ["stop"]))
|
|
291
|
+
}, null, 8, ["dark", "model-value"])) : b("", !0),
|
|
292
|
+
n.icon ? (s(), i("div", qe, [
|
|
293
|
+
w("i", {
|
|
294
|
+
class: v(`icon-kl icon-kl-${n.icon}`),
|
|
295
|
+
style: j({ fontSize: n.iconSize || "27px" })
|
|
296
|
+
}, null, 6)
|
|
297
|
+
])) : b("", !0)
|
|
298
|
+
], 64)),
|
|
299
|
+
w("span", Oe, S(n.label), 1)
|
|
300
|
+
], 2),
|
|
301
|
+
n.$slots.right ? E(n.$slots, "right", { key: 0 }, void 0, !0) : n.toggle ? (s(), I(se, {
|
|
302
|
+
key: 1,
|
|
303
|
+
class: "menu-item__toggle",
|
|
304
|
+
"model-value": n.modelValue,
|
|
305
|
+
disabled: n.disabled || n.loading,
|
|
306
|
+
dark: n.dark,
|
|
307
|
+
"onUpdate:modelValue": l[2] || (l[2] = (f) => e("update:modelValue", f))
|
|
308
|
+
}, null, 8, ["model-value", "disabled", "dark"])) : n.iconRight ? (s(), i("i", {
|
|
309
|
+
key: 2,
|
|
310
|
+
class: v([
|
|
311
|
+
"menu-item__icon-right menu-item__icon-right_custom icon-kl",
|
|
312
|
+
`icon-kl-${n.iconRight}`
|
|
313
|
+
])
|
|
314
|
+
}, null, 2)) : n.arrow ? (s(), i("i", Ne)) : b("", !0)
|
|
315
|
+
], 2)), [
|
|
316
|
+
[ge, !n.toggle && !n.checkbox && !n.persistent && !n.disabled]
|
|
317
|
+
]);
|
|
318
|
+
}
|
|
319
|
+
}), ie = /* @__PURE__ */ R(Ee, [["__scopeId", "data-v-0ebb2728"]]), Te = /* @__PURE__ */ P({
|
|
320
|
+
__name: "AppIcon",
|
|
321
|
+
props: {
|
|
322
|
+
name: {},
|
|
323
|
+
size: {},
|
|
324
|
+
color: {}
|
|
325
|
+
},
|
|
326
|
+
setup(m) {
|
|
327
|
+
return (r, o) => (s(), i("i", {
|
|
328
|
+
class: v(["icon-kl", `icon-kl-${r.name}`, r.color ? `text-${r.color}` : ""]),
|
|
329
|
+
style: j(r.size ? `font-size: ${r.size}` : void 0)
|
|
330
|
+
}, null, 6));
|
|
331
|
+
}
|
|
332
|
+
}), J = /* @__PURE__ */ R(Te, [["__scopeId", "data-v-941765ee"]]), Ue = {
|
|
333
|
+
key: 0,
|
|
334
|
+
class: "code-field__label"
|
|
335
|
+
}, Qe = { class: "code-field__inputs" }, We = ["onUpdate:modelValue", "disabled", "onInput", "onKeydown", "onPaste"], Fe = /* @__PURE__ */ P({
|
|
336
|
+
__name: "AppCodeInput",
|
|
337
|
+
props: {
|
|
338
|
+
length: { default: 5 },
|
|
339
|
+
size: { default: A.MD },
|
|
340
|
+
label: {},
|
|
341
|
+
disabled: { type: Boolean },
|
|
342
|
+
loading: { type: Boolean },
|
|
343
|
+
autofocus: { type: Boolean },
|
|
344
|
+
color: {},
|
|
345
|
+
dark: { type: Boolean, default: void 0 }
|
|
346
|
+
},
|
|
347
|
+
emits: ["update:modelValue", "completed"],
|
|
348
|
+
setup(m, { expose: r, emit: o }) {
|
|
349
|
+
const e = m, p = o, n = N(Array(e.length).fill("")), l = N([]), f = M(() => [
|
|
350
|
+
"code-field",
|
|
351
|
+
{
|
|
352
|
+
"code-field_disabled": e.disabled || e.loading
|
|
353
|
+
},
|
|
354
|
+
`code-field_${e.size}`,
|
|
355
|
+
`code-field_${e.color}`
|
|
356
|
+
]), c = M(() => {
|
|
357
|
+
let a = "";
|
|
358
|
+
return e.size == A.SM && (a += `width: ${e.length * 26 + (e.length - 1) * 5}px`), e.size == A.MD && (a += `width: ${e.length * 32 + (e.length - 1) * 8}px`), e.size == A.LG && (a += `width: ${e.length * 44 + (e.length - 1) * 10}px`), a;
|
|
359
|
+
}), g = (a, u) => {
|
|
360
|
+
var B;
|
|
361
|
+
const h = a.target.value;
|
|
362
|
+
if (h.length === 1)
|
|
363
|
+
u < e.length - 1 && l.value && ((B = l.value[u + 1]) == null || B.focus());
|
|
364
|
+
else if (h.length > 1) {
|
|
365
|
+
const k = h.slice(0, e.length - u).split("");
|
|
366
|
+
k.forEach((V, t) => {
|
|
367
|
+
n.value[u + t] = V;
|
|
368
|
+
}), Q(() => {
|
|
369
|
+
var V;
|
|
370
|
+
l.value && ((V = l.value[Math.min(u + k.length, e.length - 1)]) == null || V.focus());
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
}, z = (a) => {
|
|
374
|
+
var u;
|
|
375
|
+
n.value[a] === "" && l.value && a > 0 && ((u = l.value[a - 1]) == null || u.focus());
|
|
376
|
+
}, D = (a, u) => {
|
|
377
|
+
var B;
|
|
378
|
+
a.preventDefault();
|
|
379
|
+
const _ = ((B = a.clipboardData) == null ? void 0 : B.getData("text")) ?? "";
|
|
380
|
+
if (!_) return;
|
|
381
|
+
const h = _.slice(0, e.length - u).split("");
|
|
382
|
+
h.forEach((k, V) => {
|
|
383
|
+
n.value[u + V] = k;
|
|
384
|
+
}), Q(() => {
|
|
385
|
+
var k;
|
|
386
|
+
l.value && ((k = l.value[Math.min(u + h.length, e.length - 1)]) == null || k.focus());
|
|
387
|
+
});
|
|
388
|
+
};
|
|
389
|
+
ee(
|
|
390
|
+
n,
|
|
391
|
+
(a) => {
|
|
392
|
+
const u = a.join("");
|
|
393
|
+
T(u);
|
|
394
|
+
},
|
|
395
|
+
{ deep: !0 }
|
|
396
|
+
);
|
|
397
|
+
const T = (a) => {
|
|
398
|
+
p("update:modelValue", a), a.length === e.length && !a.includes(" ") && p("completed", a);
|
|
399
|
+
}, d = (a) => {
|
|
400
|
+
a && (n.value = a.split("").slice(0, e.length));
|
|
401
|
+
};
|
|
402
|
+
return te(() => {
|
|
403
|
+
e.autofocus && l.value && l.value[0] && l.value[0].focus();
|
|
404
|
+
}), r({
|
|
405
|
+
injectCode: d
|
|
406
|
+
}), (a, u) => (s(), i("div", {
|
|
407
|
+
class: v([
|
|
408
|
+
f.value,
|
|
409
|
+
{ "code-field_theme-dark": a.dark ?? a.$q.dark.isActive }
|
|
410
|
+
]),
|
|
411
|
+
style: j(c.value)
|
|
412
|
+
}, [
|
|
413
|
+
a.label ? (s(), i("label", Ue, S(a.label), 1)) : b("", !0),
|
|
414
|
+
w("div", Qe, [
|
|
415
|
+
(s(!0), i(L, null, F(a.length, (_, h) => ne((s(), i("input", {
|
|
416
|
+
key: h,
|
|
417
|
+
"onUpdate:modelValue": (B) => n.value[h] = B,
|
|
418
|
+
ref_for: !0,
|
|
419
|
+
ref_key: "inputRefs",
|
|
420
|
+
ref: l,
|
|
421
|
+
type: "number",
|
|
422
|
+
maxlength: "1",
|
|
423
|
+
class: "code-field__input",
|
|
424
|
+
disabled: a.disabled || a.loading,
|
|
425
|
+
onInput: (B) => g(B, h),
|
|
426
|
+
onKeydown: de((B) => z(h), ["backspace"]),
|
|
427
|
+
onPaste: (B) => D(B, h)
|
|
428
|
+
}, null, 40, We)), [
|
|
429
|
+
[ue, n.value[h]]
|
|
430
|
+
])), 128))
|
|
431
|
+
]),
|
|
432
|
+
a.loading ? (s(), I(ye, {
|
|
433
|
+
key: 1,
|
|
434
|
+
indeterminate: "",
|
|
435
|
+
rounded: "",
|
|
436
|
+
color: a.color,
|
|
437
|
+
class: "code-field__loading"
|
|
438
|
+
}, null, 8, ["color"])) : b("", !0)
|
|
439
|
+
], 6));
|
|
440
|
+
}
|
|
441
|
+
}), Al = /* @__PURE__ */ R(Fe, [["__scopeId", "data-v-779baa1e"]]), He = ["onClick", "disabled"], Ge = /* @__PURE__ */ P({
|
|
442
|
+
__name: "AppSegment",
|
|
443
|
+
props: /* @__PURE__ */ Y({
|
|
444
|
+
options: {},
|
|
445
|
+
disabled: { type: Boolean },
|
|
446
|
+
size: { default: A.MD },
|
|
447
|
+
color: {},
|
|
448
|
+
glass: { type: Boolean },
|
|
449
|
+
blur: { type: Boolean },
|
|
450
|
+
dark: { type: Boolean, default: void 0 }
|
|
451
|
+
}, {
|
|
452
|
+
modelValue: {},
|
|
453
|
+
modelModifiers: {}
|
|
454
|
+
}),
|
|
455
|
+
emits: ["update:modelValue"],
|
|
456
|
+
setup(m) {
|
|
457
|
+
const r = X(m, "modelValue"), o = m, e = Z("scroller"), p = Z("content"), n = Z("buttons"), l = N(!1), f = N(!1), c = N({ left: 0, width: 0 }), g = M(() => [
|
|
458
|
+
"app-segment",
|
|
459
|
+
{
|
|
460
|
+
"app-segment_disabled": o.disabled,
|
|
461
|
+
"app-segment_scrollable": f.value,
|
|
462
|
+
"app-segment_glass": o.glass,
|
|
463
|
+
"app-segment_blur": o.blur
|
|
464
|
+
},
|
|
465
|
+
`app-segment_${o.size}`,
|
|
466
|
+
o.color ? `app-segment_${o.color}` : ""
|
|
467
|
+
]), z = M(
|
|
468
|
+
() => o.options.findIndex((k) => k.value === r.value)
|
|
469
|
+
), D = M(() => ({
|
|
470
|
+
width: `${c.value.width}px`,
|
|
471
|
+
transform: `translateX(${c.value.left}px)`,
|
|
472
|
+
opacity: c.value.width ? 1 : 0
|
|
473
|
+
}));
|
|
474
|
+
function T() {
|
|
475
|
+
var V;
|
|
476
|
+
const k = (V = n.value) == null ? void 0 : V[z.value];
|
|
477
|
+
c.value = k ? { left: k.offsetLeft, width: k.offsetWidth } : { left: 0, width: 0 }, e.value && (f.value = e.value.scrollWidth - e.value.clientWidth > 1);
|
|
478
|
+
}
|
|
479
|
+
function d(k = "smooth") {
|
|
480
|
+
var t, $;
|
|
481
|
+
const V = (t = n.value) == null ? void 0 : t[z.value];
|
|
482
|
+
!V || !(($ = e.value) != null && $.scrollTo) || e.value.scrollTo({
|
|
483
|
+
left: V.offsetLeft + V.offsetWidth / 2 - e.value.clientWidth / 2,
|
|
484
|
+
behavior: k
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
function a(k) {
|
|
488
|
+
o.disabled || (r.value = k);
|
|
489
|
+
}
|
|
490
|
+
let u = !0;
|
|
491
|
+
function _() {
|
|
492
|
+
u = !1;
|
|
493
|
+
}
|
|
494
|
+
function h() {
|
|
495
|
+
T(), u && d();
|
|
496
|
+
}
|
|
497
|
+
let B;
|
|
498
|
+
return te(async () => {
|
|
499
|
+
T(), await Q(), d("auto"), l.value = !0, typeof ResizeObserver < "u" && e.value && p.value && (B = new ResizeObserver(h), B.observe(e.value), B.observe(p.value));
|
|
500
|
+
}), pe(() => B == null ? void 0 : B.disconnect()), ee(
|
|
501
|
+
[z, f, () => o.options, () => o.size],
|
|
502
|
+
() => Q(T)
|
|
503
|
+
), ee(z, () => {
|
|
504
|
+
u = !0, Q(() => d());
|
|
505
|
+
}), (k, V) => (s(), i("div", {
|
|
506
|
+
ref_key: "scroller",
|
|
507
|
+
ref: e,
|
|
508
|
+
class: v([
|
|
509
|
+
g.value,
|
|
510
|
+
{ "app-segment_theme-dark": k.dark ?? k.$q.dark.isActive }
|
|
511
|
+
]),
|
|
512
|
+
onWheelPassive: _,
|
|
513
|
+
onTouchstartPassive: _
|
|
514
|
+
}, [
|
|
515
|
+
w("div", {
|
|
516
|
+
ref_key: "content",
|
|
517
|
+
ref: p,
|
|
518
|
+
class: "app-segment__content"
|
|
519
|
+
}, [
|
|
520
|
+
w("div", {
|
|
521
|
+
class: v(["app-segment__thumb", { "app-segment__thumb_animated": l.value }]),
|
|
522
|
+
style: j(D.value)
|
|
523
|
+
}, null, 6),
|
|
524
|
+
(s(!0), i(L, null, F(k.options, (t, $) => (s(), i("button", {
|
|
525
|
+
ref_for: !0,
|
|
526
|
+
ref_key: "buttons",
|
|
527
|
+
ref: n,
|
|
528
|
+
key: $,
|
|
529
|
+
class: v(["app-segment__btn", { "app-segment__btn_active": r.value === t.value }]),
|
|
530
|
+
onClick: (y) => a(t.value),
|
|
531
|
+
disabled: k.disabled
|
|
532
|
+
}, [
|
|
533
|
+
E(k.$slots, "option", { option: t }, () => [
|
|
534
|
+
W(S(t.label), 1)
|
|
535
|
+
], !0)
|
|
536
|
+
], 10, He))), 128))
|
|
537
|
+
], 512)
|
|
538
|
+
], 34));
|
|
539
|
+
}
|
|
540
|
+
}), Vl = /* @__PURE__ */ R(Ge, [["__scopeId", "data-v-8d33ec7a"]]), oe = [10, 20, 50, 100], Xe = "стор.", Ye = {
|
|
541
|
+
[A.SM]: "3px 9px",
|
|
542
|
+
[A.MD]: "5px 12px",
|
|
543
|
+
[A.LG]: "6px 15px",
|
|
544
|
+
[A.XL]: "9px 20px"
|
|
545
|
+
}, je = {
|
|
546
|
+
key: 1,
|
|
547
|
+
class: "dropdown-btn__label"
|
|
548
|
+
}, Ke = /* @__PURE__ */ P({
|
|
549
|
+
__name: "DropdownButton",
|
|
550
|
+
props: {
|
|
551
|
+
size: { default: A.MD },
|
|
552
|
+
transparent: { type: Boolean },
|
|
553
|
+
flat: { type: Boolean },
|
|
554
|
+
rounded: { type: Boolean },
|
|
555
|
+
color: { default: K.PRIMARY },
|
|
556
|
+
iconLeft: {},
|
|
557
|
+
iconMiddle: {},
|
|
558
|
+
hideDropIcon: { type: Boolean },
|
|
559
|
+
disabled: { type: Boolean },
|
|
560
|
+
loading: { type: Boolean },
|
|
561
|
+
ariaLabel: {},
|
|
562
|
+
label: {},
|
|
563
|
+
menuOffset: {},
|
|
564
|
+
menuAnchor: {},
|
|
565
|
+
menuSelf: {},
|
|
566
|
+
menuClass: {},
|
|
567
|
+
glass: { type: Boolean },
|
|
568
|
+
dark: { type: Boolean, default: void 0 }
|
|
569
|
+
},
|
|
570
|
+
emits: ["menuShown", "menuHidden"],
|
|
571
|
+
setup(m, { emit: r }) {
|
|
572
|
+
const o = m, e = r, p = N(!1), n = M(() => [
|
|
573
|
+
"dropdown-btn",
|
|
574
|
+
{
|
|
575
|
+
"dropdown-btn_default": !o.transparent && !o.flat,
|
|
576
|
+
"dropdown-btn_trans": o.transparent,
|
|
577
|
+
"dropdown-btn_flat": o.flat,
|
|
578
|
+
"dropdown-btn_rounded": o.rounded,
|
|
579
|
+
"dropdown-btn_icon-left": o.iconLeft,
|
|
580
|
+
"dropdown-btn_icon-middle": o.iconMiddle,
|
|
581
|
+
"dropdown-btn_no-drop": o.hideDropIcon
|
|
582
|
+
},
|
|
583
|
+
`dropdown-btn_${o.size}`,
|
|
584
|
+
`dropdown-btn_${o.color}`
|
|
585
|
+
]), l = () => {
|
|
586
|
+
p.value = !0, e("menuShown");
|
|
587
|
+
}, f = () => {
|
|
588
|
+
p.value = !1, e("menuHidden");
|
|
589
|
+
};
|
|
590
|
+
return (c, g) => (s(), I(C(he), {
|
|
591
|
+
"no-caps": "",
|
|
592
|
+
unelevated: "",
|
|
593
|
+
modelValue: p.value,
|
|
594
|
+
"onUpdate:modelValue": g[0] || (g[0] = (z) => p.value = z),
|
|
595
|
+
class: v([
|
|
596
|
+
n.value,
|
|
597
|
+
{ "dropdown-btn_theme-dark": c.dark ?? c.$q.dark.isActive }
|
|
598
|
+
]),
|
|
599
|
+
padding: C(Ye)[c.size || C(A).MD],
|
|
600
|
+
loading: c.loading,
|
|
601
|
+
disable: c.disabled || void 0,
|
|
602
|
+
"aria-label": c.ariaLabel,
|
|
603
|
+
"menu-offset": c.menuOffset,
|
|
604
|
+
"menu-anchor": c.menuAnchor,
|
|
605
|
+
"menu-self": c.menuSelf,
|
|
606
|
+
"content-class": [
|
|
607
|
+
"kl-menu dropdown-menu",
|
|
608
|
+
{ "glass-menu": c.glass },
|
|
609
|
+
c.menuClass
|
|
610
|
+
],
|
|
611
|
+
"dropdown-icon": "icon-kl icon-kl-arrow-down",
|
|
612
|
+
onBeforeShow: l,
|
|
613
|
+
onBeforeHide: f
|
|
614
|
+
}, {
|
|
615
|
+
label: U(() => [
|
|
616
|
+
c.iconLeft || c.iconMiddle ? (s(), i("i", {
|
|
617
|
+
key: 0,
|
|
618
|
+
class: v([
|
|
619
|
+
"icon-kl",
|
|
620
|
+
c.iconLeft ? "icon-kl_left" : "icon-kl_middle",
|
|
621
|
+
`icon-kl-${c.iconLeft || c.iconMiddle}`,
|
|
622
|
+
c.transparent || c.flat ? `text-${c.color}` : "text-secondary"
|
|
623
|
+
])
|
|
624
|
+
}, null, 2)) : b("", !0),
|
|
625
|
+
c.label ? (s(), i("span", je, S(c.label), 1)) : b("", !0),
|
|
626
|
+
E(c.$slots, "label", {}, void 0, !0)
|
|
627
|
+
]),
|
|
628
|
+
default: U(() => [
|
|
629
|
+
E(c.$slots, "default", {}, void 0, !0),
|
|
630
|
+
E(c.$slots, "options", {
|
|
631
|
+
hideMenu: f,
|
|
632
|
+
showMenu: l
|
|
633
|
+
}, void 0, !0)
|
|
634
|
+
]),
|
|
635
|
+
_: 3
|
|
636
|
+
}, 8, ["modelValue", "class", "padding", "loading", "disable", "aria-label", "menu-offset", "menu-anchor", "menu-self", "content-class"]));
|
|
637
|
+
}
|
|
638
|
+
}), re = /* @__PURE__ */ R(Ke, [["__scopeId", "data-v-2fede54d"]]), Ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
639
|
+
__proto__: null,
|
|
640
|
+
default: re
|
|
641
|
+
}, Symbol.toStringTag, { value: "Module" })), Je = ["disabled"], xe = ["disabled"], el = ["disabled", "aria-current", "onClick"], ll = ["disabled"], ol = ["disabled"], x = "...", al = /* @__PURE__ */ P({
|
|
642
|
+
__name: "AppPagination",
|
|
643
|
+
props: /* @__PURE__ */ Y({
|
|
644
|
+
max: {},
|
|
645
|
+
maxPages: { default: 5 },
|
|
646
|
+
boundaryNumbers: { type: Boolean, default: !0 },
|
|
647
|
+
ellipses: { type: Boolean, default: !0 },
|
|
648
|
+
directionLinks: { type: Boolean, default: !0 },
|
|
649
|
+
boundaryLinks: { type: Boolean },
|
|
650
|
+
perPage: { type: Boolean },
|
|
651
|
+
size: { default: A.MD },
|
|
652
|
+
color: { default: K.PRIMARY },
|
|
653
|
+
glass: { type: Boolean },
|
|
654
|
+
disabled: { type: Boolean },
|
|
655
|
+
dark: { type: Boolean, default: void 0 }
|
|
656
|
+
}, {
|
|
657
|
+
modelValue: { default: 1 },
|
|
658
|
+
modelModifiers: {},
|
|
659
|
+
limit: { default: oe[0] },
|
|
660
|
+
limitModifiers: {}
|
|
661
|
+
}),
|
|
662
|
+
emits: ["update:modelValue", "update:limit"],
|
|
663
|
+
setup(m) {
|
|
664
|
+
const r = X(m, "modelValue"), o = X(m, "limit"), e = m, p = (d, a, u) => Math.min(Math.max(d, a), u), n = M(() => Math.max(1, Math.floor(e.max) || 1)), l = M(() => p(r.value, 1, n.value)), f = M(
|
|
665
|
+
() => p(Math.floor(e.maxPages) || 1, 1, 100)
|
|
666
|
+
), c = M(() => {
|
|
667
|
+
const d = n.value;
|
|
668
|
+
if (d <= f.value)
|
|
669
|
+
return Array.from({ length: d }, (h, B) => B + 1);
|
|
670
|
+
let a = Math.max(1, l.value - Math.floor((f.value - 1) / 2)), u = a + f.value - 1;
|
|
671
|
+
u > d && (u = d, a = u - f.value + 1);
|
|
672
|
+
const _ = [];
|
|
673
|
+
e.boundaryNumbers && a > 1 && (_.push(1), e.ellipses && a > 2 && _.push(x));
|
|
674
|
+
for (let h = a; h <= u; h++) _.push(h);
|
|
675
|
+
return e.boundaryNumbers && u < d && (e.ellipses && u < d - 1 && _.push(x), _.push(d)), _;
|
|
676
|
+
}), g = M(() => [
|
|
677
|
+
"app-pagination",
|
|
678
|
+
{
|
|
679
|
+
"app-pagination_glass": e.glass,
|
|
680
|
+
"app-pagination_boundary": e.boundaryLinks,
|
|
681
|
+
"app-pagination_disabled": e.disabled
|
|
682
|
+
},
|
|
683
|
+
`app-pagination_${e.size}`,
|
|
684
|
+
`app-pagination_${e.color}`
|
|
685
|
+
]), z = (d) => `${d} / ${Xe}`, D = (d) => {
|
|
686
|
+
if (e.disabled) return;
|
|
687
|
+
const a = p(d, 1, n.value);
|
|
688
|
+
a !== r.value && (r.value = a);
|
|
689
|
+
}, T = (d, a) => {
|
|
690
|
+
a(), d !== o.value && (o.value = d, r.value = 1);
|
|
691
|
+
};
|
|
692
|
+
return (d, a) => (s(), i("nav", {
|
|
693
|
+
class: v([
|
|
694
|
+
g.value,
|
|
695
|
+
{ "app-pagination_theme-dark": d.dark ?? d.$q.dark.isActive }
|
|
696
|
+
]),
|
|
697
|
+
role: "navigation",
|
|
698
|
+
"aria-label": "Пагінація"
|
|
699
|
+
}, [
|
|
700
|
+
d.boundaryLinks ? (s(), i("button", {
|
|
701
|
+
key: 0,
|
|
702
|
+
type: "button",
|
|
703
|
+
class: "app-pagination__btn app-pagination__btn_icon",
|
|
704
|
+
disabled: d.disabled || l.value <= 1,
|
|
705
|
+
"aria-label": "Перша сторінка",
|
|
706
|
+
onClick: a[0] || (a[0] = (u) => D(1))
|
|
707
|
+
}, [...a[4] || (a[4] = [
|
|
708
|
+
w("i", { class: "icon-kl icon-kl-arrow-start" }, null, -1)
|
|
709
|
+
])], 8, Je)) : b("", !0),
|
|
710
|
+
d.directionLinks ? (s(), i("button", {
|
|
711
|
+
key: 1,
|
|
712
|
+
type: "button",
|
|
713
|
+
class: "app-pagination__btn app-pagination__btn_icon",
|
|
714
|
+
disabled: d.disabled || l.value <= 1,
|
|
715
|
+
"aria-label": "Попередня сторінка",
|
|
716
|
+
onClick: a[1] || (a[1] = (u) => D(l.value - 1))
|
|
717
|
+
}, [...a[5] || (a[5] = [
|
|
718
|
+
w("i", { class: "icon-kl icon-kl-arrow-left" }, null, -1)
|
|
719
|
+
])], 8, xe)) : b("", !0),
|
|
720
|
+
(s(!0), i(L, null, F(c.value, (u, _) => (s(), i(L, null, [
|
|
721
|
+
u === x ? (s(), i("span", {
|
|
722
|
+
key: `gap-${_}`,
|
|
723
|
+
class: "app-pagination__gap"
|
|
724
|
+
}, [...a[6] || (a[6] = [
|
|
725
|
+
w("i", { class: "icon-kl icon-kl-more-horizontal" }, null, -1)
|
|
726
|
+
])])) : (s(), i("button", {
|
|
727
|
+
key: `page-${u}`,
|
|
728
|
+
type: "button",
|
|
729
|
+
class: v(["app-pagination__btn", { "app-pagination__btn_active": u === l.value }]),
|
|
730
|
+
disabled: d.disabled,
|
|
731
|
+
"aria-current": u === l.value ? "page" : void 0,
|
|
732
|
+
onClick: (h) => D(u)
|
|
733
|
+
}, S(u), 11, el))
|
|
734
|
+
], 64))), 256)),
|
|
735
|
+
d.directionLinks ? (s(), i("button", {
|
|
736
|
+
key: 2,
|
|
737
|
+
type: "button",
|
|
738
|
+
class: "app-pagination__btn app-pagination__btn_icon",
|
|
739
|
+
disabled: d.disabled || l.value >= n.value,
|
|
740
|
+
"aria-label": "Наступна сторінка",
|
|
741
|
+
onClick: a[2] || (a[2] = (u) => D(l.value + 1))
|
|
742
|
+
}, [...a[7] || (a[7] = [
|
|
743
|
+
w("i", { class: "icon-kl icon-kl-arrow-right" }, null, -1)
|
|
744
|
+
])], 8, ll)) : b("", !0),
|
|
745
|
+
d.boundaryLinks ? (s(), i("button", {
|
|
746
|
+
key: 3,
|
|
747
|
+
type: "button",
|
|
748
|
+
class: "app-pagination__btn app-pagination__btn_icon",
|
|
749
|
+
disabled: d.disabled || l.value >= n.value,
|
|
750
|
+
"aria-label": "Остання сторінка",
|
|
751
|
+
onClick: a[3] || (a[3] = (u) => D(n.value))
|
|
752
|
+
}, [...a[8] || (a[8] = [
|
|
753
|
+
w("i", { class: "icon-kl icon-kl-arrow-end" }, null, -1)
|
|
754
|
+
])], 8, ol)) : b("", !0),
|
|
755
|
+
d.perPage ? (s(), i(L, { key: 4 }, [
|
|
756
|
+
a[9] || (a[9] = w("span", { class: "app-pagination__divider" }, null, -1)),
|
|
757
|
+
G(re, {
|
|
758
|
+
flat: "",
|
|
759
|
+
rounded: "",
|
|
760
|
+
size: d.size,
|
|
761
|
+
color: d.color,
|
|
762
|
+
glass: d.glass,
|
|
763
|
+
disabled: d.disabled,
|
|
764
|
+
dark: d.dark,
|
|
765
|
+
label: z(o.value),
|
|
766
|
+
class: "app-pagination__per-page"
|
|
767
|
+
}, {
|
|
768
|
+
options: U(({ hideMenu: u }) => [
|
|
769
|
+
(s(!0), i(L, null, F(C(oe), (_) => (s(), I(ie, {
|
|
770
|
+
key: _,
|
|
771
|
+
"no-arrow": "",
|
|
772
|
+
label: z(_),
|
|
773
|
+
active: _ === o.value,
|
|
774
|
+
dark: d.dark,
|
|
775
|
+
onClick: (h) => T(_, u)
|
|
776
|
+
}, null, 8, ["label", "active", "dark", "onClick"]))), 128))
|
|
777
|
+
]),
|
|
778
|
+
_: 1
|
|
779
|
+
}, 8, ["size", "color", "glass", "disabled", "dark", "label"])
|
|
780
|
+
], 64)) : b("", !0)
|
|
781
|
+
], 2));
|
|
782
|
+
}
|
|
783
|
+
}), Cl = /* @__PURE__ */ R(al, [["__scopeId", "data-v-d305e690"]]), nl = /* @__PURE__ */ P({
|
|
784
|
+
__name: "SystemMenu",
|
|
785
|
+
props: {
|
|
786
|
+
dark: { type: Boolean, default: void 0 }
|
|
787
|
+
},
|
|
788
|
+
setup(m) {
|
|
789
|
+
return (r, o) => (s(), i("div", {
|
|
790
|
+
class: v(["system-menu", { "system-menu_dark": r.dark ?? r.$q.dark.isActive }])
|
|
791
|
+
}, [
|
|
792
|
+
E(r.$slots, "default", {}, void 0, !0)
|
|
793
|
+
], 2));
|
|
794
|
+
}
|
|
795
|
+
}), zl = /* @__PURE__ */ R(nl, [["__scopeId", "data-v-0cca883b"]]), tl = { class: "menu-item__content" }, sl = {
|
|
796
|
+
key: 0,
|
|
797
|
+
class: "menu-item__value"
|
|
798
|
+
}, il = /* @__PURE__ */ P({
|
|
799
|
+
__name: "MenuItem",
|
|
800
|
+
props: /* @__PURE__ */ Y({
|
|
801
|
+
dark: { type: Boolean, default: void 0 },
|
|
802
|
+
label: {},
|
|
803
|
+
icon: {},
|
|
804
|
+
iconRight: {},
|
|
805
|
+
arrow: { type: Boolean },
|
|
806
|
+
color: {},
|
|
807
|
+
to: {},
|
|
808
|
+
href: {},
|
|
809
|
+
target: {},
|
|
810
|
+
disabled: { type: Boolean },
|
|
811
|
+
toggle: { type: Boolean },
|
|
812
|
+
isMobile: { type: Boolean }
|
|
813
|
+
}, {
|
|
814
|
+
modelValue: { type: Boolean },
|
|
815
|
+
modelModifiers: {}
|
|
816
|
+
}),
|
|
817
|
+
emits: /* @__PURE__ */ Y(["click"], ["update:modelValue"]),
|
|
818
|
+
setup(m, { emit: r }) {
|
|
819
|
+
const o = m, e = r, p = X(m, "modelValue"), n = async () => {
|
|
820
|
+
o.toggle && (p.value = !p.value), e("click");
|
|
821
|
+
};
|
|
822
|
+
return (l, f) => (s(), I(C($e), {
|
|
823
|
+
class: v(["menu-item", {
|
|
824
|
+
"menu-item_disabled": l.disabled,
|
|
825
|
+
"menu-item_mobile": l.isMobile,
|
|
826
|
+
"menu-item_dark": l.dark ?? l.$q.dark.isActive
|
|
827
|
+
}]),
|
|
828
|
+
dark: l.dark ?? l.$q.dark.isActive,
|
|
829
|
+
to: l.to,
|
|
830
|
+
href: l.href,
|
|
831
|
+
target: l.target,
|
|
832
|
+
disable: l.disabled,
|
|
833
|
+
clickable: "",
|
|
834
|
+
onClick: n
|
|
835
|
+
}, {
|
|
836
|
+
default: U(() => [
|
|
837
|
+
l.icon ? (s(), I(C(J), {
|
|
838
|
+
key: 0,
|
|
839
|
+
name: l.icon.name,
|
|
840
|
+
class: v(["menu-item__icon", `bg-${l.icon.color}`])
|
|
841
|
+
}, null, 8, ["name", "class"])) : b("", !0),
|
|
842
|
+
w("div", tl, [
|
|
843
|
+
w("span", {
|
|
844
|
+
class: v(["app-menu-item__label", l.color ? `text-${l.color}` : ""])
|
|
845
|
+
}, [
|
|
846
|
+
W(S(l.label) + " ", 1),
|
|
847
|
+
E(l.$slots, "default", {}, void 0, !0)
|
|
848
|
+
], 2),
|
|
849
|
+
l.$slots.value ? (s(), i("span", sl, [
|
|
850
|
+
E(l.$slots, "value", {}, void 0, !0)
|
|
851
|
+
])) : b("", !0),
|
|
852
|
+
l.toggle ? (s(), I(C(se), {
|
|
853
|
+
key: 1,
|
|
854
|
+
modelValue: p.value,
|
|
855
|
+
"onUpdate:modelValue": f[0] || (f[0] = (c) => p.value = c),
|
|
856
|
+
dark: l.dark
|
|
857
|
+
}, null, 8, ["modelValue", "dark"])) : b("", !0),
|
|
858
|
+
l.iconRight ? (s(), I(C(J), {
|
|
859
|
+
key: 2,
|
|
860
|
+
class: "menu-item__icon-right",
|
|
861
|
+
name: l.iconRight.name,
|
|
862
|
+
color: l.iconRight.color
|
|
863
|
+
}, null, 8, ["name", "color"])) : b("", !0),
|
|
864
|
+
l.arrow ? (s(), I(C(J), {
|
|
865
|
+
key: 3,
|
|
866
|
+
class: "menu-item__icon-right menu-item__arrow",
|
|
867
|
+
name: "arrow-right"
|
|
868
|
+
})) : b("", !0)
|
|
869
|
+
])
|
|
870
|
+
]),
|
|
871
|
+
_: 3
|
|
872
|
+
}, 8, ["class", "dark", "to", "href", "target", "disable"]));
|
|
873
|
+
}
|
|
874
|
+
}), Ll = /* @__PURE__ */ R(il, [["__scopeId", "data-v-b86be9a2"]]), ae = (m) => m ? !0 : "Обовʼязкове поле", rl = { class: "app-select__amount" }, dl = ["onClick"], ul = /* @__PURE__ */ P({
|
|
875
|
+
__name: "AppSelect",
|
|
876
|
+
props: {
|
|
877
|
+
modelValue: {},
|
|
878
|
+
size: { default: A.MD },
|
|
879
|
+
options: {},
|
|
880
|
+
multiple: { type: Boolean },
|
|
881
|
+
label: {},
|
|
882
|
+
placeholder: {},
|
|
883
|
+
required: { type: Boolean },
|
|
884
|
+
clearable: { type: Boolean },
|
|
885
|
+
disabled: { type: Boolean },
|
|
886
|
+
loading: { type: Boolean },
|
|
887
|
+
filtering: { type: Boolean },
|
|
888
|
+
autofocus: { type: Boolean },
|
|
889
|
+
rules: {},
|
|
890
|
+
lazyRules: { type: [Boolean, String] },
|
|
891
|
+
menuClass: {},
|
|
892
|
+
glass: { type: Boolean },
|
|
893
|
+
isMobile: { type: Boolean },
|
|
894
|
+
chips: { type: Boolean },
|
|
895
|
+
creatable: { type: Boolean },
|
|
896
|
+
createRules: {},
|
|
897
|
+
onCreate: {},
|
|
898
|
+
deletable: { type: Boolean },
|
|
899
|
+
dark: { type: Boolean, default: void 0 }
|
|
900
|
+
},
|
|
901
|
+
emits: [
|
|
902
|
+
"update:modelValue",
|
|
903
|
+
"popupShow",
|
|
904
|
+
"popupHide",
|
|
905
|
+
"delete"
|
|
906
|
+
],
|
|
907
|
+
setup(m, { emit: r }) {
|
|
908
|
+
const o = m, e = r, p = N(!1), n = N(""), l = N(!1), f = N(""), c = M(() => o.filtering || o.creatable), g = M({
|
|
909
|
+
get() {
|
|
910
|
+
if (o.modelValue) {
|
|
911
|
+
if (o.multiple && Array.isArray(o.modelValue))
|
|
912
|
+
return o.options.filter(
|
|
913
|
+
(t) => o.modelValue.includes(t.value)
|
|
914
|
+
);
|
|
915
|
+
if (!Array.isArray(o.modelValue))
|
|
916
|
+
return o.options.find(
|
|
917
|
+
(t) => t.value === o.modelValue
|
|
918
|
+
);
|
|
919
|
+
}
|
|
920
|
+
},
|
|
921
|
+
set(t) {
|
|
922
|
+
if (!t) {
|
|
923
|
+
e("update:modelValue", void 0);
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
if (o.multiple && Array.isArray(t)) {
|
|
927
|
+
const $ = t.map((y) => y.value);
|
|
928
|
+
e("update:modelValue", $);
|
|
929
|
+
} else Array.isArray(t) || e("update:modelValue", t.value);
|
|
930
|
+
}
|
|
931
|
+
}), z = M(() => Array.isArray(g.value) ? g.value : g.value ? [g.value] : []), D = M(() => {
|
|
932
|
+
var t;
|
|
933
|
+
if (Array.isArray(g.value)) {
|
|
934
|
+
if (o.multiple && g.value.length == 0)
|
|
935
|
+
return o.placeholder;
|
|
936
|
+
} else return ((t = g.value) == null ? void 0 : t.label) || o.placeholder || "";
|
|
937
|
+
return "";
|
|
938
|
+
}), T = M(() => !(!o.clearable || !o.modelValue || o.modelValue && Array.isArray(o.modelValue) && !o.modelValue.length)), d = M(() => n.value ? o.options.filter(
|
|
939
|
+
(t) => t.label.toLowerCase().includes(n.value.toLowerCase())
|
|
940
|
+
) : o.options), a = M(() => {
|
|
941
|
+
if (o.rules)
|
|
942
|
+
return o.required ? [...o.rules, ae] : o.rules;
|
|
943
|
+
if (o.required)
|
|
944
|
+
return [ae];
|
|
945
|
+
}), u = () => {
|
|
946
|
+
p.value = !0, e("popupShow");
|
|
947
|
+
}, _ = () => {
|
|
948
|
+
p.value = !1, e("popupHide");
|
|
949
|
+
}, h = () => {
|
|
950
|
+
g.value = void 0;
|
|
951
|
+
}, B = (t, $) => {
|
|
952
|
+
$(() => {
|
|
953
|
+
n.value = t, f.value = "";
|
|
954
|
+
});
|
|
955
|
+
}, k = async (t) => {
|
|
956
|
+
var y;
|
|
957
|
+
const { testPattern: $ } = we;
|
|
958
|
+
for (const q of o.createRules ?? []) {
|
|
959
|
+
const O = typeof q == "function" ? await q(t, $) : (y = $[q]) == null ? void 0 : y.call($, t);
|
|
960
|
+
if (typeof O == "string") return O;
|
|
961
|
+
if (O === !1) return "Невірне значення";
|
|
962
|
+
}
|
|
963
|
+
return "";
|
|
964
|
+
}, V = async (t, $) => {
|
|
965
|
+
const y = t.trim();
|
|
966
|
+
if (!y) return $();
|
|
967
|
+
if (l.value) return;
|
|
968
|
+
const q = o.options.find(
|
|
969
|
+
(O) => O.label.toLowerCase() === y.toLowerCase()
|
|
970
|
+
);
|
|
971
|
+
if (q) return $(q, "add-unique");
|
|
972
|
+
l.value = !0;
|
|
973
|
+
try {
|
|
974
|
+
if (f.value = await k(y), f.value || !o.onCreate) return;
|
|
975
|
+
const O = await o.onCreate(y);
|
|
976
|
+
$(O || void 0, "add-unique");
|
|
977
|
+
} catch {
|
|
978
|
+
} finally {
|
|
979
|
+
l.value = !1;
|
|
980
|
+
}
|
|
981
|
+
};
|
|
982
|
+
return (t, $) => (s(), i("div", {
|
|
983
|
+
class: v(["app-select", [
|
|
984
|
+
{
|
|
985
|
+
"app-select_opened": p.value,
|
|
986
|
+
"app-select_chips": t.chips,
|
|
987
|
+
"app-select_dark": t.dark ?? t.$q.dark.isActive
|
|
988
|
+
},
|
|
989
|
+
`app-select_${t.size}`
|
|
990
|
+
]])
|
|
991
|
+
}, [
|
|
992
|
+
t.label ? (s(), i("label", {
|
|
993
|
+
key: 0,
|
|
994
|
+
class: v(["app-select__label", { "app-select__label_bold": t.required }])
|
|
995
|
+
}, S(t.required ? `${t.label} *` : t.label), 3)) : b("", !0),
|
|
996
|
+
G(C(Be), {
|
|
997
|
+
standout: "",
|
|
998
|
+
"hide-bottom-space": "",
|
|
999
|
+
"hide-dropdown-icon": "",
|
|
1000
|
+
"no-error-icon": "",
|
|
1001
|
+
behavior: "menu",
|
|
1002
|
+
dark: t.dark,
|
|
1003
|
+
"popup-no-route-dismiss": "",
|
|
1004
|
+
"popup-content-class": `kl-menu ${t.glass ? "glass-menu" : ""} app-select-menu app-select-menu_${t.size} ${t.menuClass}`,
|
|
1005
|
+
placeholder: t.creatable ? t.placeholder : t.filtering && "Почніть вводити",
|
|
1006
|
+
"input-debounce": "50",
|
|
1007
|
+
modelValue: g.value,
|
|
1008
|
+
"onUpdate:modelValue": $[0] || ($[0] = (y) => g.value = y),
|
|
1009
|
+
options: d.value,
|
|
1010
|
+
multiple: t.multiple,
|
|
1011
|
+
"use-input": t.creatable || t.filtering && (Array.isArray(g.value) || !g.value),
|
|
1012
|
+
rules: a.value,
|
|
1013
|
+
"lazy-rules": t.lazyRules,
|
|
1014
|
+
error: !!f.value,
|
|
1015
|
+
"error-message": f.value,
|
|
1016
|
+
autofocus: t.autofocus,
|
|
1017
|
+
disable: t.disabled,
|
|
1018
|
+
loading: t.loading || l.value,
|
|
1019
|
+
"menu-offset": [0, 2],
|
|
1020
|
+
onNewValue: t.creatable ? V : void 0,
|
|
1021
|
+
onFilter: B,
|
|
1022
|
+
onPopupShow: u,
|
|
1023
|
+
onPopupHide: _
|
|
1024
|
+
}, {
|
|
1025
|
+
append: U(() => [
|
|
1026
|
+
T.value ? (s(), i("i", {
|
|
1027
|
+
key: 0,
|
|
1028
|
+
class: "icon-kl icon-kl-circle-close app-select__clear",
|
|
1029
|
+
onClick: H(h, ["stop", "prevent"])
|
|
1030
|
+
})) : b("", !0),
|
|
1031
|
+
$[1] || ($[1] = w("i", { class: "icon-kl icon-kl-arrow-down app-select__drop-icon" }, null, -1))
|
|
1032
|
+
]),
|
|
1033
|
+
selected: U(() => {
|
|
1034
|
+
var y, q;
|
|
1035
|
+
return [
|
|
1036
|
+
t.chips && z.value.length ? (s(!0), i(L, { key: 0 }, F(z.value, (O) => (s(), I(C(_e), {
|
|
1037
|
+
key: O.value,
|
|
1038
|
+
dense: "",
|
|
1039
|
+
class: "app-select__chip",
|
|
1040
|
+
label: O.label
|
|
1041
|
+
}, null, 8, ["label"]))), 128)) : Array.isArray(g.value) ? (s(), i(L, { key: 1 }, [
|
|
1042
|
+
!c.value || g.value.length ? (s(), i("span", {
|
|
1043
|
+
key: 0,
|
|
1044
|
+
class: v([
|
|
1045
|
+
"app-select__selected",
|
|
1046
|
+
{
|
|
1047
|
+
"app-select__placeholder": !((y = g.value) != null && y.length) && t.placeholder
|
|
1048
|
+
}
|
|
1049
|
+
])
|
|
1050
|
+
}, [
|
|
1051
|
+
(q = g.value) != null && q.length ? (s(), i(L, { key: 0 }, [
|
|
1052
|
+
$[2] || ($[2] = W(" Вибрано ", -1)),
|
|
1053
|
+
w("span", rl, S(g.value.length), 1)
|
|
1054
|
+
], 64)) : (s(), i(L, { key: 1 }, [
|
|
1055
|
+
W(S(o.placeholder), 1)
|
|
1056
|
+
], 64))
|
|
1057
|
+
], 2)) : b("", !0)
|
|
1058
|
+
], 64)) : (s(), i(L, { key: 2 }, [
|
|
1059
|
+
!c.value || g.value ? (s(), i("span", {
|
|
1060
|
+
key: 0,
|
|
1061
|
+
class: v([
|
|
1062
|
+
"app-select__selected",
|
|
1063
|
+
{ "app-select__placeholder": !g.value && t.placeholder }
|
|
1064
|
+
])
|
|
1065
|
+
}, S(D.value), 3)) : b("", !0)
|
|
1066
|
+
], 64))
|
|
1067
|
+
];
|
|
1068
|
+
}),
|
|
1069
|
+
option: U((y) => [
|
|
1070
|
+
G(ie, ce({
|
|
1071
|
+
"no-arrow": "",
|
|
1072
|
+
label: y.opt.label,
|
|
1073
|
+
checked: y.opt.done,
|
|
1074
|
+
active: y.selected,
|
|
1075
|
+
"is-mobile": t.isMobile,
|
|
1076
|
+
dark: t.dark,
|
|
1077
|
+
checkbox: o.multiple,
|
|
1078
|
+
"model-value": y.selected
|
|
1079
|
+
}, o.multiple ? { ...y.itemProps, onClick: void 0 } : y.itemProps, {
|
|
1080
|
+
"onUpdate:modelValue": () => y.toggleOption(y.opt)
|
|
1081
|
+
}), me({ _: 2 }, [
|
|
1082
|
+
t.deletable ? {
|
|
1083
|
+
name: "right",
|
|
1084
|
+
fn: U(() => [
|
|
1085
|
+
w("i", {
|
|
1086
|
+
class: "icon-kl icon-kl-trash app-select__delete",
|
|
1087
|
+
onClick: H((q) => e("delete", y.opt), ["stop"])
|
|
1088
|
+
}, null, 8, dl)
|
|
1089
|
+
]),
|
|
1090
|
+
key: "0"
|
|
1091
|
+
} : void 0
|
|
1092
|
+
]), 1040, ["label", "checked", "active", "is-mobile", "dark", "checkbox", "model-value", "onUpdate:modelValue"])
|
|
1093
|
+
]),
|
|
1094
|
+
_: 1
|
|
1095
|
+
}, 8, ["dark", "popup-content-class", "placeholder", "modelValue", "options", "multiple", "use-input", "rules", "lazy-rules", "error", "error-message", "autofocus", "disable", "loading", "onNewValue"])
|
|
1096
|
+
], 2));
|
|
1097
|
+
}
|
|
1098
|
+
}), Sl = /* @__PURE__ */ R(ul, [["__scopeId", "data-v-8998130f"]]), Il = le(
|
|
1099
|
+
() => import("./AppButtonCopy-WPuHiwae.js")
|
|
1100
|
+
), Pl = le(
|
|
1101
|
+
() => Promise.resolve().then(() => Ze)
|
|
1102
|
+
), Rl = le(
|
|
1103
|
+
() => import("./BottomSheet-znHa17-p.js")
|
|
1104
|
+
);
|
|
1105
|
+
export {
|
|
1106
|
+
wl as A,
|
|
1107
|
+
Rl as B,
|
|
1108
|
+
K as C,
|
|
1109
|
+
Pl as D,
|
|
1110
|
+
Ll as M,
|
|
1111
|
+
ie as P,
|
|
1112
|
+
zl as S,
|
|
1113
|
+
R as _,
|
|
1114
|
+
Ml as a,
|
|
1115
|
+
Il as b,
|
|
1116
|
+
Al as c,
|
|
1117
|
+
J as d,
|
|
1118
|
+
Cl as e,
|
|
1119
|
+
Vl as f,
|
|
1120
|
+
Sl as g,
|
|
1121
|
+
se as h,
|
|
1122
|
+
Bl as i
|
|
1123
|
+
};
|