@validol4ik/uikit 0.11.5 → 0.11.7

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,774 +0,0 @@
1
- import { defineComponent as C, computed as k, openBlock as n, createBlock as A, unref as V, normalizeClass as c, withCtx as T, createElementBlock as u, createCommentVNode as f, renderSlot as L, Fragment as I, createTextVNode as q, toDisplayString as B, createElementVNode as h, withModifiers as G, withDirectives as Z, createVNode as H, normalizeStyle as Q, ref as P, watch as N, onMounted as J, renderList as x, withKeys as oe, vModelText as te, nextTick as U, useModel as ee, useTemplateRef as E, onBeforeUnmount as ae, mergeModels as Y, mergeProps as ne, defineAsyncComponent as K } from "vue";
2
- import { boot as se } from "quasar/wrappers";
3
- import ie from "quasar/src/components/btn/QBtn.js";
4
- import ue from "quasar/src/components/checkbox/QCheckbox.js";
5
- import re from "quasar/src/directives/close-popup/ClosePopup.js";
6
- import pe from "quasar/src/components/spinner/QSpinner.js";
7
- import de from "quasar/src/components/linear-progress/QLinearProgress.js";
8
- import ce from "quasar/src/components/item/QItem.js";
9
- import me from "quasar/src/components/select/QSelect.js";
10
- const ll = se(({ app: d }) => {
11
- const s = d.config.globalProperties.$q;
12
- s.iconMapFn = (o) => {
13
- if (o.startsWith("icon-kl:"))
14
- return {
15
- cls: `icon-kl icon-kl-${o.slice(8)}`
16
- };
17
- };
18
- }), X = {
19
- PRIMARY: "primary",
20
- INFO: "info"
21
- }, _ = {
22
- SM: "sm",
23
- MD: "md",
24
- LG: "lg",
25
- XL: "xl"
26
- }, fe = {
27
- [_.SM]: "3px 9px",
28
- [_.MD]: "5px 12px",
29
- [_.LG]: "6px 15px",
30
- [_.XL]: "9px 20px"
31
- }, ge = /* @__PURE__ */ C({
32
- __name: "AppButton",
33
- props: {
34
- size: { default: _.MD },
35
- transparent: { type: Boolean },
36
- flat: { type: Boolean },
37
- rounded: { type: Boolean },
38
- color: { default: X.PRIMARY },
39
- iconLeft: {},
40
- iconRight: {},
41
- iconMiddle: {},
42
- disabled: { type: Boolean },
43
- loading: { type: Boolean },
44
- to: {},
45
- href: {},
46
- target: {},
47
- submit: { type: Boolean },
48
- ariaLabel: {},
49
- label: {},
50
- download: {}
51
- },
52
- emits: ["click"],
53
- setup(d) {
54
- const s = d, o = k(() => [
55
- "app-btn",
56
- {
57
- "app-btn_default": !s.transparent && !s.flat,
58
- "app-btn_trans": s.transparent,
59
- "app-btn_flat": s.flat,
60
- "app-btn_rounded": s.rounded,
61
- "app-btn_icon-left": s.iconLeft,
62
- "app-btn_icon-right": s.iconRight,
63
- "app-btn_icon-middle": s.iconMiddle
64
- },
65
- `app-btn_${s.size}`,
66
- `app-btn_${s.color}`
67
- ]);
68
- return (l, r) => (n(), A(V(ie), {
69
- "no-caps": "",
70
- unelevated: "",
71
- class: c(o.value),
72
- padding: V(fe)[l.size || V(_).MD],
73
- loading: l.loading,
74
- disable: l.disabled || void 0,
75
- to: l.to,
76
- href: l.href,
77
- target: l.target,
78
- type: l.submit ? "submit" : void 0,
79
- "aria-label": l.ariaLabel,
80
- download: l.download,
81
- onClick: r[0] || (r[0] = (a) => l.$emit("click", a))
82
- }, {
83
- default: T(() => [
84
- l.iconLeft || l.iconMiddle ? (n(), u("i", {
85
- key: 0,
86
- class: c([
87
- "icon-kl",
88
- l.iconLeft ? "icon-kl_left" : "icon-kl_middle",
89
- `icon-kl-${l.iconLeft || l.iconMiddle}`,
90
- l.transparent || l.flat ? `text-${l.color}` : "text-secondary"
91
- ])
92
- }, null, 2)) : f("", !0),
93
- L(l.$slots, "default", {}, void 0, !0),
94
- l.label ? (n(), u(I, { key: 1 }, [
95
- q(B(l.label), 1)
96
- ], 64)) : f("", !0),
97
- l.iconRight ? (n(), u("i", {
98
- key: 2,
99
- class: c([
100
- "icon-kl",
101
- "icon-kl_right",
102
- `icon-kl-${l.iconRight}`,
103
- l.transparent ? `text-${l.color}` : "text-secondary"
104
- ])
105
- }, null, 2)) : f("", !0)
106
- ]),
107
- _: 3
108
- }, 8, ["class", "padding", "loading", "disable", "to", "href", "target", "type", "aria-label", "download"]));
109
- }
110
- }), M = (d, s) => {
111
- const o = d.__vccOpts || d;
112
- for (const [l, r] of s)
113
- o[l] = r;
114
- return o;
115
- }, ol = /* @__PURE__ */ M(ge, [["__scopeId", "data-v-c9951ab6"]]), be = /* @__PURE__ */ C({
116
- __name: "CloseButton",
117
- props: {
118
- size: { default: _.MD }
119
- },
120
- setup(d) {
121
- const s = d, o = k(() => ["close-btn", `close-btn_${s.size}`]);
122
- return (l, r) => (n(), u("button", {
123
- class: c(o.value),
124
- type: "button",
125
- "aria-label": "Close"
126
- }, [...r[0] || (r[0] = [
127
- h("i", { class: "icon-kl icon-kl-close" }, null, -1)
128
- ])], 2));
129
- }
130
- }), tl = /* @__PURE__ */ M(be, [["__scopeId", "data-v-7cc56d51"]]), ve = {
131
- key: 0,
132
- class: "app-toggle__label app-toggle__label_left"
133
- }, he = { class: "app-toggle__container" }, ye = ["checked", "disabled"], ke = { class: "app-toggle__thumb" }, _e = {
134
- key: 1,
135
- class: "app-toggle__label"
136
- }, $e = /* @__PURE__ */ C({
137
- __name: "AppToggle",
138
- props: {
139
- modelValue: { type: Boolean },
140
- size: { default: _.MD },
141
- label: {},
142
- disabled: { type: Boolean },
143
- color: { default: X.PRIMARY },
144
- iconColor: {},
145
- icon: {},
146
- iconActive: {},
147
- labelLeft: { type: Boolean }
148
- },
149
- emits: ["update:modelValue"],
150
- setup(d, { emit: s }) {
151
- const o = d, l = s, r = k({
152
- get: () => o.modelValue,
153
- set: (e) => {
154
- l("update:modelValue", e);
155
- }
156
- }), a = k(() => [
157
- "app-toggle",
158
- {
159
- "app-toggle_active": r.value,
160
- "app-toggle_disabled": o.disabled
161
- },
162
- `app-toggle_${o.size}`,
163
- `app-toggle_${o.color}`
164
- ]);
165
- return (e, b) => (n(), u("div", {
166
- class: c(a.value),
167
- onClick: b[1] || (b[1] = G(() => {
168
- }, ["stop"]))
169
- }, [
170
- e.label && e.labelLeft ? (n(), u("span", ve, B(e.label), 1)) : f("", !0),
171
- h("label", he, [
172
- h("input", {
173
- type: "checkbox",
174
- checked: r.value,
175
- onChange: b[0] || (b[0] = ($) => r.value = !r.value),
176
- disabled: e.disabled,
177
- class: "app-toggle__input"
178
- }, null, 40, ye),
179
- h("span", {
180
- class: c(["app-toggle__slider", r.value ? `bg-${e.color}` : ""])
181
- }, [
182
- h("span", ke, [
183
- e.icon && !e.modelValue ? (n(), u("i", {
184
- key: 0,
185
- class: c(["icon-kl", `icon-kl-${e.icon}`, "app-toggle__icon"])
186
- }, null, 2)) : f("", !0),
187
- e.modelValue && (e.iconActive || e.icon) ? (n(), u("i", {
188
- key: 1,
189
- class: c([
190
- "icon-kl",
191
- `icon-kl-${e.iconActive || e.icon}`,
192
- "app-toggle__icon",
193
- r.value ? `text-${e.iconColor}` : ""
194
- ])
195
- }, null, 2)) : f("", !0)
196
- ])
197
- ], 2),
198
- L(e.$slots, "default", {}, void 0, !0)
199
- ]),
200
- e.label && !e.labelLeft ? (n(), u("span", _e, B(e.label), 1)) : f("", !0)
201
- ], 2));
202
- }
203
- }), le = /* @__PURE__ */ M($e, [["__scopeId", "data-v-ba49356e"]]), Be = {
204
- key: 0,
205
- class: "menu-item__loading"
206
- }, Ve = {
207
- key: 0,
208
- class: "menu-item__checked"
209
- }, Me = {
210
- key: 2,
211
- class: "menu-item__icon"
212
- }, we = { class: "menu-item__label" }, Ae = {
213
- key: 3,
214
- class: "menu-item__icon-right icon-kl icon-kl-arrow-right"
215
- }, Ce = /* @__PURE__ */ C({
216
- __name: "PopupItem",
217
- props: {
218
- label: {},
219
- icon: {},
220
- iconSize: {},
221
- color: {},
222
- iconRight: {},
223
- arrow: { type: Boolean },
224
- toggle: { type: Boolean },
225
- checkbox: { type: Boolean },
226
- active: { type: Boolean },
227
- modelValue: { type: Boolean },
228
- persistent: { type: Boolean },
229
- loading: { type: Boolean },
230
- disabled: { type: Boolean },
231
- gap: { type: Boolean },
232
- checked: { type: Boolean },
233
- isMobile: { type: Boolean }
234
- },
235
- emits: ["update:modelValue", "closePopup"],
236
- setup(d, { emit: s }) {
237
- const o = d, l = s, r = () => {
238
- o.disabled || (o.toggle || o.checkbox ? l("update:modelValue", !o.modelValue) : o.persistent || l("closePopup"));
239
- };
240
- return (a, e) => Z((n(), u("div", {
241
- class: c(["menu-item", [
242
- { "menu-item_gap": a.gap },
243
- { "menu-item_disabled": a.disabled },
244
- { "menu-item_active": a.active },
245
- { "menu-item_mobile": a.isMobile }
246
- ]]),
247
- onClick: r
248
- }, [
249
- h("div", {
250
- class: c(["row items-center no-wrap", `text-${a.color ? a.color : "dark"}`])
251
- }, [
252
- a.loading ? (n(), u("div", Be, [
253
- H(V(pe), {
254
- size: "19px",
255
- color: a.color ? a.color : "dark"
256
- }, null, 8, ["color"])
257
- ])) : (n(), u(I, { key: 1 }, [
258
- a.checked ? (n(), u("div", Ve, [...e[3] || (e[3] = [
259
- h("i", { class: "icon-kl icon-kl-check" }, null, -1)
260
- ])])) : f("", !0),
261
- a.checkbox ? (n(), A(ue, {
262
- key: 1,
263
- class: "menu-item__checkbox",
264
- size: "34px",
265
- "model-value": a.modelValue,
266
- "onUpdate:modelValue": e[0] || (e[0] = (b) => l("update:modelValue", b)),
267
- onClick: e[1] || (e[1] = G(() => {
268
- }, ["stop"]))
269
- }, null, 8, ["model-value"])) : f("", !0),
270
- a.icon ? (n(), u("div", Me, [
271
- h("i", {
272
- class: c(`icon-kl icon-kl-${a.icon}`),
273
- style: Q({ fontSize: a.iconSize || "27px" })
274
- }, null, 6)
275
- ])) : f("", !0)
276
- ], 64)),
277
- h("span", we, B(a.label), 1)
278
- ], 2),
279
- a.$slots.right ? L(a.$slots, "right", { key: 0 }, void 0, !0) : a.toggle ? (n(), A(le, {
280
- key: 1,
281
- class: "menu-item__toggle",
282
- "model-value": a.modelValue,
283
- disabled: a.disabled || a.loading,
284
- "onUpdate:modelValue": e[2] || (e[2] = (b) => l("update:modelValue", b))
285
- }, null, 8, ["model-value", "disabled"])) : a.iconRight ? (n(), u("i", {
286
- key: 2,
287
- class: c([
288
- "menu-item__icon-right menu-item__icon-right_custom icon-kl",
289
- `icon-kl-${a.iconRight}`
290
- ])
291
- }, null, 2)) : a.arrow ? (n(), u("i", Ae)) : f("", !0)
292
- ], 2)), [
293
- [re, !a.toggle && !a.checkbox && !a.persistent && !a.disabled]
294
- ]);
295
- }
296
- }), ze = /* @__PURE__ */ M(Ce, [["__scopeId", "data-v-4b2a03b5"]]), Ie = /* @__PURE__ */ C({
297
- __name: "AppIcon",
298
- props: {
299
- name: {},
300
- size: {},
301
- color: {}
302
- },
303
- setup(d) {
304
- return (s, o) => (n(), u("i", {
305
- class: c(["icon-kl", `icon-kl-${s.name}`, s.color ? `text-${s.color}` : ""]),
306
- style: Q(s.size ? `font-size: ${s.size}` : void 0)
307
- }, null, 6));
308
- }
309
- }), F = /* @__PURE__ */ M(Ie, [["__scopeId", "data-v-941765ee"]]), Re = {
310
- key: 0,
311
- class: "code-field__label"
312
- }, Se = { class: "code-field__inputs" }, Pe = ["onUpdate:modelValue", "disabled", "onInput", "onKeydown", "onPaste"], Le = /* @__PURE__ */ C({
313
- __name: "AppCodeInput",
314
- props: {
315
- length: { default: 5 },
316
- size: { default: _.MD },
317
- label: {},
318
- disabled: { type: Boolean },
319
- loading: { type: Boolean },
320
- autofocus: { type: Boolean },
321
- color: {}
322
- },
323
- emits: ["update:modelValue", "completed"],
324
- setup(d, { expose: s, emit: o }) {
325
- const l = d, r = o, a = P(Array(l.length).fill("")), e = P([]), b = k(() => [
326
- "code-field",
327
- {
328
- "code-field_disabled": l.disabled || l.loading
329
- },
330
- `code-field_${l.size}`,
331
- `code-field_${l.color}`
332
- ]), $ = k(() => {
333
- let i = "";
334
- return l.size == _.SM && (i += `width: ${l.length * 26 + (l.length - 1) * 5}px`), l.size == _.MD && (i += `width: ${l.length * 32 + (l.length - 1) * 8}px`), l.size == _.LG && (i += `width: ${l.length * 44 + (l.length - 1) * 10}px`), i;
335
- }), D = (i, t) => {
336
- var m;
337
- const p = i.target.value;
338
- if (p.length === 1)
339
- t < l.length - 1 && e.value && ((m = e.value[t + 1]) == null || m.focus());
340
- else if (p.length > 1) {
341
- const g = p.slice(0, l.length - t).split("");
342
- g.forEach((y, w) => {
343
- a.value[t + w] = y;
344
- }), U(() => {
345
- var y;
346
- e.value && ((y = e.value[Math.min(t + g.length, l.length - 1)]) == null || y.focus());
347
- });
348
- }
349
- }, z = (i) => {
350
- var t;
351
- a.value[i] === "" && e.value && i > 0 && ((t = e.value[i - 1]) == null || t.focus());
352
- }, O = (i, t) => {
353
- var m;
354
- i.preventDefault();
355
- const v = ((m = i.clipboardData) == null ? void 0 : m.getData("text")) ?? "";
356
- if (!v) return;
357
- const p = v.slice(0, l.length - t).split("");
358
- p.forEach((g, y) => {
359
- a.value[t + y] = g;
360
- }), U(() => {
361
- var g;
362
- e.value && ((g = e.value[Math.min(t + p.length, l.length - 1)]) == null || g.focus());
363
- });
364
- };
365
- N(
366
- a,
367
- (i) => {
368
- const t = i.join("");
369
- R(t);
370
- },
371
- { deep: !0 }
372
- );
373
- const R = (i) => {
374
- r("update:modelValue", i), i.length === l.length && !i.includes(" ") && r("completed", i);
375
- }, S = (i) => {
376
- i && (a.value = i.split("").slice(0, l.length));
377
- };
378
- return J(() => {
379
- l.autofocus && e.value && e.value[0] && e.value[0].focus();
380
- }), s({
381
- injectCode: S
382
- }), (i, t) => (n(), u("div", {
383
- class: c(b.value),
384
- style: Q($.value)
385
- }, [
386
- i.label ? (n(), u("label", Re, B(i.label), 1)) : f("", !0),
387
- h("div", Se, [
388
- (n(!0), u(I, null, x(i.length, (v, p) => Z((n(), u("input", {
389
- key: p,
390
- "onUpdate:modelValue": (m) => a.value[p] = m,
391
- ref_for: !0,
392
- ref_key: "inputRefs",
393
- ref: e,
394
- type: "number",
395
- maxlength: "1",
396
- class: "code-field__input",
397
- disabled: i.disabled || i.loading,
398
- onInput: (m) => D(m, p),
399
- onKeydown: oe((m) => z(p), ["backspace"]),
400
- onPaste: (m) => O(m, p)
401
- }, null, 40, Pe)), [
402
- [te, a.value[p]]
403
- ])), 128))
404
- ]),
405
- i.loading ? (n(), A(de, {
406
- key: 1,
407
- indeterminate: "",
408
- rounded: "",
409
- color: i.color,
410
- class: "code-field__loading"
411
- }, null, 8, ["color"])) : f("", !0)
412
- ], 6));
413
- }
414
- }), al = /* @__PURE__ */ M(Le, [["__scopeId", "data-v-4e11db87"]]), De = ["onClick", "disabled"], Oe = /* @__PURE__ */ C({
415
- __name: "AppSegment",
416
- props: /* @__PURE__ */ Y({
417
- options: {},
418
- disabled: { type: Boolean },
419
- size: { default: _.MD },
420
- color: { default: X.PRIMARY },
421
- glass: { type: Boolean },
422
- blur: { type: Boolean }
423
- }, {
424
- modelValue: {},
425
- modelModifiers: {}
426
- }),
427
- emits: ["update:modelValue"],
428
- setup(d) {
429
- const s = ee(d, "modelValue"), o = d, l = E("scroller"), r = E("content"), a = E("buttons"), e = P(!1), b = P(!1), $ = P({ left: 0, width: 0 }), D = k(() => [
430
- "app-segment",
431
- {
432
- "app-segment_disabled": o.disabled,
433
- "app-segment_scrollable": b.value,
434
- "app-segment_glass": o.glass,
435
- "app-segment_blur": o.blur
436
- },
437
- `app-segment_${o.size}`,
438
- `app-segment_${o.color}`
439
- ]), z = k(
440
- () => o.options.findIndex((g) => g.value === s.value)
441
- ), O = k(() => ({
442
- width: `${$.value.width}px`,
443
- transform: `translateX(${$.value.left}px)`,
444
- opacity: $.value.width ? 1 : 0
445
- }));
446
- function R() {
447
- var y;
448
- const g = (y = a.value) == null ? void 0 : y[z.value];
449
- $.value = g ? { left: g.offsetLeft, width: g.offsetWidth } : { left: 0, width: 0 }, l.value && (b.value = l.value.scrollWidth - l.value.clientWidth > 1);
450
- }
451
- function S(g = "smooth") {
452
- var w, W;
453
- const y = (w = a.value) == null ? void 0 : w[z.value];
454
- !y || !((W = l.value) != null && W.scrollTo) || l.value.scrollTo({
455
- left: y.offsetLeft + y.offsetWidth / 2 - l.value.clientWidth / 2,
456
- behavior: g
457
- });
458
- }
459
- function i(g) {
460
- o.disabled || (s.value = g);
461
- }
462
- let t = !0;
463
- function v() {
464
- t = !1;
465
- }
466
- function p() {
467
- R(), t && S();
468
- }
469
- let m;
470
- return J(async () => {
471
- R(), await U(), S("auto"), e.value = !0, typeof ResizeObserver < "u" && l.value && r.value && (m = new ResizeObserver(p), m.observe(l.value), m.observe(r.value));
472
- }), ae(() => m == null ? void 0 : m.disconnect()), N(
473
- [z, b, () => o.options, () => o.size],
474
- () => U(R)
475
- ), N(z, () => {
476
- t = !0, U(() => S());
477
- }), (g, y) => (n(), u("div", {
478
- ref_key: "scroller",
479
- ref: l,
480
- class: c(D.value),
481
- onWheelPassive: v,
482
- onTouchstartPassive: v
483
- }, [
484
- h("div", {
485
- ref_key: "content",
486
- ref: r,
487
- class: "app-segment__content"
488
- }, [
489
- h("div", {
490
- class: c(["app-segment__thumb", { "app-segment__thumb_animated": e.value }]),
491
- style: Q(O.value)
492
- }, null, 6),
493
- (n(!0), u(I, null, x(g.options, (w, W) => (n(), u("button", {
494
- ref_for: !0,
495
- ref_key: "buttons",
496
- ref: a,
497
- key: W,
498
- class: c(["app-segment__btn", { "app-segment__btn_active": s.value === w.value }]),
499
- onClick: (Ne) => i(w.value),
500
- disabled: g.disabled
501
- }, [
502
- L(g.$slots, "option", { option: w }, () => [
503
- q(B(w.label), 1)
504
- ], !0)
505
- ], 10, De))), 128))
506
- ], 512)
507
- ], 34));
508
- }
509
- }), nl = /* @__PURE__ */ M(Oe, [["__scopeId", "data-v-11d8f417"]]), Te = {}, Ue = { class: "system-menu" };
510
- function qe(d, s) {
511
- return n(), u("div", Ue, [
512
- L(d.$slots, "default", {}, void 0, !0)
513
- ]);
514
- }
515
- const sl = /* @__PURE__ */ M(Te, [["render", qe], ["__scopeId", "data-v-5649b2f4"]]), We = { class: "menu-item__content" }, Qe = {
516
- key: 0,
517
- class: "menu-item__value"
518
- }, Ee = /* @__PURE__ */ C({
519
- __name: "MenuItem",
520
- props: /* @__PURE__ */ Y({
521
- label: {},
522
- icon: {},
523
- iconRight: {},
524
- arrow: { type: Boolean },
525
- color: {},
526
- to: {},
527
- href: {},
528
- target: {},
529
- disabled: { type: Boolean },
530
- toggle: { type: Boolean },
531
- isMobile: { type: Boolean }
532
- }, {
533
- modelValue: { type: Boolean },
534
- modelModifiers: {}
535
- }),
536
- emits: /* @__PURE__ */ Y(["click"], ["update:modelValue"]),
537
- setup(d, { emit: s }) {
538
- const o = d, l = s, r = ee(d, "modelValue"), a = async () => {
539
- o.toggle && (r.value = !r.value), l("click");
540
- };
541
- return (e, b) => (n(), A(V(ce), {
542
- class: c(["menu-item", {
543
- "menu-item_disabled": e.disabled,
544
- "menu-item_mobile": e.isMobile
545
- }]),
546
- to: e.to,
547
- href: e.href,
548
- target: e.target,
549
- disable: e.disabled,
550
- clickable: "",
551
- onClick: a
552
- }, {
553
- default: T(() => [
554
- e.icon ? (n(), A(V(F), {
555
- key: 0,
556
- name: e.icon.name,
557
- class: c(["menu-item__icon", `bg-${e.icon.color}`])
558
- }, null, 8, ["name", "class"])) : f("", !0),
559
- h("div", We, [
560
- h("span", {
561
- class: c(["app-menu-item__label", e.color ? `text-${e.color}` : ""])
562
- }, [
563
- q(B(e.label) + " ", 1),
564
- L(e.$slots, "default", {}, void 0, !0)
565
- ], 2),
566
- e.$slots.value ? (n(), u("span", Qe, [
567
- L(e.$slots, "value", {}, void 0, !0)
568
- ])) : f("", !0),
569
- e.toggle ? (n(), A(V(le), {
570
- key: 1,
571
- modelValue: r.value,
572
- "onUpdate:modelValue": b[0] || (b[0] = ($) => r.value = $)
573
- }, null, 8, ["modelValue"])) : f("", !0),
574
- e.iconRight ? (n(), A(V(F), {
575
- key: 2,
576
- class: "menu-item__icon-right",
577
- name: e.iconRight.name,
578
- color: e.iconRight.color
579
- }, null, 8, ["name", "color"])) : f("", !0),
580
- e.arrow ? (n(), A(V(F), {
581
- key: 3,
582
- class: "menu-item__icon-right menu-item__arrow",
583
- name: "arrow-right"
584
- })) : f("", !0)
585
- ])
586
- ]),
587
- _: 3
588
- }, 8, ["class", "to", "href", "target", "disable"]));
589
- }
590
- }), il = /* @__PURE__ */ M(Ee, [["__scopeId", "data-v-b9907ab7"]]), j = (d) => d ? !0 : "Обовʼязкове поле", Fe = { class: "app-select__amount" }, He = /* @__PURE__ */ C({
591
- __name: "AppSelect",
592
- props: {
593
- modelValue: {},
594
- size: { default: _.MD },
595
- options: {},
596
- multiple: { type: Boolean },
597
- label: {},
598
- placeholder: {},
599
- required: { type: Boolean },
600
- clearable: { type: Boolean },
601
- disabled: { type: Boolean },
602
- loading: { type: Boolean },
603
- filtering: { type: Boolean },
604
- autofocus: { type: Boolean },
605
- rules: {},
606
- lazyRules: { type: [Boolean, String] },
607
- menuClass: {},
608
- glass: { type: Boolean },
609
- isMobile: { type: Boolean }
610
- },
611
- emits: ["update:modelValue", "popupShow", "popupHide"],
612
- setup(d, { emit: s }) {
613
- const o = d, l = s, r = P(!1), a = P(""), e = k({
614
- get() {
615
- if (o.modelValue) {
616
- if (o.multiple && Array.isArray(o.modelValue))
617
- return o.options.filter(
618
- (t) => o.modelValue.includes(t.value)
619
- );
620
- if (!Array.isArray(o.modelValue))
621
- return o.options.find(
622
- (t) => t.value === o.modelValue
623
- );
624
- }
625
- },
626
- set(t) {
627
- if (!t) {
628
- l("update:modelValue", void 0);
629
- return;
630
- }
631
- if (o.multiple && Array.isArray(t)) {
632
- const v = t.map((p) => p.value);
633
- l("update:modelValue", v);
634
- } else Array.isArray(t) || l("update:modelValue", t.value);
635
- }
636
- }), b = k(() => {
637
- var t;
638
- if (Array.isArray(e.value)) {
639
- if (o.multiple && e.value.length == 0)
640
- return o.placeholder;
641
- } else return ((t = e.value) == null ? void 0 : t.label) || o.placeholder || "";
642
- return "";
643
- }), $ = k(() => !(!o.clearable || !o.modelValue || o.modelValue && Array.isArray(o.modelValue) && !o.modelValue.length)), D = k(() => a.value ? o.options.filter(
644
- (t) => t.label.toLowerCase().includes(a.value.toLowerCase())
645
- ) : o.options), z = k(() => {
646
- if (o.rules)
647
- return o.required ? [...o.rules, j] : o.rules;
648
- if (o.required)
649
- return [j];
650
- }), O = () => {
651
- r.value = !0, l("popupShow");
652
- }, R = () => {
653
- r.value = !1, l("popupHide");
654
- }, S = () => {
655
- e.value = void 0;
656
- }, i = (t, v) => {
657
- v(() => {
658
- a.value = t;
659
- });
660
- };
661
- return (t, v) => (n(), u("div", {
662
- class: c(["app-select", [{ "app-select_opened": r.value }, `app-select_${t.size}`]])
663
- }, [
664
- t.label ? (n(), u("label", {
665
- key: 0,
666
- class: c(["app-select__label", { "app-select__label_bold": t.required }])
667
- }, B(t.required ? `${t.label} *` : t.label), 3)) : f("", !0),
668
- H(V(me), {
669
- standout: "",
670
- "hide-bottom-space": "",
671
- "hide-dropdown-icon": "",
672
- "no-error-icon": "",
673
- behavior: "menu",
674
- "popup-no-route-dismiss": "",
675
- "popup-content-class": `kl-menu ${t.glass ? "glass-menu" : ""} app-select-menu app-select-menu_${t.size} ${t.menuClass}`,
676
- placeholder: t.filtering && "Почніть вводити",
677
- "input-debounce": "50",
678
- modelValue: e.value,
679
- "onUpdate:modelValue": v[0] || (v[0] = (p) => e.value = p),
680
- options: D.value,
681
- multiple: t.multiple,
682
- "use-input": t.filtering && (Array.isArray(e.value) || !e.value),
683
- rules: z.value,
684
- "lazy-rules": t.lazyRules,
685
- autofocus: t.autofocus,
686
- disable: t.disabled,
687
- loading: t.loading,
688
- "menu-offset": [0, 2],
689
- onFilter: i,
690
- onPopupShow: O,
691
- onPopupHide: R
692
- }, {
693
- append: T(() => [
694
- $.value ? (n(), u("i", {
695
- key: 0,
696
- class: "icon-kl icon-kl-circle-close app-select__clear",
697
- onClick: G(S, ["stop", "prevent"])
698
- })) : f("", !0),
699
- v[1] || (v[1] = h("i", { class: "icon-kl icon-kl-arrow-down app-select__drop-icon" }, null, -1))
700
- ]),
701
- selected: T(() => {
702
- var p, m;
703
- return [
704
- Array.isArray(e.value) ? (n(), u(I, { key: 0 }, [
705
- !t.filtering || e.value.length ? (n(), u("span", {
706
- key: 0,
707
- class: c([
708
- "app-select__selected",
709
- {
710
- "app-select__placeholder": !((p = e.value) != null && p.length) && t.placeholder
711
- }
712
- ])
713
- }, [
714
- (m = e.value) != null && m.length ? (n(), u(I, { key: 0 }, [
715
- v[2] || (v[2] = q(" Вибрано ", -1)),
716
- h("span", Fe, B(e.value.length), 1)
717
- ], 64)) : (n(), u(I, { key: 1 }, [
718
- q(B(o.placeholder), 1)
719
- ], 64))
720
- ], 2)) : f("", !0)
721
- ], 64)) : (n(), u(I, { key: 1 }, [
722
- !t.filtering || e.value ? (n(), u("span", {
723
- key: 0,
724
- class: c([
725
- "app-select__selected",
726
- { "app-select__placeholder": !e.value && t.placeholder }
727
- ])
728
- }, B(b.value), 3)) : f("", !0)
729
- ], 64))
730
- ];
731
- }),
732
- option: T((p) => [
733
- H(ze, ne({
734
- "no-arrow": "",
735
- label: p.opt.label,
736
- checked: p.opt.done,
737
- active: p.selected,
738
- "is-mobile": t.isMobile,
739
- checkbox: o.multiple,
740
- "model-value": p.selected
741
- }, o.multiple ? { ...p.itemProps, onClick: void 0 } : p.itemProps, {
742
- "onUpdate:modelValue": () => p.toggleOption(p.opt)
743
- }), null, 16, ["label", "checked", "active", "is-mobile", "checkbox", "model-value", "onUpdate:modelValue"])
744
- ]),
745
- _: 1
746
- }, 8, ["popup-content-class", "placeholder", "modelValue", "options", "multiple", "use-input", "rules", "lazy-rules", "autofocus", "disable", "loading"])
747
- ], 2));
748
- }
749
- }), ul = /* @__PURE__ */ M(He, [["__scopeId", "data-v-21482233"]]), rl = K(
750
- () => import("./AppButtonCopy-DkYRd1u6.js")
751
- ), pl = K(
752
- () => import("./DropdownButton-CqLRfeLk.js")
753
- ), dl = K(
754
- () => import("./BottomSheet-0yQqqUZY.js")
755
- );
756
- export {
757
- ol as A,
758
- dl as B,
759
- X as C,
760
- pl as D,
761
- il as M,
762
- ze as P,
763
- _ as S,
764
- M as _,
765
- tl as a,
766
- rl as b,
767
- al as c,
768
- F as d,
769
- nl as e,
770
- ul as f,
771
- le as g,
772
- sl as h,
773
- ll as i
774
- };