@efficiency-point/design-system 0.1.11 → 0.1.15
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/README.md +41 -41
- package/dist/components/DSDataTable/DSDataTable.d.ts +4 -0
- package/dist/components/DSDataTable/DSDataTable.d.ts.map +1 -1
- package/dist/components/DSDateTimePicker/DSDateTimePicker.d.ts +4 -0
- package/dist/components/DSDateTimePicker/DSDateTimePicker.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.es.js +834 -708
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -4,17 +4,17 @@ import { createPortal as h } from "react-dom";
|
|
|
4
4
|
import { createSortedRowModel as g, rowSortingFeature as _, tableFeatures as v, useTable as y } from "@tanstack/react-table";
|
|
5
5
|
import { create as b } from "zustand";
|
|
6
6
|
var x = {
|
|
7
|
-
badge: "
|
|
8
|
-
sm: "
|
|
9
|
-
md: "
|
|
10
|
-
neutral: "
|
|
11
|
-
info: "
|
|
12
|
-
success: "
|
|
13
|
-
warning: "
|
|
14
|
-
error: "
|
|
15
|
-
dot: "
|
|
16
|
-
icon: "
|
|
17
|
-
label: "
|
|
7
|
+
badge: "_badge_q710w_1",
|
|
8
|
+
sm: "_sm_q710w_3",
|
|
9
|
+
md: "_md_q710w_5",
|
|
10
|
+
neutral: "_neutral_q710w_7",
|
|
11
|
+
info: "_info_q710w_9",
|
|
12
|
+
success: "_success_q710w_11",
|
|
13
|
+
warning: "_warning_q710w_13",
|
|
14
|
+
error: "_error_q710w_15",
|
|
15
|
+
dot: "_dot_q710w_17",
|
|
16
|
+
icon: "_icon_q710w_19",
|
|
17
|
+
label: "_label_q710w_21"
|
|
18
18
|
}, S = ({ children: e, variant: r = "neutral", size: i = "md", dot: a = !1, icon: o, className: s = "" }) => /* @__PURE__ */ n("span", {
|
|
19
19
|
className: `${x.badge} ${x[r]} ${x[i]} ${s}`,
|
|
20
20
|
children: [
|
|
@@ -56,17 +56,17 @@ var x = {
|
|
|
56
56
|
]
|
|
57
57
|
})
|
|
58
58
|
}), w = {
|
|
59
|
-
button: "
|
|
60
|
-
sm: "
|
|
61
|
-
md: "
|
|
62
|
-
lg: "
|
|
63
|
-
primary: "
|
|
64
|
-
secondary: "
|
|
65
|
-
outline: "
|
|
66
|
-
ghost: "
|
|
67
|
-
empty: "
|
|
68
|
-
destructive: "
|
|
69
|
-
destructiveOutline: "
|
|
59
|
+
button: "_button_15zz4_1",
|
|
60
|
+
sm: "_sm_15zz4_47",
|
|
61
|
+
md: "_md_15zz4_61",
|
|
62
|
+
lg: "_lg_15zz4_75",
|
|
63
|
+
primary: "_primary_15zz4_89",
|
|
64
|
+
secondary: "_secondary_15zz4_103",
|
|
65
|
+
outline: "_outline_15zz4_117",
|
|
66
|
+
ghost: "_ghost_15zz4_131",
|
|
67
|
+
empty: "_empty_15zz4_145",
|
|
68
|
+
destructive: "_destructive_15zz4_159",
|
|
69
|
+
destructiveOutline: "_destructiveOutline_15zz4_169"
|
|
70
70
|
}, T = a(({ children: e, variant: n = "primary", size: r = "md", isLoading: i = !1, disabled: a, type: o = "button", className: s = "", ...c }, l) => /* @__PURE__ */ t("button", {
|
|
71
71
|
ref: l,
|
|
72
72
|
className: `${w.button} ${w[n]} ${w[r]} ${s}`,
|
|
@@ -78,14 +78,14 @@ var x = {
|
|
|
78
78
|
}));
|
|
79
79
|
T.displayName = "DSButton";
|
|
80
80
|
var E = {
|
|
81
|
-
label: "
|
|
82
|
-
required: "
|
|
83
|
-
error: "
|
|
84
|
-
optional: "
|
|
85
|
-
hint: "
|
|
86
|
-
disabled: "
|
|
87
|
-
message: "
|
|
88
|
-
success: "
|
|
81
|
+
label: "_label_1uvpq_1",
|
|
82
|
+
required: "_required_1uvpq_23",
|
|
83
|
+
error: "_error_1uvpq_25",
|
|
84
|
+
optional: "_optional_1uvpq_33",
|
|
85
|
+
hint: "_hint_1uvpq_35",
|
|
86
|
+
disabled: "_disabled_1uvpq_47",
|
|
87
|
+
message: "_message_1uvpq_55",
|
|
88
|
+
success: "_success_1uvpq_71"
|
|
89
89
|
}, te = ({ children: e, required: r = !1, optionalText: i, disabled: a = !1, className: o = "", ...s }) => /* @__PURE__ */ n("label", {
|
|
90
90
|
className: `${E.label} ${a ? E.disabled : ""} ${o}`,
|
|
91
91
|
...s,
|
|
@@ -264,12 +264,12 @@ var E = {
|
|
|
264
264
|
let r = k[e];
|
|
265
265
|
return /* @__PURE__ */ t(r, { ...n });
|
|
266
266
|
}, j = {
|
|
267
|
-
wrapper: "
|
|
268
|
-
label: "
|
|
269
|
-
input: "
|
|
270
|
-
control: "
|
|
271
|
-
disabled: "
|
|
272
|
-
controlError: "
|
|
267
|
+
wrapper: "_wrapper_zhpug_1",
|
|
268
|
+
label: "_label_zhpug_3",
|
|
269
|
+
input: "_input_zhpug_5",
|
|
270
|
+
control: "_control_zhpug_7",
|
|
271
|
+
disabled: "_disabled_zhpug_21",
|
|
272
|
+
controlError: "_controlError_zhpug_27"
|
|
273
273
|
}, M = ({ checked: e, onChange: r, label: i, hint: a, error: o, disabled: s = !1, readOnly: c = !1, className: d = "", name: f, id: m, indeterminate: h = !1, ...g }) => {
|
|
274
274
|
let _ = u(), v = m ?? `ds-checkbox-${f ?? _}`, y = p(null), b = a ? `${v}-hint` : void 0, x = o ? `${v}-error` : void 0;
|
|
275
275
|
return l(() => {
|
|
@@ -325,28 +325,36 @@ var E = {
|
|
|
325
325
|
]
|
|
326
326
|
});
|
|
327
327
|
}, N = {
|
|
328
|
-
wrapper: "
|
|
329
|
-
trigger: "
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
328
|
+
wrapper: "_wrapper_1dsog_1",
|
|
329
|
+
trigger: "_trigger_1dsog_17",
|
|
330
|
+
sm: "_sm_1dsog_53",
|
|
331
|
+
md: "_md_1dsog_65",
|
|
332
|
+
lg: "_lg_1dsog_75",
|
|
333
|
+
chevron: "_chevron_1dsog_89",
|
|
334
|
+
chevronOpen: "_chevronOpen_1dsog_115",
|
|
335
|
+
nav: "_nav_1dsog_127",
|
|
336
|
+
day: "_day_1dsog_129",
|
|
337
|
+
monthSelect: "_monthSelect_1dsog_131",
|
|
338
|
+
yearInput: "_yearInput_1dsog_133",
|
|
339
|
+
timeInput: "_timeInput_1dsog_135",
|
|
340
|
+
dateInput: "_dateInput_1dsog_147",
|
|
341
|
+
timeValue: "_timeValue_1dsog_189",
|
|
342
|
+
chevronButton: "_chevronButton_1dsog_201",
|
|
343
|
+
disabled: "_disabled_1dsog_235",
|
|
344
|
+
validationTooltip: "_validationTooltip_1dsog_249",
|
|
345
|
+
"validation-tooltip-lifetime": "_validation-tooltip-lifetime_1dsog_1",
|
|
346
|
+
value: "_value_1dsog_319",
|
|
347
|
+
placeholder: "_placeholder_1dsog_335",
|
|
348
|
+
error: "_error_1dsog_343",
|
|
349
|
+
panel: "_panel_1dsog_351",
|
|
350
|
+
calendarHeader: "_calendarHeader_1dsog_377",
|
|
351
|
+
weekdays: "_weekdays_1dsog_467",
|
|
352
|
+
days: "_days_1dsog_469",
|
|
353
|
+
outside: "_outside_1dsog_505",
|
|
354
|
+
selected: "_selected_1dsog_513",
|
|
355
|
+
timeLabel: "_timeLabel_1dsog_533",
|
|
356
|
+
previousMonth: "_previousMonth_1dsog_593",
|
|
357
|
+
nextMonth: "_nextMonth_1dsog_601"
|
|
350
358
|
}, P = [
|
|
351
359
|
"Пн",
|
|
352
360
|
"Вт",
|
|
@@ -368,11 +376,33 @@ var E = {
|
|
|
368
376
|
"Октябрь",
|
|
369
377
|
"Ноябрь",
|
|
370
378
|
"Декабрь"
|
|
371
|
-
], I = (e) => String(e).padStart(2, "0"), L = (e) =>
|
|
379
|
+
], I = (e) => String(e).padStart(2, "0"), L = 8, R = "Некорректная дата", z = (e) => e ? `${I(e.getDate())}.${I(e.getMonth() + 1)}.${e.getFullYear()}` : "", B = (e) => {
|
|
380
|
+
let t = e.replace(/\D/g, "").slice(0, L);
|
|
381
|
+
return [
|
|
382
|
+
t.slice(0, 2),
|
|
383
|
+
t.slice(2, 4),
|
|
384
|
+
t.slice(4, 8)
|
|
385
|
+
].filter(Boolean).join(".");
|
|
386
|
+
}, V = (e) => {
|
|
387
|
+
if (!e) return !0;
|
|
388
|
+
let t = Number(e.padEnd(4, "0"));
|
|
389
|
+
return Number(e.padEnd(4, "9")) >= 1800 && t <= 2500;
|
|
390
|
+
}, H = (e) => {
|
|
391
|
+
if (!/^\d{0,8}$/.test(e)) return !1;
|
|
392
|
+
let t = e.slice(0, 2), n = e.slice(2, 4), r = e.slice(4, 8);
|
|
393
|
+
return t.length === 1 && Number(t) > 3 || t.length === 2 && (Number(t) < 1 || Number(t) > 31) || n.length === 1 && Number(n) > 1 || n.length === 2 && (Number(n) < 1 || Number(n) > 12) ? !1 : V(r);
|
|
394
|
+
}, U = (e) => {
|
|
395
|
+
let t = /^(\d{2})\.(\d{2})\.(\d{4})$/.exec(e);
|
|
396
|
+
if (!t) return null;
|
|
397
|
+
let n = Number(t[1]), r = Number(t[2]) - 1, i = Number(t[3]);
|
|
398
|
+
if (i < 1800 || i > 2500) return null;
|
|
399
|
+
let a = new Date(i, r, n, 12);
|
|
400
|
+
return a.getFullYear() !== i || a.getMonth() !== r || a.getDate() !== n ? null : a;
|
|
401
|
+
}, W = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), G = (e, t) => {
|
|
372
402
|
if (!e) return "";
|
|
373
403
|
let n = `${e.getFullYear()}-${I(e.getMonth() + 1)}-${I(e.getDate())}`, r = `${I(e.getHours())}:${I(e.getMinutes())}`;
|
|
374
404
|
return t === "date" ? n : t === "time" ? r : `${n}T${r}`;
|
|
375
|
-
},
|
|
405
|
+
}, ne = (e, t) => {
|
|
376
406
|
if (!e) return null;
|
|
377
407
|
if (t === "time") {
|
|
378
408
|
let t = /^(\d{2}):(\d{2})$/.exec(e);
|
|
@@ -390,87 +420,115 @@ var E = {
|
|
|
390
420
|
}
|
|
391
421
|
let n = new Date(e);
|
|
392
422
|
return Number.isNaN(n.getTime()) ? null : n;
|
|
393
|
-
},
|
|
423
|
+
}, re = (e, t) => {
|
|
394
424
|
if (!e) return "";
|
|
395
425
|
let n = `${I(e.getDate())}.${I(e.getMonth() + 1)}.${e.getFullYear()}`, r = `${I(e.getHours())}:${I(e.getMinutes())}`;
|
|
396
426
|
return t === "date" ? n : t === "time" ? r : `${n} ${r}`;
|
|
397
|
-
},
|
|
427
|
+
}, ie = (e) => {
|
|
398
428
|
let t = new Date(e.getFullYear(), e.getMonth(), 1), n = (t.getDay() + 6) % 7, r = new Date(t);
|
|
399
429
|
return r.setDate(t.getDate() - n), Array.from({ length: 42 }, (e, t) => {
|
|
400
430
|
let n = new Date(r);
|
|
401
431
|
return n.setDate(r.getDate() + t), n;
|
|
402
432
|
});
|
|
403
|
-
},
|
|
404
|
-
let r =
|
|
405
|
-
return !!(t && r <
|
|
406
|
-
},
|
|
407
|
-
let E = u(), O = ee ?? `ds-date-time-${w ?? E}`, k = g ? `${O}-hint` : void 0, j = _ ? `${O}-error` : void 0, M = p(null), I = p(null),
|
|
433
|
+
}, ae = (e, t) => !!(e && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate()), oe = (e, t, n) => {
|
|
434
|
+
let r = W(e).getTime();
|
|
435
|
+
return !!(t && r < W(t).getTime() || n && r > W(n).getTime());
|
|
436
|
+
}, se = 8, ce = 6, K = ({ value: r, onChange: i, mode: a = "date", label: o, placeholder: c, hint: g, error: _, disabled: v = !1, readOnly: y = !1, required: b = !1, min: x, max: S, size: C = "md", id: ee, name: w, className: T = "" }) => {
|
|
437
|
+
let E = u(), O = ee ?? `ds-date-time-${w ?? E}`, k = g ? `${O}-hint` : void 0, j = _ ? `${O}-error` : void 0, M = p(null), I = p(null), V = p(null), W = p(null), [K, q] = m(!1), [J, le] = m(r ?? /* @__PURE__ */ new Date()), [ue, de] = m(G(r, "time")), [Y, X] = m(z(r)), [fe, pe] = m(""), [me, he] = m(0), [ge, _e] = m(null), ve = f(() => ie(J), [J]), Z = a !== "time", ye = a !== "date";
|
|
408
438
|
l(() => {
|
|
409
|
-
r &&
|
|
410
|
-
}, [r])
|
|
411
|
-
|
|
412
|
-
|
|
439
|
+
r && le(r), de(G(r, "time")), X(z(r));
|
|
440
|
+
}, [r]), l(() => () => {
|
|
441
|
+
W.current && clearTimeout(W.current);
|
|
442
|
+
}, []);
|
|
443
|
+
let be = s(() => {
|
|
444
|
+
let e = I.current, t = V.current;
|
|
413
445
|
if (!e || !t) return;
|
|
414
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom -
|
|
415
|
-
|
|
446
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - se, o = n.top - se, s = a < r.height && o > a, c = Math.max(120, s ? o : a), l = s ? Math.max(se, n.top - r.height - ce) : n.bottom + ce, u = n.left, d = i - r.width - se;
|
|
447
|
+
_e({
|
|
416
448
|
top: l,
|
|
417
|
-
left: Math.max(
|
|
449
|
+
left: Math.max(se, Math.min(u, d)),
|
|
418
450
|
maxHeight: c
|
|
419
451
|
});
|
|
420
452
|
}, []);
|
|
421
453
|
d(() => {
|
|
422
|
-
if (!
|
|
423
|
-
|
|
454
|
+
if (!K) {
|
|
455
|
+
_e(null);
|
|
424
456
|
return;
|
|
425
457
|
}
|
|
426
|
-
return
|
|
427
|
-
window.removeEventListener("resize",
|
|
458
|
+
return be(), window.addEventListener("resize", be), window.addEventListener("scroll", be, !0), () => {
|
|
459
|
+
window.removeEventListener("resize", be), window.removeEventListener("scroll", be, !0);
|
|
428
460
|
};
|
|
429
461
|
}, [
|
|
430
|
-
W,
|
|
431
|
-
le,
|
|
432
462
|
K,
|
|
433
|
-
|
|
463
|
+
be,
|
|
464
|
+
J,
|
|
465
|
+
ue
|
|
434
466
|
]), l(() => {
|
|
435
|
-
if (!
|
|
467
|
+
if (!K) return;
|
|
436
468
|
let e = (e) => {
|
|
437
|
-
let t = e.target, n = M.current?.contains(t), r =
|
|
438
|
-
!n && !r &&
|
|
469
|
+
let t = e.target, n = M.current?.contains(t), r = V.current?.contains(t);
|
|
470
|
+
!n && !r && q(!1);
|
|
439
471
|
}, t = (e) => {
|
|
440
|
-
e.key === "Escape" && (
|
|
472
|
+
e.key === "Escape" && (q(!1), I.current?.focus());
|
|
441
473
|
};
|
|
442
474
|
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
|
|
443
475
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
444
476
|
};
|
|
445
|
-
}, [
|
|
446
|
-
let
|
|
447
|
-
if (
|
|
448
|
-
let t = a === "date" ?
|
|
449
|
-
t && (a !== "date" && t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" &&
|
|
450
|
-
},
|
|
451
|
-
|
|
477
|
+
}, [K]);
|
|
478
|
+
let xe = (e) => {
|
|
479
|
+
if (oe(e, x, S)) return;
|
|
480
|
+
let t = a === "date" ? ne(G(e, "date"), "date") : new Date(e);
|
|
481
|
+
t && (a !== "date" && t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), X(z(t)), a === "date" && q(!1));
|
|
482
|
+
}, Se = () => {
|
|
483
|
+
pe(R), he((e) => e + 1), W.current && clearTimeout(W.current), W.current = setTimeout(() => {
|
|
484
|
+
pe(""), W.current = null;
|
|
485
|
+
}, 3e3);
|
|
486
|
+
}, Ce = (e) => {
|
|
487
|
+
let t = e.replace(/\D/g, "").slice(0, L);
|
|
488
|
+
if (!H(t)) {
|
|
489
|
+
Se();
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
let n = B(t);
|
|
493
|
+
if (X(n), !t) {
|
|
452
494
|
i?.(null);
|
|
453
495
|
return;
|
|
454
496
|
}
|
|
455
|
-
|
|
497
|
+
if (t.length < L) return;
|
|
498
|
+
let o = U(n);
|
|
499
|
+
if (!o || oe(o, x, S)) {
|
|
500
|
+
Se();
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
a === "datetime" && o.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(o), le(o), q(!1), requestAnimationFrame(() => I.current?.blur());
|
|
504
|
+
}, we = (e) => {
|
|
505
|
+
if (de(e), !e) {
|
|
506
|
+
i?.(null);
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
let t = ne(e, "time");
|
|
456
510
|
if (!t) return;
|
|
457
|
-
let n = new Date(a === "datetime" ? r ??
|
|
511
|
+
let n = new Date(a === "datetime" ? r ?? J : /* @__PURE__ */ new Date());
|
|
458
512
|
n.setHours(t.getHours(), t.getMinutes(), 0, 0), !(x && n < x || S && n > S) && i?.(n);
|
|
459
|
-
},
|
|
460
|
-
|
|
513
|
+
}, Te = c ?? (a === "date" ? "--.--.----" : a === "time" ? "--:--" : "--.--.---- --:--"), Ee = fe ? `${O}-validation` : void 0, De = [
|
|
514
|
+
k,
|
|
515
|
+
j,
|
|
516
|
+
Ee
|
|
517
|
+
].filter(Boolean).join(" ") || void 0, Oe = K && !y ? /* @__PURE__ */ n("div", {
|
|
518
|
+
ref: V,
|
|
461
519
|
className: N.panel,
|
|
462
520
|
role: "dialog",
|
|
463
|
-
"aria-label": o ??
|
|
464
|
-
style:
|
|
465
|
-
top:
|
|
466
|
-
left:
|
|
467
|
-
maxHeight:
|
|
521
|
+
"aria-label": o ?? Te,
|
|
522
|
+
style: ge ? {
|
|
523
|
+
top: ge.top,
|
|
524
|
+
left: ge.left,
|
|
525
|
+
maxHeight: ge.maxHeight
|
|
468
526
|
} : {
|
|
469
527
|
visibility: "hidden",
|
|
470
528
|
top: 0,
|
|
471
529
|
left: 0
|
|
472
530
|
},
|
|
473
|
-
children: [
|
|
531
|
+
children: [Z && /* @__PURE__ */ n(e, { children: [
|
|
474
532
|
/* @__PURE__ */ n("div", {
|
|
475
533
|
className: N.calendarHeader,
|
|
476
534
|
children: [
|
|
@@ -478,7 +536,7 @@ var E = {
|
|
|
478
536
|
type: "button",
|
|
479
537
|
className: N.nav,
|
|
480
538
|
"aria-label": "Предыдущий месяц",
|
|
481
|
-
onClick: () =>
|
|
539
|
+
onClick: () => le(new Date(J.getFullYear(), J.getMonth() - 1, 1)),
|
|
482
540
|
children: /* @__PURE__ */ t(A, {
|
|
483
541
|
name: "IconChevron",
|
|
484
542
|
width: 20,
|
|
@@ -489,8 +547,8 @@ var E = {
|
|
|
489
547
|
/* @__PURE__ */ t("select", {
|
|
490
548
|
className: N.monthSelect,
|
|
491
549
|
"aria-label": "Месяц",
|
|
492
|
-
value:
|
|
493
|
-
onChange: (e) =>
|
|
550
|
+
value: J.getMonth(),
|
|
551
|
+
onChange: (e) => le(new Date(J.getFullYear(), Number(e.target.value), 1)),
|
|
494
552
|
children: F.map((e, n) => /* @__PURE__ */ t("option", {
|
|
495
553
|
value: n,
|
|
496
554
|
children: e
|
|
@@ -500,14 +558,14 @@ var E = {
|
|
|
500
558
|
className: N.yearInput,
|
|
501
559
|
type: "number",
|
|
502
560
|
"aria-label": "Год",
|
|
503
|
-
value:
|
|
504
|
-
onChange: (e) =>
|
|
561
|
+
value: J.getFullYear(),
|
|
562
|
+
onChange: (e) => le(new Date(Number(e.target.value), J.getMonth(), 1))
|
|
505
563
|
}),
|
|
506
564
|
/* @__PURE__ */ t("button", {
|
|
507
565
|
type: "button",
|
|
508
566
|
className: N.nav,
|
|
509
567
|
"aria-label": "Следующий месяц",
|
|
510
|
-
onClick: () =>
|
|
568
|
+
onClick: () => le(new Date(J.getFullYear(), J.getMonth() + 1, 1)),
|
|
511
569
|
children: /* @__PURE__ */ t(A, {
|
|
512
570
|
name: "IconChevron",
|
|
513
571
|
width: 20,
|
|
@@ -523,25 +581,25 @@ var E = {
|
|
|
523
581
|
}),
|
|
524
582
|
/* @__PURE__ */ t("div", {
|
|
525
583
|
className: N.days,
|
|
526
|
-
children:
|
|
527
|
-
let n =
|
|
584
|
+
children: ve.map((e) => {
|
|
585
|
+
let n = ae(r, e);
|
|
528
586
|
return /* @__PURE__ */ t("button", {
|
|
529
587
|
type: "button",
|
|
530
|
-
className: `${N.day} ${e.getMonth() ===
|
|
531
|
-
disabled:
|
|
588
|
+
className: `${N.day} ${e.getMonth() === J.getMonth() ? "" : N.outside} ${n ? N.selected : ""}`,
|
|
589
|
+
disabled: oe(e, x, S),
|
|
532
590
|
"aria-pressed": n,
|
|
533
|
-
onClick: () =>
|
|
591
|
+
onClick: () => xe(e),
|
|
534
592
|
children: e.getDate()
|
|
535
593
|
}, e.toISOString());
|
|
536
594
|
})
|
|
537
595
|
})
|
|
538
|
-
] }),
|
|
596
|
+
] }), ye && /* @__PURE__ */ n("label", {
|
|
539
597
|
className: N.timeLabel,
|
|
540
598
|
children: [/* @__PURE__ */ t("span", { children: "Время" }), /* @__PURE__ */ t("input", {
|
|
541
599
|
className: N.timeInput,
|
|
542
600
|
type: "time",
|
|
543
|
-
value:
|
|
544
|
-
onChange: (e) =>
|
|
601
|
+
value: ue,
|
|
602
|
+
onChange: (e) => we(e.target.value)
|
|
545
603
|
})]
|
|
546
604
|
})]
|
|
547
605
|
}) : null;
|
|
@@ -555,7 +613,59 @@ var E = {
|
|
|
555
613
|
disabled: v,
|
|
556
614
|
children: o
|
|
557
615
|
}),
|
|
558
|
-
/* @__PURE__ */ n("
|
|
616
|
+
Z ? /* @__PURE__ */ n("div", {
|
|
617
|
+
className: `${N.trigger} ${N[C]} ${_ ? N.error : ""} ${v ? N.disabled : ""}`,
|
|
618
|
+
children: [
|
|
619
|
+
/* @__PURE__ */ t("input", {
|
|
620
|
+
ref: I,
|
|
621
|
+
id: O,
|
|
622
|
+
name: w,
|
|
623
|
+
className: N.dateInput,
|
|
624
|
+
value: Y,
|
|
625
|
+
placeholder: Te.split(" ")[0],
|
|
626
|
+
inputMode: "numeric",
|
|
627
|
+
autoComplete: "off",
|
|
628
|
+
maxLength: 10,
|
|
629
|
+
disabled: v,
|
|
630
|
+
readOnly: y,
|
|
631
|
+
"aria-expanded": K,
|
|
632
|
+
"aria-haspopup": "dialog",
|
|
633
|
+
"aria-describedby": De,
|
|
634
|
+
"aria-invalid": !!(_ || fe) || void 0,
|
|
635
|
+
onFocus: () => {
|
|
636
|
+
y || q(!0);
|
|
637
|
+
},
|
|
638
|
+
onClick: () => {
|
|
639
|
+
y || q(!0);
|
|
640
|
+
},
|
|
641
|
+
onChange: (e) => Ce(e.target.value)
|
|
642
|
+
}),
|
|
643
|
+
a === "datetime" && ue && /* @__PURE__ */ t("span", {
|
|
644
|
+
className: N.timeValue,
|
|
645
|
+
children: ue
|
|
646
|
+
}),
|
|
647
|
+
/* @__PURE__ */ t("button", {
|
|
648
|
+
type: "button",
|
|
649
|
+
className: N.chevronButton,
|
|
650
|
+
disabled: v || y,
|
|
651
|
+
"aria-label": K ? "Закрыть календарь" : "Открыть календарь",
|
|
652
|
+
tabIndex: -1,
|
|
653
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
654
|
+
onClick: () => {
|
|
655
|
+
q((e) => !e), I.current?.focus();
|
|
656
|
+
},
|
|
657
|
+
children: /* @__PURE__ */ t("span", {
|
|
658
|
+
className: `${N.chevron} ${Oe ? N.chevronOpen : ""}`,
|
|
659
|
+
"aria-hidden": "true",
|
|
660
|
+
children: /* @__PURE__ */ t(A, {
|
|
661
|
+
name: "IconChevron",
|
|
662
|
+
width: 20,
|
|
663
|
+
height: 20
|
|
664
|
+
})
|
|
665
|
+
})
|
|
666
|
+
})
|
|
667
|
+
]
|
|
668
|
+
}) : /* @__PURE__ */ n("button", {
|
|
559
669
|
ref: I,
|
|
560
670
|
id: O,
|
|
561
671
|
name: w,
|
|
@@ -563,17 +673,17 @@ var E = {
|
|
|
563
673
|
className: `${N.trigger} ${N[C]} ${_ ? N.error : ""}`,
|
|
564
674
|
disabled: v,
|
|
565
675
|
"aria-readonly": y || void 0,
|
|
566
|
-
"aria-expanded":
|
|
676
|
+
"aria-expanded": K,
|
|
567
677
|
"aria-haspopup": "dialog",
|
|
568
|
-
"aria-describedby":
|
|
678
|
+
"aria-describedby": De,
|
|
569
679
|
onClick: () => {
|
|
570
|
-
y ||
|
|
680
|
+
y || q((e) => !e);
|
|
571
681
|
},
|
|
572
682
|
children: [/* @__PURE__ */ t("span", {
|
|
573
683
|
className: r ? N.value : N.placeholder,
|
|
574
|
-
children:
|
|
684
|
+
children: re(r, a) || Te
|
|
575
685
|
}), /* @__PURE__ */ t("span", {
|
|
576
|
-
className:
|
|
686
|
+
className: `${N.chevron} ${Oe ? N.chevronOpen : ""}`,
|
|
577
687
|
"aria-hidden": "true",
|
|
578
688
|
children: /* @__PURE__ */ t(A, {
|
|
579
689
|
name: "IconChevron",
|
|
@@ -582,7 +692,14 @@ var E = {
|
|
|
582
692
|
})
|
|
583
693
|
})]
|
|
584
694
|
}),
|
|
585
|
-
|
|
695
|
+
fe && /* @__PURE__ */ t("span", {
|
|
696
|
+
id: Ee,
|
|
697
|
+
className: N.validationTooltip,
|
|
698
|
+
role: "status",
|
|
699
|
+
"aria-live": "polite",
|
|
700
|
+
children: fe
|
|
701
|
+
}, me),
|
|
702
|
+
Oe && h(Oe, document.body),
|
|
586
703
|
g && !_ && /* @__PURE__ */ t(D, {
|
|
587
704
|
id: k,
|
|
588
705
|
children: g
|
|
@@ -594,19 +711,19 @@ var E = {
|
|
|
594
711
|
})
|
|
595
712
|
]
|
|
596
713
|
});
|
|
597
|
-
},
|
|
714
|
+
}, q = {
|
|
598
715
|
root: "_root_q0cvp_1",
|
|
599
716
|
range: "_range_q0cvp_3"
|
|
600
|
-
},
|
|
717
|
+
}, J = (e) => !!(e.from && e.to && e.from.getTime() <= e.to.getTime()), le = ({ value: e, onChange: r, onDraftChange: i, mode: a = "date", fromLabel: o = "От", toLabel: s = "До", hint: c, error: l, min: u, max: d, disabled: f = !1, readOnly: p = !1, required: m = !1, className: h = "" }) => {
|
|
601
718
|
let g = l ?? (e.from && e.to && e.from > e.to ? "Дата «От» не может быть позже даты «До»" : void 0), _ = (e) => {
|
|
602
|
-
i?.(e),
|
|
719
|
+
i?.(e), J(e) && r?.(e);
|
|
603
720
|
};
|
|
604
721
|
return /* @__PURE__ */ n("fieldset", {
|
|
605
|
-
className: `${
|
|
722
|
+
className: `${q.root} ${h}`,
|
|
606
723
|
disabled: f,
|
|
607
724
|
children: [/* @__PURE__ */ n("div", {
|
|
608
|
-
className:
|
|
609
|
-
children: [/* @__PURE__ */ t(
|
|
725
|
+
className: q.range,
|
|
726
|
+
children: [/* @__PURE__ */ t(K, {
|
|
610
727
|
value: e.from,
|
|
611
728
|
mode: a === "datetime" ? "datetime" : a,
|
|
612
729
|
label: o,
|
|
@@ -620,7 +737,7 @@ var E = {
|
|
|
620
737
|
...e,
|
|
621
738
|
from: t
|
|
622
739
|
})
|
|
623
|
-
}), /* @__PURE__ */ t(
|
|
740
|
+
}), /* @__PURE__ */ t(K, {
|
|
624
741
|
value: e.to,
|
|
625
742
|
mode: a === "datetime" ? "datetime" : a,
|
|
626
743
|
label: s,
|
|
@@ -637,7 +754,7 @@ var E = {
|
|
|
637
754
|
})]
|
|
638
755
|
}), c && !g && /* @__PURE__ */ t(D, { children: c })]
|
|
639
756
|
});
|
|
640
|
-
},
|
|
757
|
+
}, ue = {
|
|
641
758
|
group: "_group_1fs9e_1",
|
|
642
759
|
skeleton: "_skeleton_1fs9e_3",
|
|
643
760
|
text: "_text_1fs9e_5",
|
|
@@ -645,53 +762,53 @@ var E = {
|
|
|
645
762
|
circular: "_circular_1fs9e_9",
|
|
646
763
|
animated: "_animated_1fs9e_11",
|
|
647
764
|
"ds-skeleton": "_ds-skeleton_1fs9e_1"
|
|
648
|
-
},
|
|
649
|
-
className: `${
|
|
765
|
+
}, de = ({ variant: e = "text", width: n = "100%", height: r, lines: i = 1, animated: a = !0, className: o = "" }) => /* @__PURE__ */ t("span", {
|
|
766
|
+
className: `${ue.group} ${o}`,
|
|
650
767
|
"aria-hidden": "true",
|
|
651
768
|
children: Array.from({ length: Math.max(1, i) }, (o, s) => /* @__PURE__ */ t("span", {
|
|
652
|
-
className: `${
|
|
769
|
+
className: `${ue.skeleton} ${ue[e]} ${a ? ue.animated : ""}`,
|
|
653
770
|
style: {
|
|
654
771
|
width: s === i - 1 && i > 1 ? "70%" : n,
|
|
655
772
|
height: r
|
|
656
773
|
}
|
|
657
774
|
}, s))
|
|
658
|
-
}),
|
|
659
|
-
wrapper: "
|
|
660
|
-
container: "
|
|
661
|
-
trigger: "
|
|
662
|
-
disabledText: "
|
|
663
|
-
sm: "
|
|
664
|
-
md: "
|
|
665
|
-
lg: "
|
|
666
|
-
value: "
|
|
667
|
-
placeholder: "
|
|
668
|
-
chevron: "
|
|
669
|
-
chevronOpen: "
|
|
670
|
-
menu: "
|
|
671
|
-
option: "
|
|
672
|
-
selected: "
|
|
673
|
-
message: "
|
|
674
|
-
error: "
|
|
675
|
-
errorState: "
|
|
676
|
-
},
|
|
775
|
+
}), Y = {
|
|
776
|
+
wrapper: "_wrapper_c47na_1",
|
|
777
|
+
container: "_container_c47na_17",
|
|
778
|
+
trigger: "_trigger_c47na_25",
|
|
779
|
+
disabledText: "_disabledText_c47na_27",
|
|
780
|
+
sm: "_sm_c47na_53",
|
|
781
|
+
md: "_md_c47na_67",
|
|
782
|
+
lg: "_lg_c47na_81",
|
|
783
|
+
value: "_value_c47na_147",
|
|
784
|
+
placeholder: "_placeholder_c47na_149",
|
|
785
|
+
chevron: "_chevron_c47na_205",
|
|
786
|
+
chevronOpen: "_chevronOpen_c47na_231",
|
|
787
|
+
menu: "_menu_c47na_239",
|
|
788
|
+
option: "_option_c47na_269",
|
|
789
|
+
selected: "_selected_c47na_339",
|
|
790
|
+
message: "_message_c47na_359",
|
|
791
|
+
error: "_error_c47na_361",
|
|
792
|
+
errorState: "_errorState_c47na_387"
|
|
793
|
+
}, X = 8, fe = 6, pe = 120, me = (e, t, n) => {
|
|
677
794
|
if (!e.length) return -1;
|
|
678
795
|
for (let r = 0; r < e.length; r += 1) {
|
|
679
796
|
let i = (t + r * n + e.length) % e.length;
|
|
680
797
|
if (!e[i]?.disabled) return i;
|
|
681
798
|
}
|
|
682
799
|
return -1;
|
|
683
|
-
},
|
|
800
|
+
}, he = (e) => {
|
|
684
801
|
if (typeof e == "number") return e;
|
|
685
802
|
if (typeof e == "string") {
|
|
686
803
|
let t = Number.parseFloat(e);
|
|
687
804
|
if (Number.isFinite(t)) return t;
|
|
688
805
|
}
|
|
689
806
|
return Infinity;
|
|
690
|
-
},
|
|
691
|
-
let T = u(), E = C ?? `ds-dropdown-${S ?? T}`, D = `${E}-listbox`, [O, k] = m(!1), [j, M] = m(null), N = p(null), P = p(null), F = p(null), I = p([]), L = f(() => e.find((e) => e.value === r), [e, r]), R = y ? `${E}-hint` : void 0, z = _ ? `${E}-error` : void 0, B = [R, z].filter(Boolean).join(" ") || void 0,
|
|
807
|
+
}, ge = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опцию", disabled: o = !1, stringWhileDisabled: c = !1, label: g, error: _, size: v = "md", hint: y, className: b = "", required: x = !1, name: S, id: C, needMark: ee = !0, maxMenuHeight: w }) => {
|
|
808
|
+
let T = u(), E = C ?? `ds-dropdown-${S ?? T}`, D = `${E}-listbox`, [O, k] = m(!1), [j, M] = m(null), N = p(null), P = p(null), F = p(null), I = p([]), L = f(() => e.find((e) => e.value === r), [e, r]), R = y ? `${E}-hint` : void 0, z = _ ? `${E}-error` : void 0, B = [R, z].filter(Boolean).join(" ") || void 0, V = o && c, H = s(() => {
|
|
692
809
|
let e = P.current, t = F.current;
|
|
693
810
|
if (!e || !t) return;
|
|
694
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom -
|
|
811
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - X, o = n.top - X, s = a < r.height && o > a, c = Math.max(pe, s ? o : a), l = he(w), u = Math.min(c, l), d = n.left, f = i - n.width - X, p = Math.max(X, Math.min(d, f)), m = s ? Math.max(X, n.top - r.height - fe) : n.bottom + fe;
|
|
695
812
|
M({
|
|
696
813
|
top: m,
|
|
697
814
|
left: p,
|
|
@@ -704,12 +821,12 @@ var E = {
|
|
|
704
821
|
M(null);
|
|
705
822
|
return;
|
|
706
823
|
}
|
|
707
|
-
return
|
|
708
|
-
window.removeEventListener("resize",
|
|
824
|
+
return H(), window.addEventListener("resize", H), window.addEventListener("scroll", H, !0), () => {
|
|
825
|
+
window.removeEventListener("resize", H), window.removeEventListener("scroll", H, !0);
|
|
709
826
|
};
|
|
710
827
|
}, [
|
|
711
828
|
O,
|
|
712
|
-
|
|
829
|
+
H,
|
|
713
830
|
e.length
|
|
714
831
|
]), l(() => {
|
|
715
832
|
if (!O) return;
|
|
@@ -723,17 +840,17 @@ var E = {
|
|
|
723
840
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
724
841
|
};
|
|
725
842
|
}, [O]);
|
|
726
|
-
let
|
|
727
|
-
let r =
|
|
843
|
+
let U = (t, n) => {
|
|
844
|
+
let r = me(e, t, n);
|
|
728
845
|
if (r === -1) return;
|
|
729
846
|
let i = I.current[r];
|
|
730
847
|
i?.focus(), i?.scrollIntoView({ block: "nearest" });
|
|
731
|
-
},
|
|
848
|
+
}, W = (e) => {
|
|
732
849
|
e.disabled || (i?.(e.value, e), k(!1), P.current?.focus());
|
|
733
|
-
},
|
|
850
|
+
}, G = O ? /* @__PURE__ */ t("ul", {
|
|
734
851
|
ref: F,
|
|
735
852
|
id: D,
|
|
736
|
-
className:
|
|
853
|
+
className: Y.menu,
|
|
737
854
|
role: "listbox",
|
|
738
855
|
"aria-label": g,
|
|
739
856
|
style: j ? {
|
|
@@ -762,23 +879,23 @@ var E = {
|
|
|
762
879
|
"aria-selected": o,
|
|
763
880
|
disabled: i.disabled,
|
|
764
881
|
className: [
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
o ?
|
|
882
|
+
Y[v],
|
|
883
|
+
Y.option,
|
|
884
|
+
o ? Y.selected : ""
|
|
768
885
|
].filter(Boolean).join(" "),
|
|
769
|
-
onClick: () =>
|
|
886
|
+
onClick: () => W(i),
|
|
770
887
|
onKeyDown: (t) => {
|
|
771
888
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
772
889
|
t.preventDefault();
|
|
773
890
|
let e = t.key === "ArrowDown" ? 1 : -1;
|
|
774
|
-
|
|
891
|
+
U(a + e, e);
|
|
775
892
|
}
|
|
776
893
|
if (t.key === "Tab" && k(!1), t.key === "Home" || t.key === "End") {
|
|
777
894
|
t.preventDefault();
|
|
778
895
|
let n = t.key === "Home" ? 1 : -1;
|
|
779
|
-
|
|
896
|
+
U(t.key === "Home" ? 0 : e.length - 1, n);
|
|
780
897
|
}
|
|
781
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
898
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), W(i));
|
|
782
899
|
},
|
|
783
900
|
children: [/* @__PURE__ */ t("span", { children: i.label }), o && ee && /* @__PURE__ */ t(A, {
|
|
784
901
|
name: "IconCheck",
|
|
@@ -792,22 +909,22 @@ var E = {
|
|
|
792
909
|
return /* @__PURE__ */ n("div", {
|
|
793
910
|
ref: N,
|
|
794
911
|
className: [
|
|
795
|
-
|
|
796
|
-
_ ?
|
|
912
|
+
Y.wrapper,
|
|
913
|
+
_ ? Y.errorState : "",
|
|
797
914
|
b
|
|
798
915
|
].filter(Boolean).join(" "),
|
|
799
916
|
children: [
|
|
800
917
|
g && /* @__PURE__ */ t(te, {
|
|
801
918
|
required: x,
|
|
802
919
|
disabled: o,
|
|
803
|
-
htmlFor:
|
|
920
|
+
htmlFor: V ? void 0 : E,
|
|
804
921
|
children: g
|
|
805
922
|
}),
|
|
806
923
|
/* @__PURE__ */ t("div", {
|
|
807
|
-
className:
|
|
808
|
-
children:
|
|
924
|
+
className: Y.container,
|
|
925
|
+
children: V ? /* @__PURE__ */ t("div", {
|
|
809
926
|
id: E,
|
|
810
|
-
className:
|
|
927
|
+
className: Y.disabledText,
|
|
811
928
|
"aria-describedby": B,
|
|
812
929
|
children: L?.label ?? a
|
|
813
930
|
}) : /* @__PURE__ */ n("button", {
|
|
@@ -815,7 +932,7 @@ var E = {
|
|
|
815
932
|
id: E,
|
|
816
933
|
type: "button",
|
|
817
934
|
name: S,
|
|
818
|
-
className: `${
|
|
935
|
+
className: `${Y.trigger} ${Y[v]}`,
|
|
819
936
|
disabled: o,
|
|
820
937
|
"aria-haspopup": "listbox",
|
|
821
938
|
"aria-expanded": O,
|
|
@@ -828,21 +945,21 @@ var E = {
|
|
|
828
945
|
t.preventDefault(), k(!0);
|
|
829
946
|
let n = t.key === "ArrowDown" ? 1 : -1;
|
|
830
947
|
requestAnimationFrame(() => {
|
|
831
|
-
|
|
948
|
+
U(t.key === "ArrowDown" ? 0 : e.length - 1, n);
|
|
832
949
|
});
|
|
833
950
|
}
|
|
834
951
|
if (t.key === "Enter" && O) {
|
|
835
952
|
t.preventDefault();
|
|
836
953
|
let n = e.findIndex((e) => e.value === r);
|
|
837
|
-
|
|
954
|
+
U(n >= 0 ? n : 0, 1);
|
|
838
955
|
}
|
|
839
956
|
},
|
|
840
957
|
children: [/* @__PURE__ */ t("span", {
|
|
841
|
-
className: `${L ?
|
|
842
|
-
${
|
|
958
|
+
className: `${L ? Y.value : Y.placeholder}
|
|
959
|
+
${Y[v]}`,
|
|
843
960
|
children: L?.label ?? a
|
|
844
961
|
}), /* @__PURE__ */ t("span", {
|
|
845
|
-
className: [
|
|
962
|
+
className: [Y.chevron, O ? Y.chevronOpen : ""].filter(Boolean).join(" "),
|
|
846
963
|
"aria-hidden": "true",
|
|
847
964
|
children: /* @__PURE__ */ t(A, {
|
|
848
965
|
name: "IconChevron",
|
|
@@ -852,38 +969,38 @@ var E = {
|
|
|
852
969
|
})]
|
|
853
970
|
})
|
|
854
971
|
}),
|
|
855
|
-
O && h(
|
|
972
|
+
O && h(G, document.body),
|
|
856
973
|
y && !_ && /* @__PURE__ */ t("span", {
|
|
857
974
|
id: R,
|
|
858
|
-
className:
|
|
975
|
+
className: Y.message,
|
|
859
976
|
children: y
|
|
860
977
|
}),
|
|
861
978
|
_ && /* @__PURE__ */ t("span", {
|
|
862
979
|
id: z,
|
|
863
|
-
className:
|
|
980
|
+
className: Y.error,
|
|
864
981
|
children: _
|
|
865
982
|
})
|
|
866
983
|
]
|
|
867
984
|
});
|
|
868
|
-
},
|
|
985
|
+
}, _e = (e) => `${e.id}:${e.direction}`, ve = ({ options: e, value: n, onChange: r, label: i = "Сортировка", placeholder: a = "Выберите сортировку", disabled: o = !1, className: s }) => {
|
|
869
986
|
let c = e.flatMap((e) => [{
|
|
870
|
-
value:
|
|
987
|
+
value: _e({
|
|
871
988
|
id: e.id,
|
|
872
989
|
direction: "asc"
|
|
873
990
|
}),
|
|
874
991
|
label: e.ascLabel ?? `${e.label} · по возрастанию`,
|
|
875
992
|
disabled: e.disabled
|
|
876
993
|
}, {
|
|
877
|
-
value:
|
|
994
|
+
value: _e({
|
|
878
995
|
id: e.id,
|
|
879
996
|
direction: "desc"
|
|
880
997
|
}),
|
|
881
998
|
label: e.descLabel ?? `${e.label} · по убыванию`,
|
|
882
999
|
disabled: e.disabled
|
|
883
1000
|
}]);
|
|
884
|
-
return /* @__PURE__ */ t(
|
|
1001
|
+
return /* @__PURE__ */ t(ge, {
|
|
885
1002
|
options: c,
|
|
886
|
-
value: n ?
|
|
1003
|
+
value: n ? _e(n) : "",
|
|
887
1004
|
label: i,
|
|
888
1005
|
placeholder: a,
|
|
889
1006
|
disabled: o,
|
|
@@ -896,33 +1013,39 @@ var E = {
|
|
|
896
1013
|
});
|
|
897
1014
|
}
|
|
898
1015
|
});
|
|
899
|
-
},
|
|
900
|
-
root: "
|
|
901
|
-
tableWrap: "
|
|
902
|
-
table: "
|
|
903
|
-
sticky: "
|
|
904
|
-
sortButton: "
|
|
905
|
-
state: "
|
|
906
|
-
cards: "
|
|
907
|
-
mobileSort: "
|
|
908
|
-
card: "
|
|
909
|
-
spanTwo: "
|
|
910
|
-
clickableRow: "
|
|
911
|
-
pagination: "
|
|
912
|
-
paginationRange: "
|
|
913
|
-
paginationControls: "
|
|
914
|
-
pageNumbers: "
|
|
915
|
-
pageButton: "
|
|
916
|
-
ellipsis: "
|
|
917
|
-
previousIcon: "
|
|
918
|
-
nextIcon: "
|
|
919
|
-
default: "
|
|
920
|
-
tableOnMobile: "
|
|
921
|
-
wide: "
|
|
922
|
-
},
|
|
1016
|
+
}, Z = {
|
|
1017
|
+
root: "_root_l2civ_1",
|
|
1018
|
+
tableWrap: "_tableWrap_l2civ_3",
|
|
1019
|
+
table: "_table_l2civ_3",
|
|
1020
|
+
sticky: "_sticky_l2civ_15",
|
|
1021
|
+
sortButton: "_sortButton_l2civ_17",
|
|
1022
|
+
state: "_state_l2civ_21",
|
|
1023
|
+
cards: "_cards_l2civ_23",
|
|
1024
|
+
mobileSort: "_mobileSort_l2civ_23",
|
|
1025
|
+
card: "_card_l2civ_23",
|
|
1026
|
+
spanTwo: "_spanTwo_l2civ_37",
|
|
1027
|
+
clickableRow: "_clickableRow_l2civ_41",
|
|
1028
|
+
pagination: "_pagination_l2civ_49",
|
|
1029
|
+
paginationRange: "_paginationRange_l2civ_75",
|
|
1030
|
+
paginationControls: "_paginationControls_l2civ_87",
|
|
1031
|
+
pageNumbers: "_pageNumbers_l2civ_89",
|
|
1032
|
+
pageButton: "_pageButton_l2civ_101",
|
|
1033
|
+
ellipsis: "_ellipsis_l2civ_111",
|
|
1034
|
+
previousIcon: "_previousIcon_l2civ_123",
|
|
1035
|
+
nextIcon: "_nextIcon_l2civ_131",
|
|
1036
|
+
default: "_default_l2civ_169",
|
|
1037
|
+
tableOnMobile: "_tableOnMobile_l2civ_169",
|
|
1038
|
+
wide: "_wide_l2civ_173"
|
|
1039
|
+
}, ye = v({
|
|
923
1040
|
rowSortingFeature: _,
|
|
924
1041
|
sortedRowModel: g()
|
|
925
|
-
}),
|
|
1042
|
+
}), be = (e) => {
|
|
1043
|
+
if (!(!e || e.width === void 0 && e.minWidth === void 0 && e.maxWidth === void 0)) return {
|
|
1044
|
+
width: e.width,
|
|
1045
|
+
minWidth: e.minWidth,
|
|
1046
|
+
maxWidth: e.maxWidth
|
|
1047
|
+
};
|
|
1048
|
+
}, xe = (e, t) => t <= 7 ? Array.from({ length: t }, (e, t) => t) : e <= 3 ? [
|
|
926
1049
|
0,
|
|
927
1050
|
1,
|
|
928
1051
|
2,
|
|
@@ -946,7 +1069,7 @@ var E = {
|
|
|
946
1069
|
e + 1,
|
|
947
1070
|
"ellipsis-end",
|
|
948
1071
|
t - 1
|
|
949
|
-
],
|
|
1072
|
+
], Se = (e, t) => {
|
|
950
1073
|
let n = /* @__PURE__ */ new Set();
|
|
951
1074
|
for (let t of e) {
|
|
952
1075
|
if (!t.id.trim()) return "Идентификатор колонки не может быть пустым";
|
|
@@ -958,36 +1081,36 @@ var E = {
|
|
|
958
1081
|
for (let t of e) if (typeof t.accessor == "string" && !(t.accessor in r)) return `В строке ${n + 1} отсутствует колонка «${t.id}»`;
|
|
959
1082
|
}
|
|
960
1083
|
return null;
|
|
961
|
-
},
|
|
1084
|
+
}, Ce = (e, t) => typeof e == "function" ? e(t) : t[e], we = (e) => {
|
|
962
1085
|
if (e == null || e === "") return null;
|
|
963
1086
|
let t = Date.parse(String(e));
|
|
964
1087
|
return Number.isNaN(t) ? null : t;
|
|
965
|
-
},
|
|
966
|
-
let r =
|
|
1088
|
+
}, Te = (e, t, n) => {
|
|
1089
|
+
let r = we(e.getValue(n)), i = we(t.getValue(n));
|
|
967
1090
|
return r === null && i === null ? 0 : r === null ? -1 : i === null ? 1 : r - i;
|
|
968
|
-
},
|
|
1091
|
+
}, Ee = (e, t, n) => {
|
|
969
1092
|
let r = e.getValue(n), i = t.getValue(n);
|
|
970
1093
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(r) - Number(i);
|
|
971
|
-
},
|
|
1094
|
+
}, De = (e, t, n) => {
|
|
972
1095
|
let r = e.getValue(n), i = t.getValue(n);
|
|
973
1096
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(!!r) - Number(!!i);
|
|
974
|
-
},
|
|
1097
|
+
}, Oe = (e, t, n) => {
|
|
975
1098
|
let r = String(e.getValue(n) ?? ""), i = String(t.getValue(n) ?? "");
|
|
976
1099
|
return r.localeCompare(i, void 0, {
|
|
977
1100
|
numeric: !0,
|
|
978
1101
|
sensitivity: "base"
|
|
979
1102
|
});
|
|
980
|
-
},
|
|
1103
|
+
}, ke = (e) => {
|
|
981
1104
|
switch (e) {
|
|
982
|
-
case "date": return
|
|
983
|
-
case "number": return
|
|
984
|
-
case "boolean": return
|
|
1105
|
+
case "date": return Te;
|
|
1106
|
+
case "number": return Ee;
|
|
1107
|
+
case "boolean": return De;
|
|
985
1108
|
case "text":
|
|
986
|
-
case void 0: return
|
|
1109
|
+
case void 0: return Oe;
|
|
987
1110
|
case "custom": return;
|
|
988
1111
|
}
|
|
989
|
-
},
|
|
990
|
-
let t = (t) =>
|
|
1112
|
+
}, Ae = (e) => {
|
|
1113
|
+
let t = (t) => Ce(e.accessor, t), n = e.sortFn ?? ke(e.dataType), r = e.enableSorting ?? (e.dataType !== "custom" && n !== void 0), i = {
|
|
991
1114
|
id: e.id,
|
|
992
1115
|
accessorFn: t,
|
|
993
1116
|
header: () => e.header,
|
|
@@ -999,13 +1122,13 @@ var E = {
|
|
|
999
1122
|
sortDescFirst: e.sortDescFirst
|
|
1000
1123
|
};
|
|
1001
1124
|
return n !== void 0 && (i.sortFn = n), i;
|
|
1002
|
-
},
|
|
1125
|
+
}, je = ({ columns: e, data: r, tableOnMobile: i = !1, breakpoint: a = "default", sorting: o, onSortingChange: s, renderMobileCard: c, getRowId: u, caption: d, ariaLabel: p, loading: h = !1, error: g, emptyState: _ = "Нет данных", stickyHeader: v = !1, maxHeight: b, className: x = "", onRowClick: S, pagination: C = !1, pageSize: ee = 30, visibleColumnIds: w }) => {
|
|
1003
1126
|
let [E, te] = m([]), [D, O] = m(0), k = o ?? E, j = k.map((e) => `${e.id}:${e.desc ? "desc" : "asc"}`).join("|"), M = Number.isFinite(ee) && ee > 0 ? Math.floor(ee) : 30, N = f(() => {
|
|
1004
1127
|
if (w === void 0) return e;
|
|
1005
1128
|
let t = new Set(w);
|
|
1006
1129
|
return e.filter((e) => t.has(e.id));
|
|
1007
|
-
}, [e, w]), P = f(() => N.length === 0 ? "Должна быть видима хотя бы одна колонка" :
|
|
1008
|
-
features:
|
|
1130
|
+
}, [e, w]), P = f(() => N.length === 0 ? "Должна быть видима хотя бы одна колонка" : Se(N, r), [r, N]), F = f(() => N.map(Ae), [N]), I = N.some((e) => be(e) !== void 0), L = y({
|
|
1131
|
+
features: ye,
|
|
1009
1132
|
columns: F,
|
|
1010
1133
|
data: r,
|
|
1011
1134
|
state: { sorting: k },
|
|
@@ -1014,20 +1137,20 @@ var E = {
|
|
|
1014
1137
|
o === void 0 && te(t), O(0), s?.(t);
|
|
1015
1138
|
},
|
|
1016
1139
|
getRowId: u
|
|
1017
|
-
}),
|
|
1140
|
+
}), R = L.getRowModel().rows, z = C ? Math.max(1, Math.ceil(R.length / M)) : 1, B = Math.min(D, z - 1), V = f(() => C ? R.slice(B * M, (B + 1) * M) : R, [
|
|
1018
1141
|
M,
|
|
1019
1142
|
C,
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
]),
|
|
1143
|
+
B,
|
|
1144
|
+
R
|
|
1145
|
+
]), H = f(() => N.filter((e) => e.enableSorting ?? e.dataType !== "custom").map((e) => ({
|
|
1023
1146
|
id: e.id,
|
|
1024
1147
|
label: typeof e.header == "string" ? e.header : e.id
|
|
1025
|
-
})), [N]),
|
|
1026
|
-
|
|
1027
|
-
a === "wide" ?
|
|
1028
|
-
i ?
|
|
1148
|
+
})), [N]), U = f(() => xe(B, z), [z, B]), W = [
|
|
1149
|
+
Z.root,
|
|
1150
|
+
a === "wide" ? Z.wide : Z.default,
|
|
1151
|
+
i ? Z.tableOnMobile : "",
|
|
1029
1152
|
x
|
|
1030
|
-
].filter(Boolean).join(" "),
|
|
1153
|
+
].filter(Boolean).join(" "), G = P ?? g, ne = C && !h && !G && R.length > M, re = B * M + 1, ie = Math.min((B + 1) * M, R.length);
|
|
1031
1154
|
return l(() => {
|
|
1032
1155
|
O(0);
|
|
1033
1156
|
}, [
|
|
@@ -1036,44 +1159,46 @@ var E = {
|
|
|
1036
1159
|
C,
|
|
1037
1160
|
j
|
|
1038
1161
|
]), l(() => {
|
|
1039
|
-
D >=
|
|
1040
|
-
}, [
|
|
1041
|
-
className:
|
|
1162
|
+
D >= z && O(z - 1);
|
|
1163
|
+
}, [z, D]), /* @__PURE__ */ n("section", {
|
|
1164
|
+
className: W,
|
|
1042
1165
|
"aria-busy": h,
|
|
1043
1166
|
children: [
|
|
1044
|
-
!i && !h && !
|
|
1045
|
-
className:
|
|
1046
|
-
options:
|
|
1167
|
+
!i && !h && !G && V.length > 0 && H.length > 0 && /* @__PURE__ */ t(ve, {
|
|
1168
|
+
className: Z.mobileSort,
|
|
1169
|
+
options: H,
|
|
1047
1170
|
value: k[0] ? {
|
|
1048
1171
|
id: k[0].id,
|
|
1049
1172
|
direction: k[0].desc ? "desc" : "asc"
|
|
1050
1173
|
} : null,
|
|
1051
|
-
onChange: (e) =>
|
|
1174
|
+
onChange: (e) => L.setSorting([{
|
|
1052
1175
|
id: e.id,
|
|
1053
1176
|
desc: e.direction === "desc"
|
|
1054
1177
|
}])
|
|
1055
1178
|
}),
|
|
1056
1179
|
/* @__PURE__ */ t("div", {
|
|
1057
|
-
className:
|
|
1180
|
+
className: Z.tableWrap,
|
|
1058
1181
|
style: { maxHeight: b },
|
|
1059
1182
|
children: /* @__PURE__ */ n("table", {
|
|
1060
|
-
className:
|
|
1183
|
+
className: Z.table,
|
|
1061
1184
|
"aria-label": p,
|
|
1062
1185
|
children: [
|
|
1063
1186
|
d && /* @__PURE__ */ t("caption", { children: d }),
|
|
1187
|
+
I && /* @__PURE__ */ t("colgroup", { children: N.map((e) => /* @__PURE__ */ t("col", { style: be(e) }, e.id)) }),
|
|
1064
1188
|
/* @__PURE__ */ t("thead", {
|
|
1065
|
-
className: v ?
|
|
1066
|
-
children:
|
|
1189
|
+
className: v ? Z.sticky : "",
|
|
1190
|
+
children: L.getHeaderGroups().map((e) => /* @__PURE__ */ t("tr", { children: e.headers.map((e) => {
|
|
1067
1191
|
let r = e.column.getIsSorted(), i = e.column.getCanSort(), a = e.column.getToggleSortingHandler();
|
|
1068
1192
|
return /* @__PURE__ */ t("th", {
|
|
1069
1193
|
scope: "col",
|
|
1070
1194
|
"aria-sort": r === "asc" ? "ascending" : r === "desc" ? "descending" : "none",
|
|
1195
|
+
style: be(N.find((t) => t.id === e.column.id)),
|
|
1071
1196
|
children: /* @__PURE__ */ n("button", {
|
|
1072
1197
|
type: "button",
|
|
1073
|
-
className:
|
|
1198
|
+
className: Z.sortButton,
|
|
1074
1199
|
disabled: !i,
|
|
1075
1200
|
onClick: a,
|
|
1076
|
-
children: [/* @__PURE__ */ t(
|
|
1201
|
+
children: [/* @__PURE__ */ t(L.FlexRender, { header: e }), /* @__PURE__ */ t(A, {
|
|
1077
1202
|
name: r === "asc" ? "IconSortAscending" : r === "desc" ? "IconSortDescending" : "IconSort",
|
|
1078
1203
|
width: 16,
|
|
1079
1204
|
height: 16
|
|
@@ -1084,39 +1209,42 @@ var E = {
|
|
|
1084
1209
|
}),
|
|
1085
1210
|
/* @__PURE__ */ t("tbody", { children: h ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
1086
1211
|
colSpan: N.length,
|
|
1087
|
-
children: /* @__PURE__ */ t(
|
|
1088
|
-
}) }) :
|
|
1089
|
-
className:
|
|
1212
|
+
children: /* @__PURE__ */ t(de, { lines: 3 })
|
|
1213
|
+
}) }) : G ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
1214
|
+
className: Z.state,
|
|
1090
1215
|
colSpan: N.length,
|
|
1091
|
-
children:
|
|
1092
|
-
}) }) :
|
|
1093
|
-
className:
|
|
1216
|
+
children: G
|
|
1217
|
+
}) }) : V.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
1218
|
+
className: Z.state,
|
|
1094
1219
|
colSpan: N.length,
|
|
1095
1220
|
children: _
|
|
1096
|
-
}) }) :
|
|
1097
|
-
className: S ?
|
|
1221
|
+
}) }) : V.map((e) => /* @__PURE__ */ t("tr", {
|
|
1222
|
+
className: S ? Z.clickableRow : void 0,
|
|
1098
1223
|
onClick: () => S?.(e.original),
|
|
1099
1224
|
onKeyDown: (t) => {
|
|
1100
1225
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), S?.(e.original));
|
|
1101
1226
|
},
|
|
1102
1227
|
tabIndex: S ? 0 : void 0,
|
|
1103
1228
|
role: S ? "button" : void 0,
|
|
1104
|
-
children: e.getAllCells().map((e) => /* @__PURE__ */ t("td", {
|
|
1229
|
+
children: e.getAllCells().map((e) => /* @__PURE__ */ t("td", {
|
|
1230
|
+
style: be(N.find((t) => t.id === e.column.id)),
|
|
1231
|
+
children: /* @__PURE__ */ t(L.FlexRender, { cell: e })
|
|
1232
|
+
}, e.id))
|
|
1105
1233
|
}, e.id)) })
|
|
1106
1234
|
]
|
|
1107
1235
|
})
|
|
1108
1236
|
}),
|
|
1109
1237
|
!i && /* @__PURE__ */ t("div", {
|
|
1110
|
-
className:
|
|
1238
|
+
className: Z.cards,
|
|
1111
1239
|
role: "list",
|
|
1112
1240
|
"aria-label": p ?? d,
|
|
1113
|
-
children: h ? /* @__PURE__ */ t(
|
|
1114
|
-
className:
|
|
1115
|
-
children:
|
|
1116
|
-
}) :
|
|
1117
|
-
className:
|
|
1241
|
+
children: h ? /* @__PURE__ */ t(de, { lines: 4 }) : G ? /* @__PURE__ */ t("div", {
|
|
1242
|
+
className: Z.state,
|
|
1243
|
+
children: G
|
|
1244
|
+
}) : V.length === 0 ? /* @__PURE__ */ t("div", {
|
|
1245
|
+
className: Z.state,
|
|
1118
1246
|
children: _
|
|
1119
|
-
}) :
|
|
1247
|
+
}) : V.map((e) => {
|
|
1120
1248
|
if (c) return /* @__PURE__ */ t("div", {
|
|
1121
1249
|
role: "listitem",
|
|
1122
1250
|
children: c({
|
|
@@ -1124,14 +1252,14 @@ var E = {
|
|
|
1124
1252
|
columns: N
|
|
1125
1253
|
})
|
|
1126
1254
|
}, e.id);
|
|
1127
|
-
let r = N.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), i = r.find((e) => e.mobile?.primary) ?? r.find((e) => e.mobile?.mobileVariant !== "actions"), a = (t) =>
|
|
1255
|
+
let r = N.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), i = r.find((e) => e.mobile?.primary) ?? r.find((e) => e.mobile?.mobileVariant !== "actions"), a = (t) => Ce(t.accessor, e.original), o = (t) => t.mobile?.renderMobile?.(e.original, a(t)) ?? t.cell?.(e.original, a(t)) ?? String(a(t) ?? "");
|
|
1128
1256
|
return /* @__PURE__ */ n("article", {
|
|
1129
1257
|
role: "listitem",
|
|
1130
|
-
className:
|
|
1258
|
+
className: Z.card,
|
|
1131
1259
|
children: [
|
|
1132
1260
|
/* @__PURE__ */ t("h3", { children: i ? o(i) : `Строка ${e.index + 1}` }),
|
|
1133
1261
|
/* @__PURE__ */ t("dl", { children: r.filter((e) => e !== i && e.mobile?.mobileVariant !== "actions").map((e) => /* @__PURE__ */ n("div", {
|
|
1134
|
-
className: e.mobile?.mobileSpan === 2 ?
|
|
1262
|
+
className: e.mobile?.mobileSpan === 2 ? Z.spanTwo : "",
|
|
1135
1263
|
children: [/* @__PURE__ */ t("dt", { children: e.mobile?.mobileLabel ?? e.header }), /* @__PURE__ */ t("dd", { children: o(e) })]
|
|
1136
1264
|
}, e.id)) }),
|
|
1137
1265
|
r.filter((e) => e.mobile?.mobileVariant === "actions").map((e) => /* @__PURE__ */ t("footer", { children: o(e) }, e.id))
|
|
@@ -1139,26 +1267,26 @@ var E = {
|
|
|
1139
1267
|
}, e.id);
|
|
1140
1268
|
})
|
|
1141
1269
|
}),
|
|
1142
|
-
|
|
1143
|
-
className:
|
|
1270
|
+
ne && /* @__PURE__ */ n("nav", {
|
|
1271
|
+
className: Z.pagination,
|
|
1144
1272
|
"aria-label": "Пагинация таблицы",
|
|
1145
1273
|
children: [/* @__PURE__ */ n("span", {
|
|
1146
|
-
className:
|
|
1274
|
+
className: Z.paginationRange,
|
|
1147
1275
|
"aria-live": "polite",
|
|
1148
1276
|
children: [
|
|
1149
|
-
|
|
1277
|
+
re,
|
|
1150
1278
|
"–",
|
|
1151
|
-
|
|
1279
|
+
ie,
|
|
1152
1280
|
" из ",
|
|
1153
|
-
|
|
1281
|
+
R.length
|
|
1154
1282
|
]
|
|
1155
1283
|
}), /* @__PURE__ */ n("div", {
|
|
1156
|
-
className:
|
|
1284
|
+
className: Z.paginationControls,
|
|
1157
1285
|
children: [
|
|
1158
1286
|
/* @__PURE__ */ n(T, {
|
|
1159
1287
|
variant: "empty",
|
|
1160
1288
|
size: "md",
|
|
1161
|
-
disabled:
|
|
1289
|
+
disabled: B === 0,
|
|
1162
1290
|
"aria-label": "Предыдущая страница",
|
|
1163
1291
|
onClick: () => {
|
|
1164
1292
|
O((e) => Math.max(0, e - 1));
|
|
@@ -1167,26 +1295,26 @@ var E = {
|
|
|
1167
1295
|
name: "IconChevron",
|
|
1168
1296
|
width: 18,
|
|
1169
1297
|
height: 18,
|
|
1170
|
-
className:
|
|
1298
|
+
className: Z.previousIcon
|
|
1171
1299
|
}), /* @__PURE__ */ t("span", {
|
|
1172
|
-
className:
|
|
1300
|
+
className: Z.paginationButtonLabel,
|
|
1173
1301
|
children: "Назад"
|
|
1174
1302
|
})]
|
|
1175
1303
|
}),
|
|
1176
1304
|
/* @__PURE__ */ t("div", {
|
|
1177
|
-
className:
|
|
1178
|
-
children:
|
|
1179
|
-
variant: e ===
|
|
1305
|
+
className: Z.pageNumbers,
|
|
1306
|
+
children: U.map((e) => typeof e == "number" ? /* @__PURE__ */ t(T, {
|
|
1307
|
+
variant: e === B ? "secondary" : "empty",
|
|
1180
1308
|
size: "md",
|
|
1181
|
-
className:
|
|
1309
|
+
className: Z.pageButton,
|
|
1182
1310
|
"aria-label": `Перейти на страницу ${e + 1}`,
|
|
1183
|
-
"aria-current": e ===
|
|
1311
|
+
"aria-current": e === B ? "page" : void 0,
|
|
1184
1312
|
onClick: () => {
|
|
1185
1313
|
O(e);
|
|
1186
1314
|
},
|
|
1187
1315
|
children: e + 1
|
|
1188
1316
|
}, e) : /* @__PURE__ */ t("span", {
|
|
1189
|
-
className:
|
|
1317
|
+
className: Z.ellipsis,
|
|
1190
1318
|
"aria-hidden": "true",
|
|
1191
1319
|
children: "…"
|
|
1192
1320
|
}, e))
|
|
@@ -1194,19 +1322,19 @@ var E = {
|
|
|
1194
1322
|
/* @__PURE__ */ n(T, {
|
|
1195
1323
|
variant: "empty",
|
|
1196
1324
|
size: "md",
|
|
1197
|
-
disabled:
|
|
1325
|
+
disabled: B === z - 1,
|
|
1198
1326
|
"aria-label": "Следующая страница",
|
|
1199
1327
|
onClick: () => {
|
|
1200
|
-
O((e) => Math.min(
|
|
1328
|
+
O((e) => Math.min(z - 1, e + 1));
|
|
1201
1329
|
},
|
|
1202
1330
|
children: [/* @__PURE__ */ t("span", {
|
|
1203
|
-
className:
|
|
1331
|
+
className: Z.paginationButtonLabel,
|
|
1204
1332
|
children: "Вперёд"
|
|
1205
1333
|
}), /* @__PURE__ */ t(A, {
|
|
1206
1334
|
name: "IconChevron",
|
|
1207
1335
|
width: 18,
|
|
1208
1336
|
height: 18,
|
|
1209
|
-
className:
|
|
1337
|
+
className: Z.nextIcon
|
|
1210
1338
|
})]
|
|
1211
1339
|
})
|
|
1212
1340
|
]
|
|
@@ -1214,23 +1342,23 @@ var E = {
|
|
|
1214
1342
|
})
|
|
1215
1343
|
]
|
|
1216
1344
|
});
|
|
1217
|
-
},
|
|
1345
|
+
}, Me = 8, Ne = 6, Pe = 120, Fe = (e) => {
|
|
1218
1346
|
if (typeof e == "number") return e;
|
|
1219
1347
|
if (typeof e == "string") {
|
|
1220
1348
|
let t = Number.parseFloat(e);
|
|
1221
1349
|
if (Number.isFinite(t)) return t;
|
|
1222
1350
|
}
|
|
1223
1351
|
return Infinity;
|
|
1224
|
-
},
|
|
1225
|
-
let E = u(), D = C ?? `ds-dropdown-multiple-${S ?? E}`, O = `${D}-listbox`, [k, j] = m(!1), [M, N] = m(null), P = p(null), F = p(null), I = p(null), L = p([]), R = f(() => e.filter((e) => r.includes(e.value)), [e, r]).map((e) => e.label).join(", "), z = b ? `${D}-hint` : void 0, B = _ ? `${D}-error` : void 0,
|
|
1352
|
+
}, Ie = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опции", disabled: o = !1, stringWhileDisabled: c = !1, label: g, error: _, size: v = "md", required: y = !1, hint: b, className: x = "", name: S, id: C, closeOnSelect: ee = !1, needMark: w = !0, maxMenuHeight: T }) => {
|
|
1353
|
+
let E = u(), D = C ?? `ds-dropdown-multiple-${S ?? E}`, O = `${D}-listbox`, [k, j] = m(!1), [M, N] = m(null), P = p(null), F = p(null), I = p(null), L = p([]), R = f(() => e.filter((e) => r.includes(e.value)), [e, r]).map((e) => e.label).join(", "), z = b ? `${D}-hint` : void 0, B = _ ? `${D}-error` : void 0, V = [z, B].filter(Boolean).join(" ") || void 0, H = o && c, U = s(() => {
|
|
1226
1354
|
let e = F.current, t = I.current;
|
|
1227
1355
|
if (!e || !t) return;
|
|
1228
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerHeight - n.bottom -
|
|
1356
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerHeight - n.bottom - Me, a = n.top - Me, o = i < r.height && a > i, s = Math.max(Pe, o ? a : i), c = window.innerWidth - n.width - Me;
|
|
1229
1357
|
N({
|
|
1230
|
-
top: o ? Math.max(
|
|
1231
|
-
left: Math.max(
|
|
1358
|
+
top: o ? Math.max(Me, n.top - r.height - Ne) : n.bottom + Ne,
|
|
1359
|
+
left: Math.max(Me, Math.min(n.left, c)),
|
|
1232
1360
|
width: n.width,
|
|
1233
|
-
maxHeight: Math.min(s,
|
|
1361
|
+
maxHeight: Math.min(s, Fe(T))
|
|
1234
1362
|
});
|
|
1235
1363
|
}, [T]);
|
|
1236
1364
|
d(() => {
|
|
@@ -1238,13 +1366,13 @@ var E = {
|
|
|
1238
1366
|
N(null);
|
|
1239
1367
|
return;
|
|
1240
1368
|
}
|
|
1241
|
-
return
|
|
1242
|
-
window.removeEventListener("resize",
|
|
1369
|
+
return U(), window.addEventListener("resize", U), window.addEventListener("scroll", U, !0), () => {
|
|
1370
|
+
window.removeEventListener("resize", U), window.removeEventListener("scroll", U, !0);
|
|
1243
1371
|
};
|
|
1244
1372
|
}, [
|
|
1245
1373
|
k,
|
|
1246
1374
|
e.length,
|
|
1247
|
-
|
|
1375
|
+
U
|
|
1248
1376
|
]), l(() => {
|
|
1249
1377
|
if (!k) return;
|
|
1250
1378
|
let e = (e) => {
|
|
@@ -1257,17 +1385,17 @@ var E = {
|
|
|
1257
1385
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
1258
1386
|
};
|
|
1259
1387
|
}, [k]);
|
|
1260
|
-
let
|
|
1261
|
-
let r =
|
|
1388
|
+
let W = (t, n) => {
|
|
1389
|
+
let r = me(e, t, n);
|
|
1262
1390
|
r !== -1 && (L.current[r]?.focus(), L.current[r]?.scrollIntoView({ block: "nearest" }));
|
|
1263
|
-
},
|
|
1391
|
+
}, G = (t) => {
|
|
1264
1392
|
if (t.disabled) return;
|
|
1265
1393
|
let n = r.includes(t.value) ? r.filter((e) => e !== t.value) : [...r, t.value];
|
|
1266
1394
|
i?.(n, e.filter((e) => n.includes(e.value))), ee && (j(!1), F.current?.focus());
|
|
1267
|
-
},
|
|
1395
|
+
}, ne = k ? /* @__PURE__ */ t("ul", {
|
|
1268
1396
|
ref: I,
|
|
1269
1397
|
id: O,
|
|
1270
|
-
className:
|
|
1398
|
+
className: Y.menu,
|
|
1271
1399
|
role: "listbox",
|
|
1272
1400
|
"aria-label": g,
|
|
1273
1401
|
"aria-multiselectable": "true",
|
|
@@ -1297,23 +1425,23 @@ var E = {
|
|
|
1297
1425
|
"aria-selected": o,
|
|
1298
1426
|
disabled: i.disabled,
|
|
1299
1427
|
className: [
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
o ?
|
|
1428
|
+
Y[v],
|
|
1429
|
+
Y.option,
|
|
1430
|
+
o ? Y.selected : ""
|
|
1303
1431
|
].filter(Boolean).join(" "),
|
|
1304
|
-
onClick: () =>
|
|
1432
|
+
onClick: () => G(i),
|
|
1305
1433
|
onKeyDown: (t) => {
|
|
1306
1434
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
1307
1435
|
t.preventDefault();
|
|
1308
1436
|
let e = t.key === "ArrowDown" ? 1 : -1;
|
|
1309
|
-
|
|
1437
|
+
W(a + e, e);
|
|
1310
1438
|
}
|
|
1311
1439
|
if (t.key === "Home" || t.key === "End") {
|
|
1312
1440
|
t.preventDefault();
|
|
1313
1441
|
let n = t.key === "Home" ? 1 : -1;
|
|
1314
|
-
|
|
1442
|
+
W(t.key === "Home" ? 0 : e.length - 1, n);
|
|
1315
1443
|
}
|
|
1316
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
1444
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), G(i)), t.key === "Tab" && j(!1);
|
|
1317
1445
|
},
|
|
1318
1446
|
children: [/* @__PURE__ */ t("span", { children: i.label }), o && w && /* @__PURE__ */ t(A, {
|
|
1319
1447
|
name: "IconCheck",
|
|
@@ -1327,49 +1455,49 @@ var E = {
|
|
|
1327
1455
|
return /* @__PURE__ */ n("div", {
|
|
1328
1456
|
ref: P,
|
|
1329
1457
|
className: [
|
|
1330
|
-
|
|
1331
|
-
_ ?
|
|
1458
|
+
Y.wrapper,
|
|
1459
|
+
_ ? Y.errorState : "",
|
|
1332
1460
|
x
|
|
1333
1461
|
].filter(Boolean).join(" "),
|
|
1334
1462
|
children: [
|
|
1335
1463
|
g && /* @__PURE__ */ t(te, {
|
|
1336
|
-
htmlFor:
|
|
1464
|
+
htmlFor: H ? void 0 : D,
|
|
1337
1465
|
required: y,
|
|
1338
1466
|
disabled: o,
|
|
1339
1467
|
children: g
|
|
1340
1468
|
}),
|
|
1341
1469
|
/* @__PURE__ */ t("div", {
|
|
1342
|
-
className:
|
|
1343
|
-
children:
|
|
1470
|
+
className: Y.container,
|
|
1471
|
+
children: H ? /* @__PURE__ */ t("div", {
|
|
1344
1472
|
id: D,
|
|
1345
|
-
className: `${
|
|
1346
|
-
"aria-describedby":
|
|
1473
|
+
className: `${Y.disabledText} ${Y[v]}`,
|
|
1474
|
+
"aria-describedby": V,
|
|
1347
1475
|
children: R || a
|
|
1348
1476
|
}) : /* @__PURE__ */ n("button", {
|
|
1349
1477
|
ref: F,
|
|
1350
1478
|
id: D,
|
|
1351
1479
|
type: "button",
|
|
1352
1480
|
name: S,
|
|
1353
|
-
className: `${
|
|
1481
|
+
className: `${Y.trigger} ${Y[v]}`,
|
|
1354
1482
|
disabled: o,
|
|
1355
1483
|
"aria-haspopup": "listbox",
|
|
1356
1484
|
"aria-expanded": k,
|
|
1357
1485
|
"aria-controls": O,
|
|
1358
|
-
"aria-describedby":
|
|
1486
|
+
"aria-describedby": V,
|
|
1359
1487
|
"aria-invalid": !!_,
|
|
1360
1488
|
onClick: () => j((e) => !e),
|
|
1361
1489
|
onKeyDown: (t) => {
|
|
1362
1490
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
1363
1491
|
t.preventDefault(), j(!0);
|
|
1364
1492
|
let n = t.key === "ArrowDown" ? 1 : -1;
|
|
1365
|
-
requestAnimationFrame(() =>
|
|
1493
|
+
requestAnimationFrame(() => W(t.key === "ArrowDown" ? 0 : e.length - 1, n));
|
|
1366
1494
|
}
|
|
1367
1495
|
},
|
|
1368
1496
|
children: [/* @__PURE__ */ t("span", {
|
|
1369
|
-
className: `${R ?
|
|
1497
|
+
className: `${R ? Y.value : Y.placeholder} ${Y[v]}`,
|
|
1370
1498
|
children: R || a
|
|
1371
1499
|
}), /* @__PURE__ */ t("span", {
|
|
1372
|
-
className: [
|
|
1500
|
+
className: [Y.chevron, k ? Y.chevronOpen : ""].filter(Boolean).join(" "),
|
|
1373
1501
|
"aria-hidden": "true",
|
|
1374
1502
|
children: /* @__PURE__ */ t(A, {
|
|
1375
1503
|
name: "IconChevron",
|
|
@@ -1379,35 +1507,35 @@ var E = {
|
|
|
1379
1507
|
})]
|
|
1380
1508
|
})
|
|
1381
1509
|
}),
|
|
1382
|
-
k && h(
|
|
1510
|
+
k && h(ne, document.body),
|
|
1383
1511
|
b && !_ && /* @__PURE__ */ t("span", {
|
|
1384
1512
|
id: z,
|
|
1385
|
-
className:
|
|
1513
|
+
className: Y.message,
|
|
1386
1514
|
children: b
|
|
1387
1515
|
}),
|
|
1388
1516
|
_ && /* @__PURE__ */ t("span", {
|
|
1389
1517
|
id: B,
|
|
1390
|
-
className:
|
|
1518
|
+
className: Y.error,
|
|
1391
1519
|
children: _
|
|
1392
1520
|
})
|
|
1393
1521
|
]
|
|
1394
1522
|
});
|
|
1395
|
-
},
|
|
1396
|
-
wrapper: "
|
|
1397
|
-
control: "
|
|
1398
|
-
input: "
|
|
1399
|
-
disabledText: "
|
|
1400
|
-
sm: "
|
|
1401
|
-
md: "
|
|
1402
|
-
lg: "
|
|
1403
|
-
inputError: "
|
|
1404
|
-
trailingAction: "
|
|
1405
|
-
},
|
|
1523
|
+
}, Le = {
|
|
1524
|
+
wrapper: "_wrapper_nptih_1",
|
|
1525
|
+
control: "_control_nptih_3",
|
|
1526
|
+
input: "_input_nptih_7",
|
|
1527
|
+
disabledText: "_disabledText_nptih_7",
|
|
1528
|
+
sm: "_sm_nptih_51",
|
|
1529
|
+
md: "_md_nptih_67",
|
|
1530
|
+
lg: "_lg_nptih_83",
|
|
1531
|
+
inputError: "_inputError_nptih_99",
|
|
1532
|
+
trailingAction: "_trailingAction_nptih_101"
|
|
1533
|
+
}, Re = ({ value: e, onChange: r, type: i = "text", placeholder: a = "", disabled: o = !1, readOnly: s = !1, stringWhileDisabled: c = !1, label: d, error: f, hint: h, className: g = "", name: _, id: v, size: y = "md", clearable: b = !0, required: x = !1, selectTextOnFocus: S = !1, isPassword: C = !1, passwordVisibleLabel: ee = "Скрыть пароль", passwordHiddenLabel: w = "Показать пароль", onFocus: T, ...E }) => {
|
|
1406
1534
|
let O = u(), k = v ?? `ds-input-${_ ?? O}`, j = p(null), [M, N] = m(!1), P = h ? `${k}-hint` : void 0, F = f ? `${k}-error` : void 0, I = String(e ?? ""), L = [P, F].filter(Boolean).join(" ") || void 0, R = C ? M ? "text" : "password" : i;
|
|
1407
1535
|
return l(() => {
|
|
1408
1536
|
C || N(!1);
|
|
1409
1537
|
}, [C]), /* @__PURE__ */ n("div", {
|
|
1410
|
-
className: `${
|
|
1538
|
+
className: `${Le.wrapper} ${g}`,
|
|
1411
1539
|
children: [
|
|
1412
1540
|
d && /* @__PURE__ */ t(te, {
|
|
1413
1541
|
htmlFor: k,
|
|
@@ -1417,11 +1545,11 @@ var E = {
|
|
|
1417
1545
|
}),
|
|
1418
1546
|
o && c ? /* @__PURE__ */ t("div", {
|
|
1419
1547
|
id: k,
|
|
1420
|
-
className:
|
|
1548
|
+
className: Le.disabledText,
|
|
1421
1549
|
"aria-describedby": L,
|
|
1422
1550
|
children: I || a
|
|
1423
1551
|
}) : /* @__PURE__ */ n("div", {
|
|
1424
|
-
className:
|
|
1552
|
+
className: Le.control,
|
|
1425
1553
|
children: [
|
|
1426
1554
|
/* @__PURE__ */ t("input", {
|
|
1427
1555
|
ref: j,
|
|
@@ -1435,7 +1563,7 @@ var E = {
|
|
|
1435
1563
|
required: x,
|
|
1436
1564
|
"aria-invalid": !!f,
|
|
1437
1565
|
"aria-describedby": L,
|
|
1438
|
-
className: `${
|
|
1566
|
+
className: `${Le.input} ${Le[y]} ${f ? Le.inputError : ""}`,
|
|
1439
1567
|
onChange: (e) => {
|
|
1440
1568
|
if (i === "number" && !C) {
|
|
1441
1569
|
let t = e.target.value === "" ? "" : Number(e.target.value);
|
|
@@ -1451,7 +1579,7 @@ var E = {
|
|
|
1451
1579
|
}),
|
|
1452
1580
|
C && /* @__PURE__ */ t("button", {
|
|
1453
1581
|
type: "button",
|
|
1454
|
-
className:
|
|
1582
|
+
className: Le.trailingAction,
|
|
1455
1583
|
disabled: o,
|
|
1456
1584
|
"aria-label": M ? ee : w,
|
|
1457
1585
|
"aria-pressed": M,
|
|
@@ -1464,7 +1592,7 @@ var E = {
|
|
|
1464
1592
|
}),
|
|
1465
1593
|
!C && b && I && !o && !s && /* @__PURE__ */ t("button", {
|
|
1466
1594
|
type: "button",
|
|
1467
|
-
className:
|
|
1595
|
+
className: Le.trailingAction,
|
|
1468
1596
|
"aria-label": "Очистить поле",
|
|
1469
1597
|
onClick: () => {
|
|
1470
1598
|
let e = j.current;
|
|
@@ -1489,103 +1617,103 @@ var E = {
|
|
|
1489
1617
|
})
|
|
1490
1618
|
]
|
|
1491
1619
|
});
|
|
1492
|
-
},
|
|
1620
|
+
}, ze = (e, t) => {
|
|
1493
1621
|
let n = t.trim().toLocaleLowerCase();
|
|
1494
1622
|
return n ? e.filter((e) => e.label.toLocaleLowerCase().includes(n) || e.value.toLocaleLowerCase().includes(n)) : e;
|
|
1495
|
-
},
|
|
1623
|
+
}, Be = (e, t, n) => {
|
|
1496
1624
|
if (!e.length) return -1;
|
|
1497
1625
|
for (let r = 0; r < e.length; r += 1) {
|
|
1498
1626
|
let i = (t + r * n + e.length) % e.length;
|
|
1499
1627
|
if (!e[i]?.disabled) return i;
|
|
1500
1628
|
}
|
|
1501
1629
|
return -1;
|
|
1502
|
-
},
|
|
1503
|
-
wrapper: "
|
|
1504
|
-
control: "
|
|
1505
|
-
inputHost: "
|
|
1506
|
-
sm: "
|
|
1507
|
-
md: "
|
|
1508
|
-
lg: "
|
|
1509
|
-
errorState: "
|
|
1510
|
-
disabledText: "
|
|
1511
|
-
chevron: "
|
|
1512
|
-
chevronOpen: "
|
|
1513
|
-
menu: "
|
|
1514
|
-
option: "
|
|
1515
|
-
empty: "
|
|
1516
|
-
selected: "
|
|
1517
|
-
active: "
|
|
1518
|
-
visuallyHidden: "
|
|
1519
|
-
},
|
|
1630
|
+
}, Q = {
|
|
1631
|
+
wrapper: "_wrapper_13nh5_1",
|
|
1632
|
+
control: "_control_13nh5_5",
|
|
1633
|
+
inputHost: "_inputHost_13nh5_9",
|
|
1634
|
+
sm: "_sm_13nh5_25",
|
|
1635
|
+
md: "_md_13nh5_41",
|
|
1636
|
+
lg: "_lg_13nh5_55",
|
|
1637
|
+
errorState: "_errorState_13nh5_69",
|
|
1638
|
+
disabledText: "_disabledText_13nh5_77",
|
|
1639
|
+
chevron: "_chevron_13nh5_119",
|
|
1640
|
+
chevronOpen: "_chevronOpen_13nh5_143",
|
|
1641
|
+
menu: "_menu_13nh5_147",
|
|
1642
|
+
option: "_option_13nh5_175",
|
|
1643
|
+
empty: "_empty_13nh5_175",
|
|
1644
|
+
selected: "_selected_13nh5_219",
|
|
1645
|
+
active: "_active_13nh5_219",
|
|
1646
|
+
visuallyHidden: "_visuallyHidden_13nh5_231"
|
|
1647
|
+
}, Ve = 8, He = 6, Ue = 5, We = {
|
|
1520
1648
|
sm: 20,
|
|
1521
1649
|
md: 30,
|
|
1522
1650
|
lg: 40
|
|
1523
|
-
},
|
|
1651
|
+
}, Ge = ({ options: e, value: r, onChange: i, placeholder: a = "Начните вводить", noResultsText: o = "Ничего не найдено", disabled: c = !1, readOnly: g = !1, stringWhileDisabled: _ = !1, label: v, error: y, hint: b, size: x = "md", required: S = !1, className: C = "", name: ee, id: w, needMark: T = !0 }) => {
|
|
1524
1652
|
let E = u(), O = w ?? `ds-search-dropdown-${ee ?? E}`, k = `${O}-listbox`, j = `${O}-status`, M = b ? `${O}-hint` : void 0, N = y ? `${O}-error` : void 0, P = [
|
|
1525
1653
|
j,
|
|
1526
1654
|
M,
|
|
1527
1655
|
N
|
|
1528
|
-
].filter(Boolean).join(" "), F = p(null), I = p(null), L = p([]), [R, z] = m(!1), [B,
|
|
1529
|
-
l(() => ne
|
|
1530
|
-
let
|
|
1531
|
-
|
|
1532
|
-
}, []),
|
|
1533
|
-
let e =
|
|
1656
|
+
].filter(Boolean).join(" "), F = p(null), I = p(null), L = p([]), [R, z] = m(!1), [B, V] = m(""), [H, U] = m(-1), [W, G] = m(null), ne = f(() => e.find((e) => e.value === r), [e, r]), re = f(() => ze(e, B), [e, B]), ie = c && _, ae = H >= 0 ? re[H] : void 0;
|
|
1657
|
+
l(() => V(ne?.label ?? ""), [ne?.label, r]);
|
|
1658
|
+
let oe = s(() => F.current?.querySelector("input") ?? null, []), se = s((e, t) => Be(re, e, t), [re]), ce = s((e) => {
|
|
1659
|
+
U(e), !(e < 0) && requestAnimationFrame(() => L.current[e]?.scrollIntoView({ block: "nearest" }));
|
|
1660
|
+
}, []), K = s(() => {
|
|
1661
|
+
let e = oe();
|
|
1534
1662
|
if (!e) return;
|
|
1535
|
-
let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(
|
|
1536
|
-
|
|
1663
|
+
let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(re.length, Ue)) * We[x] + 2, r = window.innerHeight - t.bottom - Ve, i = t.top - Ve, a = r < n && i > r, o = a ? i : r, s = Math.max(We[x] + 2, Math.min(n, o)), c = window.innerWidth - t.width - Ve, l = Math.max(Ve, Math.min(t.left, c)), u = a ? Math.max(Ve, t.top - s - He) : t.bottom + He;
|
|
1664
|
+
G({
|
|
1537
1665
|
top: u,
|
|
1538
1666
|
left: l,
|
|
1539
1667
|
width: t.width,
|
|
1540
1668
|
maxHeight: s
|
|
1541
1669
|
});
|
|
1542
1670
|
}, [
|
|
1543
|
-
|
|
1544
|
-
|
|
1671
|
+
re.length,
|
|
1672
|
+
oe,
|
|
1545
1673
|
x
|
|
1546
1674
|
]);
|
|
1547
1675
|
d(() => {
|
|
1548
1676
|
if (!R) {
|
|
1549
|
-
|
|
1677
|
+
G(null);
|
|
1550
1678
|
return;
|
|
1551
1679
|
}
|
|
1552
|
-
return
|
|
1553
|
-
window.removeEventListener("resize",
|
|
1680
|
+
return K(), window.addEventListener("resize", K), window.addEventListener("scroll", K, !0), () => {
|
|
1681
|
+
window.removeEventListener("resize", K), window.removeEventListener("scroll", K, !0);
|
|
1554
1682
|
};
|
|
1555
|
-
}, [R,
|
|
1683
|
+
}, [R, K]), l(() => {
|
|
1556
1684
|
if (!R) return;
|
|
1557
1685
|
let e = (e) => {
|
|
1558
1686
|
let t = e.target;
|
|
1559
|
-
!F.current?.contains(t) && !I.current?.contains(t) && (z(!1),
|
|
1687
|
+
!F.current?.contains(t) && !I.current?.contains(t) && (z(!1), U(-1));
|
|
1560
1688
|
};
|
|
1561
1689
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1562
1690
|
}, [R]);
|
|
1563
|
-
let
|
|
1564
|
-
c || g || (z(!0),
|
|
1565
|
-
},
|
|
1566
|
-
e.disabled || (
|
|
1567
|
-
},
|
|
1691
|
+
let q = () => {
|
|
1692
|
+
c || g || (z(!0), U(se(0, 1)));
|
|
1693
|
+
}, J = (e) => {
|
|
1694
|
+
e.disabled || (V(e.label), z(!1), U(-1), i?.(e.value, e), oe()?.focus());
|
|
1695
|
+
}, le = R ? /* @__PURE__ */ t("ul", {
|
|
1568
1696
|
ref: I,
|
|
1569
1697
|
id: k,
|
|
1570
|
-
className:
|
|
1698
|
+
className: Q.menu,
|
|
1571
1699
|
role: "listbox",
|
|
1572
1700
|
"aria-label": v,
|
|
1573
|
-
style:
|
|
1574
|
-
top:
|
|
1575
|
-
left:
|
|
1576
|
-
width:
|
|
1577
|
-
maxHeight:
|
|
1701
|
+
style: W ? {
|
|
1702
|
+
top: W.top,
|
|
1703
|
+
left: W.left,
|
|
1704
|
+
width: W.width,
|
|
1705
|
+
maxHeight: W.maxHeight
|
|
1578
1706
|
} : {
|
|
1579
1707
|
top: 0,
|
|
1580
1708
|
left: 0,
|
|
1581
1709
|
visibility: "hidden",
|
|
1582
1710
|
maxHeight: 0
|
|
1583
1711
|
},
|
|
1584
|
-
children:
|
|
1585
|
-
className: `${
|
|
1712
|
+
children: re.length === 0 ? /* @__PURE__ */ t("li", {
|
|
1713
|
+
className: `${Q.empty} ${Q[x]}`,
|
|
1586
1714
|
children: o
|
|
1587
|
-
}) :
|
|
1588
|
-
let a = e.value === r, o = i ===
|
|
1715
|
+
}) : re.map((e, i) => {
|
|
1716
|
+
let a = e.value === r, o = i === H;
|
|
1589
1717
|
return /* @__PURE__ */ t("li", {
|
|
1590
1718
|
role: "presentation",
|
|
1591
1719
|
children: /* @__PURE__ */ n("button", {
|
|
@@ -1600,15 +1728,15 @@ var E = {
|
|
|
1600
1728
|
"aria-disabled": e.disabled,
|
|
1601
1729
|
"aria-selected": a,
|
|
1602
1730
|
className: [
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
a ?
|
|
1606
|
-
o ?
|
|
1731
|
+
Q.option,
|
|
1732
|
+
Q[x],
|
|
1733
|
+
a ? Q.selected : "",
|
|
1734
|
+
o ? Q.active : ""
|
|
1607
1735
|
].filter(Boolean).join(" "),
|
|
1608
1736
|
onPointerMove: () => {
|
|
1609
|
-
e.disabled ||
|
|
1737
|
+
e.disabled || U(i);
|
|
1610
1738
|
},
|
|
1611
|
-
onClick: () =>
|
|
1739
|
+
onClick: () => J(e),
|
|
1612
1740
|
children: [/* @__PURE__ */ t("span", { children: e.label }), a && T && /* @__PURE__ */ t(A, {
|
|
1613
1741
|
name: "IconCheck",
|
|
1614
1742
|
width: 16,
|
|
@@ -1621,23 +1749,23 @@ var E = {
|
|
|
1621
1749
|
return /* @__PURE__ */ n("div", {
|
|
1622
1750
|
ref: F,
|
|
1623
1751
|
className: [
|
|
1624
|
-
|
|
1625
|
-
y ?
|
|
1752
|
+
Q.wrapper,
|
|
1753
|
+
y ? Q.errorState : "",
|
|
1626
1754
|
C
|
|
1627
1755
|
].filter(Boolean).join(" "),
|
|
1628
1756
|
children: [
|
|
1629
1757
|
v && /* @__PURE__ */ t(te, {
|
|
1630
|
-
htmlFor:
|
|
1758
|
+
htmlFor: ie ? void 0 : O,
|
|
1631
1759
|
required: S,
|
|
1632
1760
|
disabled: c,
|
|
1633
1761
|
children: v
|
|
1634
1762
|
}),
|
|
1635
|
-
|
|
1636
|
-
className: `${
|
|
1637
|
-
children:
|
|
1763
|
+
ie ? /* @__PURE__ */ t("div", {
|
|
1764
|
+
className: `${Q.disabledText} ${Q[x]}`,
|
|
1765
|
+
children: ne?.label ?? a
|
|
1638
1766
|
}) : /* @__PURE__ */ n("div", {
|
|
1639
|
-
className:
|
|
1640
|
-
children: [/* @__PURE__ */ t(
|
|
1767
|
+
className: Q.control,
|
|
1768
|
+
children: [/* @__PURE__ */ t(Re, {
|
|
1641
1769
|
id: O,
|
|
1642
1770
|
name: ee,
|
|
1643
1771
|
value: B,
|
|
@@ -1648,36 +1776,36 @@ var E = {
|
|
|
1648
1776
|
size: x,
|
|
1649
1777
|
clearable: !1,
|
|
1650
1778
|
autoComplete: "off",
|
|
1651
|
-
className: `${
|
|
1652
|
-
onFocus:
|
|
1779
|
+
className: `${Q.inputHost} ${Q[x]}`,
|
|
1780
|
+
onFocus: q,
|
|
1653
1781
|
onChange: (t) => {
|
|
1654
|
-
let n = String(t), r =
|
|
1655
|
-
|
|
1782
|
+
let n = String(t), r = ze(e, n);
|
|
1783
|
+
V(n), z(!0), U(Be(r, 0, 1));
|
|
1656
1784
|
},
|
|
1657
1785
|
role: "combobox",
|
|
1658
1786
|
"aria-autocomplete": "list",
|
|
1659
1787
|
"aria-expanded": R,
|
|
1660
1788
|
"aria-controls": k,
|
|
1661
|
-
"aria-activedescendant":
|
|
1789
|
+
"aria-activedescendant": ae ? `${O}-option-${H}` : void 0,
|
|
1662
1790
|
"aria-invalid": !!y,
|
|
1663
1791
|
"aria-describedby": P,
|
|
1664
|
-
onClick:
|
|
1792
|
+
onClick: q,
|
|
1665
1793
|
onKeyDown: (e) => {
|
|
1666
1794
|
if (!(c || g)) {
|
|
1667
1795
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
1668
1796
|
e.preventDefault();
|
|
1669
|
-
let t = e.key === "ArrowDown" ? 1 : -1, n =
|
|
1670
|
-
z(!0),
|
|
1797
|
+
let t = e.key === "ArrowDown" ? 1 : -1, n = H >= 0 ? H + t : t === 1 ? 0 : re.length - 1;
|
|
1798
|
+
z(!0), ce(se(n, t));
|
|
1671
1799
|
} else if (e.key === "Home" || e.key === "End") {
|
|
1672
1800
|
if (!R) return;
|
|
1673
1801
|
e.preventDefault();
|
|
1674
1802
|
let t = e.key === "Home" ? 1 : -1;
|
|
1675
|
-
|
|
1676
|
-
} else e.key === "Enter" && R &&
|
|
1803
|
+
ce(se(e.key === "Home" ? 0 : re.length - 1, t));
|
|
1804
|
+
} else e.key === "Enter" && R && ae ? (e.preventDefault(), J(ae)) : e.key === "Escape" && R ? (e.preventDefault(), z(!1), U(-1)) : e.key === "Tab" && (z(!1), U(-1));
|
|
1677
1805
|
}
|
|
1678
1806
|
}
|
|
1679
1807
|
}), /* @__PURE__ */ t("span", {
|
|
1680
|
-
className: `${
|
|
1808
|
+
className: `${Q.chevron} ${R ? Q.chevronOpen : ""}`,
|
|
1681
1809
|
"aria-hidden": "true",
|
|
1682
1810
|
children: /* @__PURE__ */ t(A, {
|
|
1683
1811
|
name: "IconChevron",
|
|
@@ -1686,12 +1814,12 @@ var E = {
|
|
|
1686
1814
|
})
|
|
1687
1815
|
})]
|
|
1688
1816
|
}),
|
|
1689
|
-
R && typeof document < "u" && h(
|
|
1817
|
+
R && typeof document < "u" && h(le, document.body),
|
|
1690
1818
|
/* @__PURE__ */ n("span", {
|
|
1691
1819
|
id: j,
|
|
1692
|
-
className:
|
|
1820
|
+
className: Q.visuallyHidden,
|
|
1693
1821
|
"aria-live": "polite",
|
|
1694
|
-
children: ["Найдено вариантов: ",
|
|
1822
|
+
children: ["Найдено вариантов: ", re.length]
|
|
1695
1823
|
}),
|
|
1696
1824
|
b && !y && /* @__PURE__ */ t(D, {
|
|
1697
1825
|
id: M,
|
|
@@ -1704,25 +1832,25 @@ var E = {
|
|
|
1704
1832
|
})
|
|
1705
1833
|
]
|
|
1706
1834
|
});
|
|
1707
|
-
},
|
|
1835
|
+
}, Ke = {
|
|
1708
1836
|
root: "_root_1gjqg_1",
|
|
1709
1837
|
header: "_header_1gjqg_21",
|
|
1710
1838
|
title: "_title_1gjqg_41",
|
|
1711
1839
|
dismiss: "_dismiss_1gjqg_55",
|
|
1712
1840
|
content: "_content_1gjqg_65"
|
|
1713
|
-
},
|
|
1841
|
+
}, qe = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: c = "" }) => {
|
|
1714
1842
|
let l = `ds-info-block-${u()}`;
|
|
1715
1843
|
return /* @__PURE__ */ n("section", {
|
|
1716
|
-
className: `${
|
|
1844
|
+
className: `${Ke.root} ${c}`,
|
|
1717
1845
|
"aria-labelledby": l,
|
|
1718
1846
|
children: [/* @__PURE__ */ n("header", {
|
|
1719
|
-
className:
|
|
1847
|
+
className: Ke.header,
|
|
1720
1848
|
children: [/* @__PURE__ */ t(s, {
|
|
1721
1849
|
id: l,
|
|
1722
|
-
className:
|
|
1850
|
+
className: Ke.title,
|
|
1723
1851
|
children: e
|
|
1724
1852
|
}), i && /* @__PURE__ */ t(T, {
|
|
1725
|
-
className:
|
|
1853
|
+
className: Ke.dismiss,
|
|
1726
1854
|
variant: "empty",
|
|
1727
1855
|
onClick: a,
|
|
1728
1856
|
"aria-label": o,
|
|
@@ -1733,26 +1861,26 @@ var E = {
|
|
|
1733
1861
|
})
|
|
1734
1862
|
})]
|
|
1735
1863
|
}), /* @__PURE__ */ t("div", {
|
|
1736
|
-
className:
|
|
1864
|
+
className: Ke.content,
|
|
1737
1865
|
children: r
|
|
1738
1866
|
})]
|
|
1739
1867
|
});
|
|
1740
|
-
},
|
|
1741
|
-
wrapper: "
|
|
1742
|
-
input: "
|
|
1743
|
-
switch: "
|
|
1744
|
-
thumb: "
|
|
1745
|
-
label: "
|
|
1746
|
-
disabled: "
|
|
1747
|
-
},
|
|
1868
|
+
}, Je = {
|
|
1869
|
+
wrapper: "_wrapper_1o3hg_1",
|
|
1870
|
+
input: "_input_1o3hg_21",
|
|
1871
|
+
switch: "_switch_1o3hg_35",
|
|
1872
|
+
thumb: "_thumb_1o3hg_67",
|
|
1873
|
+
label: "_label_1o3hg_113",
|
|
1874
|
+
disabled: "_disabled_1o3hg_125"
|
|
1875
|
+
}, Ye = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: s = "", name: c, id: l, value: d }) => {
|
|
1748
1876
|
let f = u(), p = l ?? `ds-radio-button-${c ?? f}`;
|
|
1749
1877
|
return /* @__PURE__ */ n("label", {
|
|
1750
1878
|
htmlFor: p,
|
|
1751
|
-
className: `${
|
|
1879
|
+
className: `${Je.wrapper} ${a ? Je.disabled : ""} ${s}`,
|
|
1752
1880
|
children: [
|
|
1753
1881
|
/* @__PURE__ */ t("input", {
|
|
1754
1882
|
id: p,
|
|
1755
|
-
className:
|
|
1883
|
+
className: Je.input,
|
|
1756
1884
|
type: "checkbox",
|
|
1757
1885
|
role: "switch",
|
|
1758
1886
|
name: c,
|
|
@@ -1765,21 +1893,21 @@ var E = {
|
|
|
1765
1893
|
}
|
|
1766
1894
|
}),
|
|
1767
1895
|
/* @__PURE__ */ t("span", {
|
|
1768
|
-
className:
|
|
1896
|
+
className: Je.switch,
|
|
1769
1897
|
"aria-hidden": "true",
|
|
1770
|
-
children: /* @__PURE__ */ t("span", { className:
|
|
1898
|
+
children: /* @__PURE__ */ t("span", { className: Je.thumb })
|
|
1771
1899
|
}),
|
|
1772
1900
|
i && /* @__PURE__ */ t("span", {
|
|
1773
|
-
className:
|
|
1901
|
+
className: Je.label,
|
|
1774
1902
|
children: i
|
|
1775
1903
|
})
|
|
1776
1904
|
]
|
|
1777
1905
|
});
|
|
1778
|
-
},
|
|
1779
|
-
root: "
|
|
1780
|
-
grid: "
|
|
1781
|
-
actions: "
|
|
1782
|
-
},
|
|
1906
|
+
}, Xe = {
|
|
1907
|
+
root: "_root_1vmtf_1",
|
|
1908
|
+
grid: "_grid_1vmtf_3",
|
|
1909
|
+
actions: "_actions_1vmtf_5"
|
|
1910
|
+
}, Ze = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
|
|
1783
1911
|
let d = (e, t) => {
|
|
1784
1912
|
let n = {
|
|
1785
1913
|
...r,
|
|
@@ -1788,11 +1916,11 @@ var E = {
|
|
|
1788
1916
|
i?.(n, e), s === "instant" && a?.(n);
|
|
1789
1917
|
};
|
|
1790
1918
|
return /* @__PURE__ */ n("section", {
|
|
1791
|
-
className: `${
|
|
1919
|
+
className: `${Xe.root} ${u}`,
|
|
1792
1920
|
"aria-label": "Фильтры",
|
|
1793
1921
|
"aria-busy": c,
|
|
1794
1922
|
children: [/* @__PURE__ */ t("div", {
|
|
1795
|
-
className:
|
|
1923
|
+
className: Xe.grid,
|
|
1796
1924
|
children: e.filter((e) => !e.hidden).map((e) => {
|
|
1797
1925
|
let n = l || c || e.disabled, i = r[e.id];
|
|
1798
1926
|
if (e.type === "input") {
|
|
@@ -1802,20 +1930,19 @@ var E = {
|
|
|
1802
1930
|
placeholder: e.placeholder,
|
|
1803
1931
|
disabled: n
|
|
1804
1932
|
};
|
|
1805
|
-
return e.inputType === "number" ? /* @__PURE__ */ t(
|
|
1933
|
+
return e.inputType === "number" ? /* @__PURE__ */ t(Re, {
|
|
1806
1934
|
...r,
|
|
1807
1935
|
type: "number",
|
|
1808
1936
|
value: i ?? "",
|
|
1809
1937
|
onChange: (t) => d(e.id, t)
|
|
1810
|
-
}, e.id) : /* @__PURE__ */ t(
|
|
1938
|
+
}, e.id) : /* @__PURE__ */ t(Re, {
|
|
1811
1939
|
...r,
|
|
1812
1940
|
type: "text",
|
|
1813
1941
|
value: String(i ?? ""),
|
|
1814
1942
|
onChange: (t) => d(e.id, t)
|
|
1815
1943
|
}, e.id);
|
|
1816
1944
|
}
|
|
1817
|
-
if (e.type === "dropdown") return /* @__PURE__ */ t(
|
|
1818
|
-
size: "lg",
|
|
1945
|
+
if (e.type === "dropdown") return /* @__PURE__ */ t(ge, {
|
|
1819
1946
|
label: e.label,
|
|
1820
1947
|
hint: e.hint,
|
|
1821
1948
|
placeholder: e.placeholder,
|
|
@@ -1824,8 +1951,7 @@ var E = {
|
|
|
1824
1951
|
disabled: n,
|
|
1825
1952
|
onChange: (t) => d(e.id, t)
|
|
1826
1953
|
}, e.id);
|
|
1827
|
-
if (e.type === "multiple") return /* @__PURE__ */ t(
|
|
1828
|
-
size: "lg",
|
|
1954
|
+
if (e.type === "multiple") return /* @__PURE__ */ t(Ie, {
|
|
1829
1955
|
label: e.label,
|
|
1830
1956
|
hint: e.hint,
|
|
1831
1957
|
placeholder: e.placeholder,
|
|
@@ -1841,7 +1967,7 @@ var E = {
|
|
|
1841
1967
|
disabled: n,
|
|
1842
1968
|
onChange: (t) => d(e.id, t)
|
|
1843
1969
|
}, e.id);
|
|
1844
|
-
if (e.type === "radio") return /* @__PURE__ */ t(
|
|
1970
|
+
if (e.type === "radio") return /* @__PURE__ */ t(Ye, {
|
|
1845
1971
|
label: e.label,
|
|
1846
1972
|
checked: !!i,
|
|
1847
1973
|
disabled: n,
|
|
@@ -1851,7 +1977,7 @@ var E = {
|
|
|
1851
1977
|
from: null,
|
|
1852
1978
|
to: null
|
|
1853
1979
|
};
|
|
1854
|
-
return /* @__PURE__ */ t(
|
|
1980
|
+
return /* @__PURE__ */ t(le, {
|
|
1855
1981
|
hint: e.hint,
|
|
1856
1982
|
mode: e.mode,
|
|
1857
1983
|
min: e.min,
|
|
@@ -1862,7 +1988,7 @@ var E = {
|
|
|
1862
1988
|
}, e.id);
|
|
1863
1989
|
})
|
|
1864
1990
|
}), (o || s === "manual") && /* @__PURE__ */ n("div", {
|
|
1865
|
-
className:
|
|
1991
|
+
className: Xe.actions,
|
|
1866
1992
|
children: [o && /* @__PURE__ */ t(T, {
|
|
1867
1993
|
variant: "destructiveOutline",
|
|
1868
1994
|
disabled: l || c,
|
|
@@ -1876,7 +2002,7 @@ var E = {
|
|
|
1876
2002
|
})]
|
|
1877
2003
|
})]
|
|
1878
2004
|
});
|
|
1879
|
-
},
|
|
2005
|
+
}, Qe = {
|
|
1880
2006
|
wrapper: "_wrapper_8w6xl_1",
|
|
1881
2007
|
dropzone: "_dropzone_8w6xl_3",
|
|
1882
2008
|
dragActive: "_dragActive_8w6xl_5",
|
|
@@ -1889,12 +2015,12 @@ var E = {
|
|
|
1889
2015
|
file: "_file_8w6xl_17",
|
|
1890
2016
|
fileName: "_fileName_8w6xl_21",
|
|
1891
2017
|
fileSize: "_fileSize_8w6xl_23"
|
|
1892
|
-
},
|
|
2018
|
+
}, $e = (e) => `${e.name}:${e.size}:${e.lastModified}`, et = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, tt = (e, t) => !t || t.split(",").map((e) => e.trim().toLowerCase()).some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type.toLowerCase() === t), nt = ({ value: r, onChange: i, multiple: a = !1, accept: o, maxSize: s, maxFiles: c, label: l, hint: d, error: f, required: h = !1, disabled: g = !1, readOnly: _ = !1, name: v, id: y, className: b = "", dropLabel: x = "Перетащите файлы в эту область", browseLabel: S = "Выбрать файлы", addMoreLabel: C = "Добавить ещё", onReject: ee }) => {
|
|
1893
2019
|
let w = u(), E = y ?? `ds-file-input-${v ?? w}`, O = p(null), k = p(0), [j, M] = m(!1), N = d ? `${E}-hint` : void 0, P = f ? `${E}-error` : void 0, F = [N, P].filter(Boolean).join(" ") || void 0, I = !g && !_, L = (e) => {
|
|
1894
|
-
let t = [], n = new Set(r.map(
|
|
2020
|
+
let t = [], n = new Set(r.map($e)), l = e.filter((e) => tt(e, o) ? s !== void 0 && e.size > s ? (t.push({
|
|
1895
2021
|
file: e,
|
|
1896
2022
|
reason: "maxSize"
|
|
1897
|
-
}), !1) : !n.has(
|
|
2023
|
+
}), !1) : !n.has($e(e)) && (n.add($e(e)), !0) : (t.push({
|
|
1898
2024
|
file: e,
|
|
1899
2025
|
reason: "accept"
|
|
1900
2026
|
}), !1)), u = a ? c : 1, d = a ? [...r, ...l] : l.slice(-1);
|
|
@@ -1904,7 +2030,7 @@ var E = {
|
|
|
1904
2030
|
})), d = d.slice(0, u)), t.length && ee?.(t), l.length && i?.(d), O.current && (O.current.value = "");
|
|
1905
2031
|
};
|
|
1906
2032
|
return /* @__PURE__ */ n("div", {
|
|
1907
|
-
className: `${
|
|
2033
|
+
className: `${Qe.wrapper} ${b}`,
|
|
1908
2034
|
children: [
|
|
1909
2035
|
l && /* @__PURE__ */ t(te, {
|
|
1910
2036
|
htmlFor: E,
|
|
@@ -1913,7 +2039,7 @@ var E = {
|
|
|
1913
2039
|
children: l
|
|
1914
2040
|
}),
|
|
1915
2041
|
/* @__PURE__ */ n("div", {
|
|
1916
|
-
className: `${
|
|
2042
|
+
className: `${Qe.dropzone} ${j ? Qe.dragActive : ""} ${g ? Qe.disabled : ""} ${f ? Qe.error : ""}`,
|
|
1917
2043
|
onDragEnter: (e) => {
|
|
1918
2044
|
e.preventDefault(), I && ++k.current === 1 && M(!0);
|
|
1919
2045
|
},
|
|
@@ -1928,7 +2054,7 @@ var E = {
|
|
|
1928
2054
|
ref: O,
|
|
1929
2055
|
id: E,
|
|
1930
2056
|
name: v,
|
|
1931
|
-
className:
|
|
2057
|
+
className: Qe.nativeInput,
|
|
1932
2058
|
type: "file",
|
|
1933
2059
|
multiple: a,
|
|
1934
2060
|
accept: o,
|
|
@@ -1939,19 +2065,19 @@ var E = {
|
|
|
1939
2065
|
onChange: (e) => L(Array.from(e.target.files ?? []))
|
|
1940
2066
|
}), r.length ? /* @__PURE__ */ n(e, { children: [
|
|
1941
2067
|
/* @__PURE__ */ t("ul", {
|
|
1942
|
-
className:
|
|
2068
|
+
className: Qe.files,
|
|
1943
2069
|
"aria-live": "polite",
|
|
1944
2070
|
children: r.map((e, a) => /* @__PURE__ */ n("li", {
|
|
1945
|
-
className:
|
|
2071
|
+
className: Qe.file,
|
|
1946
2072
|
children: [
|
|
1947
2073
|
/* @__PURE__ */ t("span", {
|
|
1948
|
-
className:
|
|
2074
|
+
className: Qe.fileName,
|
|
1949
2075
|
title: e.name,
|
|
1950
2076
|
children: e.name
|
|
1951
2077
|
}),
|
|
1952
2078
|
/* @__PURE__ */ t("span", {
|
|
1953
|
-
className:
|
|
1954
|
-
children:
|
|
2079
|
+
className: Qe.fileSize,
|
|
2080
|
+
children: et(e.size)
|
|
1955
2081
|
}),
|
|
1956
2082
|
I && /* @__PURE__ */ t(T, {
|
|
1957
2083
|
variant: "empty",
|
|
@@ -1965,25 +2091,25 @@ var E = {
|
|
|
1965
2091
|
})
|
|
1966
2092
|
})
|
|
1967
2093
|
]
|
|
1968
|
-
},
|
|
2094
|
+
}, $e(e)))
|
|
1969
2095
|
}),
|
|
1970
2096
|
I && (a || r.length === 0) && /* @__PURE__ */ t(T, {
|
|
1971
|
-
className:
|
|
2097
|
+
className: Qe.browseButton,
|
|
1972
2098
|
size: "sm",
|
|
1973
2099
|
onClick: () => O.current?.click(),
|
|
1974
2100
|
children: C
|
|
1975
2101
|
}),
|
|
1976
2102
|
I && !a && /* @__PURE__ */ t(T, {
|
|
1977
|
-
className:
|
|
2103
|
+
className: Qe.browseButton,
|
|
1978
2104
|
size: "sm",
|
|
1979
2105
|
onClick: () => O.current?.click(),
|
|
1980
2106
|
children: S
|
|
1981
2107
|
})
|
|
1982
2108
|
] }) : /* @__PURE__ */ n("div", {
|
|
1983
|
-
className:
|
|
2109
|
+
className: Qe.empty,
|
|
1984
2110
|
children: [
|
|
1985
2111
|
/* @__PURE__ */ t("span", {
|
|
1986
|
-
className:
|
|
2112
|
+
className: Qe.uploadIcon,
|
|
1987
2113
|
"aria-hidden": "true",
|
|
1988
2114
|
children: /* @__PURE__ */ t(A, {
|
|
1989
2115
|
name: "IconUpload",
|
|
@@ -2011,26 +2137,26 @@ var E = {
|
|
|
2011
2137
|
})
|
|
2012
2138
|
]
|
|
2013
2139
|
});
|
|
2014
|
-
},
|
|
2015
|
-
wrapper: "
|
|
2016
|
-
control: "
|
|
2017
|
-
textarea: "
|
|
2018
|
-
disabledText: "
|
|
2019
|
-
sm: "
|
|
2020
|
-
md: "
|
|
2021
|
-
lg: "
|
|
2022
|
-
autoResize: "
|
|
2023
|
-
manualResize: "
|
|
2024
|
-
textareaError: "
|
|
2025
|
-
clearAction: "
|
|
2026
|
-
messages: "
|
|
2027
|
-
counter: "
|
|
2028
|
-
},
|
|
2029
|
-
function
|
|
2140
|
+
}, rt = {
|
|
2141
|
+
wrapper: "_wrapper_1bwdq_1",
|
|
2142
|
+
control: "_control_1bwdq_15",
|
|
2143
|
+
textarea: "_textarea_1bwdq_25",
|
|
2144
|
+
disabledText: "_disabledText_1bwdq_27",
|
|
2145
|
+
sm: "_sm_1bwdq_103",
|
|
2146
|
+
md: "_md_1bwdq_117",
|
|
2147
|
+
lg: "_lg_1bwdq_131",
|
|
2148
|
+
autoResize: "_autoResize_1bwdq_145",
|
|
2149
|
+
manualResize: "_manualResize_1bwdq_155",
|
|
2150
|
+
textareaError: "_textareaError_1bwdq_163",
|
|
2151
|
+
clearAction: "_clearAction_1bwdq_171",
|
|
2152
|
+
messages: "_messages_1bwdq_251",
|
|
2153
|
+
counter: "_counter_1bwdq_265"
|
|
2154
|
+
}, it = 2;
|
|
2155
|
+
function at(e) {
|
|
2030
2156
|
let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight);
|
|
2031
2157
|
return Number.isFinite(n) ? n : Number.parseFloat(t.fontSize) * 1.4;
|
|
2032
2158
|
}
|
|
2033
|
-
function
|
|
2159
|
+
function ot({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, readOnly: o = !1, stringWhileDisabled: c = !1, label: d, error: f, hint: m, className: h = "", name: g, id: _, size: v = "md", clearable: y = !1, required: b = !1, maxLength: x, showCount: S = !1, minRows: C = it, maxRows: ee, autoResize: w = !0, ...T }) {
|
|
2034
2160
|
let E = u(), O = _ ?? `ds-textarea-${g ?? E}`, k = p(null), j = m ? `${O}-hint` : void 0, M = f ? `${O}-error` : void 0, N = S && x ? `${O}-count` : void 0, P = [
|
|
2035
2161
|
j,
|
|
2036
2162
|
M,
|
|
@@ -2038,7 +2164,7 @@ function $e({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2038
2164
|
].filter(Boolean).join(" ") || void 0, F = Math.max(1, C), I = ee === void 0 ? void 0 : Math.max(F, ee), L = s(() => {
|
|
2039
2165
|
let e = k.current;
|
|
2040
2166
|
if (!e || !w) return;
|
|
2041
|
-
let t = window.getComputedStyle(e), n =
|
|
2167
|
+
let t = window.getComputedStyle(e), n = at(e), r = Number.parseFloat(t.paddingTop) + Number.parseFloat(t.paddingBottom) + Number.parseFloat(t.borderTopWidth) + Number.parseFloat(t.borderBottomWidth), i = n * F + r, a = I === void 0 ? Infinity : n * I + r;
|
|
2042
2168
|
e.style.height = "auto";
|
|
2043
2169
|
let o = Math.min(Math.max(e.scrollHeight, i), a);
|
|
2044
2170
|
e.style.height = `${o}px`, e.style.overflowY = e.scrollHeight > a ? "auto" : "hidden";
|
|
@@ -2070,7 +2196,7 @@ function $e({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2070
2196
|
e && ((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus(), L());
|
|
2071
2197
|
}, B = { "--ds-textarea-min-rows": F };
|
|
2072
2198
|
return /* @__PURE__ */ n("div", {
|
|
2073
|
-
className: `${
|
|
2199
|
+
className: `${rt.wrapper} ${h}`,
|
|
2074
2200
|
children: [
|
|
2075
2201
|
d && /* @__PURE__ */ t(te, {
|
|
2076
2202
|
htmlFor: O,
|
|
@@ -2080,12 +2206,12 @@ function $e({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2080
2206
|
}),
|
|
2081
2207
|
a && c ? /* @__PURE__ */ t("div", {
|
|
2082
2208
|
id: O,
|
|
2083
|
-
className: `${
|
|
2209
|
+
className: `${rt.disabledText} ${rt[v]}`,
|
|
2084
2210
|
style: B,
|
|
2085
2211
|
"aria-describedby": P,
|
|
2086
2212
|
children: e || i
|
|
2087
2213
|
}) : /* @__PURE__ */ n("div", {
|
|
2088
|
-
className:
|
|
2214
|
+
className: rt.control,
|
|
2089
2215
|
children: [/* @__PURE__ */ t("textarea", {
|
|
2090
2216
|
ref: k,
|
|
2091
2217
|
id: O,
|
|
@@ -2100,12 +2226,12 @@ function $e({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2100
2226
|
style: B,
|
|
2101
2227
|
"aria-invalid": !!f,
|
|
2102
2228
|
"aria-describedby": P,
|
|
2103
|
-
className: `${
|
|
2229
|
+
className: `${rt.textarea} ${rt[v]} ${w ? rt.autoResize : rt.manualResize} ${f ? rt.textareaError : ""}`,
|
|
2104
2230
|
onChange: R,
|
|
2105
2231
|
...T
|
|
2106
2232
|
}), y && e && !a && !o && /* @__PURE__ */ t("button", {
|
|
2107
2233
|
type: "button",
|
|
2108
|
-
className:
|
|
2234
|
+
className: rt.clearAction,
|
|
2109
2235
|
"aria-label": "Очистить поле",
|
|
2110
2236
|
onClick: z,
|
|
2111
2237
|
children: /* @__PURE__ */ t(A, {
|
|
@@ -2116,7 +2242,7 @@ function $e({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2116
2242
|
})]
|
|
2117
2243
|
}),
|
|
2118
2244
|
(m || f || N) && /* @__PURE__ */ n("div", {
|
|
2119
|
-
className:
|
|
2245
|
+
className: rt.messages,
|
|
2120
2246
|
children: [
|
|
2121
2247
|
m && !f && /* @__PURE__ */ t(D, {
|
|
2122
2248
|
id: j,
|
|
@@ -2129,7 +2255,7 @@ function $e({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2129
2255
|
}),
|
|
2130
2256
|
N && /* @__PURE__ */ n("span", {
|
|
2131
2257
|
id: N,
|
|
2132
|
-
className:
|
|
2258
|
+
className: rt.counter,
|
|
2133
2259
|
children: [
|
|
2134
2260
|
e.length,
|
|
2135
2261
|
" / ",
|
|
@@ -2143,11 +2269,11 @@ function $e({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2143
2269
|
}
|
|
2144
2270
|
//#endregion
|
|
2145
2271
|
//#region src/components/DSModal/modal.store.ts
|
|
2146
|
-
var
|
|
2272
|
+
var st = 0, ct = b((e, t) => ({
|
|
2147
2273
|
modals: [],
|
|
2148
2274
|
openModal: (t, n = {}, r = {}) => {
|
|
2149
|
-
|
|
2150
|
-
let i = `ds-modal-${
|
|
2275
|
+
st += 1;
|
|
2276
|
+
let i = `ds-modal-${st}`;
|
|
2151
2277
|
return e((e) => ({ modals: [...e.modals, {
|
|
2152
2278
|
id: i,
|
|
2153
2279
|
name: t,
|
|
@@ -2171,21 +2297,21 @@ var et = 0, Q = b((e, t) => ({
|
|
|
2171
2297
|
let n = t().modals;
|
|
2172
2298
|
n.length && (e({ modals: [] }), n.forEach((e) => e.onClose?.()));
|
|
2173
2299
|
}
|
|
2174
|
-
})),
|
|
2175
|
-
|
|
2176
|
-
},
|
|
2177
|
-
layer: "
|
|
2178
|
-
backdrop: "
|
|
2179
|
-
panel: "
|
|
2180
|
-
header: "
|
|
2181
|
-
title: "
|
|
2182
|
-
description: "
|
|
2183
|
-
content: "
|
|
2184
|
-
close: "
|
|
2185
|
-
},
|
|
2186
|
-
function
|
|
2300
|
+
})), lt = () => {
|
|
2301
|
+
ct.getState().closeAllModals(), st = 0;
|
|
2302
|
+
}, ut = {
|
|
2303
|
+
layer: "_layer_d4mga_1",
|
|
2304
|
+
backdrop: "_backdrop_d4mga_3",
|
|
2305
|
+
panel: "_panel_d4mga_5",
|
|
2306
|
+
header: "_header_d4mga_9",
|
|
2307
|
+
title: "_title_d4mga_11",
|
|
2308
|
+
description: "_description_d4mga_13",
|
|
2309
|
+
content: "_content_d4mga_15",
|
|
2310
|
+
close: "_close_d4mga_19"
|
|
2311
|
+
}, dt = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", ft = i({});
|
|
2312
|
+
function pt(e) {
|
|
2187
2313
|
if (e.key !== "Tab") return;
|
|
2188
|
-
let t = Array.from(e.currentTarget.querySelectorAll(
|
|
2314
|
+
let t = Array.from(e.currentTarget.querySelectorAll(dt));
|
|
2189
2315
|
if (!t.length) {
|
|
2190
2316
|
e.preventDefault();
|
|
2191
2317
|
return;
|
|
@@ -2193,29 +2319,29 @@ function at(e) {
|
|
|
2193
2319
|
let n = t[0], r = t.at(-1);
|
|
2194
2320
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r?.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n?.focus());
|
|
2195
2321
|
}
|
|
2196
|
-
var
|
|
2197
|
-
let f = c(
|
|
2322
|
+
var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: s = "", role: d = "dialog" }) => {
|
|
2323
|
+
let f = c(ft), m = r ?? f.title, h = i ?? f.description, g = u(), _ = u(), v = p(null), y = ct((e) => e.closeModal), b = m != null, x = h != null;
|
|
2198
2324
|
return l(() => {
|
|
2199
2325
|
let e = document.activeElement, t = v.current;
|
|
2200
|
-
return (t?.querySelector(
|
|
2326
|
+
return (t?.querySelector(dt) ?? t)?.focus(), () => e?.focus();
|
|
2201
2327
|
}, []), /* @__PURE__ */ n("div", {
|
|
2202
2328
|
ref: v,
|
|
2203
|
-
className: `${
|
|
2329
|
+
className: `${ut.panel} ${s}`,
|
|
2204
2330
|
role: d,
|
|
2205
2331
|
"aria-modal": "true",
|
|
2206
2332
|
"aria-labelledby": b ? g : void 0,
|
|
2207
2333
|
"aria-describedby": x ? _ : void 0,
|
|
2208
2334
|
tabIndex: -1,
|
|
2209
|
-
onKeyDown:
|
|
2335
|
+
onKeyDown: pt,
|
|
2210
2336
|
children: [
|
|
2211
2337
|
(b || o) && /* @__PURE__ */ n("header", {
|
|
2212
|
-
className:
|
|
2338
|
+
className: ut.header,
|
|
2213
2339
|
children: [b && /* @__PURE__ */ t("h2", {
|
|
2214
2340
|
id: g,
|
|
2215
|
-
className:
|
|
2341
|
+
className: ut.title,
|
|
2216
2342
|
children: m
|
|
2217
2343
|
}), /* @__PURE__ */ t(T, {
|
|
2218
|
-
className:
|
|
2344
|
+
className: ut.close,
|
|
2219
2345
|
variant: "empty",
|
|
2220
2346
|
size: "sm",
|
|
2221
2347
|
"aria-label": o,
|
|
@@ -2229,21 +2355,21 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2229
2355
|
}),
|
|
2230
2356
|
x && /* @__PURE__ */ t("p", {
|
|
2231
2357
|
id: _,
|
|
2232
|
-
className:
|
|
2358
|
+
className: ut.description,
|
|
2233
2359
|
children: h
|
|
2234
2360
|
}),
|
|
2235
2361
|
/* @__PURE__ */ t("div", {
|
|
2236
|
-
className:
|
|
2362
|
+
className: ut.content,
|
|
2237
2363
|
children: e
|
|
2238
2364
|
})
|
|
2239
2365
|
]
|
|
2240
2366
|
});
|
|
2241
|
-
},
|
|
2242
|
-
let n =
|
|
2367
|
+
}, ht = ({ registry: e }) => {
|
|
2368
|
+
let n = ct((e) => e.modals), r = ct((e) => e.closeModal), i = ct((e) => e.closeAllModals);
|
|
2243
2369
|
return l(() => {
|
|
2244
2370
|
let e = (e) => {
|
|
2245
2371
|
if (e.key !== "Escape") return;
|
|
2246
|
-
let t =
|
|
2372
|
+
let t = ct.getState().modals.at(-1);
|
|
2247
2373
|
t?.closeOnEscape && r(t.id);
|
|
2248
2374
|
};
|
|
2249
2375
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
@@ -2256,18 +2382,18 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2256
2382
|
n,
|
|
2257
2383
|
e
|
|
2258
2384
|
]), !n.length || typeof document > "u" ? null : h(/* @__PURE__ */ t("div", {
|
|
2259
|
-
className:
|
|
2385
|
+
className: ut.layer,
|
|
2260
2386
|
"aria-label": "Модальные окна",
|
|
2261
2387
|
children: n.map((a, o) => {
|
|
2262
2388
|
let s = e[a.name];
|
|
2263
2389
|
return s ? /* @__PURE__ */ t("div", {
|
|
2264
|
-
className:
|
|
2390
|
+
className: ut.backdrop,
|
|
2265
2391
|
"aria-hidden": o !== n.length - 1 || void 0,
|
|
2266
2392
|
inert: o !== n.length - 1 || void 0,
|
|
2267
2393
|
onMouseDown: (e) => {
|
|
2268
2394
|
e.target === e.currentTarget && a.closeOnBackdrop && r(a.id);
|
|
2269
2395
|
},
|
|
2270
|
-
children: /* @__PURE__ */ t(
|
|
2396
|
+
children: /* @__PURE__ */ t(ft.Provider, {
|
|
2271
2397
|
value: {
|
|
2272
2398
|
title: a.title ?? a.payload.title,
|
|
2273
2399
|
description: a.description ?? a.payload.description
|
|
@@ -2282,31 +2408,31 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2282
2408
|
}, a.id) : null;
|
|
2283
2409
|
})
|
|
2284
2410
|
}), document.body);
|
|
2285
|
-
},
|
|
2286
|
-
let o =
|
|
2411
|
+
}, gt = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
2412
|
+
let o = ct((e) => e.modals.length);
|
|
2287
2413
|
return l(() => {
|
|
2288
2414
|
if (!a || o === 0) return;
|
|
2289
2415
|
let e = document.body.style.overflow;
|
|
2290
2416
|
return document.body.style.overflow = "hidden", () => {
|
|
2291
2417
|
document.body.style.overflow = e;
|
|
2292
2418
|
};
|
|
2293
|
-
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(
|
|
2294
|
-
},
|
|
2419
|
+
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(ht, { registry: r })] });
|
|
2420
|
+
}, _t = (e) => e, vt = {
|
|
2295
2421
|
message: "_message_1vtru_1",
|
|
2296
2422
|
actions: "_actions_1vtru_3"
|
|
2297
|
-
},
|
|
2423
|
+
}, yt = /* @__PURE__ */ new Map(), bt = 0, xt = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
|
|
2298
2424
|
let u = (e) => {
|
|
2299
|
-
|
|
2425
|
+
yt.get(l)?.(e), yt.delete(l), r();
|
|
2300
2426
|
};
|
|
2301
|
-
return /* @__PURE__ */ n(
|
|
2427
|
+
return /* @__PURE__ */ n(mt, {
|
|
2302
2428
|
modalId: e,
|
|
2303
2429
|
title: i,
|
|
2304
2430
|
role: "alertdialog",
|
|
2305
2431
|
children: [/* @__PURE__ */ t("p", {
|
|
2306
|
-
className:
|
|
2432
|
+
className: vt.message,
|
|
2307
2433
|
children: a
|
|
2308
2434
|
}), /* @__PURE__ */ n("div", {
|
|
2309
|
-
className:
|
|
2435
|
+
className: vt.actions,
|
|
2310
2436
|
children: [/* @__PURE__ */ t(T, {
|
|
2311
2437
|
variant: "outline",
|
|
2312
2438
|
onClick: () => u(!1),
|
|
@@ -2318,46 +2444,46 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2318
2444
|
})]
|
|
2319
2445
|
})]
|
|
2320
2446
|
});
|
|
2321
|
-
},
|
|
2447
|
+
}, St = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(mt, {
|
|
2322
2448
|
modalId: e,
|
|
2323
2449
|
title: i,
|
|
2324
2450
|
role: "alertdialog",
|
|
2325
2451
|
children: [/* @__PURE__ */ t("p", {
|
|
2326
|
-
className:
|
|
2452
|
+
className: vt.message,
|
|
2327
2453
|
children: a
|
|
2328
2454
|
}), /* @__PURE__ */ t("div", {
|
|
2329
|
-
className:
|
|
2455
|
+
className: vt.actions,
|
|
2330
2456
|
children: /* @__PURE__ */ t(T, {
|
|
2331
2457
|
onClick: r,
|
|
2332
2458
|
children: o
|
|
2333
2459
|
})
|
|
2334
2460
|
})]
|
|
2335
|
-
}),
|
|
2336
|
-
ConfirmModal:
|
|
2337
|
-
ErrorModal:
|
|
2338
|
-
}),
|
|
2339
|
-
let e =
|
|
2461
|
+
}), Ct = _t({
|
|
2462
|
+
ConfirmModal: xt,
|
|
2463
|
+
ErrorModal: St
|
|
2464
|
+
}), wt = () => {
|
|
2465
|
+
let e = ct((e) => e.openModal);
|
|
2340
2466
|
return (t = {}) => new Promise((n) => {
|
|
2341
|
-
|
|
2342
|
-
let r = `confirm-${
|
|
2343
|
-
|
|
2467
|
+
bt += 1;
|
|
2468
|
+
let r = `confirm-${bt}`;
|
|
2469
|
+
yt.set(r, n), e("ConfirmModal", {
|
|
2344
2470
|
...t,
|
|
2345
2471
|
requestId: r
|
|
2346
2472
|
}, {
|
|
2347
2473
|
closeOnEscape: !1,
|
|
2348
2474
|
onClose: () => {
|
|
2349
|
-
|
|
2475
|
+
yt.get(r)?.(!1), yt.delete(r);
|
|
2350
2476
|
}
|
|
2351
2477
|
});
|
|
2352
2478
|
});
|
|
2353
|
-
},
|
|
2354
|
-
let e =
|
|
2479
|
+
}, Tt = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", Et = () => {
|
|
2480
|
+
let e = ct((e) => e.openModal);
|
|
2355
2481
|
return { showError: (t, n) => e("ErrorModal", {
|
|
2356
2482
|
title: n,
|
|
2357
|
-
message:
|
|
2483
|
+
message: Tt(t)
|
|
2358
2484
|
}) };
|
|
2359
|
-
},
|
|
2360
|
-
let e =
|
|
2485
|
+
}, Dt = b(() => ({})), Ot = b(() => ({})), kt = () => {
|
|
2486
|
+
let e = ct((e) => e.modals), t = ct((e) => e.openModal), n = ct((e) => e.closeModal), r = ct((e) => e.closeTopModal), i = ct((e) => e.closeAllModals), a = s((e, n = {}, r) => t(e, n, r), [t]), o = s((t) => e.some((e) => e.name === t), [e]);
|
|
2361
2487
|
return f(() => ({
|
|
2362
2488
|
openModal: a,
|
|
2363
2489
|
closeModal: n,
|
|
@@ -2373,7 +2499,7 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2373
2499
|
e.length,
|
|
2374
2500
|
a
|
|
2375
2501
|
]);
|
|
2376
|
-
},
|
|
2502
|
+
}, At = {
|
|
2377
2503
|
wrapper: "_wrapper_1qbyz_1",
|
|
2378
2504
|
container: "_container_1qbyz_15",
|
|
2379
2505
|
inner: "_inner_1qbyz_35",
|
|
@@ -2381,29 +2507,29 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2381
2507
|
jump: "_jump_1qbyz_1",
|
|
2382
2508
|
cube__inner: "_cube__inner_1qbyz_67",
|
|
2383
2509
|
morph: "_morph_1qbyz_1"
|
|
2384
|
-
},
|
|
2385
|
-
className:
|
|
2510
|
+
}, jt = () => /* @__PURE__ */ t("div", {
|
|
2511
|
+
className: At.wrapper,
|
|
2386
2512
|
children: /* @__PURE__ */ t("div", {
|
|
2387
|
-
className:
|
|
2513
|
+
className: At.container,
|
|
2388
2514
|
children: /* @__PURE__ */ n("div", {
|
|
2389
|
-
className:
|
|
2515
|
+
className: At.inner,
|
|
2390
2516
|
children: [
|
|
2391
2517
|
/* @__PURE__ */ t("div", {
|
|
2392
|
-
className:
|
|
2393
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
2518
|
+
className: At.cube,
|
|
2519
|
+
children: /* @__PURE__ */ t("div", { className: At.cube__inner })
|
|
2394
2520
|
}),
|
|
2395
2521
|
/* @__PURE__ */ t("div", {
|
|
2396
|
-
className:
|
|
2397
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
2522
|
+
className: At.cube,
|
|
2523
|
+
children: /* @__PURE__ */ t("div", { className: At.cube__inner })
|
|
2398
2524
|
}),
|
|
2399
2525
|
/* @__PURE__ */ t("div", {
|
|
2400
|
-
className:
|
|
2401
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
2526
|
+
className: At.cube,
|
|
2527
|
+
children: /* @__PURE__ */ t("div", { className: At.cube__inner })
|
|
2402
2528
|
})
|
|
2403
2529
|
]
|
|
2404
2530
|
})
|
|
2405
2531
|
})
|
|
2406
|
-
}),
|
|
2532
|
+
}), Mt = {
|
|
2407
2533
|
viewport: "_viewport_joq18_1",
|
|
2408
2534
|
"top-right": "_top-right_joq18_3",
|
|
2409
2535
|
"top-left": "_top-left_joq18_5",
|
|
@@ -2415,7 +2541,7 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2415
2541
|
success: "_success_joq18_17",
|
|
2416
2542
|
warning: "_warning_joq18_19",
|
|
2417
2543
|
error: "_error_joq18_21"
|
|
2418
|
-
},
|
|
2544
|
+
}, Nt = {
|
|
2419
2545
|
info: {
|
|
2420
2546
|
name: "IconInfoCircle",
|
|
2421
2547
|
color: "var(--color-primary)"
|
|
@@ -2432,7 +2558,7 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2432
2558
|
name: "IconWarning",
|
|
2433
2559
|
color: "var(--color-error)"
|
|
2434
2560
|
}
|
|
2435
|
-
},
|
|
2561
|
+
}, Pt = ({ toast: e, onClose: r }) => {
|
|
2436
2562
|
let [i, a] = m(!1), o = p(e.duration), s = p(Date.now());
|
|
2437
2563
|
return l(() => {
|
|
2438
2564
|
if (i || e.duration <= 0) return;
|
|
@@ -2447,7 +2573,7 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2447
2573
|
e.duration,
|
|
2448
2574
|
e.id
|
|
2449
2575
|
]), /* @__PURE__ */ n("article", {
|
|
2450
|
-
className: `${
|
|
2576
|
+
className: `${Mt.toast} ${Mt[e.variant]}`,
|
|
2451
2577
|
role: e.variant === "error" ? "alert" : "status",
|
|
2452
2578
|
"aria-live": e.variant === "error" ? "assertive" : "polite",
|
|
2453
2579
|
onMouseEnter: () => a(!0),
|
|
@@ -2456,12 +2582,12 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2456
2582
|
onBlur: () => a(!1),
|
|
2457
2583
|
children: [
|
|
2458
2584
|
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(A, {
|
|
2459
|
-
...
|
|
2585
|
+
...Nt[e.variant],
|
|
2460
2586
|
width: 24,
|
|
2461
2587
|
height: 24
|
|
2462
2588
|
}) }),
|
|
2463
2589
|
/* @__PURE__ */ n("div", {
|
|
2464
|
-
className:
|
|
2590
|
+
className: Mt.body,
|
|
2465
2591
|
children: [
|
|
2466
2592
|
e.title && /* @__PURE__ */ t("strong", { children: e.title }),
|
|
2467
2593
|
/* @__PURE__ */ t("div", { children: e.message }),
|
|
@@ -2488,11 +2614,11 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2488
2614
|
})
|
|
2489
2615
|
]
|
|
2490
2616
|
});
|
|
2491
|
-
},
|
|
2617
|
+
}, Ft = 0, It = b((e) => ({
|
|
2492
2618
|
toasts: [],
|
|
2493
2619
|
showToast: (t) => {
|
|
2494
|
-
|
|
2495
|
-
let n = `ds-toast-${
|
|
2620
|
+
Ft += 1;
|
|
2621
|
+
let n = `ds-toast-${Ft}`;
|
|
2496
2622
|
return e((e) => ({ toasts: [...e.toasts, {
|
|
2497
2623
|
variant: "info",
|
|
2498
2624
|
duration: 5e3,
|
|
@@ -2503,18 +2629,18 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2503
2629
|
},
|
|
2504
2630
|
removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
|
|
2505
2631
|
clearToasts: () => e({ toasts: [] })
|
|
2506
|
-
})),
|
|
2507
|
-
let n =
|
|
2632
|
+
})), Lt = () => It.setState({ toasts: [] }), Rt = ({ position: e = "top-right" }) => {
|
|
2633
|
+
let n = It((e) => e.toasts), r = It((e) => e.removeToast);
|
|
2508
2634
|
return /* @__PURE__ */ t("div", {
|
|
2509
|
-
className: `${
|
|
2635
|
+
className: `${Mt.viewport} ${Mt[e]}`,
|
|
2510
2636
|
"aria-label": "Уведомления",
|
|
2511
|
-
children: n.map((e) => /* @__PURE__ */ t(
|
|
2637
|
+
children: n.map((e) => /* @__PURE__ */ t(Pt, {
|
|
2512
2638
|
toast: e,
|
|
2513
2639
|
onClose: r
|
|
2514
2640
|
}, e.id))
|
|
2515
2641
|
});
|
|
2516
|
-
},
|
|
2517
|
-
let e =
|
|
2642
|
+
}, zt = () => {
|
|
2643
|
+
let e = It((e) => e.showToast), t = It((e) => e.removeToast), n = It((e) => e.clearToasts), r = s((t) => e({
|
|
2518
2644
|
...t,
|
|
2519
2645
|
variant: "info"
|
|
2520
2646
|
}), [e]), i = s((t) => e({
|
|
@@ -2544,7 +2670,7 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2544
2670
|
i,
|
|
2545
2671
|
a
|
|
2546
2672
|
]);
|
|
2547
|
-
},
|
|
2673
|
+
}, Bt = {
|
|
2548
2674
|
root: "_root_s9o0g_1",
|
|
2549
2675
|
tooltip: "_tooltip_s9o0g_3",
|
|
2550
2676
|
"ds-tooltip-in": "_ds-tooltip-in_s9o0g_1",
|
|
@@ -2552,7 +2678,7 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2552
2678
|
bottom: "_bottom_s9o0g_7",
|
|
2553
2679
|
left: "_left_s9o0g_9",
|
|
2554
2680
|
right: "_right_s9o0g_11"
|
|
2555
|
-
},
|
|
2681
|
+
}, Vt = ({ content: e, children: i, placement: a = "top", delay: s = 450, disabled: c = !1, maxWidth: d = 280, className: f = "" }) => {
|
|
2556
2682
|
let h = u(), [g, _] = m(!1), v = p(null), y = () => {
|
|
2557
2683
|
c || !e || (v.current = setTimeout(() => _(!0), s));
|
|
2558
2684
|
}, b = () => {
|
|
@@ -2574,80 +2700,80 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2574
2700
|
onBlur: b
|
|
2575
2701
|
});
|
|
2576
2702
|
return /* @__PURE__ */ n("span", {
|
|
2577
|
-
className: `${
|
|
2703
|
+
className: `${Bt.root} ${f}`,
|
|
2578
2704
|
onPointerDown: g ? b : y,
|
|
2579
2705
|
children: [x, g && /* @__PURE__ */ t("span", {
|
|
2580
2706
|
id: h,
|
|
2581
2707
|
role: "tooltip",
|
|
2582
|
-
className: `${
|
|
2708
|
+
className: `${Bt.tooltip} ${Bt[a]}`,
|
|
2583
2709
|
style: { maxWidth: d },
|
|
2584
2710
|
children: e
|
|
2585
2711
|
})]
|
|
2586
2712
|
});
|
|
2587
|
-
},
|
|
2713
|
+
}, Ht = (e) => {
|
|
2588
2714
|
if (!Number.isFinite(e) || e < 0) return "00:00";
|
|
2589
2715
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60, a = `${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}`;
|
|
2590
2716
|
return n ? `${n}:${a}` : a;
|
|
2591
2717
|
}, $ = {
|
|
2592
|
-
root: "
|
|
2593
|
-
frame: "
|
|
2594
|
-
video: "
|
|
2595
|
-
overlay: "
|
|
2596
|
-
state: "
|
|
2597
|
-
buffering: "
|
|
2598
|
-
loaderViewport: "
|
|
2599
|
-
loaderScale: "
|
|
2600
|
-
stateIcon: "
|
|
2601
|
-
empty: "
|
|
2602
|
-
error: "
|
|
2603
|
-
replay: "
|
|
2604
|
-
controlsLayer: "
|
|
2605
|
-
controlsVisible: "
|
|
2606
|
-
controls: "
|
|
2607
|
-
controlGroup: "
|
|
2608
|
-
controlButton: "
|
|
2609
|
-
settingsAction: "
|
|
2610
|
-
timeline: "
|
|
2611
|
-
volume: "
|
|
2612
|
-
settings: "
|
|
2613
|
-
playButton: "
|
|
2614
|
-
volumeGroup: "
|
|
2615
|
-
timelineGroup: "
|
|
2616
|
-
time: "
|
|
2617
|
-
settingsActionLabel: "
|
|
2618
|
-
caption: "
|
|
2619
|
-
fullscreen: "
|
|
2620
|
-
},
|
|
2718
|
+
root: "_root_1oxvl_1",
|
|
2719
|
+
frame: "_frame_1oxvl_35",
|
|
2720
|
+
video: "_video_1oxvl_65",
|
|
2721
|
+
overlay: "_overlay_1oxvl_79",
|
|
2722
|
+
state: "_state_1oxvl_81",
|
|
2723
|
+
buffering: "_buffering_1oxvl_83",
|
|
2724
|
+
loaderViewport: "_loaderViewport_1oxvl_143",
|
|
2725
|
+
loaderScale: "_loaderScale_1oxvl_155",
|
|
2726
|
+
stateIcon: "_stateIcon_1oxvl_169",
|
|
2727
|
+
empty: "_empty_1oxvl_201",
|
|
2728
|
+
error: "_error_1oxvl_211",
|
|
2729
|
+
replay: "_replay_1oxvl_223",
|
|
2730
|
+
controlsLayer: "_controlsLayer_1oxvl_259",
|
|
2731
|
+
controlsVisible: "_controlsVisible_1oxvl_285",
|
|
2732
|
+
controls: "_controls_1oxvl_259",
|
|
2733
|
+
controlGroup: "_controlGroup_1oxvl_309",
|
|
2734
|
+
controlButton: "_controlButton_1oxvl_335",
|
|
2735
|
+
settingsAction: "_settingsAction_1oxvl_367",
|
|
2736
|
+
timeline: "_timeline_1oxvl_385",
|
|
2737
|
+
volume: "_volume_1oxvl_387",
|
|
2738
|
+
settings: "_settings_1oxvl_367",
|
|
2739
|
+
playButton: "_playButton_1oxvl_401",
|
|
2740
|
+
volumeGroup: "_volumeGroup_1oxvl_415",
|
|
2741
|
+
timelineGroup: "_timelineGroup_1oxvl_439",
|
|
2742
|
+
time: "_time_1oxvl_385",
|
|
2743
|
+
settingsActionLabel: "_settingsActionLabel_1oxvl_677",
|
|
2744
|
+
caption: "_caption_1oxvl_689",
|
|
2745
|
+
fullscreen: "_fullscreen_1oxvl_703"
|
|
2746
|
+
}, Ut = 2500, Wt = 5, Gt = .05, Kt = [
|
|
2621
2747
|
.5,
|
|
2622
2748
|
.75,
|
|
2623
2749
|
1,
|
|
2624
2750
|
1.25,
|
|
2625
2751
|
1.5,
|
|
2626
2752
|
2
|
|
2627
|
-
],
|
|
2628
|
-
let y = p(null), b = p(null), x = p(null), S = p(void 0), [C, w] = m(!1), [E, te] = m(r.length > 0), [D, O] = m(!1), [k, j] = m(!1), [M, N] = m(!1), [P, F] = m(0), [I, L] = m(0), [R, z] = m(0), [B,
|
|
2753
|
+
], qt = ({ sources: r, tracks: i = [], title: a, aspectRatio: o = "16 / 9", objectFit: c = "contain", loading: u = !1, error: d, fallback: f, className: h = "", controls: g = !0, playsInline: _ = !0, ...v }) => {
|
|
2754
|
+
let y = p(null), b = p(null), x = p(null), S = p(void 0), [C, w] = m(!1), [E, te] = m(r.length > 0), [D, O] = m(!1), [k, j] = m(!1), [M, N] = m(!1), [P, F] = m(0), [I, L] = m(0), [R, z] = m(0), [B, V] = m(1), [H, U] = m(!!v.muted), [W, G] = m(1), [ne, re] = m(!!v.loop), [ie, ae] = m(-1), [oe, se] = m(!1), [ce, K] = m(!0), [q, J] = m(!1), [le, ue] = m(!1), de = r.map(({ src: e, type: t }) => `${e}:${t ?? ""}`).join("|"), Y = i.map((e, t) => ({
|
|
2629
2755
|
track: e,
|
|
2630
2756
|
index: t
|
|
2631
|
-
})).filter(({ track: e }) => e.kind === "captions" || e.kind === "subtitles"),
|
|
2632
|
-
|
|
2633
|
-
}, [k,
|
|
2757
|
+
})).filter(({ track: e }) => e.kind === "captions" || e.kind === "subtitles"), X = d ?? (C ? "Не удалось воспроизвести видео" : void 0), fe = u || E && !X && r.length > 0, pe = !fe && !X && r.length === 0, me = typeof document < "u" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled, he = s(() => {
|
|
2758
|
+
K(!0), window.clearTimeout(S.current), k && !oe && (S.current = window.setTimeout(() => K(!1), Ut));
|
|
2759
|
+
}, [k, oe]);
|
|
2634
2760
|
l(() => {
|
|
2635
2761
|
w(!1), te(r.length > 0), O(!1), j(!1), N(!1), F(0), L(0), z(0);
|
|
2636
|
-
}, [
|
|
2637
|
-
let e = () =>
|
|
2762
|
+
}, [de, r.length]), l(() => (he(), () => window.clearTimeout(S.current)), [he]), l(() => {
|
|
2763
|
+
let e = () => J(document.fullscreenElement === b.current), t = () => ue(document.pictureInPictureElement === x.current);
|
|
2638
2764
|
return document.addEventListener("fullscreenchange", e), document.addEventListener("enterpictureinpicture", t), document.addEventListener("leavepictureinpicture", t), () => {
|
|
2639
2765
|
document.removeEventListener("fullscreenchange", e), document.removeEventListener("enterpictureinpicture", t), document.removeEventListener("leavepictureinpicture", t);
|
|
2640
2766
|
};
|
|
2641
2767
|
}, []), l(() => {
|
|
2642
|
-
if (!
|
|
2768
|
+
if (!oe) return;
|
|
2643
2769
|
let e = (e) => {
|
|
2644
|
-
y.current?.contains(e.target) ||
|
|
2770
|
+
y.current?.contains(e.target) || se(!1);
|
|
2645
2771
|
};
|
|
2646
2772
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
2647
|
-
}, [
|
|
2773
|
+
}, [oe]);
|
|
2648
2774
|
let ge = async () => {
|
|
2649
2775
|
let e = x.current;
|
|
2650
|
-
if (!(!e ||
|
|
2776
|
+
if (!(!e || X || fe)) {
|
|
2651
2777
|
if (e.paused || e.ended) {
|
|
2652
2778
|
e.ended && (e.currentTime = 0);
|
|
2653
2779
|
try {
|
|
@@ -2663,54 +2789,54 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2663
2789
|
}, ve = (e) => {
|
|
2664
2790
|
let t = x.current;
|
|
2665
2791
|
t && (t.volume = Math.min(1, Math.max(0, e)), t.muted = t.volume === 0);
|
|
2666
|
-
},
|
|
2792
|
+
}, Z = (e) => {
|
|
2667
2793
|
let t = x.current;
|
|
2668
2794
|
!t || !I || (t.currentTime = Math.min(I, Math.max(0, e)), F(t.currentTime));
|
|
2669
|
-
},
|
|
2795
|
+
}, ye = async () => {
|
|
2670
2796
|
if (b.current) try {
|
|
2671
2797
|
document.fullscreenElement ? await document.exitFullscreen() : await b.current.requestFullscreen();
|
|
2672
2798
|
} catch {
|
|
2673
|
-
|
|
2799
|
+
J(!1);
|
|
2674
2800
|
}
|
|
2675
|
-
},
|
|
2801
|
+
}, be = async () => {
|
|
2676
2802
|
let e = x.current;
|
|
2677
2803
|
if (!(!e || !me)) try {
|
|
2678
2804
|
document.pictureInPictureElement ? await document.exitPictureInPicture() : await e.requestPictureInPicture();
|
|
2679
2805
|
} catch {
|
|
2680
|
-
|
|
2806
|
+
ue(!1);
|
|
2681
2807
|
}
|
|
2682
|
-
},
|
|
2808
|
+
}, xe = (e) => {
|
|
2683
2809
|
let t = x.current;
|
|
2684
2810
|
t && (Array.from(t.textTracks).forEach((t, n) => {
|
|
2685
2811
|
t.mode = n === e ? "showing" : "disabled";
|
|
2686
|
-
}),
|
|
2687
|
-
},
|
|
2812
|
+
}), ae(e));
|
|
2813
|
+
}, Se = (e) => {
|
|
2688
2814
|
let t = e.target;
|
|
2689
2815
|
if (/^(INPUT|SELECT|BUTTON)$/.test(t.tagName)) return;
|
|
2690
2816
|
let n = e.key.toLowerCase();
|
|
2691
|
-
n === " " || n === "k" ? (e.preventDefault(), ge()) : n === "m" ? (e.preventDefault(), _e()) : n === "f" ? (e.preventDefault(),
|
|
2692
|
-
},
|
|
2817
|
+
n === " " || n === "k" ? (e.preventDefault(), ge()) : n === "m" ? (e.preventDefault(), _e()) : n === "f" ? (e.preventDefault(), ye()) : n === "c" && Y.length ? (e.preventDefault(), xe(ie === -1 ? Y[0].index : -1)) : e.key === "ArrowLeft" || e.key === "ArrowRight" ? (e.preventDefault(), Z(P + (e.key === "ArrowRight" ? Wt : -5))) : e.key === "ArrowUp" || e.key === "ArrowDown" ? (e.preventDefault(), ve(B + (e.key === "ArrowUp" ? Gt : -.05))) : e.key === "Escape" && se(!1), he();
|
|
2818
|
+
}, Ce = () => {
|
|
2693
2819
|
let e = x.current;
|
|
2694
2820
|
w(!1), te(!0), e?.load();
|
|
2695
|
-
},
|
|
2821
|
+
}, we = {
|
|
2696
2822
|
"--video-progress": `${I ? P / I * 100 : 0}%`,
|
|
2697
2823
|
"--video-buffered": `${R * 100}%`
|
|
2698
2824
|
};
|
|
2699
2825
|
return /* @__PURE__ */ n("figure", {
|
|
2700
2826
|
ref: y,
|
|
2701
2827
|
className: `${$.root} ${h}`,
|
|
2702
|
-
onKeyDown:
|
|
2828
|
+
onKeyDown: Se,
|
|
2703
2829
|
children: [/* @__PURE__ */ n("div", {
|
|
2704
2830
|
ref: b,
|
|
2705
|
-
className: `${$.frame} ${
|
|
2831
|
+
className: `${$.frame} ${q ? $.fullscreen : ""}`,
|
|
2706
2832
|
style: { aspectRatio: o },
|
|
2707
|
-
"aria-busy":
|
|
2833
|
+
"aria-busy": fe || void 0,
|
|
2708
2834
|
tabIndex: g && r.length ? 0 : void 0,
|
|
2709
2835
|
onPointerMove: he,
|
|
2710
2836
|
onPointerDown: he,
|
|
2711
2837
|
onFocusCapture: he,
|
|
2712
2838
|
onMouseLeave: () => {
|
|
2713
|
-
k && !
|
|
2839
|
+
k && !oe && K(!1);
|
|
2714
2840
|
},
|
|
2715
2841
|
children: [
|
|
2716
2842
|
r.length > 0 && /* @__PURE__ */ n("video", {
|
|
@@ -2719,22 +2845,22 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2719
2845
|
"aria-label": a,
|
|
2720
2846
|
controls: !1,
|
|
2721
2847
|
playsInline: _,
|
|
2722
|
-
loop:
|
|
2848
|
+
loop: ne,
|
|
2723
2849
|
className: $.video,
|
|
2724
2850
|
style: { objectFit: c },
|
|
2725
2851
|
onClick: (e) => {
|
|
2726
2852
|
v.onClick?.(e), ge();
|
|
2727
2853
|
},
|
|
2728
2854
|
onDoubleClick: (e) => {
|
|
2729
|
-
v.onDoubleClick?.(e),
|
|
2855
|
+
v.onDoubleClick?.(e), ye();
|
|
2730
2856
|
},
|
|
2731
2857
|
onLoadStart: (e) => {
|
|
2732
2858
|
te(!0), v.onLoadStart?.(e);
|
|
2733
2859
|
},
|
|
2734
2860
|
onLoadedMetadata: (e) => {
|
|
2735
2861
|
L(e.currentTarget.duration || 0);
|
|
2736
|
-
let t =
|
|
2737
|
-
|
|
2862
|
+
let t = Y.find(({ track: e }) => e.default);
|
|
2863
|
+
xe(t?.index ?? -1), v.onLoadedMetadata?.(e);
|
|
2738
2864
|
},
|
|
2739
2865
|
onDurationChange: (e) => {
|
|
2740
2866
|
L(e.currentTarget.duration || 0), v.onDurationChange?.(e);
|
|
@@ -2765,20 +2891,20 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2765
2891
|
j(!1), v.onPause?.(e);
|
|
2766
2892
|
},
|
|
2767
2893
|
onEnded: (e) => {
|
|
2768
|
-
j(!1), N(!0),
|
|
2894
|
+
j(!1), N(!0), K(!0), v.onEnded?.(e);
|
|
2769
2895
|
},
|
|
2770
2896
|
onVolumeChange: (e) => {
|
|
2771
|
-
|
|
2897
|
+
V(e.currentTarget.volume), U(e.currentTarget.muted), v.onVolumeChange?.(e);
|
|
2772
2898
|
},
|
|
2773
2899
|
onRateChange: (e) => {
|
|
2774
|
-
|
|
2900
|
+
G(e.currentTarget.playbackRate), v.onRateChange?.(e);
|
|
2775
2901
|
},
|
|
2776
2902
|
onError: (e) => {
|
|
2777
2903
|
te(!1), O(!1), w(!0), v.onError?.(e);
|
|
2778
2904
|
},
|
|
2779
2905
|
children: [r.map((e) => /* @__PURE__ */ t("source", { ...e }, `${e.src}-${e.type}`)), i.map((e) => /* @__PURE__ */ t("track", { ...e }, `${e.src}-${e.srcLang}`))]
|
|
2780
2906
|
}),
|
|
2781
|
-
|
|
2907
|
+
fe && /* @__PURE__ */ n("div", {
|
|
2782
2908
|
className: $.overlay,
|
|
2783
2909
|
role: "status",
|
|
2784
2910
|
"aria-live": "polite",
|
|
@@ -2787,11 +2913,11 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2787
2913
|
"aria-hidden": "true",
|
|
2788
2914
|
children: /* @__PURE__ */ t("div", {
|
|
2789
2915
|
className: $.loaderScale,
|
|
2790
|
-
children: /* @__PURE__ */ t(
|
|
2916
|
+
children: /* @__PURE__ */ t(jt, {})
|
|
2791
2917
|
})
|
|
2792
2918
|
}), /* @__PURE__ */ t("span", { children: "Загрузка видео" })]
|
|
2793
2919
|
}),
|
|
2794
|
-
!
|
|
2920
|
+
!fe && D && !X && /* @__PURE__ */ t("div", {
|
|
2795
2921
|
className: $.buffering,
|
|
2796
2922
|
role: "status",
|
|
2797
2923
|
"aria-label": "Буферизация видео",
|
|
@@ -2811,7 +2937,7 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2811
2937
|
f ?? /* @__PURE__ */ t("span", { children: "Источник видео не указан" })
|
|
2812
2938
|
]
|
|
2813
2939
|
}),
|
|
2814
|
-
!
|
|
2940
|
+
!fe && X && /* @__PURE__ */ n("div", {
|
|
2815
2941
|
className: `${$.state} ${$.error}`,
|
|
2816
2942
|
role: "alert",
|
|
2817
2943
|
children: [
|
|
@@ -2821,16 +2947,16 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2821
2947
|
width: 40,
|
|
2822
2948
|
height: 40
|
|
2823
2949
|
}),
|
|
2824
|
-
f ?? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("strong", { children: "Видео недоступно" }), /* @__PURE__ */ t("span", { children:
|
|
2950
|
+
f ?? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("strong", { children: "Видео недоступно" }), /* @__PURE__ */ t("span", { children: X })] }),
|
|
2825
2951
|
r.length > 0 && /* @__PURE__ */ t(T, {
|
|
2826
2952
|
size: "sm",
|
|
2827
2953
|
variant: "secondary",
|
|
2828
|
-
onClick:
|
|
2954
|
+
onClick: Ce,
|
|
2829
2955
|
children: "Повторить"
|
|
2830
2956
|
})
|
|
2831
2957
|
]
|
|
2832
2958
|
}),
|
|
2833
|
-
!
|
|
2959
|
+
!fe && !X && M && /* @__PURE__ */ t("button", {
|
|
2834
2960
|
type: "button",
|
|
2835
2961
|
className: $.replay,
|
|
2836
2962
|
"aria-label": "Воспроизвести заново",
|
|
@@ -2841,32 +2967,32 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2841
2967
|
height: 28
|
|
2842
2968
|
})
|
|
2843
2969
|
}),
|
|
2844
|
-
g && r.length > 0 && !
|
|
2845
|
-
className: `${$.controlsLayer} ${
|
|
2970
|
+
g && r.length > 0 && !fe && !X && /* @__PURE__ */ n("div", {
|
|
2971
|
+
className: `${$.controlsLayer} ${ce || !k ? $.controlsVisible : ""}`,
|
|
2846
2972
|
onClick: (e) => e.stopPropagation(),
|
|
2847
|
-
children: [
|
|
2973
|
+
children: [oe && /* @__PURE__ */ n("div", {
|
|
2848
2974
|
className: $.settings,
|
|
2849
2975
|
role: "dialog",
|
|
2850
2976
|
"aria-label": "Настройки видео",
|
|
2851
2977
|
children: [
|
|
2852
2978
|
/* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("span", { children: "Скорость" }), /* @__PURE__ */ t("select", {
|
|
2853
|
-
value:
|
|
2979
|
+
value: W,
|
|
2854
2980
|
onChange: (e) => {
|
|
2855
2981
|
let t = Number(e.target.value);
|
|
2856
2982
|
x.current && (x.current.playbackRate = t);
|
|
2857
2983
|
},
|
|
2858
|
-
children:
|
|
2984
|
+
children: Kt.map((e) => /* @__PURE__ */ n("option", {
|
|
2859
2985
|
value: e,
|
|
2860
2986
|
children: [e, "×"]
|
|
2861
2987
|
}, e))
|
|
2862
2988
|
})] }),
|
|
2863
|
-
|
|
2864
|
-
value:
|
|
2865
|
-
onChange: (e) =>
|
|
2989
|
+
Y.length > 0 && /* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("span", { children: "Субтитры" }), /* @__PURE__ */ n("select", {
|
|
2990
|
+
value: ie,
|
|
2991
|
+
onChange: (e) => xe(Number(e.target.value)),
|
|
2866
2992
|
children: [/* @__PURE__ */ t("option", {
|
|
2867
2993
|
value: -1,
|
|
2868
2994
|
children: "Выключены"
|
|
2869
|
-
}),
|
|
2995
|
+
}), Y.map(({ track: e, index: n }) => /* @__PURE__ */ t("option", {
|
|
2870
2996
|
value: n,
|
|
2871
2997
|
children: e.label
|
|
2872
2998
|
}, `${e.srcLang}-${e.label}`))]
|
|
@@ -2874,15 +3000,15 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2874
3000
|
/* @__PURE__ */ n("button", {
|
|
2875
3001
|
type: "button",
|
|
2876
3002
|
className: $.settingsAction,
|
|
2877
|
-
"aria-pressed":
|
|
2878
|
-
onClick: () =>
|
|
2879
|
-
children: [/* @__PURE__ */ t("span", { children: "Повтор" }), /* @__PURE__ */ t("span", { children:
|
|
3003
|
+
"aria-pressed": ne,
|
|
3004
|
+
onClick: () => re((e) => !e),
|
|
3005
|
+
children: [/* @__PURE__ */ t("span", { children: "Повтор" }), /* @__PURE__ */ t("span", { children: ne ? "Вкл." : "Выкл." })]
|
|
2880
3006
|
}),
|
|
2881
3007
|
me && /* @__PURE__ */ t("button", {
|
|
2882
3008
|
type: "button",
|
|
2883
3009
|
className: $.settingsAction,
|
|
2884
|
-
"aria-pressed":
|
|
2885
|
-
onClick: () => void
|
|
3010
|
+
"aria-pressed": le,
|
|
3011
|
+
onClick: () => void be(),
|
|
2886
3012
|
children: /* @__PURE__ */ n("span", {
|
|
2887
3013
|
className: $.settingsActionLabel,
|
|
2888
3014
|
children: [/* @__PURE__ */ t(A, {
|
|
@@ -2916,12 +3042,12 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2916
3042
|
children: [/* @__PURE__ */ t("button", {
|
|
2917
3043
|
type: "button",
|
|
2918
3044
|
className: $.controlButton,
|
|
2919
|
-
"aria-label":
|
|
2920
|
-
"aria-pressed":
|
|
3045
|
+
"aria-label": H ? "Включить звук" : "Выключить звук",
|
|
3046
|
+
"aria-pressed": H,
|
|
2921
3047
|
title: "Звук (M)",
|
|
2922
3048
|
onClick: _e,
|
|
2923
3049
|
children: /* @__PURE__ */ t(A, {
|
|
2924
|
-
name:
|
|
3050
|
+
name: H || B === 0 ? "IconVolumeMuted" : "IconVolume",
|
|
2925
3051
|
width: 22,
|
|
2926
3052
|
height: 22
|
|
2927
3053
|
})
|
|
@@ -2931,9 +3057,9 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2931
3057
|
min: 0,
|
|
2932
3058
|
max: 1,
|
|
2933
3059
|
step: .05,
|
|
2934
|
-
value:
|
|
3060
|
+
value: H ? 0 : B,
|
|
2935
3061
|
"aria-label": "Громкость",
|
|
2936
|
-
"aria-valuetext": `${Math.round((
|
|
3062
|
+
"aria-valuetext": `${Math.round((H ? 0 : B) * 100)}%`,
|
|
2937
3063
|
onChange: (e) => ve(Number(e.target.value))
|
|
2938
3064
|
})]
|
|
2939
3065
|
}),
|
|
@@ -2942,23 +3068,23 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2942
3068
|
children: [
|
|
2943
3069
|
/* @__PURE__ */ t("span", {
|
|
2944
3070
|
className: $.time,
|
|
2945
|
-
children:
|
|
3071
|
+
children: Ht(P)
|
|
2946
3072
|
}),
|
|
2947
3073
|
/* @__PURE__ */ t("input", {
|
|
2948
3074
|
className: $.timeline,
|
|
2949
|
-
style:
|
|
3075
|
+
style: we,
|
|
2950
3076
|
type: "range",
|
|
2951
3077
|
min: 0,
|
|
2952
3078
|
max: I || 0,
|
|
2953
3079
|
step: .01,
|
|
2954
3080
|
value: Math.min(P, I || 0),
|
|
2955
3081
|
"aria-label": "Позиция воспроизведения",
|
|
2956
|
-
"aria-valuetext": `${
|
|
2957
|
-
onChange: (e) =>
|
|
3082
|
+
"aria-valuetext": `${Ht(P)} из ${Ht(I)}`,
|
|
3083
|
+
onChange: (e) => Z(Number(e.target.value))
|
|
2958
3084
|
}),
|
|
2959
3085
|
/* @__PURE__ */ t("span", {
|
|
2960
3086
|
className: $.time,
|
|
2961
|
-
children:
|
|
3087
|
+
children: Ht(I)
|
|
2962
3088
|
})
|
|
2963
3089
|
]
|
|
2964
3090
|
}),
|
|
@@ -2968,9 +3094,9 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2968
3094
|
type: "button",
|
|
2969
3095
|
className: $.controlButton,
|
|
2970
3096
|
"aria-label": "Настройки",
|
|
2971
|
-
"aria-expanded":
|
|
3097
|
+
"aria-expanded": oe,
|
|
2972
3098
|
title: "Настройки",
|
|
2973
|
-
onClick: () =>
|
|
3099
|
+
onClick: () => se((e) => !e),
|
|
2974
3100
|
children: /* @__PURE__ */ t(A, {
|
|
2975
3101
|
name: "IconSettings",
|
|
2976
3102
|
width: 22,
|
|
@@ -2979,11 +3105,11 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2979
3105
|
}), /* @__PURE__ */ t("button", {
|
|
2980
3106
|
type: "button",
|
|
2981
3107
|
className: $.controlButton,
|
|
2982
|
-
"aria-label":
|
|
3108
|
+
"aria-label": q ? "Выйти из полноэкранного режима" : "Полноэкранный режим",
|
|
2983
3109
|
title: "Полноэкранный режим (F)",
|
|
2984
|
-
onClick: () => void
|
|
3110
|
+
onClick: () => void ye(),
|
|
2985
3111
|
children: /* @__PURE__ */ t(A, {
|
|
2986
|
-
name:
|
|
3112
|
+
name: q ? "IconFullscreenExit" : "IconFullscreen",
|
|
2987
3113
|
width: 22,
|
|
2988
3114
|
height: 22
|
|
2989
3115
|
})
|
|
@@ -2998,7 +3124,7 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2998
3124
|
children: a
|
|
2999
3125
|
})]
|
|
3000
3126
|
});
|
|
3001
|
-
},
|
|
3127
|
+
}, Jt = {
|
|
3002
3128
|
root: "_root_1tdda_1",
|
|
3003
3129
|
trigger: "_trigger_1tdda_15",
|
|
3004
3130
|
heading: "_heading_1tdda_41",
|
|
@@ -3008,7 +3134,7 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3008
3134
|
open: "_open_1tdda_91",
|
|
3009
3135
|
content: "_content_1tdda_99",
|
|
3010
3136
|
contentInner: "_contentInner_1tdda_119"
|
|
3011
|
-
},
|
|
3137
|
+
}, Yt = (e, t, n, r = 16) => {
|
|
3012
3138
|
if (t > Math.max(0, n - r * 2)) {
|
|
3013
3139
|
let t = e - r;
|
|
3014
3140
|
return Math.abs(t) <= 1 ? {
|
|
@@ -3030,7 +3156,7 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3030
3156
|
alignment: "none",
|
|
3031
3157
|
delta: 0
|
|
3032
3158
|
};
|
|
3033
|
-
},
|
|
3159
|
+
}, Xt = ({ title: e, subtitle: r, children: i, defaultOpen: a = !1, open: o, onOpenChange: s, autoScrollOnOpen: c = !0, scrollOffset: d = 16, className: f = "" }) => {
|
|
3034
3160
|
let h = u(), [g, _] = m(a), v = o ?? g, y = p(null), b = p(null), x = p(v);
|
|
3035
3161
|
return l(() => {
|
|
3036
3162
|
let e = x.current;
|
|
@@ -3040,7 +3166,7 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3040
3166
|
let r = !1, i = () => {
|
|
3041
3167
|
if (r) return;
|
|
3042
3168
|
r = !0;
|
|
3043
|
-
let e = t.getBoundingClientRect(), n =
|
|
3169
|
+
let e = t.getBoundingClientRect(), n = Yt(e.top, e.height, window.innerHeight, d);
|
|
3044
3170
|
if (n.alignment === "none") return;
|
|
3045
3171
|
let i = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
3046
3172
|
window.scrollBy({
|
|
@@ -3061,10 +3187,10 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3061
3187
|
d
|
|
3062
3188
|
]), /* @__PURE__ */ n("section", {
|
|
3063
3189
|
ref: y,
|
|
3064
|
-
className: `${
|
|
3190
|
+
className: `${Jt.root} ${v ? Jt.open : ""} ${f}`,
|
|
3065
3191
|
children: [/* @__PURE__ */ n("button", {
|
|
3066
3192
|
type: "button",
|
|
3067
|
-
className:
|
|
3193
|
+
className: Jt.trigger,
|
|
3068
3194
|
"aria-expanded": v,
|
|
3069
3195
|
"aria-controls": h,
|
|
3070
3196
|
onClick: () => {
|
|
@@ -3072,16 +3198,16 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3072
3198
|
o === void 0 && _(e), s?.(e);
|
|
3073
3199
|
},
|
|
3074
3200
|
children: [/* @__PURE__ */ n("span", {
|
|
3075
|
-
className:
|
|
3201
|
+
className: Jt.heading,
|
|
3076
3202
|
children: [/* @__PURE__ */ t("span", {
|
|
3077
|
-
className:
|
|
3203
|
+
className: Jt.title,
|
|
3078
3204
|
children: e
|
|
3079
3205
|
}), r && /* @__PURE__ */ t("span", {
|
|
3080
|
-
className:
|
|
3206
|
+
className: Jt.subtitle,
|
|
3081
3207
|
children: r
|
|
3082
3208
|
})]
|
|
3083
3209
|
}), /* @__PURE__ */ t("span", {
|
|
3084
|
-
className:
|
|
3210
|
+
className: Jt.icon,
|
|
3085
3211
|
"aria-hidden": "true",
|
|
3086
3212
|
children: /* @__PURE__ */ t(A, {
|
|
3087
3213
|
name: "IconChevron",
|
|
@@ -3092,15 +3218,15 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3092
3218
|
}), /* @__PURE__ */ t("div", {
|
|
3093
3219
|
ref: b,
|
|
3094
3220
|
id: h,
|
|
3095
|
-
className:
|
|
3221
|
+
className: Jt.content,
|
|
3096
3222
|
"aria-hidden": !v,
|
|
3097
3223
|
children: /* @__PURE__ */ t("div", {
|
|
3098
|
-
className:
|
|
3224
|
+
className: Jt.contentInner,
|
|
3099
3225
|
children: i
|
|
3100
3226
|
})
|
|
3101
3227
|
})]
|
|
3102
3228
|
});
|
|
3103
|
-
},
|
|
3229
|
+
}, Zt = ({ children: e, containerId: t = "overlay-root" }) => {
|
|
3104
3230
|
let [n, r] = m(null);
|
|
3105
3231
|
return l(() => {
|
|
3106
3232
|
let e = document.getElementById(t);
|
|
@@ -3115,4 +3241,4 @@ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3115
3241
|
}, [t]), n ? h(e, n) : null;
|
|
3116
3242
|
};
|
|
3117
3243
|
//#endregion
|
|
3118
|
-
export {
|
|
3244
|
+
export { xt as ConfirmModal, Xt as DSAccordion, S as DSBadge, T as DSButton, M as DSCheckbox, je as DSDataTable, le as DSDateRange, K as DSDateTimePicker, ge as DSDropDown, Ie as DSDropDownMultiple, te as DSFieldLabel, D as DSFieldMessage, nt as DSFileInput, Ze as DSFilters, A as DSIcon, qe as DSInfoBlock, Re as DSInput, ee as DSLoader, ht as DSModal, mt as DSModalFrame, jt as DSPageLoader, Zt as DSPortal, Ye as DSRadioButton, Ge as DSSearchDropDown, de as DSSkeleton, ve as DSSort, ot as DSTextarea, Pt as DSToast, Rt as DSToastProvider, Vt as DSTooltip, qt as DSVideoPlayerFrame, St as ErrorModal, gt as ModalSystemProvider, Ct as builtInModalRegistry, _t as defineModalRegistry, z as formatDateInputValue, G as formatDateTimeLocalValue, Yt as getDSAccordionScrollTarget, be as getDSDataTableColumnStyle, xe as getDSDataTablePaginationItems, Tt as getErrorMessage, me as getNextEnabledOptionIndex, H as isValidDateInputPrefix, J as isValidDateRange, B as maskDateInputValue, U as parseDateInputValue, ne as parseDateTimeLocalValue, lt as resetModalStore, Lt as resetToastStore, wt as useConfirmModal, Dt as useConfirmModalStore, Et as useErrorModal, Ot as useErrorModalStore, kt as useModals, ct as useModalsStore, zt as useToast, It as useToastStore, Se as validateDSDataTableData };
|