urfu-ui-kit-react 2.1.7-next.1 → 2.1.7-next.3
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 +2 -2
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +232 -194
- package/dist/components/Calendar/Calendar.types.d.ts +21 -0
- package/dist/components/Calendar/Calendar.types.d.ts.map +1 -1
- package/dist/components/Calendar/CalendarSelect.js +38 -38
- package/dist/components/Calendar/MaskedDateInput.d.ts +2 -0
- package/dist/components/Calendar/MaskedDateInput.d.ts.map +1 -1
- package/dist/components/Calendar/MaskedDateInput.js +120 -113
- package/dist/components/ColumnSettings/ColumnSettings.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettings.js +22 -21
- package/dist/components/ConfirmModal/ConfirmModal.d.ts +0 -1
- package/dist/components/ConfirmModal/ConfirmModal.d.ts.map +1 -1
- package/dist/components/ConfirmModal/ConfirmModal.js +11 -12
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.js +23 -22
- package/dist/components/ErrorScreen/ErrorScreen.js +117 -115
- package/dist/components/ErrorScreen/ErrorScreenIllustration.js +28 -28
- package/dist/components/InputExpandTextarea/InputExpandTextarea.js +1 -1
- package/dist/components/InputTime/InputTime.js +12 -12
- package/dist/components/Menu/Menu.js +11 -11
- package/dist/components/Modal/Modal.js +33 -33
- package/dist/components/Pagination/Pagination.js +22 -22
- package/dist/components/Preloader/Preloader.d.ts.map +1 -1
- package/dist/components/Preloader/Preloader.js +13 -13
- package/dist/components/Search/Search.d.ts.map +1 -1
- package/dist/components/Search/Search.js +28 -23
- package/dist/components/Select/Select.d.ts +2 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +21 -19
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.js +8 -8
- package/dist/components/Table/Filter/FilterStringBox.js +8 -8
- package/dist/components/Table/Filter/SelectFilter.d.ts.map +1 -1
- package/dist/components/Table/Filter/SelectFilter.js +24 -22
- package/dist/components/Table/Filter/useFilterOptionsPreload.js +2 -2
- package/dist/components/Table/Table.types.d.ts +1 -1
- package/dist/components/Table/Table.types.d.ts.map +1 -1
- package/dist/components/Table/TableHead.js +6 -6
- package/dist/components/Table/TableMobileCard.d.ts.map +1 -1
- package/dist/components/Table/TableMobileCard.js +27 -26
- package/dist/components/Table/TableMobileView.js +46 -46
- package/dist/components/Table/TableRow.js +1 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +25 -24
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +37 -36
- package/dist/dev/index.js +16 -16
- package/dist/dev/types/vanilla/src/dev/panelStyles.d.ts +1 -1
- package/dist/hooks/useAutoId.js +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/shared/kitCopy.js +1 -1
- package/dist/shared/kitRegistry.d.ts +2 -2
- package/dist/shared/optionStateColors.d.ts +2 -2
- package/dist/shared/optionStateColors.js +4 -4
- package/dist/style-no-fonts.css +1 -1
- package/dist/style.css +1 -1
- package/dist/style.layer.css +2 -2
- package/dist/style.shell.css +3 -3
- package/dist/urfu-ui-kit-react.js +12 -12
- package/dist/utils/describeError.d.ts +27 -0
- package/dist/utils/describeError.d.ts.map +1 -1
- package/dist/vanilla/core/dateMask.js +1 -1
- package/dist/vanilla/core/describeError.js +42 -37
- package/package.json +1 -1
|
@@ -2,39 +2,38 @@ import { jsxs as a, jsx as i } from "react/jsx-runtime";
|
|
|
2
2
|
import { useAutoId$u as h } from "../../hooks/useAutoId.js";
|
|
3
3
|
import { Button$u as e } from "../Button/Button.js";
|
|
4
4
|
import { Modal$u as _ } from "../Modal/Modal.js";
|
|
5
|
-
/* empty css */
|
|
6
5
|
/* empty css */
|
|
7
|
-
const
|
|
6
|
+
const j = ({
|
|
8
7
|
active: m,
|
|
9
8
|
title: c,
|
|
10
9
|
description: r,
|
|
11
10
|
onCancel: t,
|
|
12
|
-
onConfirm:
|
|
11
|
+
onConfirm: l,
|
|
13
12
|
confirmText: d = "Да",
|
|
14
13
|
cancelText: n = "Нет",
|
|
15
14
|
confirmVariant: s = "primary",
|
|
16
15
|
confirmDisabled: u = !1,
|
|
17
|
-
className:
|
|
18
|
-
...
|
|
16
|
+
className: f = "",
|
|
17
|
+
...p
|
|
19
18
|
}) => {
|
|
20
|
-
const
|
|
19
|
+
const o = h(void 0, "u-confirm-modal-title");
|
|
21
20
|
return /* @__PURE__ */ a(
|
|
22
21
|
_,
|
|
23
22
|
{
|
|
24
|
-
...
|
|
25
|
-
ariaLabelledBy:
|
|
23
|
+
...p,
|
|
24
|
+
ariaLabelledBy: o,
|
|
26
25
|
active: m,
|
|
27
26
|
onCancel: t,
|
|
28
|
-
className: `u-react-confirm-modal ${
|
|
27
|
+
className: `u-react-confirm-modal ${f}`,
|
|
29
28
|
children: [
|
|
30
|
-
/* @__PURE__ */ i("h3", { id:
|
|
29
|
+
/* @__PURE__ */ i("h3", { id: o, className: "u-react-confirm-modal__title", children: c }),
|
|
31
30
|
r ? /* @__PURE__ */ i("div", { className: "u-react-confirm-modal__description", children: r }) : null,
|
|
32
31
|
/* @__PURE__ */ a("div", { className: "u-react-confirm-modal__actions", children: [
|
|
33
32
|
/* @__PURE__ */ i(e, { type: "button", variant: "simple", onClick: t, children: n }),
|
|
34
|
-
|
|
33
|
+
l ? /* @__PURE__ */ i(e, { type: "button", variant: s, disabled: u, onClick: l, children: d }) : null
|
|
35
34
|
] })
|
|
36
35
|
]
|
|
37
36
|
}
|
|
38
37
|
);
|
|
39
38
|
};
|
|
40
|
-
export {
|
|
39
|
+
export { j as ConfirmModal$u };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,0BAA0B,CAAC;AAClC,OAAO,qDAAqD,CAAC;
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,0BAA0B,CAAC;AAClC,OAAO,qDAAqD,CAAC;AAG7D;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,oKAgBpB,gBAAgB,gCAyElB,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as N,
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { useMountTransition$u as
|
|
5
|
-
import { useModalFocus$u as
|
|
6
|
-
import { getPortalScopeProps$u as
|
|
2
|
+
import { useRef as N, useEffect as l } from "react";
|
|
3
|
+
import { createPortal as R } from "react-dom";
|
|
4
|
+
import { useMountTransition$u as F } from "../../hooks/useMountTransition.js";
|
|
5
|
+
import { useModalFocus$u as T, ModalFocusContext$u as j, isTopModal$u as A } from "../Modal/useModalFocus.js";
|
|
6
|
+
import { getPortalScopeProps$u as D } from "../../shared/uiKitDefaults.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
/* empty css */
|
|
9
9
|
/* empty css */
|
|
10
|
-
import {
|
|
10
|
+
import { useAutoId$u as H } from "../../hooks/useAutoId.js";
|
|
11
|
+
import { lockKitScroll$u as L, ownKitNode$u as O, isKitEventHandled$u as S, markKitEventHandled$u as B } from "../../vanilla/core/kitRegistry.js";
|
|
11
12
|
import { MOTION_MS$u as q } from "../../vanilla/core/motion.js";
|
|
12
|
-
const
|
|
13
|
+
const tr = ({
|
|
13
14
|
open: r,
|
|
14
15
|
onClose: s,
|
|
15
16
|
side: k = "right",
|
|
@@ -26,26 +27,26 @@ const er = ({
|
|
|
26
27
|
trapFocus: K = !0,
|
|
27
28
|
initialFocus: P = "first"
|
|
28
29
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
30
|
+
const i = N(null), w = H(void 0, "u-drawer-title"), { shouldRender: _, status: h, isAnimated: b } = F({ isOpen: r, duration: q.base }), { scope: n, onFocusCapture: $ } = T(i, r, K, P), o = N(s);
|
|
31
|
+
if (o.current = s, l(() => {
|
|
31
32
|
if (!r || !p) return;
|
|
32
|
-
const t = (
|
|
33
|
-
|
|
33
|
+
const t = (d) => {
|
|
34
|
+
d.key !== "Escape" || d.defaultPrevented || S(d) || !A(n) || (B(d), o.current());
|
|
34
35
|
};
|
|
35
36
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
36
|
-
}, [r, p,
|
|
37
|
+
}, [r, p, n]), l(() => {
|
|
37
38
|
if (!(!r || !v))
|
|
38
|
-
return
|
|
39
|
+
return L();
|
|
39
40
|
}, [r, v]), l(() => {
|
|
40
|
-
const t =
|
|
41
|
-
return t ?
|
|
41
|
+
const t = i.current;
|
|
42
|
+
return t ? O(t) : void 0;
|
|
42
43
|
}, [_]), !_ || typeof document > "u") return null;
|
|
43
44
|
const C = b && h !== "open", I = b && h === "exiting", y = x ?? (a ? w : void 0);
|
|
44
|
-
return
|
|
45
|
-
/* @__PURE__ */ e(
|
|
45
|
+
return R(
|
|
46
|
+
/* @__PURE__ */ e(j.Provider, { value: n, children: /* @__PURE__ */ u(
|
|
46
47
|
"div",
|
|
47
48
|
{
|
|
48
|
-
...
|
|
49
|
+
...D(),
|
|
49
50
|
className: `u-drawer u-drawer--${k}${C ? " u-drawer--hidden" : ""}${I ? " u-drawer--leaving" : ""}${f ? ` ${f}` : ""}`,
|
|
50
51
|
children: [
|
|
51
52
|
/* @__PURE__ */ e(
|
|
@@ -53,13 +54,13 @@ const er = ({
|
|
|
53
54
|
{
|
|
54
55
|
className: "u-drawer__backdrop",
|
|
55
56
|
"aria-hidden": "true",
|
|
56
|
-
onClick: E ? () =>
|
|
57
|
+
onClick: E ? () => o.current() : void 0
|
|
57
58
|
}
|
|
58
59
|
),
|
|
59
60
|
/* @__PURE__ */ u(
|
|
60
61
|
"div",
|
|
61
62
|
{
|
|
62
|
-
ref:
|
|
63
|
+
ref: i,
|
|
63
64
|
className: "u-drawer__panel",
|
|
64
65
|
role: "dialog",
|
|
65
66
|
tabIndex: -1,
|
|
@@ -71,7 +72,7 @@ const er = ({
|
|
|
71
72
|
children: [
|
|
72
73
|
/* @__PURE__ */ u("div", { className: "u-drawer__header", children: [
|
|
73
74
|
a ? /* @__PURE__ */ e("h2", { id: w, className: "u-drawer__title", children: a }) : null,
|
|
74
|
-
/* @__PURE__ */ e("button", { type: "button", className: "u-button-cross u-drawer__close", "aria-label": "Закрыть", onClick: () =>
|
|
75
|
+
/* @__PURE__ */ e("button", { type: "button", className: "u-button-cross u-drawer__close", "aria-label": "Закрыть", onClick: () => o.current() })
|
|
75
76
|
] }),
|
|
76
77
|
/* @__PURE__ */ e("div", { className: "u-drawer__body", children: M }),
|
|
77
78
|
m ? /* @__PURE__ */ e("div", { className: "u-drawer__footer", children: m }) : null
|
|
@@ -84,4 +85,4 @@ const er = ({
|
|
|
84
85
|
document.body
|
|
85
86
|
);
|
|
86
87
|
};
|
|
87
|
-
export {
|
|
88
|
+
export { tr as Drawer$u };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as a, jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useAutoId$u as
|
|
1
|
+
import { jsxs as a, jsx as n, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as x, useState as y, useEffect as oe, useLayoutEffect as Ee, useMemo as be } from "react";
|
|
3
|
+
import { useAutoId$u as we } from "../../hooks/useAutoId.js";
|
|
4
4
|
import { Button$u as N } from "../Button/Button.js";
|
|
5
5
|
import { Card$u as Ce } from "../Card/Card.js";
|
|
6
|
-
import { Message$u as
|
|
7
|
-
import { Modal$u as
|
|
8
|
-
import { ErrorScreenIllustration$u as
|
|
6
|
+
import { Message$u as ge } from "../Message/Message.js";
|
|
7
|
+
import { Modal$u as ye } from "../Modal/Modal.js";
|
|
8
|
+
import { ErrorScreenIllustration$u as Ne, ErrorScreenDecor$u as j } from "./ErrorScreenIllustration.js";
|
|
9
9
|
/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
|
-
import { describeError$u as
|
|
12
|
-
const
|
|
11
|
+
import { describeError$u as Se, DEFAULT_SUPPORT_EMAIL$u as Le, DEFAULT_SUPPORT_LABEL$u as Re, supportMailto$u as le, formatErrorDetails$u as Ae, getErrorReportConfig$u as _e } from "../../vanilla/core/describeError.js";
|
|
12
|
+
const ke = {
|
|
13
13
|
notFound: { code: "404", title: "Страница не найдена", text: "Возможно, страница была удалена или адрес введён с ошибкой." },
|
|
14
14
|
forbidden: { code: "403", title: "Нет доступа к странице", text: "Права вашей роли не позволяют открыть этот раздел." },
|
|
15
15
|
serverError: { code: "500", title: "Ошибка в работе сервиса", text: "Попробуйте обновить страницу. Если ошибка повторится, обратитесь в техническую поддержку." },
|
|
@@ -20,64 +20,64 @@ const _e = {
|
|
|
20
20
|
serverError: "error",
|
|
21
21
|
maintenance: "maintenance"
|
|
22
22
|
}, Oe = '[id^="__qiankun_microapp_wrapper_for_"]';
|
|
23
|
-
function
|
|
23
|
+
function De() {
|
|
24
24
|
return typeof window < "u" && !!window.__POWERED_BY_QIANKUN__;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Ie(r) {
|
|
27
27
|
for (let e = r.parentElement; e && e !== document.body; e = e.parentElement) {
|
|
28
|
-
const { overflowY:
|
|
29
|
-
if (
|
|
28
|
+
const { overflowY: o } = getComputedStyle(e);
|
|
29
|
+
if (o === "auto" || o === "scroll") return e;
|
|
30
30
|
}
|
|
31
31
|
return r;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
for (let
|
|
36
|
-
const d =
|
|
33
|
+
function xe(r, e) {
|
|
34
|
+
const o = [];
|
|
35
|
+
for (let t = r; t && t !== e; t = t.parentElement) {
|
|
36
|
+
const d = t.parentElement;
|
|
37
37
|
if (!d) break;
|
|
38
38
|
for (const i of Array.from(d.children))
|
|
39
|
-
i !==
|
|
39
|
+
i !== t && i instanceof HTMLElement && !i.inert && (i.inert = !0, o.push(i));
|
|
40
40
|
}
|
|
41
|
-
return () =>
|
|
42
|
-
|
|
41
|
+
return () => o.forEach((t) => {
|
|
42
|
+
t.inert = !1;
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
function Je({
|
|
46
46
|
variant: r,
|
|
47
47
|
error: e,
|
|
48
|
-
subject:
|
|
49
|
-
operation:
|
|
48
|
+
subject: o,
|
|
49
|
+
operation: t,
|
|
50
50
|
notFoundIsPage: d,
|
|
51
51
|
onRetry: i,
|
|
52
52
|
onLogin: u,
|
|
53
53
|
onHome: m,
|
|
54
54
|
showDetails: b,
|
|
55
|
-
supportEmail:
|
|
55
|
+
supportEmail: w,
|
|
56
56
|
supportLabel: S,
|
|
57
57
|
onSupport: L,
|
|
58
|
-
title:
|
|
58
|
+
title: P,
|
|
59
59
|
text: R,
|
|
60
60
|
code: p,
|
|
61
|
-
illustration:
|
|
61
|
+
illustration: A,
|
|
62
62
|
reasons: h,
|
|
63
63
|
reasonsTitle: F,
|
|
64
64
|
onAction: s,
|
|
65
|
-
actionLabel:
|
|
65
|
+
actionLabel: _,
|
|
66
66
|
secondaryActionLabel: K,
|
|
67
67
|
onSecondaryAction: Y,
|
|
68
68
|
loading: V = !1,
|
|
69
|
-
className:
|
|
70
|
-
fullScreen:
|
|
69
|
+
className: z = "",
|
|
70
|
+
fullScreen: C = !1
|
|
71
71
|
}) {
|
|
72
|
-
const G =
|
|
73
|
-
|
|
72
|
+
const G = x(null), J = x(null), B = x(null), [ce] = y(De), [ie, se] = y(null), [ae, de] = y(!1), v = C && ce && !ae;
|
|
73
|
+
oe(() => {
|
|
74
74
|
const c = G.current;
|
|
75
|
-
if (!
|
|
76
|
-
const f = (
|
|
77
|
-
return c.setAttribute("closedby", "none"), c.addEventListener("cancel", f), c.showModal(),
|
|
75
|
+
if (!C || v || !c) return;
|
|
76
|
+
const f = (O) => O.preventDefault();
|
|
77
|
+
return c.setAttribute("closedby", "none"), c.addEventListener("cancel", f), c.showModal(), te(B.current), () => {
|
|
78
78
|
c.removeEventListener("cancel", f), c.close();
|
|
79
79
|
};
|
|
80
|
-
}, [
|
|
80
|
+
}, [C, v]), Ee(() => {
|
|
81
81
|
const c = J.current;
|
|
82
82
|
if (!v || !c) return;
|
|
83
83
|
const f = c.closest(Oe);
|
|
@@ -85,48 +85,48 @@ function Je({
|
|
|
85
85
|
de(!0);
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
const
|
|
89
|
-
const I =
|
|
90
|
-
|
|
88
|
+
const O = Ie(f), D = () => {
|
|
89
|
+
const I = O.getBoundingClientRect();
|
|
90
|
+
se({ top: I.top, left: I.left, width: I.width, height: I.height });
|
|
91
91
|
};
|
|
92
|
-
|
|
93
|
-
const E = typeof ResizeObserver > "u" ? null : new ResizeObserver(
|
|
94
|
-
E == null || E.observe(
|
|
95
|
-
const
|
|
96
|
-
return
|
|
97
|
-
E == null || E.disconnect(), window.removeEventListener("resize",
|
|
92
|
+
D();
|
|
93
|
+
const E = typeof ResizeObserver > "u" ? null : new ResizeObserver(D);
|
|
94
|
+
E == null || E.observe(O), window.addEventListener("resize", D);
|
|
95
|
+
const ve = xe(c, f), W = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
96
|
+
return te(B.current), () => {
|
|
97
|
+
E == null || E.disconnect(), window.removeEventListener("resize", D), ve(), W == null || W.focus();
|
|
98
98
|
};
|
|
99
99
|
}, [v]);
|
|
100
|
-
const l =
|
|
100
|
+
const l = be(() => {
|
|
101
101
|
if (e == null) return;
|
|
102
|
-
const c =
|
|
102
|
+
const c = Se(e, { subject: o, operation: t, notFoundIsPage: d });
|
|
103
103
|
return c.group === "aborted" ? void 0 : c;
|
|
104
|
-
}, [e,
|
|
104
|
+
}, [e, o, t, d]), X = r ?? (l == null ? void 0 : l.variant) ?? "serverError", k = ke[X], M = p !== void 0 ? p : l ? l.code : k.code, U = A ?? (p != null ? "none" : Te[X]), g = h != null && h.length ? h : null, $ = M ?? void 0, H = P ?? (l == null ? void 0 : l.title) ?? k.title, T = typeof H == "string" ? H : k.title, ue = !!(K && Y), Z = Pe(l, { onAction: s, actionLabel: _, onRetry: i, onLogin: u, onHome: m }), ee = Me({ supportEmail: w, supportLabel: S, onSupport: L }), me = !!l && b !== !1, [fe, pe] = y(!1), he = [
|
|
105
105
|
"u-error-screen-card",
|
|
106
106
|
U !== "none" && "u-error-screen-card--illustrated",
|
|
107
107
|
g && "u-error-screen-card--reasons"
|
|
108
|
-
].filter(Boolean).join(" "),
|
|
109
|
-
U !== "none" ? /* @__PURE__ */
|
|
108
|
+
].filter(Boolean).join(" "), Q = /* @__PURE__ */ a(Ce, { className: he, children: [
|
|
109
|
+
U !== "none" ? /* @__PURE__ */ n(Ne, { name: U }) : M !== null && /* @__PURE__ */ n("span", { className: "u-error-screen-code", "aria-hidden": "true", children: M }),
|
|
110
110
|
/* @__PURE__ */ a("div", { className: "u-error-screen-message", children: [
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
(R !== void 0 || l || !g) && /* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ n("p", { className: "u-error-screen-title", children: H }),
|
|
112
|
+
(R !== void 0 || l || !g) && /* @__PURE__ */ n("p", { className: "u-error-screen-description", children: Be(R ?? (l == null ? void 0 : l.text) ?? k.text, ee.email, l ? { ...l, title: T } : void 0) }),
|
|
113
113
|
g && /* @__PURE__ */ a("div", { className: "u-error-screen-reasons", children: [
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ n("p", { className: "u-error-screen-reasons-title", children: F ?? (g.length > 1 ? "Причины" : "Причина") }),
|
|
115
|
+
/* @__PURE__ */ n("ul", { className: "u-error-screen-reasons-list", children: g.map((c, f) => /* @__PURE__ */ n("li", { children: c }, f)) })
|
|
116
116
|
] })
|
|
117
117
|
] }),
|
|
118
|
-
/* @__PURE__ */ a("div", { className: "u-error-screen-actions", ref:
|
|
119
|
-
|
|
120
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ a("div", { className: "u-error-screen-actions", ref: B, children: [
|
|
119
|
+
ue && /* @__PURE__ */ n(N, { size: "small", variant: "simple", disabled: V, onClick: Y, children: K }),
|
|
120
|
+
/* @__PURE__ */ n(N, { size: "small", loading: V, onClick: Z.onClick, children: Z.label })
|
|
121
121
|
] }),
|
|
122
|
-
l &&
|
|
122
|
+
l && me && /* @__PURE__ */ n(
|
|
123
123
|
Ue,
|
|
124
124
|
{
|
|
125
|
-
description: { ...l, title:
|
|
126
|
-
inDialog:
|
|
125
|
+
description: { ...l, title: T },
|
|
126
|
+
inDialog: C && !v,
|
|
127
127
|
support: ee,
|
|
128
128
|
open: fe,
|
|
129
|
-
onOpenChange:
|
|
129
|
+
onOpenChange: pe
|
|
130
130
|
}
|
|
131
131
|
)
|
|
132
132
|
] });
|
|
@@ -135,118 +135,120 @@ function Je({
|
|
|
135
135
|
{
|
|
136
136
|
ref: J,
|
|
137
137
|
role: "dialog",
|
|
138
|
-
"aria-label":
|
|
139
|
-
style:
|
|
138
|
+
"aria-label": T,
|
|
139
|
+
style: ie ?? void 0,
|
|
140
140
|
"data-error-code": $,
|
|
141
|
-
className: `u-error-screen u-error-screen-fullscreen u-error-screen-area ${
|
|
141
|
+
className: `u-error-screen u-error-screen-fullscreen u-error-screen-area ${z}`,
|
|
142
142
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
|
|
143
|
+
/* @__PURE__ */ n(j, {}),
|
|
144
|
+
Q
|
|
145
145
|
]
|
|
146
146
|
}
|
|
147
|
-
) :
|
|
147
|
+
) : C ? /* @__PURE__ */ a(
|
|
148
148
|
"dialog",
|
|
149
149
|
{
|
|
150
150
|
ref: G,
|
|
151
|
-
className: `u-error-screen u-error-screen-fullscreen ${
|
|
152
|
-
"aria-label":
|
|
151
|
+
className: `u-error-screen u-error-screen-fullscreen ${z}`,
|
|
152
|
+
"aria-label": T,
|
|
153
153
|
"data-error-code": $,
|
|
154
154
|
children: [
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
|
|
155
|
+
/* @__PURE__ */ n(j, {}),
|
|
156
|
+
Q
|
|
157
157
|
]
|
|
158
158
|
}
|
|
159
|
-
) : /* @__PURE__ */ a("div", { className: `u-error-screen ${
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
|
|
159
|
+
) : /* @__PURE__ */ a("div", { className: `u-error-screen ${z}`, role: "alert", "data-error-code": $, children: [
|
|
160
|
+
/* @__PURE__ */ n(j, {}),
|
|
161
|
+
Q
|
|
162
162
|
] });
|
|
163
163
|
}
|
|
164
|
-
const
|
|
165
|
-
function
|
|
164
|
+
const re = () => window.location.reload();
|
|
165
|
+
function te(r) {
|
|
166
166
|
var e;
|
|
167
167
|
(e = r == null ? void 0 : r.querySelector("button:last-of-type")) == null || e.focus();
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
const
|
|
171
|
-
if (e.onAction) return { label:
|
|
172
|
-
if (!r) return { label:
|
|
173
|
-
const
|
|
169
|
+
function Pe(r, e) {
|
|
170
|
+
const o = e.actionLabel;
|
|
171
|
+
if (e.onAction) return { label: o ?? (r ? "Повторить" : "Обновить страницу"), onClick: e.onAction };
|
|
172
|
+
if (!r) return { label: o ?? "Обновить страницу", onClick: e.onRetry ?? re };
|
|
173
|
+
const t = { label: o ?? "Обновить страницу", onClick: re };
|
|
174
174
|
switch (r.action) {
|
|
175
175
|
case "login":
|
|
176
|
-
return e.onLogin ? { label:
|
|
176
|
+
return e.onLogin ? { label: o ?? r.actionLabel, onClick: e.onLogin } : t;
|
|
177
177
|
case "home":
|
|
178
|
-
return e.onHome ? { label:
|
|
178
|
+
return e.onHome ? { label: o ?? r.actionLabel, onClick: e.onHome } : t;
|
|
179
179
|
case "retry":
|
|
180
180
|
case "wait":
|
|
181
181
|
case "fix":
|
|
182
|
-
return e.onRetry ? { label:
|
|
182
|
+
return e.onRetry ? { label: o ?? r.actionLabel, onClick: e.onRetry } : t;
|
|
183
183
|
default:
|
|
184
|
-
return
|
|
184
|
+
return t;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
const
|
|
188
|
-
function
|
|
189
|
-
if (typeof r != "string") return r;
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
187
|
+
const ze = 2e3, q = "техническую поддержку";
|
|
188
|
+
function Be(r, e, o) {
|
|
189
|
+
if (typeof r != "string" || !e) return r;
|
|
190
|
+
const t = r.indexOf(q) + q.length;
|
|
191
|
+
if (t < q.length) return r;
|
|
192
|
+
const d = o ? le(o, e) : `mailto:${e}`;
|
|
193
|
+
return /* @__PURE__ */ a(ne, { children: [
|
|
194
|
+
r.slice(0, t),
|
|
195
|
+
": ",
|
|
196
|
+
/* @__PURE__ */ n("a", { className: "u-link", href: d, children: e }),
|
|
197
|
+
r.slice(t)
|
|
196
198
|
] });
|
|
197
199
|
}
|
|
198
200
|
function Me(r) {
|
|
199
|
-
const e =
|
|
200
|
-
return { email: r.supportEmail !== void 0 ? r.supportEmail : e.supportEmail !== void 0 ? e.supportEmail :
|
|
201
|
+
const e = _e();
|
|
202
|
+
return { email: r.supportEmail !== void 0 ? r.supportEmail : e.supportEmail !== void 0 ? e.supportEmail : Le, label: r.supportLabel ?? e.supportLabel ?? Re, onSupport: r.onSupport ?? e.onSupport };
|
|
201
203
|
}
|
|
202
|
-
function Ue({ description: r, support: e, inDialog:
|
|
203
|
-
const i = e.email, [u, m] = y("idle"), b =
|
|
204
|
+
function Ue({ description: r, support: e, inDialog: o, open: t, onOpenChange: d }) {
|
|
205
|
+
const i = e.email, [u, m] = y("idle"), b = x(null), w = Ae(r), S = () => {
|
|
204
206
|
const s = window.getSelection();
|
|
205
207
|
s && b.current && s.selectAllChildren(b.current);
|
|
206
|
-
}, L = (s,
|
|
208
|
+
}, L = (s, _) => {
|
|
207
209
|
if (!navigator.clipboard) {
|
|
208
|
-
S(),
|
|
210
|
+
S(), _();
|
|
209
211
|
return;
|
|
210
212
|
}
|
|
211
|
-
navigator.clipboard.writeText(
|
|
212
|
-
S(),
|
|
213
|
+
navigator.clipboard.writeText(w).then(s, () => {
|
|
214
|
+
S(), _();
|
|
213
215
|
});
|
|
214
|
-
},
|
|
215
|
-
const s = i ?
|
|
216
|
+
}, P = () => L(() => m("copied"), () => m("selected")), R = () => {
|
|
217
|
+
const s = i ? le(r, i) : null;
|
|
216
218
|
if (e.onSupport) {
|
|
217
|
-
e.onSupport({ report:
|
|
219
|
+
e.onSupport({ report: w, description: r, mailto: s });
|
|
218
220
|
return;
|
|
219
221
|
}
|
|
220
222
|
s && (L(() => m("mailCopied"), () => m("mailSelected")), window.open(s, "_self"));
|
|
221
223
|
};
|
|
222
|
-
|
|
224
|
+
oe(() => {
|
|
223
225
|
if (u !== "copied") return;
|
|
224
|
-
const s = setTimeout(() => m("idle"),
|
|
226
|
+
const s = setTimeout(() => m("idle"), ze);
|
|
225
227
|
return () => clearTimeout(s);
|
|
226
228
|
}, [u]);
|
|
227
|
-
const p = u === "copied" ? "Скопировано" : u === "selected" ? "Выделено — нажмите Ctrl+C" : "Скопировать",
|
|
228
|
-
return /* @__PURE__ */ a(
|
|
229
|
-
/* @__PURE__ */
|
|
229
|
+
const p = u === "copied" ? "Скопировано" : u === "selected" ? "Выделено — нажмите Ctrl+C" : "Скопировать", A = u === "mailCopied" ? `Открываем письмо. Если почта не открылась — текст скопирован, вставьте его в письмо на ${i}` : u === "mailSelected" ? `Открываем письмо. Если почта не открылась — текст выделен: нажмите Ctrl+C и вставьте его в письмо на ${i}` : "", h = we(void 0, "u-error-screen-details-title");
|
|
230
|
+
return /* @__PURE__ */ a(ne, { children: [
|
|
231
|
+
/* @__PURE__ */ n(N, { size: "small", variant: "text", onClick: () => d(!0), children: "Подробности для технической поддержки" }),
|
|
230
232
|
/* @__PURE__ */ a(
|
|
231
|
-
|
|
233
|
+
ye,
|
|
232
234
|
{
|
|
233
|
-
active:
|
|
235
|
+
active: t,
|
|
234
236
|
onCancel: () => {
|
|
235
237
|
d(!1), m("idle");
|
|
236
238
|
},
|
|
237
239
|
unmountOnClose: !0,
|
|
238
|
-
portalOn: !
|
|
240
|
+
portalOn: !o,
|
|
239
241
|
ariaLabelledBy: h,
|
|
240
242
|
maxWidth: "640px",
|
|
241
243
|
className: "u-error-screen-details-modal",
|
|
242
244
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ n("h3", { id: h, className: "u-error-screen-details-title", children: "Подробности для технической поддержки" }),
|
|
246
|
+
/* @__PURE__ */ n("pre", { ref: b, className: "u-error-screen-report", children: w }),
|
|
245
247
|
/* @__PURE__ */ a("div", { className: "u-error-screen-copy", children: [
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
(i || e.onSupport) && /* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ n(N, { size: "small", variant: "text", onClick: P, children: p }),
|
|
249
|
+
(i || e.onSupport) && /* @__PURE__ */ n(N, { size: "small", onClick: R, children: e.label })
|
|
248
250
|
] }),
|
|
249
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ n("div", { className: "u-error-screen-copy-status", role: "status", "aria-live": "polite", children: A ? /* @__PURE__ */ n(ge, { size: "small", children: A }) : u !== "idle" && /* @__PURE__ */ n("span", { className: "u-error-screen-sr-only", children: p }) })
|
|
250
252
|
]
|
|
251
253
|
}
|
|
252
254
|
)
|