@efficiency-point/design-system 0.1.16 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js
CHANGED
|
@@ -4,17 +4,17 @@ import { createPortal as h } from "react-dom";
|
|
|
4
4
|
import { createSortedRowModel as g, rowSortingFeature as _, tableFeatures as v, useTable as y } from "@tanstack/react-table";
|
|
5
5
|
import { create as b } from "zustand";
|
|
6
6
|
var x = {
|
|
7
|
-
badge: "
|
|
8
|
-
sm: "
|
|
9
|
-
md: "
|
|
10
|
-
neutral: "
|
|
11
|
-
info: "
|
|
12
|
-
success: "
|
|
13
|
-
warning: "
|
|
14
|
-
error: "
|
|
15
|
-
dot: "
|
|
16
|
-
icon: "
|
|
17
|
-
label: "
|
|
7
|
+
badge: "_badge_1xyff_1",
|
|
8
|
+
sm: "_sm_1xyff_29",
|
|
9
|
+
md: "_md_1xyff_39",
|
|
10
|
+
neutral: "_neutral_1xyff_49",
|
|
11
|
+
info: "_info_1xyff_61",
|
|
12
|
+
success: "_success_1xyff_73",
|
|
13
|
+
warning: "_warning_1xyff_85",
|
|
14
|
+
error: "_error_1xyff_97",
|
|
15
|
+
dot: "_dot_1xyff_109",
|
|
16
|
+
icon: "_icon_1xyff_125",
|
|
17
|
+
label: "_label_1xyff_135"
|
|
18
18
|
}, S = ({ children: e, variant: r = "neutral", size: i = "md", dot: a = !1, icon: o, className: s = "" }) => /* @__PURE__ */ n("span", {
|
|
19
19
|
className: `${x.badge} ${x[r]} ${x[i]} ${s}`,
|
|
20
20
|
children: [
|
|
@@ -33,17 +33,17 @@ var x = {
|
|
|
33
33
|
})
|
|
34
34
|
]
|
|
35
35
|
}), C = {
|
|
36
|
-
container: "
|
|
37
|
-
inner: "
|
|
38
|
-
line: "
|
|
39
|
-
primary: "
|
|
40
|
-
secondary: "
|
|
41
|
-
outline: "
|
|
42
|
-
ghost: "
|
|
43
|
-
empty: "
|
|
44
|
-
destructive: "
|
|
45
|
-
destructiveOutline: "
|
|
46
|
-
grow: "
|
|
36
|
+
container: "_container_18tg4_1",
|
|
37
|
+
inner: "_inner_18tg4_21",
|
|
38
|
+
line: "_line_18tg4_39",
|
|
39
|
+
primary: "_primary_18tg4_57",
|
|
40
|
+
secondary: "_secondary_18tg4_65",
|
|
41
|
+
outline: "_outline_18tg4_73",
|
|
42
|
+
ghost: "_ghost_18tg4_81",
|
|
43
|
+
empty: "_empty_18tg4_89",
|
|
44
|
+
destructive: "_destructive_18tg4_97",
|
|
45
|
+
destructiveOutline: "_destructiveOutline_18tg4_105",
|
|
46
|
+
grow: "_grow_18tg4_1"
|
|
47
47
|
}, ee = ({ variant: e = "primary" }) => /* @__PURE__ */ t("div", {
|
|
48
48
|
className: `${C.container} ${C[e]}`,
|
|
49
49
|
children: /* @__PURE__ */ n("div", {
|
|
@@ -56,17 +56,17 @@ var x = {
|
|
|
56
56
|
]
|
|
57
57
|
})
|
|
58
58
|
}), w = {
|
|
59
|
-
button: "
|
|
60
|
-
sm: "
|
|
61
|
-
md: "
|
|
62
|
-
lg: "
|
|
63
|
-
primary: "
|
|
64
|
-
secondary: "
|
|
65
|
-
outline: "
|
|
66
|
-
ghost: "
|
|
67
|
-
empty: "
|
|
68
|
-
destructive: "
|
|
69
|
-
destructiveOutline: "
|
|
59
|
+
button: "_button_cfuv9_1",
|
|
60
|
+
sm: "_sm_cfuv9_59",
|
|
61
|
+
md: "_md_cfuv9_73",
|
|
62
|
+
lg: "_lg_cfuv9_87",
|
|
63
|
+
primary: "_primary_cfuv9_101",
|
|
64
|
+
secondary: "_secondary_cfuv9_115",
|
|
65
|
+
outline: "_outline_cfuv9_129",
|
|
66
|
+
ghost: "_ghost_cfuv9_143",
|
|
67
|
+
empty: "_empty_cfuv9_157",
|
|
68
|
+
destructive: "_destructive_cfuv9_171",
|
|
69
|
+
destructiveOutline: "_destructiveOutline_cfuv9_183"
|
|
70
70
|
}, T = a(({ children: e, variant: n = "primary", size: r = "md", isLoading: i = !1, disabled: a, type: o = "button", className: s = "", ...c }, l) => /* @__PURE__ */ t("button", {
|
|
71
71
|
ref: l,
|
|
72
72
|
className: `${w.button} ${w[n]} ${w[r]} ${s}`,
|
|
@@ -78,14 +78,14 @@ var x = {
|
|
|
78
78
|
}));
|
|
79
79
|
T.displayName = "DSButton";
|
|
80
80
|
var E = {
|
|
81
|
-
label: "
|
|
82
|
-
required: "
|
|
83
|
-
error: "
|
|
84
|
-
optional: "
|
|
85
|
-
hint: "
|
|
86
|
-
disabled: "
|
|
87
|
-
message: "
|
|
88
|
-
success: "
|
|
81
|
+
label: "_label_1o819_1",
|
|
82
|
+
required: "_required_1o819_23",
|
|
83
|
+
error: "_error_1o819_25",
|
|
84
|
+
optional: "_optional_1o819_33",
|
|
85
|
+
hint: "_hint_1o819_35",
|
|
86
|
+
disabled: "_disabled_1o819_47",
|
|
87
|
+
message: "_message_1o819_55",
|
|
88
|
+
success: "_success_1o819_71"
|
|
89
89
|
}, te = ({ children: e, required: r = !1, optionalText: i, disabled: a = !1, className: o = "", ...s }) => /* @__PURE__ */ n("label", {
|
|
90
90
|
className: `${E.label} ${a ? E.disabled : ""} ${o}`,
|
|
91
91
|
...s,
|
|
@@ -264,12 +264,12 @@ var E = {
|
|
|
264
264
|
let r = k[e];
|
|
265
265
|
return /* @__PURE__ */ t(r, { ...n });
|
|
266
266
|
}, j = {
|
|
267
|
-
wrapper: "
|
|
268
|
-
label: "
|
|
269
|
-
input: "
|
|
270
|
-
control: "
|
|
271
|
-
disabled: "
|
|
272
|
-
controlError: "
|
|
267
|
+
wrapper: "_wrapper_1seon_1",
|
|
268
|
+
label: "_label_1seon_13",
|
|
269
|
+
input: "_input_1seon_35",
|
|
270
|
+
control: "_control_1seon_49",
|
|
271
|
+
disabled: "_disabled_1seon_95",
|
|
272
|
+
controlError: "_controlError_1seon_121"
|
|
273
273
|
}, M = ({ checked: e, onChange: r, label: i, hint: a, error: o, disabled: s = !1, readOnly: c = !1, className: d = "", name: f, id: m, indeterminate: h = !1, ...g }) => {
|
|
274
274
|
let _ = u(), v = m ?? `ds-checkbox-${f ?? _}`, y = p(null), b = a ? `${v}-hint` : void 0, x = o ? `${v}-error` : void 0;
|
|
275
275
|
return l(() => {
|
|
@@ -325,36 +325,36 @@ var E = {
|
|
|
325
325
|
]
|
|
326
326
|
});
|
|
327
327
|
}, N = {
|
|
328
|
-
wrapper: "
|
|
329
|
-
trigger: "
|
|
330
|
-
sm: "
|
|
331
|
-
md: "
|
|
332
|
-
lg: "
|
|
333
|
-
chevron: "
|
|
334
|
-
chevronOpen: "
|
|
335
|
-
nav: "
|
|
336
|
-
day: "
|
|
337
|
-
monthSelect: "
|
|
338
|
-
yearInput: "
|
|
339
|
-
timeInput: "
|
|
340
|
-
dateInput: "
|
|
341
|
-
timeValue: "
|
|
342
|
-
chevronButton: "
|
|
343
|
-
disabled: "
|
|
344
|
-
validationTooltip: "
|
|
345
|
-
"validation-tooltip-lifetime": "_validation-tooltip-
|
|
346
|
-
value: "
|
|
347
|
-
placeholder: "
|
|
348
|
-
error: "
|
|
349
|
-
panel: "
|
|
350
|
-
calendarHeader: "
|
|
351
|
-
weekdays: "
|
|
352
|
-
days: "
|
|
353
|
-
outside: "
|
|
354
|
-
selected: "
|
|
355
|
-
timeLabel: "
|
|
356
|
-
previousMonth: "
|
|
357
|
-
nextMonth: "
|
|
328
|
+
wrapper: "_wrapper_su17c_1",
|
|
329
|
+
trigger: "_trigger_su17c_17",
|
|
330
|
+
sm: "_sm_su17c_53",
|
|
331
|
+
md: "_md_su17c_65",
|
|
332
|
+
lg: "_lg_su17c_75",
|
|
333
|
+
chevron: "_chevron_su17c_89",
|
|
334
|
+
chevronOpen: "_chevronOpen_su17c_115",
|
|
335
|
+
nav: "_nav_su17c_127",
|
|
336
|
+
day: "_day_su17c_129",
|
|
337
|
+
monthSelect: "_monthSelect_su17c_131",
|
|
338
|
+
yearInput: "_yearInput_su17c_133",
|
|
339
|
+
timeInput: "_timeInput_su17c_135",
|
|
340
|
+
dateInput: "_dateInput_su17c_147",
|
|
341
|
+
timeValue: "_timeValue_su17c_189",
|
|
342
|
+
chevronButton: "_chevronButton_su17c_201",
|
|
343
|
+
disabled: "_disabled_su17c_235",
|
|
344
|
+
validationTooltip: "_validationTooltip_su17c_249",
|
|
345
|
+
"validation-tooltip-lifetime": "_validation-tooltip-lifetime_su17c_1",
|
|
346
|
+
value: "_value_su17c_319",
|
|
347
|
+
placeholder: "_placeholder_su17c_335",
|
|
348
|
+
error: "_error_su17c_343",
|
|
349
|
+
panel: "_panel_su17c_351",
|
|
350
|
+
calendarHeader: "_calendarHeader_su17c_377",
|
|
351
|
+
weekdays: "_weekdays_su17c_467",
|
|
352
|
+
days: "_days_su17c_469",
|
|
353
|
+
outside: "_outside_su17c_505",
|
|
354
|
+
selected: "_selected_su17c_513",
|
|
355
|
+
timeLabel: "_timeLabel_su17c_533",
|
|
356
|
+
previousMonth: "_previousMonth_su17c_593",
|
|
357
|
+
nextMonth: "_nextMonth_su17c_601"
|
|
358
358
|
}, P = [
|
|
359
359
|
"Пн",
|
|
360
360
|
"Вт",
|
|
@@ -712,8 +712,8 @@ var E = {
|
|
|
712
712
|
]
|
|
713
713
|
});
|
|
714
714
|
}, q = {
|
|
715
|
-
root: "
|
|
716
|
-
range: "
|
|
715
|
+
root: "_root_19vq2_1",
|
|
716
|
+
range: "_range_19vq2_21"
|
|
717
717
|
}, J = (e) => !!(e.from && e.to && e.from.getTime() <= e.to.getTime()), le = ({ value: e, onChange: r, onDraftChange: i, mode: a = "date", fromLabel: o = "От", toLabel: s = "До", hint: c, error: l, min: u, max: d, disabled: f = !1, readOnly: p = !1, required: m = !1, className: h = "" }) => {
|
|
718
718
|
let g = l ?? (e.from && e.to && e.from > e.to ? "Дата «От» не может быть позже даты «До»" : void 0), _ = (e) => {
|
|
719
719
|
i?.(e), J(e) && r?.(e);
|
|
@@ -755,13 +755,13 @@ var E = {
|
|
|
755
755
|
}), c && !g && /* @__PURE__ */ t(D, { children: c })]
|
|
756
756
|
});
|
|
757
757
|
}, ue = {
|
|
758
|
-
group: "
|
|
759
|
-
skeleton: "
|
|
760
|
-
text: "
|
|
761
|
-
rectangular: "
|
|
762
|
-
circular: "
|
|
763
|
-
animated: "
|
|
764
|
-
"ds-skeleton": "_ds-
|
|
758
|
+
group: "_group_10ug0_1",
|
|
759
|
+
skeleton: "_skeleton_10ug0_15",
|
|
760
|
+
text: "_text_10ug0_27",
|
|
761
|
+
rectangular: "_rectangular_10ug0_37",
|
|
762
|
+
circular: "_circular_10ug0_47",
|
|
763
|
+
animated: "_animated_10ug0_59",
|
|
764
|
+
"ds-skeleton": "_ds-skeleton_10ug0_1"
|
|
765
765
|
}, de = ({ variant: e = "text", width: n = "100%", height: r, lines: i = 1, animated: a = !0, className: o = "" }) => /* @__PURE__ */ t("span", {
|
|
766
766
|
className: `${ue.group} ${o}`,
|
|
767
767
|
"aria-hidden": "true",
|
|
@@ -773,23 +773,23 @@ var E = {
|
|
|
773
773
|
}
|
|
774
774
|
}, s))
|
|
775
775
|
}), Y = {
|
|
776
|
-
wrapper: "
|
|
777
|
-
container: "
|
|
778
|
-
trigger: "
|
|
779
|
-
disabledText: "
|
|
780
|
-
sm: "
|
|
781
|
-
md: "
|
|
782
|
-
lg: "
|
|
783
|
-
value: "
|
|
784
|
-
placeholder: "
|
|
785
|
-
chevron: "
|
|
786
|
-
chevronOpen: "
|
|
787
|
-
menu: "
|
|
788
|
-
option: "
|
|
789
|
-
selected: "
|
|
790
|
-
message: "
|
|
791
|
-
error: "
|
|
792
|
-
errorState: "
|
|
776
|
+
wrapper: "_wrapper_6g3qd_1",
|
|
777
|
+
container: "_container_6g3qd_17",
|
|
778
|
+
trigger: "_trigger_6g3qd_25",
|
|
779
|
+
disabledText: "_disabledText_6g3qd_27",
|
|
780
|
+
sm: "_sm_6g3qd_53",
|
|
781
|
+
md: "_md_6g3qd_67",
|
|
782
|
+
lg: "_lg_6g3qd_81",
|
|
783
|
+
value: "_value_6g3qd_147",
|
|
784
|
+
placeholder: "_placeholder_6g3qd_149",
|
|
785
|
+
chevron: "_chevron_6g3qd_205",
|
|
786
|
+
chevronOpen: "_chevronOpen_6g3qd_231",
|
|
787
|
+
menu: "_menu_6g3qd_239",
|
|
788
|
+
option: "_option_6g3qd_269",
|
|
789
|
+
selected: "_selected_6g3qd_339",
|
|
790
|
+
message: "_message_6g3qd_359",
|
|
791
|
+
error: "_error_6g3qd_361",
|
|
792
|
+
errorState: "_errorState_6g3qd_387"
|
|
793
793
|
}, X = 8, fe = 6, pe = 120, me = (e, t, n) => {
|
|
794
794
|
if (!e.length) return -1;
|
|
795
795
|
for (let r = 0; r < e.length; r += 1) {
|
|
@@ -1014,28 +1014,28 @@ var E = {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
});
|
|
1016
1016
|
}, Z = {
|
|
1017
|
-
root: "
|
|
1018
|
-
tableWrap: "
|
|
1019
|
-
table: "
|
|
1020
|
-
sticky: "
|
|
1021
|
-
sortButton: "
|
|
1022
|
-
state: "
|
|
1023
|
-
cards: "
|
|
1024
|
-
mobileSort: "
|
|
1025
|
-
card: "
|
|
1026
|
-
spanTwo: "
|
|
1027
|
-
clickableRow: "
|
|
1028
|
-
pagination: "
|
|
1029
|
-
paginationRange: "
|
|
1030
|
-
paginationControls: "
|
|
1031
|
-
pageNumbers: "
|
|
1032
|
-
pageButton: "
|
|
1033
|
-
ellipsis: "
|
|
1034
|
-
previousIcon: "
|
|
1035
|
-
nextIcon: "
|
|
1036
|
-
default: "
|
|
1037
|
-
tableOnMobile: "
|
|
1038
|
-
wide: "
|
|
1017
|
+
root: "_root_1jtuu_1",
|
|
1018
|
+
tableWrap: "_tableWrap_1jtuu_15",
|
|
1019
|
+
table: "_table_1jtuu_15",
|
|
1020
|
+
sticky: "_sticky_1jtuu_81",
|
|
1021
|
+
sortButton: "_sortButton_1jtuu_95",
|
|
1022
|
+
state: "_state_1jtuu_133",
|
|
1023
|
+
cards: "_cards_1jtuu_145",
|
|
1024
|
+
mobileSort: "_mobileSort_1jtuu_145",
|
|
1025
|
+
card: "_card_1jtuu_145",
|
|
1026
|
+
spanTwo: "_spanTwo_1jtuu_233",
|
|
1027
|
+
clickableRow: "_clickableRow_1jtuu_241",
|
|
1028
|
+
pagination: "_pagination_1jtuu_249",
|
|
1029
|
+
paginationRange: "_paginationRange_1jtuu_275",
|
|
1030
|
+
paginationControls: "_paginationControls_1jtuu_287",
|
|
1031
|
+
pageNumbers: "_pageNumbers_1jtuu_289",
|
|
1032
|
+
pageButton: "_pageButton_1jtuu_301",
|
|
1033
|
+
ellipsis: "_ellipsis_1jtuu_311",
|
|
1034
|
+
previousIcon: "_previousIcon_1jtuu_323",
|
|
1035
|
+
nextIcon: "_nextIcon_1jtuu_331",
|
|
1036
|
+
default: "_default_1jtuu_371",
|
|
1037
|
+
tableOnMobile: "_tableOnMobile_1jtuu_371",
|
|
1038
|
+
wide: "_wide_1jtuu_401"
|
|
1039
1039
|
}, ye = v({
|
|
1040
1040
|
rowSortingFeature: _,
|
|
1041
1041
|
sortedRowModel: g()
|
|
@@ -1521,15 +1521,15 @@ var E = {
|
|
|
1521
1521
|
]
|
|
1522
1522
|
});
|
|
1523
1523
|
}, Le = {
|
|
1524
|
-
wrapper: "
|
|
1525
|
-
control: "
|
|
1526
|
-
input: "
|
|
1527
|
-
disabledText: "
|
|
1528
|
-
sm: "
|
|
1529
|
-
md: "
|
|
1530
|
-
lg: "
|
|
1531
|
-
inputError: "
|
|
1532
|
-
trailingAction: "
|
|
1524
|
+
wrapper: "_wrapper_1izp1_1",
|
|
1525
|
+
control: "_control_1izp1_15",
|
|
1526
|
+
input: "_input_1izp1_25",
|
|
1527
|
+
disabledText: "_disabledText_1izp1_25",
|
|
1528
|
+
sm: "_sm_1izp1_107",
|
|
1529
|
+
md: "_md_1izp1_123",
|
|
1530
|
+
lg: "_lg_1izp1_139",
|
|
1531
|
+
inputError: "_inputError_1izp1_155",
|
|
1532
|
+
trailingAction: "_trailingAction_1izp1_163"
|
|
1533
1533
|
}, Re = ({ value: e, onChange: r, type: i = "text", placeholder: a = "", disabled: o = !1, readOnly: s = !1, stringWhileDisabled: c = !1, label: d, error: f, hint: h, className: g = "", name: _, id: v, size: y = "md", clearable: b = !0, required: x = !1, selectTextOnFocus: S = !1, isPassword: C = !1, passwordVisibleLabel: ee = "Скрыть пароль", passwordHiddenLabel: w = "Показать пароль", onFocus: T, ...E }) => {
|
|
1534
1534
|
let O = u(), k = v ?? `ds-input-${_ ?? O}`, j = p(null), [M, N] = m(!1), P = h ? `${k}-hint` : void 0, F = f ? `${k}-error` : void 0, I = String(e ?? ""), L = [P, F].filter(Boolean).join(" ") || void 0, R = C ? M ? "text" : "password" : i;
|
|
1535
1535
|
return l(() => {
|
|
@@ -1628,27 +1628,28 @@ var E = {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
return -1;
|
|
1630
1630
|
}, Q = {
|
|
1631
|
-
wrapper: "
|
|
1632
|
-
control: "
|
|
1633
|
-
inputHost: "
|
|
1634
|
-
sm: "
|
|
1635
|
-
md: "
|
|
1636
|
-
lg: "
|
|
1637
|
-
errorState: "
|
|
1638
|
-
disabledText: "
|
|
1639
|
-
chevron: "
|
|
1640
|
-
chevronOpen: "
|
|
1641
|
-
menu: "
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1631
|
+
wrapper: "_wrapper_1v2s8_1",
|
|
1632
|
+
control: "_control_1v2s8_17",
|
|
1633
|
+
inputHost: "_inputHost_1v2s8_25",
|
|
1634
|
+
sm: "_sm_1v2s8_41",
|
|
1635
|
+
md: "_md_1v2s8_57",
|
|
1636
|
+
lg: "_lg_1v2s8_71",
|
|
1637
|
+
errorState: "_errorState_1v2s8_85",
|
|
1638
|
+
disabledText: "_disabledText_1v2s8_93",
|
|
1639
|
+
chevron: "_chevron_1v2s8_163",
|
|
1640
|
+
chevronOpen: "_chevronOpen_1v2s8_197",
|
|
1641
|
+
menu: "_menu_1v2s8_205",
|
|
1642
|
+
menuEmpty: "_menuEmpty_1v2s8_233",
|
|
1643
|
+
option: "_option_1v2s8_241",
|
|
1644
|
+
empty: "_empty_1v2s8_241",
|
|
1645
|
+
selected: "_selected_1v2s8_321",
|
|
1646
|
+
active: "_active_1v2s8_321",
|
|
1647
|
+
visuallyHidden: "_visuallyHidden_1v2s8_341"
|
|
1648
|
+
}, Ve = 8, He = 6, Ue = 5, We = 10, Ge = {
|
|
1649
|
+
sm: 30,
|
|
1650
|
+
md: 40,
|
|
1651
|
+
lg: 50
|
|
1652
|
+
}, Ke = ({ 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 }) => {
|
|
1652
1653
|
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 = [
|
|
1653
1654
|
j,
|
|
1654
1655
|
M,
|
|
@@ -1660,7 +1661,7 @@ var E = {
|
|
|
1660
1661
|
}, []), K = s(() => {
|
|
1661
1662
|
let e = oe();
|
|
1662
1663
|
if (!e) return;
|
|
1663
|
-
let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(re.length, Ue)) *
|
|
1664
|
+
let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(re.length, Ue)) * Ge[x] + We, r = window.innerHeight - t.bottom - Ve, i = t.top - Ve, a = r < n && i > r, o = a ? i : r, s = Math.max(Ge[x] + We, Math.min(n, o)), c = window.innerWidth - t.width - Ve, l = Math.max(Ve, Math.min(t.left, c)), u = a ? Math.max(Ve, t.top - s - He) : t.bottom + He;
|
|
1664
1665
|
G({
|
|
1665
1666
|
top: u,
|
|
1666
1667
|
left: l,
|
|
@@ -1695,7 +1696,7 @@ var E = {
|
|
|
1695
1696
|
}, le = R ? /* @__PURE__ */ t("ul", {
|
|
1696
1697
|
ref: I,
|
|
1697
1698
|
id: k,
|
|
1698
|
-
className: Q.menu
|
|
1699
|
+
className: `${Q.menu} ${re.length === 0 ? Q.menuEmpty : ""}`,
|
|
1699
1700
|
role: "listbox",
|
|
1700
1701
|
"aria-label": v,
|
|
1701
1702
|
style: W ? {
|
|
@@ -1832,25 +1833,25 @@ var E = {
|
|
|
1832
1833
|
})
|
|
1833
1834
|
]
|
|
1834
1835
|
});
|
|
1835
|
-
},
|
|
1836
|
-
root: "
|
|
1837
|
-
header: "
|
|
1838
|
-
title: "
|
|
1839
|
-
dismiss: "
|
|
1840
|
-
content: "
|
|
1841
|
-
},
|
|
1836
|
+
}, qe = {
|
|
1837
|
+
root: "_root_11adi_1",
|
|
1838
|
+
header: "_header_11adi_21",
|
|
1839
|
+
title: "_title_11adi_41",
|
|
1840
|
+
dismiss: "_dismiss_11adi_55",
|
|
1841
|
+
content: "_content_11adi_65"
|
|
1842
|
+
}, Je = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: c = "" }) => {
|
|
1842
1843
|
let l = `ds-info-block-${u()}`;
|
|
1843
1844
|
return /* @__PURE__ */ n("section", {
|
|
1844
|
-
className: `${
|
|
1845
|
+
className: `${qe.root} ${c}`,
|
|
1845
1846
|
"aria-labelledby": l,
|
|
1846
1847
|
children: [/* @__PURE__ */ n("header", {
|
|
1847
|
-
className:
|
|
1848
|
+
className: qe.header,
|
|
1848
1849
|
children: [/* @__PURE__ */ t(s, {
|
|
1849
1850
|
id: l,
|
|
1850
|
-
className:
|
|
1851
|
+
className: qe.title,
|
|
1851
1852
|
children: e
|
|
1852
1853
|
}), i && /* @__PURE__ */ t(T, {
|
|
1853
|
-
className:
|
|
1854
|
+
className: qe.dismiss,
|
|
1854
1855
|
variant: "empty",
|
|
1855
1856
|
onClick: a,
|
|
1856
1857
|
"aria-label": o,
|
|
@@ -1861,26 +1862,26 @@ var E = {
|
|
|
1861
1862
|
})
|
|
1862
1863
|
})]
|
|
1863
1864
|
}), /* @__PURE__ */ t("div", {
|
|
1864
|
-
className:
|
|
1865
|
+
className: qe.content,
|
|
1865
1866
|
children: r
|
|
1866
1867
|
})]
|
|
1867
1868
|
});
|
|
1868
|
-
},
|
|
1869
|
-
wrapper: "
|
|
1870
|
-
input: "
|
|
1871
|
-
switch: "
|
|
1872
|
-
thumb: "
|
|
1873
|
-
label: "
|
|
1874
|
-
disabled: "
|
|
1875
|
-
},
|
|
1869
|
+
}, Ye = {
|
|
1870
|
+
wrapper: "_wrapper_1np4e_1",
|
|
1871
|
+
input: "_input_1np4e_21",
|
|
1872
|
+
switch: "_switch_1np4e_35",
|
|
1873
|
+
thumb: "_thumb_1np4e_67",
|
|
1874
|
+
label: "_label_1np4e_113",
|
|
1875
|
+
disabled: "_disabled_1np4e_125"
|
|
1876
|
+
}, Xe = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: s = "", name: c, id: l, value: d }) => {
|
|
1876
1877
|
let f = u(), p = l ?? `ds-radio-button-${c ?? f}`;
|
|
1877
1878
|
return /* @__PURE__ */ n("label", {
|
|
1878
1879
|
htmlFor: p,
|
|
1879
|
-
className: `${
|
|
1880
|
+
className: `${Ye.wrapper} ${a ? Ye.disabled : ""} ${s}`,
|
|
1880
1881
|
children: [
|
|
1881
1882
|
/* @__PURE__ */ t("input", {
|
|
1882
1883
|
id: p,
|
|
1883
|
-
className:
|
|
1884
|
+
className: Ye.input,
|
|
1884
1885
|
type: "checkbox",
|
|
1885
1886
|
role: "switch",
|
|
1886
1887
|
name: c,
|
|
@@ -1893,21 +1894,21 @@ var E = {
|
|
|
1893
1894
|
}
|
|
1894
1895
|
}),
|
|
1895
1896
|
/* @__PURE__ */ t("span", {
|
|
1896
|
-
className:
|
|
1897
|
+
className: Ye.switch,
|
|
1897
1898
|
"aria-hidden": "true",
|
|
1898
|
-
children: /* @__PURE__ */ t("span", { className:
|
|
1899
|
+
children: /* @__PURE__ */ t("span", { className: Ye.thumb })
|
|
1899
1900
|
}),
|
|
1900
1901
|
i && /* @__PURE__ */ t("span", {
|
|
1901
|
-
className:
|
|
1902
|
+
className: Ye.label,
|
|
1902
1903
|
children: i
|
|
1903
1904
|
})
|
|
1904
1905
|
]
|
|
1905
1906
|
});
|
|
1906
|
-
},
|
|
1907
|
-
root: "
|
|
1908
|
-
grid: "
|
|
1909
|
-
actions: "
|
|
1910
|
-
},
|
|
1907
|
+
}, Ze = {
|
|
1908
|
+
root: "_root_1ecm3_1",
|
|
1909
|
+
grid: "_grid_1ecm3_13",
|
|
1910
|
+
actions: "_actions_1ecm3_27"
|
|
1911
|
+
}, Qe = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
|
|
1911
1912
|
let d = (e, t) => {
|
|
1912
1913
|
let n = {
|
|
1913
1914
|
...r,
|
|
@@ -1916,11 +1917,11 @@ var E = {
|
|
|
1916
1917
|
i?.(n, e), s === "instant" && a?.(n);
|
|
1917
1918
|
};
|
|
1918
1919
|
return /* @__PURE__ */ n("section", {
|
|
1919
|
-
className: `${
|
|
1920
|
+
className: `${Ze.root} ${u}`,
|
|
1920
1921
|
"aria-label": "Фильтры",
|
|
1921
1922
|
"aria-busy": c,
|
|
1922
1923
|
children: [/* @__PURE__ */ t("div", {
|
|
1923
|
-
className:
|
|
1924
|
+
className: Ze.grid,
|
|
1924
1925
|
children: e.filter((e) => !e.hidden).map((e) => {
|
|
1925
1926
|
let n = l || c || e.disabled, i = r[e.id];
|
|
1926
1927
|
if (e.type === "input") {
|
|
@@ -1967,7 +1968,7 @@ var E = {
|
|
|
1967
1968
|
disabled: n,
|
|
1968
1969
|
onChange: (t) => d(e.id, t)
|
|
1969
1970
|
}, e.id);
|
|
1970
|
-
if (e.type === "radio") return /* @__PURE__ */ t(
|
|
1971
|
+
if (e.type === "radio") return /* @__PURE__ */ t(Xe, {
|
|
1971
1972
|
label: e.label,
|
|
1972
1973
|
checked: !!i,
|
|
1973
1974
|
disabled: n,
|
|
@@ -1988,7 +1989,7 @@ var E = {
|
|
|
1988
1989
|
}, e.id);
|
|
1989
1990
|
})
|
|
1990
1991
|
}), (o || s === "manual") && /* @__PURE__ */ n("div", {
|
|
1991
|
-
className:
|
|
1992
|
+
className: Ze.actions,
|
|
1992
1993
|
children: [o && /* @__PURE__ */ t(T, {
|
|
1993
1994
|
variant: "destructiveOutline",
|
|
1994
1995
|
disabled: l || c,
|
|
@@ -2002,25 +2003,25 @@ var E = {
|
|
|
2002
2003
|
})]
|
|
2003
2004
|
})]
|
|
2004
2005
|
});
|
|
2005
|
-
},
|
|
2006
|
-
wrapper: "
|
|
2007
|
-
dropzone: "
|
|
2008
|
-
dragActive: "
|
|
2009
|
-
disabled: "
|
|
2010
|
-
error: "
|
|
2011
|
-
nativeInput: "
|
|
2012
|
-
empty: "
|
|
2013
|
-
uploadIcon: "
|
|
2014
|
-
files: "
|
|
2015
|
-
file: "
|
|
2016
|
-
fileName: "
|
|
2017
|
-
fileSize: "
|
|
2018
|
-
},
|
|
2006
|
+
}, $e = {
|
|
2007
|
+
wrapper: "_wrapper_i20hz_1",
|
|
2008
|
+
dropzone: "_dropzone_i20hz_15",
|
|
2009
|
+
dragActive: "_dragActive_i20hz_45",
|
|
2010
|
+
disabled: "_disabled_i20hz_59",
|
|
2011
|
+
error: "_error_i20hz_69",
|
|
2012
|
+
nativeInput: "_nativeInput_i20hz_77",
|
|
2013
|
+
empty: "_empty_i20hz_95",
|
|
2014
|
+
uploadIcon: "_uploadIcon_i20hz_111",
|
|
2015
|
+
files: "_files_i20hz_133",
|
|
2016
|
+
file: "_file_i20hz_133",
|
|
2017
|
+
fileName: "_fileName_i20hz_175",
|
|
2018
|
+
fileSize: "_fileSize_i20hz_187"
|
|
2019
|
+
}, et = (e) => `${e.name}:${e.size}:${e.lastModified}`, tt = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, nt = (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), rt = ({ 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 }) => {
|
|
2019
2020
|
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) => {
|
|
2020
|
-
let t = [], n = new Set(r.map(
|
|
2021
|
+
let t = [], n = new Set(r.map(et)), l = e.filter((e) => nt(e, o) ? s !== void 0 && e.size > s ? (t.push({
|
|
2021
2022
|
file: e,
|
|
2022
2023
|
reason: "maxSize"
|
|
2023
|
-
}), !1) : !n.has(
|
|
2024
|
+
}), !1) : !n.has(et(e)) && (n.add(et(e)), !0) : (t.push({
|
|
2024
2025
|
file: e,
|
|
2025
2026
|
reason: "accept"
|
|
2026
2027
|
}), !1)), u = a ? c : 1, d = a ? [...r, ...l] : l.slice(-1);
|
|
@@ -2030,7 +2031,7 @@ var E = {
|
|
|
2030
2031
|
})), d = d.slice(0, u)), t.length && ee?.(t), l.length && i?.(d), O.current && (O.current.value = "");
|
|
2031
2032
|
};
|
|
2032
2033
|
return /* @__PURE__ */ n("div", {
|
|
2033
|
-
className: `${
|
|
2034
|
+
className: `${$e.wrapper} ${b}`,
|
|
2034
2035
|
children: [
|
|
2035
2036
|
l && /* @__PURE__ */ t(te, {
|
|
2036
2037
|
htmlFor: E,
|
|
@@ -2039,7 +2040,7 @@ var E = {
|
|
|
2039
2040
|
children: l
|
|
2040
2041
|
}),
|
|
2041
2042
|
/* @__PURE__ */ n("div", {
|
|
2042
|
-
className: `${
|
|
2043
|
+
className: `${$e.dropzone} ${j ? $e.dragActive : ""} ${g ? $e.disabled : ""} ${f ? $e.error : ""}`,
|
|
2043
2044
|
onDragEnter: (e) => {
|
|
2044
2045
|
e.preventDefault(), I && ++k.current === 1 && M(!0);
|
|
2045
2046
|
},
|
|
@@ -2054,7 +2055,7 @@ var E = {
|
|
|
2054
2055
|
ref: O,
|
|
2055
2056
|
id: E,
|
|
2056
2057
|
name: v,
|
|
2057
|
-
className:
|
|
2058
|
+
className: $e.nativeInput,
|
|
2058
2059
|
type: "file",
|
|
2059
2060
|
multiple: a,
|
|
2060
2061
|
accept: o,
|
|
@@ -2065,19 +2066,19 @@ var E = {
|
|
|
2065
2066
|
onChange: (e) => L(Array.from(e.target.files ?? []))
|
|
2066
2067
|
}), r.length ? /* @__PURE__ */ n(e, { children: [
|
|
2067
2068
|
/* @__PURE__ */ t("ul", {
|
|
2068
|
-
className:
|
|
2069
|
+
className: $e.files,
|
|
2069
2070
|
"aria-live": "polite",
|
|
2070
2071
|
children: r.map((e, a) => /* @__PURE__ */ n("li", {
|
|
2071
|
-
className:
|
|
2072
|
+
className: $e.file,
|
|
2072
2073
|
children: [
|
|
2073
2074
|
/* @__PURE__ */ t("span", {
|
|
2074
|
-
className:
|
|
2075
|
+
className: $e.fileName,
|
|
2075
2076
|
title: e.name,
|
|
2076
2077
|
children: e.name
|
|
2077
2078
|
}),
|
|
2078
2079
|
/* @__PURE__ */ t("span", {
|
|
2079
|
-
className:
|
|
2080
|
-
children:
|
|
2080
|
+
className: $e.fileSize,
|
|
2081
|
+
children: tt(e.size)
|
|
2081
2082
|
}),
|
|
2082
2083
|
I && /* @__PURE__ */ t(T, {
|
|
2083
2084
|
variant: "empty",
|
|
@@ -2091,25 +2092,25 @@ var E = {
|
|
|
2091
2092
|
})
|
|
2092
2093
|
})
|
|
2093
2094
|
]
|
|
2094
|
-
},
|
|
2095
|
+
}, et(e)))
|
|
2095
2096
|
}),
|
|
2096
2097
|
I && (a || r.length === 0) && /* @__PURE__ */ t(T, {
|
|
2097
|
-
className:
|
|
2098
|
+
className: $e.browseButton,
|
|
2098
2099
|
size: "sm",
|
|
2099
2100
|
onClick: () => O.current?.click(),
|
|
2100
2101
|
children: C
|
|
2101
2102
|
}),
|
|
2102
2103
|
I && !a && /* @__PURE__ */ t(T, {
|
|
2103
|
-
className:
|
|
2104
|
+
className: $e.browseButton,
|
|
2104
2105
|
size: "sm",
|
|
2105
2106
|
onClick: () => O.current?.click(),
|
|
2106
2107
|
children: S
|
|
2107
2108
|
})
|
|
2108
2109
|
] }) : /* @__PURE__ */ n("div", {
|
|
2109
|
-
className:
|
|
2110
|
+
className: $e.empty,
|
|
2110
2111
|
children: [
|
|
2111
2112
|
/* @__PURE__ */ t("span", {
|
|
2112
|
-
className:
|
|
2113
|
+
className: $e.uploadIcon,
|
|
2113
2114
|
"aria-hidden": "true",
|
|
2114
2115
|
children: /* @__PURE__ */ t(A, {
|
|
2115
2116
|
name: "IconUpload",
|
|
@@ -2137,26 +2138,26 @@ var E = {
|
|
|
2137
2138
|
})
|
|
2138
2139
|
]
|
|
2139
2140
|
});
|
|
2140
|
-
},
|
|
2141
|
-
wrapper: "
|
|
2142
|
-
control: "
|
|
2143
|
-
textarea: "
|
|
2144
|
-
disabledText: "
|
|
2145
|
-
sm: "
|
|
2146
|
-
md: "
|
|
2147
|
-
lg: "
|
|
2148
|
-
autoResize: "
|
|
2149
|
-
manualResize: "
|
|
2150
|
-
textareaError: "
|
|
2151
|
-
clearAction: "
|
|
2152
|
-
messages: "
|
|
2153
|
-
counter: "
|
|
2154
|
-
},
|
|
2155
|
-
function
|
|
2141
|
+
}, it = {
|
|
2142
|
+
wrapper: "_wrapper_x2gki_1",
|
|
2143
|
+
control: "_control_x2gki_15",
|
|
2144
|
+
textarea: "_textarea_x2gki_25",
|
|
2145
|
+
disabledText: "_disabledText_x2gki_27",
|
|
2146
|
+
sm: "_sm_x2gki_103",
|
|
2147
|
+
md: "_md_x2gki_117",
|
|
2148
|
+
lg: "_lg_x2gki_131",
|
|
2149
|
+
autoResize: "_autoResize_x2gki_145",
|
|
2150
|
+
manualResize: "_manualResize_x2gki_155",
|
|
2151
|
+
textareaError: "_textareaError_x2gki_163",
|
|
2152
|
+
clearAction: "_clearAction_x2gki_171",
|
|
2153
|
+
messages: "_messages_x2gki_251",
|
|
2154
|
+
counter: "_counter_x2gki_265"
|
|
2155
|
+
}, at = 2;
|
|
2156
|
+
function ot(e) {
|
|
2156
2157
|
let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight);
|
|
2157
2158
|
return Number.isFinite(n) ? n : Number.parseFloat(t.fontSize) * 1.4;
|
|
2158
2159
|
}
|
|
2159
|
-
function
|
|
2160
|
+
function st({ 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 = at, maxRows: ee, autoResize: w = !0, ...T }) {
|
|
2160
2161
|
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 = [
|
|
2161
2162
|
j,
|
|
2162
2163
|
M,
|
|
@@ -2164,7 +2165,7 @@ function ot({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2164
2165
|
].filter(Boolean).join(" ") || void 0, F = Math.max(1, C), I = ee === void 0 ? void 0 : Math.max(F, ee), L = s(() => {
|
|
2165
2166
|
let e = k.current;
|
|
2166
2167
|
if (!e || !w) return;
|
|
2167
|
-
let t = window.getComputedStyle(e), n =
|
|
2168
|
+
let t = window.getComputedStyle(e), n = ot(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;
|
|
2168
2169
|
e.style.height = "auto";
|
|
2169
2170
|
let o = Math.min(Math.max(e.scrollHeight, i), a);
|
|
2170
2171
|
e.style.height = `${o}px`, e.style.overflowY = e.scrollHeight > a ? "auto" : "hidden";
|
|
@@ -2196,7 +2197,7 @@ function ot({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2196
2197
|
e && ((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus(), L());
|
|
2197
2198
|
}, B = { "--ds-textarea-min-rows": F };
|
|
2198
2199
|
return /* @__PURE__ */ n("div", {
|
|
2199
|
-
className: `${
|
|
2200
|
+
className: `${it.wrapper} ${h}`,
|
|
2200
2201
|
children: [
|
|
2201
2202
|
d && /* @__PURE__ */ t(te, {
|
|
2202
2203
|
htmlFor: O,
|
|
@@ -2206,12 +2207,12 @@ function ot({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2206
2207
|
}),
|
|
2207
2208
|
a && c ? /* @__PURE__ */ t("div", {
|
|
2208
2209
|
id: O,
|
|
2209
|
-
className: `${
|
|
2210
|
+
className: `${it.disabledText} ${it[v]}`,
|
|
2210
2211
|
style: B,
|
|
2211
2212
|
"aria-describedby": P,
|
|
2212
2213
|
children: e || i
|
|
2213
2214
|
}) : /* @__PURE__ */ n("div", {
|
|
2214
|
-
className:
|
|
2215
|
+
className: it.control,
|
|
2215
2216
|
children: [/* @__PURE__ */ t("textarea", {
|
|
2216
2217
|
ref: k,
|
|
2217
2218
|
id: O,
|
|
@@ -2226,12 +2227,12 @@ function ot({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2226
2227
|
style: B,
|
|
2227
2228
|
"aria-invalid": !!f,
|
|
2228
2229
|
"aria-describedby": P,
|
|
2229
|
-
className: `${
|
|
2230
|
+
className: `${it.textarea} ${it[v]} ${w ? it.autoResize : it.manualResize} ${f ? it.textareaError : ""}`,
|
|
2230
2231
|
onChange: R,
|
|
2231
2232
|
...T
|
|
2232
2233
|
}), y && e && !a && !o && /* @__PURE__ */ t("button", {
|
|
2233
2234
|
type: "button",
|
|
2234
|
-
className:
|
|
2235
|
+
className: it.clearAction,
|
|
2235
2236
|
"aria-label": "Очистить поле",
|
|
2236
2237
|
onClick: z,
|
|
2237
2238
|
children: /* @__PURE__ */ t(A, {
|
|
@@ -2242,7 +2243,7 @@ function ot({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2242
2243
|
})]
|
|
2243
2244
|
}),
|
|
2244
2245
|
(m || f || N) && /* @__PURE__ */ n("div", {
|
|
2245
|
-
className:
|
|
2246
|
+
className: it.messages,
|
|
2246
2247
|
children: [
|
|
2247
2248
|
m && !f && /* @__PURE__ */ t(D, {
|
|
2248
2249
|
id: j,
|
|
@@ -2255,7 +2256,7 @@ function ot({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2255
2256
|
}),
|
|
2256
2257
|
N && /* @__PURE__ */ n("span", {
|
|
2257
2258
|
id: N,
|
|
2258
|
-
className:
|
|
2259
|
+
className: it.counter,
|
|
2259
2260
|
children: [
|
|
2260
2261
|
e.length,
|
|
2261
2262
|
" / ",
|
|
@@ -2269,11 +2270,11 @@ function ot({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
2269
2270
|
}
|
|
2270
2271
|
//#endregion
|
|
2271
2272
|
//#region src/components/DSModal/modal.store.ts
|
|
2272
|
-
var
|
|
2273
|
+
var ct = 0, lt = b((e, t) => ({
|
|
2273
2274
|
modals: [],
|
|
2274
2275
|
openModal: (t, n = {}, r = {}) => {
|
|
2275
|
-
|
|
2276
|
-
let i = `ds-modal-${
|
|
2276
|
+
ct += 1;
|
|
2277
|
+
let i = `ds-modal-${ct}`;
|
|
2277
2278
|
return e((e) => ({ modals: [...e.modals, {
|
|
2278
2279
|
id: i,
|
|
2279
2280
|
name: t,
|
|
@@ -2297,21 +2298,21 @@ var st = 0, ct = b((e, t) => ({
|
|
|
2297
2298
|
let n = t().modals;
|
|
2298
2299
|
n.length && (e({ modals: [] }), n.forEach((e) => e.onClose?.()));
|
|
2299
2300
|
}
|
|
2300
|
-
})),
|
|
2301
|
-
|
|
2302
|
-
},
|
|
2303
|
-
layer: "
|
|
2304
|
-
backdrop: "
|
|
2305
|
-
panel: "
|
|
2306
|
-
header: "
|
|
2307
|
-
title: "
|
|
2308
|
-
description: "
|
|
2309
|
-
content: "
|
|
2310
|
-
close: "
|
|
2311
|
-
},
|
|
2312
|
-
function
|
|
2301
|
+
})), ut = () => {
|
|
2302
|
+
lt.getState().closeAllModals(), ct = 0;
|
|
2303
|
+
}, dt = {
|
|
2304
|
+
layer: "_layer_1mvch_1",
|
|
2305
|
+
backdrop: "_backdrop_1mvch_15",
|
|
2306
|
+
panel: "_panel_1mvch_35",
|
|
2307
|
+
header: "_header_1mvch_63",
|
|
2308
|
+
title: "_title_1mvch_81",
|
|
2309
|
+
description: "_description_1mvch_93",
|
|
2310
|
+
content: "_content_1mvch_107",
|
|
2311
|
+
close: "_close_1mvch_115"
|
|
2312
|
+
}, ft = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", pt = i({});
|
|
2313
|
+
function mt(e) {
|
|
2313
2314
|
if (e.key !== "Tab") return;
|
|
2314
|
-
let t = Array.from(e.currentTarget.querySelectorAll(
|
|
2315
|
+
let t = Array.from(e.currentTarget.querySelectorAll(ft));
|
|
2315
2316
|
if (!t.length) {
|
|
2316
2317
|
e.preventDefault();
|
|
2317
2318
|
return;
|
|
@@ -2319,29 +2320,29 @@ function pt(e) {
|
|
|
2319
2320
|
let n = t[0], r = t.at(-1);
|
|
2320
2321
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r?.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n?.focus());
|
|
2321
2322
|
}
|
|
2322
|
-
var
|
|
2323
|
-
let f = c(
|
|
2323
|
+
var ht = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: s = "", role: d = "dialog" }) => {
|
|
2324
|
+
let f = c(pt), m = r ?? f.title, h = i ?? f.description, g = u(), _ = u(), v = p(null), y = lt((e) => e.closeModal), b = m != null, x = h != null;
|
|
2324
2325
|
return l(() => {
|
|
2325
2326
|
let e = document.activeElement, t = v.current;
|
|
2326
|
-
return (t?.querySelector(
|
|
2327
|
+
return (t?.querySelector(ft) ?? t)?.focus(), () => e?.focus();
|
|
2327
2328
|
}, []), /* @__PURE__ */ n("div", {
|
|
2328
2329
|
ref: v,
|
|
2329
|
-
className: `${
|
|
2330
|
+
className: `${dt.panel} ${s}`,
|
|
2330
2331
|
role: d,
|
|
2331
2332
|
"aria-modal": "true",
|
|
2332
2333
|
"aria-labelledby": b ? g : void 0,
|
|
2333
2334
|
"aria-describedby": x ? _ : void 0,
|
|
2334
2335
|
tabIndex: -1,
|
|
2335
|
-
onKeyDown:
|
|
2336
|
+
onKeyDown: mt,
|
|
2336
2337
|
children: [
|
|
2337
2338
|
(b || o) && /* @__PURE__ */ n("header", {
|
|
2338
|
-
className:
|
|
2339
|
+
className: dt.header,
|
|
2339
2340
|
children: [b && /* @__PURE__ */ t("h2", {
|
|
2340
2341
|
id: g,
|
|
2341
|
-
className:
|
|
2342
|
+
className: dt.title,
|
|
2342
2343
|
children: m
|
|
2343
2344
|
}), /* @__PURE__ */ t(T, {
|
|
2344
|
-
className:
|
|
2345
|
+
className: dt.close,
|
|
2345
2346
|
variant: "empty",
|
|
2346
2347
|
size: "sm",
|
|
2347
2348
|
"aria-label": o,
|
|
@@ -2355,21 +2356,21 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2355
2356
|
}),
|
|
2356
2357
|
x && /* @__PURE__ */ t("p", {
|
|
2357
2358
|
id: _,
|
|
2358
|
-
className:
|
|
2359
|
+
className: dt.description,
|
|
2359
2360
|
children: h
|
|
2360
2361
|
}),
|
|
2361
2362
|
/* @__PURE__ */ t("div", {
|
|
2362
|
-
className:
|
|
2363
|
+
className: dt.content,
|
|
2363
2364
|
children: e
|
|
2364
2365
|
})
|
|
2365
2366
|
]
|
|
2366
2367
|
});
|
|
2367
|
-
},
|
|
2368
|
-
let n =
|
|
2368
|
+
}, gt = ({ registry: e }) => {
|
|
2369
|
+
let n = lt((e) => e.modals), r = lt((e) => e.closeModal), i = lt((e) => e.closeAllModals);
|
|
2369
2370
|
return l(() => {
|
|
2370
2371
|
let e = (e) => {
|
|
2371
2372
|
if (e.key !== "Escape") return;
|
|
2372
|
-
let t =
|
|
2373
|
+
let t = lt.getState().modals.at(-1);
|
|
2373
2374
|
t?.closeOnEscape && r(t.id);
|
|
2374
2375
|
};
|
|
2375
2376
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
@@ -2382,18 +2383,18 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2382
2383
|
n,
|
|
2383
2384
|
e
|
|
2384
2385
|
]), !n.length || typeof document > "u" ? null : h(/* @__PURE__ */ t("div", {
|
|
2385
|
-
className:
|
|
2386
|
+
className: dt.layer,
|
|
2386
2387
|
"aria-label": "Модальные окна",
|
|
2387
2388
|
children: n.map((a, o) => {
|
|
2388
2389
|
let s = e[a.name];
|
|
2389
2390
|
return s ? /* @__PURE__ */ t("div", {
|
|
2390
|
-
className:
|
|
2391
|
+
className: dt.backdrop,
|
|
2391
2392
|
"aria-hidden": o !== n.length - 1 || void 0,
|
|
2392
2393
|
inert: o !== n.length - 1 || void 0,
|
|
2393
2394
|
onMouseDown: (e) => {
|
|
2394
2395
|
e.target === e.currentTarget && a.closeOnBackdrop && r(a.id);
|
|
2395
2396
|
},
|
|
2396
|
-
children: /* @__PURE__ */ t(
|
|
2397
|
+
children: /* @__PURE__ */ t(pt.Provider, {
|
|
2397
2398
|
value: {
|
|
2398
2399
|
title: a.title ?? a.payload.title,
|
|
2399
2400
|
description: a.description ?? a.payload.description
|
|
@@ -2408,31 +2409,31 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2408
2409
|
}, a.id) : null;
|
|
2409
2410
|
})
|
|
2410
2411
|
}), document.body);
|
|
2411
|
-
},
|
|
2412
|
-
let o =
|
|
2412
|
+
}, _t = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
2413
|
+
let o = lt((e) => e.modals.length);
|
|
2413
2414
|
return l(() => {
|
|
2414
2415
|
if (!a || o === 0) return;
|
|
2415
2416
|
let e = document.body.style.overflow;
|
|
2416
2417
|
return document.body.style.overflow = "hidden", () => {
|
|
2417
2418
|
document.body.style.overflow = e;
|
|
2418
2419
|
};
|
|
2419
|
-
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(
|
|
2420
|
-
},
|
|
2421
|
-
message: "
|
|
2422
|
-
actions: "
|
|
2423
|
-
},
|
|
2420
|
+
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(gt, { registry: r })] });
|
|
2421
|
+
}, vt = (e) => e, yt = {
|
|
2422
|
+
message: "_message_c23ie_1",
|
|
2423
|
+
actions: "_actions_c23ie_13"
|
|
2424
|
+
}, bt = /* @__PURE__ */ new Map(), xt = 0, St = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
|
|
2424
2425
|
let u = (e) => {
|
|
2425
|
-
|
|
2426
|
+
bt.get(l)?.(e), bt.delete(l), r();
|
|
2426
2427
|
};
|
|
2427
|
-
return /* @__PURE__ */ n(
|
|
2428
|
+
return /* @__PURE__ */ n(ht, {
|
|
2428
2429
|
modalId: e,
|
|
2429
2430
|
title: i,
|
|
2430
2431
|
role: "alertdialog",
|
|
2431
2432
|
children: [/* @__PURE__ */ t("p", {
|
|
2432
|
-
className:
|
|
2433
|
+
className: yt.message,
|
|
2433
2434
|
children: a
|
|
2434
2435
|
}), /* @__PURE__ */ n("div", {
|
|
2435
|
-
className:
|
|
2436
|
+
className: yt.actions,
|
|
2436
2437
|
children: [/* @__PURE__ */ t(T, {
|
|
2437
2438
|
variant: "outline",
|
|
2438
2439
|
onClick: () => u(!1),
|
|
@@ -2444,46 +2445,46 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2444
2445
|
})]
|
|
2445
2446
|
})]
|
|
2446
2447
|
});
|
|
2447
|
-
},
|
|
2448
|
+
}, Ct = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(ht, {
|
|
2448
2449
|
modalId: e,
|
|
2449
2450
|
title: i,
|
|
2450
2451
|
role: "alertdialog",
|
|
2451
2452
|
children: [/* @__PURE__ */ t("p", {
|
|
2452
|
-
className:
|
|
2453
|
+
className: yt.message,
|
|
2453
2454
|
children: a
|
|
2454
2455
|
}), /* @__PURE__ */ t("div", {
|
|
2455
|
-
className:
|
|
2456
|
+
className: yt.actions,
|
|
2456
2457
|
children: /* @__PURE__ */ t(T, {
|
|
2457
2458
|
onClick: r,
|
|
2458
2459
|
children: o
|
|
2459
2460
|
})
|
|
2460
2461
|
})]
|
|
2461
|
-
}),
|
|
2462
|
-
ConfirmModal:
|
|
2463
|
-
ErrorModal:
|
|
2464
|
-
}),
|
|
2465
|
-
let e =
|
|
2462
|
+
}), wt = vt({
|
|
2463
|
+
ConfirmModal: St,
|
|
2464
|
+
ErrorModal: Ct
|
|
2465
|
+
}), Tt = () => {
|
|
2466
|
+
let e = lt((e) => e.openModal);
|
|
2466
2467
|
return (t = {}) => new Promise((n) => {
|
|
2467
|
-
|
|
2468
|
-
let r = `confirm-${
|
|
2469
|
-
|
|
2468
|
+
xt += 1;
|
|
2469
|
+
let r = `confirm-${xt}`;
|
|
2470
|
+
bt.set(r, n), e("ConfirmModal", {
|
|
2470
2471
|
...t,
|
|
2471
2472
|
requestId: r
|
|
2472
2473
|
}, {
|
|
2473
2474
|
closeOnEscape: !1,
|
|
2474
2475
|
onClose: () => {
|
|
2475
|
-
|
|
2476
|
+
bt.get(r)?.(!1), bt.delete(r);
|
|
2476
2477
|
}
|
|
2477
2478
|
});
|
|
2478
2479
|
});
|
|
2479
|
-
},
|
|
2480
|
-
let e =
|
|
2480
|
+
}, Et = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", Dt = () => {
|
|
2481
|
+
let e = lt((e) => e.openModal);
|
|
2481
2482
|
return { showError: (t, n) => e("ErrorModal", {
|
|
2482
2483
|
title: n,
|
|
2483
|
-
message:
|
|
2484
|
+
message: Et(t)
|
|
2484
2485
|
}) };
|
|
2485
|
-
},
|
|
2486
|
-
let e =
|
|
2486
|
+
}, Ot = b(() => ({})), kt = b(() => ({})), At = () => {
|
|
2487
|
+
let e = lt((e) => e.modals), t = lt((e) => e.openModal), n = lt((e) => e.closeModal), r = lt((e) => e.closeTopModal), i = lt((e) => e.closeAllModals), a = s((e, n = {}, r) => t(e, n, r), [t]), o = s((t) => e.some((e) => e.name === t), [e]);
|
|
2487
2488
|
return f(() => ({
|
|
2488
2489
|
openModal: a,
|
|
2489
2490
|
closeModal: n,
|
|
@@ -2499,49 +2500,49 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2499
2500
|
e.length,
|
|
2500
2501
|
a
|
|
2501
2502
|
]);
|
|
2502
|
-
},
|
|
2503
|
-
wrapper: "
|
|
2504
|
-
container: "
|
|
2505
|
-
inner: "
|
|
2506
|
-
cube: "
|
|
2507
|
-
jump: "
|
|
2508
|
-
cube__inner: "
|
|
2509
|
-
morph: "
|
|
2510
|
-
},
|
|
2511
|
-
className:
|
|
2503
|
+
}, jt = {
|
|
2504
|
+
wrapper: "_wrapper_71h8n_1",
|
|
2505
|
+
container: "_container_71h8n_15",
|
|
2506
|
+
inner: "_inner_71h8n_35",
|
|
2507
|
+
cube: "_cube_71h8n_53",
|
|
2508
|
+
jump: "_jump_71h8n_1",
|
|
2509
|
+
cube__inner: "_cube__inner_71h8n_67",
|
|
2510
|
+
morph: "_morph_71h8n_1"
|
|
2511
|
+
}, Mt = () => /* @__PURE__ */ t("div", {
|
|
2512
|
+
className: jt.wrapper,
|
|
2512
2513
|
children: /* @__PURE__ */ t("div", {
|
|
2513
|
-
className:
|
|
2514
|
+
className: jt.container,
|
|
2514
2515
|
children: /* @__PURE__ */ n("div", {
|
|
2515
|
-
className:
|
|
2516
|
+
className: jt.inner,
|
|
2516
2517
|
children: [
|
|
2517
2518
|
/* @__PURE__ */ t("div", {
|
|
2518
|
-
className:
|
|
2519
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
2519
|
+
className: jt.cube,
|
|
2520
|
+
children: /* @__PURE__ */ t("div", { className: jt.cube__inner })
|
|
2520
2521
|
}),
|
|
2521
2522
|
/* @__PURE__ */ t("div", {
|
|
2522
|
-
className:
|
|
2523
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
2523
|
+
className: jt.cube,
|
|
2524
|
+
children: /* @__PURE__ */ t("div", { className: jt.cube__inner })
|
|
2524
2525
|
}),
|
|
2525
2526
|
/* @__PURE__ */ t("div", {
|
|
2526
|
-
className:
|
|
2527
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
2527
|
+
className: jt.cube,
|
|
2528
|
+
children: /* @__PURE__ */ t("div", { className: jt.cube__inner })
|
|
2528
2529
|
})
|
|
2529
2530
|
]
|
|
2530
2531
|
})
|
|
2531
2532
|
})
|
|
2532
|
-
}),
|
|
2533
|
-
viewport: "
|
|
2534
|
-
"top-right": "_top-
|
|
2535
|
-
"top-left": "_top-
|
|
2536
|
-
"bottom-right": "_bottom-
|
|
2537
|
-
"bottom-left": "_bottom-
|
|
2538
|
-
toast: "
|
|
2539
|
-
body: "
|
|
2540
|
-
info: "
|
|
2541
|
-
success: "
|
|
2542
|
-
warning: "
|
|
2543
|
-
error: "
|
|
2544
|
-
},
|
|
2533
|
+
}), Nt = {
|
|
2534
|
+
viewport: "_viewport_3qpmj_1",
|
|
2535
|
+
"top-right": "_top-right_3qpmj_21",
|
|
2536
|
+
"top-left": "_top-left_3qpmj_31",
|
|
2537
|
+
"bottom-right": "_bottom-right_3qpmj_41",
|
|
2538
|
+
"bottom-left": "_bottom-left_3qpmj_51",
|
|
2539
|
+
toast: "_toast_3qpmj_61",
|
|
2540
|
+
body: "_body_3qpmj_89",
|
|
2541
|
+
info: "_info_3qpmj_109",
|
|
2542
|
+
success: "_success_3qpmj_117",
|
|
2543
|
+
warning: "_warning_3qpmj_125",
|
|
2544
|
+
error: "_error_3qpmj_133"
|
|
2545
|
+
}, Pt = {
|
|
2545
2546
|
info: {
|
|
2546
2547
|
name: "IconInfoCircle",
|
|
2547
2548
|
color: "var(--color-primary)"
|
|
@@ -2558,7 +2559,7 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2558
2559
|
name: "IconWarning",
|
|
2559
2560
|
color: "var(--color-error)"
|
|
2560
2561
|
}
|
|
2561
|
-
},
|
|
2562
|
+
}, Ft = ({ toast: e, onClose: r }) => {
|
|
2562
2563
|
let [i, a] = m(!1), o = p(e.duration), s = p(Date.now());
|
|
2563
2564
|
return l(() => {
|
|
2564
2565
|
if (i || e.duration <= 0) return;
|
|
@@ -2573,7 +2574,7 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2573
2574
|
e.duration,
|
|
2574
2575
|
e.id
|
|
2575
2576
|
]), /* @__PURE__ */ n("article", {
|
|
2576
|
-
className: `${
|
|
2577
|
+
className: `${Nt.toast} ${Nt[e.variant]}`,
|
|
2577
2578
|
role: e.variant === "error" ? "alert" : "status",
|
|
2578
2579
|
"aria-live": e.variant === "error" ? "assertive" : "polite",
|
|
2579
2580
|
onMouseEnter: () => a(!0),
|
|
@@ -2582,12 +2583,12 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2582
2583
|
onBlur: () => a(!1),
|
|
2583
2584
|
children: [
|
|
2584
2585
|
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(A, {
|
|
2585
|
-
...
|
|
2586
|
+
...Pt[e.variant],
|
|
2586
2587
|
width: 24,
|
|
2587
2588
|
height: 24
|
|
2588
2589
|
}) }),
|
|
2589
2590
|
/* @__PURE__ */ n("div", {
|
|
2590
|
-
className:
|
|
2591
|
+
className: Nt.body,
|
|
2591
2592
|
children: [
|
|
2592
2593
|
e.title && /* @__PURE__ */ t("strong", { children: e.title }),
|
|
2593
2594
|
/* @__PURE__ */ t("div", { children: e.message }),
|
|
@@ -2614,11 +2615,11 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2614
2615
|
})
|
|
2615
2616
|
]
|
|
2616
2617
|
});
|
|
2617
|
-
},
|
|
2618
|
+
}, It = 0, Lt = b((e) => ({
|
|
2618
2619
|
toasts: [],
|
|
2619
2620
|
showToast: (t) => {
|
|
2620
|
-
|
|
2621
|
-
let n = `ds-toast-${
|
|
2621
|
+
It += 1;
|
|
2622
|
+
let n = `ds-toast-${It}`;
|
|
2622
2623
|
return e((e) => ({ toasts: [...e.toasts, {
|
|
2623
2624
|
variant: "info",
|
|
2624
2625
|
duration: 5e3,
|
|
@@ -2629,18 +2630,18 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2629
2630
|
},
|
|
2630
2631
|
removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
|
|
2631
2632
|
clearToasts: () => e({ toasts: [] })
|
|
2632
|
-
})),
|
|
2633
|
-
let n =
|
|
2633
|
+
})), Rt = () => Lt.setState({ toasts: [] }), zt = ({ position: e = "top-right" }) => {
|
|
2634
|
+
let n = Lt((e) => e.toasts), r = Lt((e) => e.removeToast);
|
|
2634
2635
|
return /* @__PURE__ */ t("div", {
|
|
2635
|
-
className: `${
|
|
2636
|
+
className: `${Nt.viewport} ${Nt[e]}`,
|
|
2636
2637
|
"aria-label": "Уведомления",
|
|
2637
|
-
children: n.map((e) => /* @__PURE__ */ t(
|
|
2638
|
+
children: n.map((e) => /* @__PURE__ */ t(Ft, {
|
|
2638
2639
|
toast: e,
|
|
2639
2640
|
onClose: r
|
|
2640
2641
|
}, e.id))
|
|
2641
2642
|
});
|
|
2642
|
-
},
|
|
2643
|
-
let e =
|
|
2643
|
+
}, Bt = () => {
|
|
2644
|
+
let e = Lt((e) => e.showToast), t = Lt((e) => e.removeToast), n = Lt((e) => e.clearToasts), r = s((t) => e({
|
|
2644
2645
|
...t,
|
|
2645
2646
|
variant: "info"
|
|
2646
2647
|
}), [e]), i = s((t) => e({
|
|
@@ -2670,15 +2671,15 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2670
2671
|
i,
|
|
2671
2672
|
a
|
|
2672
2673
|
]);
|
|
2673
|
-
},
|
|
2674
|
-
root: "
|
|
2675
|
-
tooltip: "
|
|
2676
|
-
"ds-tooltip-in": "_ds-tooltip-
|
|
2677
|
-
top: "
|
|
2678
|
-
bottom: "
|
|
2679
|
-
left: "
|
|
2680
|
-
right: "
|
|
2681
|
-
},
|
|
2674
|
+
}, Vt = {
|
|
2675
|
+
root: "_root_8dm5q_1",
|
|
2676
|
+
tooltip: "_tooltip_8dm5q_11",
|
|
2677
|
+
"ds-tooltip-in": "_ds-tooltip-in_8dm5q_1",
|
|
2678
|
+
top: "_top_8dm5q_43",
|
|
2679
|
+
bottom: "_bottom_8dm5q_55",
|
|
2680
|
+
left: "_left_8dm5q_67",
|
|
2681
|
+
right: "_right_8dm5q_79"
|
|
2682
|
+
}, Ht = ({ content: e, children: i, placement: a = "top", delay: s = 450, disabled: c = !1, maxWidth: d = 280, className: f = "" }) => {
|
|
2682
2683
|
let h = u(), [g, _] = m(!1), v = p(null), y = () => {
|
|
2683
2684
|
c || !e || (v.current = setTimeout(() => _(!0), s));
|
|
2684
2685
|
}, b = () => {
|
|
@@ -2700,62 +2701,62 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2700
2701
|
onBlur: b
|
|
2701
2702
|
});
|
|
2702
2703
|
return /* @__PURE__ */ n("span", {
|
|
2703
|
-
className: `${
|
|
2704
|
+
className: `${Vt.root} ${f}`,
|
|
2704
2705
|
onPointerDown: g ? b : y,
|
|
2705
2706
|
children: [x, g && /* @__PURE__ */ t("span", {
|
|
2706
2707
|
id: h,
|
|
2707
2708
|
role: "tooltip",
|
|
2708
|
-
className: `${
|
|
2709
|
+
className: `${Vt.tooltip} ${Vt[a]}`,
|
|
2709
2710
|
style: { maxWidth: d },
|
|
2710
2711
|
children: e
|
|
2711
2712
|
})]
|
|
2712
2713
|
});
|
|
2713
|
-
},
|
|
2714
|
+
}, Ut = (e) => {
|
|
2714
2715
|
if (!Number.isFinite(e) || e < 0) return "00:00";
|
|
2715
2716
|
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")}`;
|
|
2716
2717
|
return n ? `${n}:${a}` : a;
|
|
2717
2718
|
}, $ = {
|
|
2718
|
-
root: "
|
|
2719
|
-
frame: "
|
|
2720
|
-
video: "
|
|
2721
|
-
overlay: "
|
|
2722
|
-
state: "
|
|
2723
|
-
buffering: "
|
|
2724
|
-
loaderViewport: "
|
|
2725
|
-
loaderScale: "
|
|
2726
|
-
stateIcon: "
|
|
2727
|
-
empty: "
|
|
2728
|
-
error: "
|
|
2729
|
-
replay: "
|
|
2730
|
-
controlsLayer: "
|
|
2731
|
-
controlsVisible: "
|
|
2732
|
-
controls: "
|
|
2733
|
-
controlGroup: "
|
|
2734
|
-
controlButton: "
|
|
2735
|
-
settingsAction: "
|
|
2736
|
-
timeline: "
|
|
2737
|
-
volume: "
|
|
2738
|
-
settings: "
|
|
2739
|
-
playButton: "
|
|
2740
|
-
volumeGroup: "
|
|
2741
|
-
timelineGroup: "
|
|
2742
|
-
time: "
|
|
2743
|
-
settingsActionLabel: "
|
|
2744
|
-
caption: "
|
|
2745
|
-
fullscreen: "
|
|
2746
|
-
},
|
|
2719
|
+
root: "_root_1h73w_1",
|
|
2720
|
+
frame: "_frame_1h73w_35",
|
|
2721
|
+
video: "_video_1h73w_65",
|
|
2722
|
+
overlay: "_overlay_1h73w_81",
|
|
2723
|
+
state: "_state_1h73w_83",
|
|
2724
|
+
buffering: "_buffering_1h73w_85",
|
|
2725
|
+
loaderViewport: "_loaderViewport_1h73w_145",
|
|
2726
|
+
loaderScale: "_loaderScale_1h73w_157",
|
|
2727
|
+
stateIcon: "_stateIcon_1h73w_171",
|
|
2728
|
+
empty: "_empty_1h73w_203",
|
|
2729
|
+
error: "_error_1h73w_213",
|
|
2730
|
+
replay: "_replay_1h73w_225",
|
|
2731
|
+
controlsLayer: "_controlsLayer_1h73w_261",
|
|
2732
|
+
controlsVisible: "_controlsVisible_1h73w_287",
|
|
2733
|
+
controls: "_controls_1h73w_261",
|
|
2734
|
+
controlGroup: "_controlGroup_1h73w_311",
|
|
2735
|
+
controlButton: "_controlButton_1h73w_337",
|
|
2736
|
+
settingsAction: "_settingsAction_1h73w_369",
|
|
2737
|
+
timeline: "_timeline_1h73w_401",
|
|
2738
|
+
volume: "_volume_1h73w_403",
|
|
2739
|
+
settings: "_settings_1h73w_369",
|
|
2740
|
+
playButton: "_playButton_1h73w_417",
|
|
2741
|
+
volumeGroup: "_volumeGroup_1h73w_431",
|
|
2742
|
+
timelineGroup: "_timelineGroup_1h73w_455",
|
|
2743
|
+
time: "_time_1h73w_401",
|
|
2744
|
+
settingsActionLabel: "_settingsActionLabel_1h73w_693",
|
|
2745
|
+
caption: "_caption_1h73w_705",
|
|
2746
|
+
fullscreen: "_fullscreen_1h73w_719"
|
|
2747
|
+
}, Wt = 2500, Gt = 5, Kt = .05, qt = [
|
|
2747
2748
|
.5,
|
|
2748
2749
|
.75,
|
|
2749
2750
|
1,
|
|
2750
2751
|
1.25,
|
|
2751
2752
|
1.5,
|
|
2752
2753
|
2
|
|
2753
|
-
],
|
|
2754
|
+
], Jt = ({ sources: r, tracks: i = [], title: a, aspectRatio: o = "16 / 9", objectFit: c = "contain", loading: u = !1, error: d, fallback: f, className: h = "", controls: g = !0, playsInline: _ = !0, ...v }) => {
|
|
2754
2755
|
let y = p(null), b = p(null), x = p(null), S = p(void 0), [C, w] = m(!1), [E, te] = m(r.length > 0), [D, O] = m(!1), [k, j] = m(!1), [M, N] = m(!1), [P, F] = m(0), [I, L] = m(0), [R, z] = m(0), [B, V] = m(1), [H, U] = m(!!v.muted), [W, G] = m(1), [ne, re] = m(!!v.loop), [ie, ae] = m(-1), [oe, se] = m(!1), [ce, K] = m(!0), [q, J] = m(!1), [le, ue] = m(!1), de = r.map(({ src: e, type: t }) => `${e}:${t ?? ""}`).join("|"), Y = i.map((e, t) => ({
|
|
2755
2756
|
track: e,
|
|
2756
2757
|
index: t
|
|
2757
2758
|
})).filter(({ track: e }) => e.kind === "captions" || e.kind === "subtitles"), X = d ?? (C ? "Не удалось воспроизвести видео" : void 0), fe = u || E && !X && r.length > 0, pe = !fe && !X && r.length === 0, me = typeof document < "u" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled, he = s(() => {
|
|
2758
|
-
K(!0), window.clearTimeout(S.current), k && !oe && (S.current = window.setTimeout(() => K(!1),
|
|
2759
|
+
K(!0), window.clearTimeout(S.current), k && !oe && (S.current = window.setTimeout(() => K(!1), Wt));
|
|
2759
2760
|
}, [k, oe]);
|
|
2760
2761
|
l(() => {
|
|
2761
2762
|
w(!1), te(r.length > 0), O(!1), j(!1), N(!1), F(0), L(0), z(0);
|
|
@@ -2814,7 +2815,7 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2814
2815
|
let t = e.target;
|
|
2815
2816
|
if (/^(INPUT|SELECT|BUTTON)$/.test(t.tagName)) return;
|
|
2816
2817
|
let n = e.key.toLowerCase();
|
|
2817
|
-
n === " " || n === "k" ? (e.preventDefault(), ge()) : n === "m" ? (e.preventDefault(), _e()) : n === "f" ? (e.preventDefault(), ye()) : n === "c" && Y.length ? (e.preventDefault(), xe(ie === -1 ? Y[0].index : -1)) : e.key === "ArrowLeft" || e.key === "ArrowRight" ? (e.preventDefault(), Z(P + (e.key === "ArrowRight" ?
|
|
2818
|
+
n === " " || n === "k" ? (e.preventDefault(), ge()) : n === "m" ? (e.preventDefault(), _e()) : n === "f" ? (e.preventDefault(), ye()) : n === "c" && Y.length ? (e.preventDefault(), xe(ie === -1 ? Y[0].index : -1)) : e.key === "ArrowLeft" || e.key === "ArrowRight" ? (e.preventDefault(), Z(P + (e.key === "ArrowRight" ? Gt : -5))) : e.key === "ArrowUp" || e.key === "ArrowDown" ? (e.preventDefault(), ve(B + (e.key === "ArrowUp" ? Kt : -.05))) : e.key === "Escape" && se(!1), he();
|
|
2818
2819
|
}, Ce = () => {
|
|
2819
2820
|
let e = x.current;
|
|
2820
2821
|
w(!1), te(!0), e?.load();
|
|
@@ -2913,7 +2914,7 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2913
2914
|
"aria-hidden": "true",
|
|
2914
2915
|
children: /* @__PURE__ */ t("div", {
|
|
2915
2916
|
className: $.loaderScale,
|
|
2916
|
-
children: /* @__PURE__ */ t(
|
|
2917
|
+
children: /* @__PURE__ */ t(Mt, {})
|
|
2917
2918
|
})
|
|
2918
2919
|
}), /* @__PURE__ */ t("span", { children: "Загрузка видео" })]
|
|
2919
2920
|
}),
|
|
@@ -2981,7 +2982,7 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
2981
2982
|
let t = Number(e.target.value);
|
|
2982
2983
|
x.current && (x.current.playbackRate = t);
|
|
2983
2984
|
},
|
|
2984
|
-
children:
|
|
2985
|
+
children: qt.map((e) => /* @__PURE__ */ n("option", {
|
|
2985
2986
|
value: e,
|
|
2986
2987
|
children: [e, "×"]
|
|
2987
2988
|
}, e))
|
|
@@ -3068,7 +3069,7 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3068
3069
|
children: [
|
|
3069
3070
|
/* @__PURE__ */ t("span", {
|
|
3070
3071
|
className: $.time,
|
|
3071
|
-
children:
|
|
3072
|
+
children: Ut(P)
|
|
3072
3073
|
}),
|
|
3073
3074
|
/* @__PURE__ */ t("input", {
|
|
3074
3075
|
className: $.timeline,
|
|
@@ -3079,12 +3080,12 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3079
3080
|
step: .01,
|
|
3080
3081
|
value: Math.min(P, I || 0),
|
|
3081
3082
|
"aria-label": "Позиция воспроизведения",
|
|
3082
|
-
"aria-valuetext": `${
|
|
3083
|
+
"aria-valuetext": `${Ut(P)} из ${Ut(I)}`,
|
|
3083
3084
|
onChange: (e) => Z(Number(e.target.value))
|
|
3084
3085
|
}),
|
|
3085
3086
|
/* @__PURE__ */ t("span", {
|
|
3086
3087
|
className: $.time,
|
|
3087
|
-
children:
|
|
3088
|
+
children: Ut(I)
|
|
3088
3089
|
})
|
|
3089
3090
|
]
|
|
3090
3091
|
}),
|
|
@@ -3124,17 +3125,17 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3124
3125
|
children: a
|
|
3125
3126
|
})]
|
|
3126
3127
|
});
|
|
3127
|
-
},
|
|
3128
|
-
root: "
|
|
3129
|
-
trigger: "
|
|
3130
|
-
heading: "
|
|
3131
|
-
title: "
|
|
3132
|
-
subtitle: "
|
|
3133
|
-
icon: "
|
|
3134
|
-
open: "
|
|
3135
|
-
content: "
|
|
3136
|
-
contentInner: "
|
|
3137
|
-
},
|
|
3128
|
+
}, Yt = {
|
|
3129
|
+
root: "_root_ymidq_1",
|
|
3130
|
+
trigger: "_trigger_ymidq_15",
|
|
3131
|
+
heading: "_heading_ymidq_41",
|
|
3132
|
+
title: "_title_ymidq_51",
|
|
3133
|
+
subtitle: "_subtitle_ymidq_59",
|
|
3134
|
+
icon: "_icon_ymidq_69",
|
|
3135
|
+
open: "_open_ymidq_91",
|
|
3136
|
+
content: "_content_ymidq_99",
|
|
3137
|
+
contentInner: "_contentInner_ymidq_119"
|
|
3138
|
+
}, Xt = (e, t, n, r = 16) => {
|
|
3138
3139
|
if (t > Math.max(0, n - r * 2)) {
|
|
3139
3140
|
let t = e - r;
|
|
3140
3141
|
return Math.abs(t) <= 1 ? {
|
|
@@ -3156,7 +3157,7 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3156
3157
|
alignment: "none",
|
|
3157
3158
|
delta: 0
|
|
3158
3159
|
};
|
|
3159
|
-
},
|
|
3160
|
+
}, Zt = ({ title: e, subtitle: r, children: i, defaultOpen: a = !1, open: o, onOpenChange: s, autoScrollOnOpen: c = !0, scrollOffset: d = 16, className: f = "" }) => {
|
|
3160
3161
|
let h = u(), [g, _] = m(a), v = o ?? g, y = p(null), b = p(null), x = p(v);
|
|
3161
3162
|
return l(() => {
|
|
3162
3163
|
let e = x.current;
|
|
@@ -3166,7 +3167,7 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3166
3167
|
let r = !1, i = () => {
|
|
3167
3168
|
if (r) return;
|
|
3168
3169
|
r = !0;
|
|
3169
|
-
let e = t.getBoundingClientRect(), n =
|
|
3170
|
+
let e = t.getBoundingClientRect(), n = Xt(e.top, e.height, window.innerHeight, d);
|
|
3170
3171
|
if (n.alignment === "none") return;
|
|
3171
3172
|
let i = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
3172
3173
|
window.scrollBy({
|
|
@@ -3187,10 +3188,10 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3187
3188
|
d
|
|
3188
3189
|
]), /* @__PURE__ */ n("section", {
|
|
3189
3190
|
ref: y,
|
|
3190
|
-
className: `${
|
|
3191
|
+
className: `${Yt.root} ${v ? Yt.open : ""} ${f}`,
|
|
3191
3192
|
children: [/* @__PURE__ */ n("button", {
|
|
3192
3193
|
type: "button",
|
|
3193
|
-
className:
|
|
3194
|
+
className: Yt.trigger,
|
|
3194
3195
|
"aria-expanded": v,
|
|
3195
3196
|
"aria-controls": h,
|
|
3196
3197
|
onClick: () => {
|
|
@@ -3198,16 +3199,16 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3198
3199
|
o === void 0 && _(e), s?.(e);
|
|
3199
3200
|
},
|
|
3200
3201
|
children: [/* @__PURE__ */ n("span", {
|
|
3201
|
-
className:
|
|
3202
|
+
className: Yt.heading,
|
|
3202
3203
|
children: [/* @__PURE__ */ t("span", {
|
|
3203
|
-
className:
|
|
3204
|
+
className: Yt.title,
|
|
3204
3205
|
children: e
|
|
3205
3206
|
}), r && /* @__PURE__ */ t("span", {
|
|
3206
|
-
className:
|
|
3207
|
+
className: Yt.subtitle,
|
|
3207
3208
|
children: r
|
|
3208
3209
|
})]
|
|
3209
3210
|
}), /* @__PURE__ */ t("span", {
|
|
3210
|
-
className:
|
|
3211
|
+
className: Yt.icon,
|
|
3211
3212
|
"aria-hidden": "true",
|
|
3212
3213
|
children: /* @__PURE__ */ t(A, {
|
|
3213
3214
|
name: "IconChevron",
|
|
@@ -3218,15 +3219,15 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3218
3219
|
}), /* @__PURE__ */ t("div", {
|
|
3219
3220
|
ref: b,
|
|
3220
3221
|
id: h,
|
|
3221
|
-
className:
|
|
3222
|
+
className: Yt.content,
|
|
3222
3223
|
"aria-hidden": !v,
|
|
3223
3224
|
children: /* @__PURE__ */ t("div", {
|
|
3224
|
-
className:
|
|
3225
|
+
className: Yt.contentInner,
|
|
3225
3226
|
children: i
|
|
3226
3227
|
})
|
|
3227
3228
|
})]
|
|
3228
3229
|
});
|
|
3229
|
-
},
|
|
3230
|
+
}, Qt = ({ children: e, containerId: t = "overlay-root" }) => {
|
|
3230
3231
|
let [n, r] = m(null);
|
|
3231
3232
|
return l(() => {
|
|
3232
3233
|
let e = document.getElementById(t);
|
|
@@ -3241,4 +3242,4 @@ var mt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3241
3242
|
}, [t]), n ? h(e, n) : null;
|
|
3242
3243
|
};
|
|
3243
3244
|
//#endregion
|
|
3244
|
-
export {
|
|
3245
|
+
export { St as ConfirmModal, Zt as DSAccordion, S as DSBadge, T as DSButton, M as DSCheckbox, je as DSDataTable, le as DSDateRange, K as DSDateTimePicker, ge as DSDropDown, Ie as DSDropDownMultiple, te as DSFieldLabel, D as DSFieldMessage, rt as DSFileInput, Qe as DSFilters, A as DSIcon, Je as DSInfoBlock, Re as DSInput, ee as DSLoader, gt as DSModal, ht as DSModalFrame, Mt as DSPageLoader, Qt as DSPortal, Xe as DSRadioButton, Ke as DSSearchDropDown, de as DSSkeleton, ve as DSSort, st as DSTextarea, Ft as DSToast, zt as DSToastProvider, Ht as DSTooltip, Jt as DSVideoPlayerFrame, Ct as ErrorModal, _t as ModalSystemProvider, wt as builtInModalRegistry, vt as defineModalRegistry, z as formatDateInputValue, G as formatDateTimeLocalValue, Xt as getDSAccordionScrollTarget, be as getDSDataTableColumnStyle, xe as getDSDataTablePaginationItems, Et as getErrorMessage, me as getNextEnabledOptionIndex, H as isValidDateInputPrefix, J as isValidDateRange, B as maskDateInputValue, U as parseDateInputValue, ne as parseDateTimeLocalValue, ut as resetModalStore, Rt as resetToastStore, Tt as useConfirmModal, Ot as useConfirmModalStore, Dt as useErrorModal, kt as useErrorModalStore, At as useModals, lt as useModalsStore, Bt as useToast, Lt as useToastStore, Se as validateDSDataTableData };
|