@validol4ik/uikit 0.11.7 → 0.11.9

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