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