urfu-ui-kit-react 2.1.7-next.2 → 2.1.7-next.4

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.
Files changed (34) hide show
  1. package/README.md +2 -2
  2. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  3. package/dist/components/Calendar/Calendar.js +226 -205
  4. package/dist/components/Calendar/Calendar.types.d.ts +19 -0
  5. package/dist/components/Calendar/Calendar.types.d.ts.map +1 -1
  6. package/dist/components/ErrorScreen/ErrorScreen.js +117 -115
  7. package/dist/components/SearchSelect/SearchSelect.d.ts.map +1 -1
  8. package/dist/components/SearchSelect/SearchSelect.js +162 -152
  9. package/dist/components/Table/Filter/FilterStringBox.js +8 -8
  10. package/dist/components/Table/Filter/useFilterOptionsPreload.js +2 -2
  11. package/dist/components/Table/Table.types.d.ts +1 -1
  12. package/dist/components/Table/Table.types.d.ts.map +1 -1
  13. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  14. package/dist/components/Tabs/Tabs.js +34 -33
  15. package/dist/components/Tabs/distributeTabs.d.ts +7 -3
  16. package/dist/components/Tabs/distributeTabs.d.ts.map +1 -1
  17. package/dist/components/Tabs/useTabsOverflow.d.ts +4 -0
  18. package/dist/components/Tabs/useTabsOverflow.d.ts.map +1 -1
  19. package/dist/components/Tabs/useTabsOverflow.js +40 -41
  20. package/dist/dev/index.js +2 -2
  21. package/dist/index.d.ts +5 -3
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/shared/kitCopy.js +1 -1
  24. package/dist/style-no-fonts.css +1 -1
  25. package/dist/style.css +1 -1
  26. package/dist/style.layer.css +2 -2
  27. package/dist/style.shell.css +2 -2
  28. package/dist/urfu-ui-kit-react.js +10 -9
  29. package/dist/utils/describeError.d.ts +27 -0
  30. package/dist/utils/describeError.d.ts.map +1 -1
  31. package/dist/vanilla/core/dateLimits.js +21 -0
  32. package/dist/vanilla/core/describeError.js +44 -39
  33. package/dist/vanilla/core/distributeTabs.js +36 -23
  34. package/package.json +1 -1
@@ -13,10 +13,10 @@ import { ErrorScreen$u as C } from "./components/ErrorScreen/ErrorScreen.js";
13
13
  import { OfflineBanner$u as F } from "./components/OfflineBanner/OfflineBanner.js";
14
14
  import { useOnlineStatus$u as U } from "./hooks/useOnlineStatus.js";
15
15
  import { useCollapseMotion$u as R } from "./hooks/useCollapseMotion.js";
16
- import { useEnterMotion$u as h } from "./hooks/useEnterMotion.js";
17
- import { Checkbox$u as _ } from "./components/Checkbox/Checkbox.js";
16
+ import { useEnterMotion$u as D } from "./hooks/useEnterMotion.js";
17
+ import { Checkbox$u as h } from "./components/Checkbox/Checkbox.js";
18
18
  import { ConfirmModal$u as w } from "./components/ConfirmModal/ConfirmModal.js";
19
- import { ColumnSettings$u as V } from "./components/ColumnSettings/ColumnSettings.js";
19
+ import { ColumnSettings$u as B } from "./components/ColumnSettings/ColumnSettings.js";
20
20
  import { FormField$u as K } from "./components/FormField/FormField.js";
21
21
  import { Icon$u as N } from "./components/Icon/Icon.js";
22
22
  import { InputExpandTextarea$u as X } from "./components/InputExpandTextarea/InputExpandTextarea.js";
@@ -40,9 +40,9 @@ import { Switch$u as Ir } from "./components/Switch/Switch.js";
40
40
  import { StickyActionBar$u as Lr } from "./components/StickyActionBar/StickyActionBar.js";
41
41
  import { Table$u as Or } from "./components/Table/Table.js";
42
42
  import { Pagination$u as Ar } from "./components/Pagination/Pagination.js";
43
- import { Tabs$u as Dr } from "./components/Tabs/Tabs.js";
43
+ import { Tabs$u as Vr } from "./components/Tabs/Tabs.js";
44
44
  import { TabPanels$u as kr } from "./components/TabPanels/TabPanels.js";
45
- import { Textarea$u as Br } from "./components/Textarea/Textarea.js";
45
+ import { Textarea$u as _r } from "./components/Textarea/Textarea.js";
46
46
  import { Tooltip$u as yr } from "./components/Tooltip/Tooltip.js";
47
47
  import { TreeView$u as vr } from "./components/TreeView/TreeView.js";
48
48
  import { VirtualList$u as Hr } from "./components/VirtualList/VirtualList.js";
@@ -57,9 +57,10 @@ import { TableFilterOptions$u as io } from "./components/Table/Filter/TableFilte
57
57
  import { TableFilterDates$u as ao } from "./components/Table/Filter/FilterDateBox.js";
58
58
  import { Skeleton$u as so } from "./components/Skeleton/Skeleton.js";
59
59
  import { installInputModeTracking$u as o } from "./vanilla/core/inputMode.js";
60
- import { DEFAULT_ERROR_TEXTS$u as uo, DEFAULT_SUPPORT_EMAIL$u as co, DEFAULT_SUPPORT_LABEL$u as To, configureErrorReport$u as So, configureErrorTexts$u as Eo, describeError$u as go, describeFieldErrors$u as bo, formatErrorDetails$u as Mo, isHumanMessage$u as Po, supportMailto$u as Co } from "./vanilla/core/describeError.js";
61
- import { hasPreviousPage$u as Fo } from "./vanilla/core/hasPreviousPage.js";
62
- import { reconcileColumnOrder$u as Uo } from "./vanilla/core/reconcileColumnOrder.js";
60
+ import { DEFAULT_ERROR_TEXTS$u as uo, DEFAULT_SUPPORT_EMAIL$u as co, DEFAULT_SUPPORT_LABEL$u as To, configureErrorReport$u as So, configureErrorTexts$u as Eo, describeError$u as go, describeFieldErrors$u as bo, errorView$u as Mo, formatErrorDetails$u as Po, isHumanMessage$u as Co, supportMailto$u as Io } from "./vanilla/core/describeError.js";
61
+ import { hasPreviousPage$u as Lo } from "./vanilla/core/hasPreviousPage.js";
62
+ import { maskDateValue$u as Oo } from "./vanilla/core/dateMask.js";
63
+ import { reconcileColumnOrder$u as Ao } from "./vanilla/core/reconcileColumnOrder.js";
63
64
  r();
64
65
  o();
65
- export { u as Accordion, T as BreadCrumbs, d as Button, g as Calendar, M as Card, _ as Checkbox, V as ColumnSettings, w as ConfirmModal, uo as DEFAULT_ERROR_TEXTS, co as DEFAULT_SUPPORT_EMAIL, To as DEFAULT_SUPPORT_LABEL, mr as Drawer, C as ErrorScreen, K as FormField, N as Icon, jr as InfiniteScroll, X as InputExpandTextarea, q as InputFile, G as InputNumber, Q as InputText, Y as InputTime, $ as Menu, or as Message, tr as Modal, ir as Multiselect, ar as NotificationProvider, F as OfflineBanner, Ar as Pagination, lr as Preloader, cr as Radio, Sr as Search, Er as SearchSelect, br as Select, so as Skeleton, Pr as Status, Lr as StickyActionBar, Ir as Switch, kr as TabPanels, Or as Table, ao as TableFilterDates, io as TableFilterOptions, Dr as Tabs, Br as Textarea, yr as Tooltip, vr as TreeView, Hr as VirtualList, ro as compareValues, So as configureErrorReport, Eo as configureErrorTexts, po as configureUiKit, go as describeError, bo as describeFieldErrors, Mo as formatErrorDetails, n as getUiKitCopies, s as hasLegacyUiKitOverlay, Fo as hasPreviousPage, Po as isHumanMessage, oo as nextSort, Uo as reconcileColumnOrder, eo as sortRows, Co as supportMailto, R as useCollapseMotion, h as useEnterMotion, Jr as useInfiniteScroll, nr as useNotification, U as useOnlineStatus, Zr as usePagination, Wr as useTableSort, mo as useUiKitViewport, zr as useVirtualList };
66
+ export { u as Accordion, T as BreadCrumbs, d as Button, g as Calendar, M as Card, h as Checkbox, B as ColumnSettings, w as ConfirmModal, uo as DEFAULT_ERROR_TEXTS, co as DEFAULT_SUPPORT_EMAIL, To as DEFAULT_SUPPORT_LABEL, mr as Drawer, C as ErrorScreen, K as FormField, N as Icon, jr as InfiniteScroll, X as InputExpandTextarea, q as InputFile, G as InputNumber, Q as InputText, Y as InputTime, $ as Menu, or as Message, tr as Modal, ir as Multiselect, ar as NotificationProvider, F as OfflineBanner, Ar as Pagination, lr as Preloader, cr as Radio, Sr as Search, Er as SearchSelect, br as Select, so as Skeleton, Pr as Status, Lr as StickyActionBar, Ir as Switch, kr as TabPanels, Or as Table, ao as TableFilterDates, io as TableFilterOptions, Vr as Tabs, _r as Textarea, yr as Tooltip, vr as TreeView, Hr as VirtualList, ro as compareValues, So as configureErrorReport, Eo as configureErrorTexts, po as configureUiKit, go as describeError, bo as describeFieldErrors, Mo as errorView, Po as formatErrorDetails, n as getUiKitCopies, s as hasLegacyUiKitOverlay, Lo as hasPreviousPage, Co as isHumanMessage, Oo as maskDateValue, oo as nextSort, Ao as reconcileColumnOrder, eo as sortRows, Io as supportMailto, R as useCollapseMotion, D as useEnterMotion, Jr as useInfiniteScroll, nr as useNotification, U as useOnlineStatus, Zr as usePagination, Wr as useTableSort, mo as useUiKitViewport, zr as useVirtualList };
@@ -79,6 +79,33 @@ export declare function isHumanMessage(message: string | undefined): message is
79
79
  /** Описать ошибку для человека. Отмену запроса возвращает с group 'aborted' и action 'none' — её не показывают. */
80
80
  export declare function describeError(error: unknown, options?: DescribeErrorOptions): ErrorDescription;
81
81
  /** Ошибки валидации по полям формы — разбор ответа 400/422 (решение дизайнера 20.10.2026: причину — у поля). */
82
+ /**
83
+ * Что запрос значит для экрана — единственное, что сервис решает сам:
84
+ * record — основной ресурс (запись, форма): без него экран не показать;
85
+ * list — основной список экрана: пустая таблица с условиями — тоже содержимое;
86
+ * part — часть экрана в своей карточке (вкладка, чат);
87
+ * extra — вспомогательный запрос или действие: только уведомление, ничего не закрывает.
88
+ */
89
+ export type ErrorViewRole = 'record' | 'list' | 'part' | 'extra';
90
+ /**
91
+ * content — ошибки нет или запрос отменён; page — ErrorScreen на месте содержимого (крошки и заголовок
92
+ * остаются, действия скрыты); block — ErrorScreen в карточке списка или части, остальное на месте;
93
+ * notice — уведомление при содержимом.
94
+ */
95
+ export type ErrorView = 'content' | 'page' | 'block' | 'notice';
96
+ export interface ErrorViewInput {
97
+ error: unknown;
98
+ role: ErrorViewRole;
99
+ /** Есть что показать: ранее загруженные данные. */
100
+ hasData?: boolean;
101
+ /** Активны поиск или фильтры: они сохраняются между визитами, без них запрос не исправить. */
102
+ hasQuery?: boolean;
103
+ }
104
+ /**
105
+ * Заглушка или уведомление — одно правило для всех сервисов:
106
+ * показать нечего и не загрузилось основное — ErrorScreen, иначе уведомление.
107
+ */
108
+ export declare function errorView({ error, role, hasData, hasQuery }: ErrorViewInput): ErrorView;
82
109
  export interface FieldErrors {
83
110
  /** Текст ошибки по ключу поля — показывать под полем (проп `error` у полей кита). */
84
111
  fields: Record<string, string>;
@@ -1 +1 @@
1
- {"version":3,"file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,CAAC,MAAM,EAAE,iBAAiB,cAK7D;AAED,2EAA2E;AAC3E,wBAAgB,oBAAoB,IAAI,QAAQ,CAAC,iBAAiB,CAAC,CAElE;AA8HD,wFAAwF;AACxF,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,gBAAgB,GAAG,MAAM,CAExE;AA+BD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,gBAAgB,EAAE,KAAK,GAAE,MAA8B,GAAG,MAAM,CAc1G"}
@@ -0,0 +1,21 @@
1
+ const l = (e) => {
2
+ if (e == null || e === "") return null;
3
+ const n = new Date(e);
4
+ return Number.isNaN(n.getTime()) ? null : (n.setHours(12, 0, 0, 0), n);
5
+ }, a = (e) => e.getFullYear() * 1e4 + e.getMonth() * 100 + e.getDate(), f = /* @__PURE__ */ new WeakMap(), i = (e) => {
6
+ const n = f.get(e);
7
+ if (n) return n;
8
+ const s = l(e.minDate), t = l(e.maxDate), r = [];
9
+ for (const c of e.excludeDates ?? []) {
10
+ const u = l(c);
11
+ u !== null && r.push(a(u));
12
+ }
13
+ const o = { min: s && a(s), max: t && a(t), excluded: r };
14
+ return f.set(e, o), o;
15
+ }, m = (e, n, s) => {
16
+ let t = a(e), r = a(n);
17
+ t > r && ([t, r] = [r, t]);
18
+ const { min: o, max: c, excluded: u } = i(s);
19
+ return o !== null && t < o || c !== null && r > c ? !0 : u.some((d) => d >= t && d <= r);
20
+ }, x = (e, n) => m(e, e, n);
21
+ export { x as isCalendarDayBlocked$u, m as isCalendarRangeBlocked$u, l as toCalendarDay$u };
@@ -1,4 +1,4 @@
1
- import { startRequestLog$u as j, getRequestLog$u as k } from "./requestLog.js";
1
+ import { startRequestLog$u as k, getRequestLog$u as j } from "./requestLog.js";
2
2
  const N = {
3
3
  auth: { title: "Требуется вход", text: "Сессия закончилась. Войдите снова — данные на странице сохранятся.", action: "login", actionLabel: "Войти снова" },
4
4
  forbidden: { title: "Нет доступа", text: "У вашей роли нет прав на это действие или раздел. Если доступ нужен для работы, обратитесь к руководителю подразделения.", action: "home", actionLabel: "На главную" },
@@ -28,7 +28,7 @@ function $(t) {
28
28
  return t === 401 ? "auth" : t === 403 ? "forbidden" : t === 404 || t === 410 ? "notFound" : t === 400 || t === 422 ? "invalid" : t === 409 || t === 412 ? "conflict" : t === 413 ? "tooLarge" : t === 429 ? "rateLimit" : t === 408 || t === 504 ? "timeout" : "server";
29
29
  }
30
30
  const l = (t) => typeof t == "object" && t !== null;
31
- function L(t) {
31
+ function _(t) {
32
32
  const n = t, e = l(n.response) ? n.response : void 0;
33
33
  return [n.status, n.statusCode, e == null ? void 0 : e.status].find((r) => typeof r == "number");
34
34
  }
@@ -55,21 +55,21 @@ function D(t) {
55
55
  if (typeof e == "string" && e) return e;
56
56
  }
57
57
  }
58
- function T(t) {
58
+ function O(t) {
59
59
  return !t || t.length > 300 || /\n\s+at |<\/?[a-z][\s\S]*>|Exception|Error:|ОШИБКА:|SQLSTATE|^[A-Z_]+$/.test(t) ? !1 : /[А-Яа-яЁё]/.test(t);
60
60
  }
61
- function O(t) {
61
+ function R(t) {
62
62
  if (typeof t == "number") return { group: $(t), code: t };
63
63
  if (typeof Response < "u" && t instanceof Response) return { group: $(t.status), code: t.status };
64
64
  if (!l(t)) return { group: "server", code: null };
65
- if (L(t) === void 0) {
65
+ if (_(t) === void 0) {
66
66
  const r = typeof t.status == "string" ? t.status : void 0;
67
67
  if (r === "TIMEOUT_ERROR") return { group: "timeout", code: null, status: r, message: h(t) };
68
68
  const i = B(t);
69
69
  if (i) return { group: i, code: null, status: r, message: h(t) };
70
70
  if (t instanceof Error && r === void 0) return { group: "render", code: null, message: t.message };
71
71
  }
72
- const n = l(t.response) ? t.response : void 0, e = L(t) ?? t.status, o = "data" in t ? t.data : n == null ? void 0 : n.data;
72
+ const n = l(t.response) ? t.response : void 0, e = _(t) ?? t.status, o = "data" in t ? t.data : n == null ? void 0 : n.data;
73
73
  if (typeof e == "number") return { group: $(e), code: e, body: o, message: C(o) };
74
74
  if (e === "PARSING_ERROR") {
75
75
  const r = typeof t.originalStatus == "number" ? t.originalStatus : null, i = r !== null && r >= 400 ? r : null;
@@ -81,7 +81,7 @@ function P(t) {
81
81
  return t === "forbidden" || t === "auth" ? "forbidden" : t === "notFound" ? "notFound" : "serverError";
82
82
  }
83
83
  function w(t, n = {}) {
84
- const e = O(t);
84
+ const e = R(t);
85
85
  let o = e.group;
86
86
  o === "notFound" && n.notFoundIsPage === !1 && (o = "server");
87
87
  const r = {
@@ -95,11 +95,16 @@ function w(t, n = {}) {
95
95
  };
96
96
  if (o === "aborted")
97
97
  return { group: o, code: null, variant: "serverError", title: "", text: "", action: "none", actionLabel: "", message: "", details: r };
98
- const i = p[o], a = n.operation ? `Не удалось ${n.operation}` : n.subject ? `Не удалось загрузить ${n.subject}` : void 0, c = (a && (o === "server" || o === "parsing") ? a : void 0) ?? i.title, d = T(e.message) ? e.message : void 0, v = a && (o === "network" || o === "timeout") ? `${a}. ${i.text}` : void 0, y = d ?? v ?? i.text, E = d ? `${c}. ${d}` : c;
98
+ const i = p[o], a = n.operation ? `Не удалось ${n.operation}` : n.subject ? `Не удалось загрузить ${n.subject}` : void 0, c = (a && (o === "server" || o === "parsing") ? a : void 0) ?? i.title, d = O(e.message) ? e.message : void 0, v = a && (o === "network" || o === "timeout") ? `${a}. ${i.text}` : void 0, y = d ?? v ?? i.text, E = d ? `${c}. ${d}` : c;
99
99
  return { group: o, code: e.code, variant: P(o), title: c, text: y, action: i.action, actionLabel: i.actionLabel, message: E, details: r };
100
100
  }
101
+ function ot({ error: t, role: n, hasData: e = !1, hasQuery: o = !1 }) {
102
+ if (t == null) return "content";
103
+ const { group: r } = R(t);
104
+ return r === "aborted" ? "content" : n === "extra" || e || (r === "invalid" || r === "tooLarge") && n !== "record" ? "notice" : n === "part" || o ? "block" : "page";
105
+ }
101
106
  const U = ["field", "property", "path", "name", "key"], W = ["message", "msg", "detail", "error"];
102
- function R(t) {
107
+ function L(t) {
103
108
  if (typeof t == "string") return t.trim() || void 0;
104
109
  if (Array.isArray(t)) {
105
110
  const n = t.filter((e) => typeof e == "string" && !!e.trim());
@@ -115,13 +120,13 @@ function M(t) {
115
120
  }
116
121
  function K(t) {
117
122
  for (const n of W) {
118
- const e = R(t[n]);
123
+ const e = L(t[n]);
119
124
  if (e) return e;
120
125
  }
121
- return l(t.constraints) ? R(Object.values(t.constraints)) : void 0;
126
+ return l(t.constraints) ? L(Object.values(t.constraints)) : void 0;
122
127
  }
123
- function ot(t, n = {}) {
124
- const { requiredText: e = "Заполните обязательное поле", ...o } = n, r = O(t), i = r.group === "invalid" && l(r.body) ? r.body : void 0, a = /* @__PURE__ */ new Map(), g = [], c = (u, m) => {
128
+ function rt(t, n = {}) {
129
+ const { requiredText: e = "Заполните обязательное поле", ...o } = n, r = R(t), i = r.group === "invalid" && l(r.body) ? r.body : void 0, a = /* @__PURE__ */ new Map(), g = [], c = (u, m) => {
125
130
  const f = a.get(u);
126
131
  a.set(u, f && f !== m ? `${f}; ${m}` : m);
127
132
  };
@@ -140,7 +145,7 @@ function ot(t, n = {}) {
140
145
  } else if (i && l(i.errors)) {
141
146
  d = !0;
142
147
  for (const [u, m] of Object.entries(i.errors)) {
143
- const f = R(m);
148
+ const f = L(m);
144
149
  f && c(u, f);
145
150
  }
146
151
  }
@@ -151,29 +156,29 @@ function ot(t, n = {}) {
151
156
  if (!y.length) return { fields: v, message: w(t, o).message };
152
157
  if (!d)
153
158
  return { fields: v, firstField: y[0], message: w(t, o).message };
154
- const E = g.filter(T), I = E.length ? E.join("; ") : g.length ? w(t, o).title : "";
159
+ const E = g.filter(O), I = E.length ? E.join("; ") : g.length ? w(t, o).title : "";
155
160
  return { fields: v, firstField: y[0], message: I };
156
161
  }
157
- const Y = "support@urfu.ru", rt = "Написать в техподдержку";
162
+ const Y = "support@urfu.ru", it = "Написать в техподдержку";
158
163
  let s = {}, b = null;
159
- function _() {
160
- s.diagnostics && !b ? b = j() : !s.diagnostics && b && (b(), b = null);
164
+ function x() {
165
+ s.diagnostics && !b ? b = k() : !s.diagnostics && b && (b(), b = null);
161
166
  }
162
- function it(t) {
167
+ function st(t) {
163
168
  const n = s;
164
- return s = { ...s, ...t }, _(), () => {
165
- s = n, _();
169
+ return s = { ...s, ...t }, x(), () => {
170
+ s = n, x();
166
171
  };
167
172
  }
168
- function st() {
173
+ function ut() {
169
174
  return s;
170
175
  }
171
- const x = "__qiankun_microapp_wrapper_for_";
176
+ const A = "__qiankun_microapp_wrapper_for_";
172
177
  function S() {
173
178
  if (s.service) return s.service;
174
179
  if (typeof document > "u") return;
175
- const t = document.querySelector(`[id^="${x}"]`);
176
- return t ? t.id.slice(x.length).replace(/_+$/, "").replaceAll("_", "-") : typeof location > "u" ? void 0 : location.host;
180
+ const t = document.querySelector(`[id^="${A}"]`);
181
+ return t ? t.id.slice(A.length).replace(/_+$/, "").replaceAll("_", "-") : typeof location > "u" ? void 0 : location.host;
177
182
  }
178
183
  function X(t) {
179
184
  const n = [
@@ -190,7 +195,7 @@ function X(t) {
190
195
  }
191
196
  return t.slice(0, 120);
192
197
  }
193
- function H(t) {
198
+ function V(t) {
194
199
  if (/Windows NT 10/.test(t)) return "Windows 10 или 11";
195
200
  if (/Windows NT 6\.3/.test(t)) return "Windows 8.1";
196
201
  if (/Windows NT 6\.1/.test(t)) return "Windows 7";
@@ -199,7 +204,7 @@ function H(t) {
199
204
  const e = t.match(/(?:iPhone|iPad).*OS ([\d_]+)/);
200
205
  return e ? `iOS ${e[1].replaceAll("_", ".")}` : /Mac OS X/.test(t) ? "macOS" : /Linux/.test(t) ? "Linux" : "не определена";
201
206
  }
202
- function Q(t) {
207
+ function H(t) {
203
208
  const n = new Date(t);
204
209
  return Number.isNaN(n.getTime()) ? t : `${n.toLocaleString("ru-RU", {
205
210
  timeZone: "Asia/Yekaterinburg",
@@ -211,11 +216,11 @@ function Q(t) {
211
216
  second: "2-digit"
212
217
  })} по Екатеринбургу (${t})`;
213
218
  }
214
- function V(t) {
219
+ function Q(t) {
215
220
  return new Date(t).toLocaleTimeString("ru-RU", { timeZone: "Asia/Yekaterinburg", hour12: !1 });
216
221
  }
217
222
  function Z(t) {
218
- return `${V(t.time)} ${t.status ? t.status : "—"} ${t.path} ${t.duration} мс`;
223
+ return `${Q(t.time)} ${t.status ? t.status : "—"} ${t.path} ${t.duration} мс`;
219
224
  }
220
225
  function G() {
221
226
  if (typeof document > "u" || typeof window > "u") return;
@@ -224,8 +229,8 @@ function G() {
224
229
  const e = window.innerWidth;
225
230
  return `${e <= 576 ? "mobile" : e <= 900 ? "tablet" : "desktop"} (по ширине окна, шкала urfu не включена)`;
226
231
  }
227
- function A() {
228
- return "2.1.7-next.2";
232
+ function T() {
233
+ return "2.1.7-next.4";
229
234
  }
230
235
  function z(t) {
231
236
  if (!(!s.roles && !t))
@@ -249,18 +254,18 @@ function J() {
249
254
  function tt(t, n) {
250
255
  const e = G(), o = z(n == null ? void 0 : n.roles);
251
256
  if (!t)
252
- return ["Дополнительные сведения: " + [`кит ${A()}`, e && `брейкпоинт ${e.split(" ")[0]}`, o && o.charAt(0).toLowerCase() + o.slice(1)].filter(Boolean).join("; ")];
253
- const r = n ? n.requests : k();
257
+ return ["Дополнительные сведения: " + [`кит ${T()}`, e && `брейкпоинт ${e.split(" ")[0]}`, o && o.charAt(0).toLowerCase() + o.slice(1)].filter(Boolean).join("; ")];
258
+ const r = n ? n.requests : j();
254
259
  return [
255
260
  "",
256
261
  "Дополнительные сведения:",
257
- `Версия кита: ${A()}`,
262
+ `Версия кита: ${T()}`,
258
263
  e ? `Брейкпоинт: ${e}` : void 0,
259
264
  o,
260
265
  ...r.length ? ["Последние запросы (время по Екатеринбургу):", ...r.map(Z)] : ["Последние запросы: нет"]
261
266
  ];
262
267
  }
263
- function ut(t) {
268
+ function at(t) {
264
269
  return F(t, !0);
265
270
  }
266
271
  function F(t, n) {
@@ -274,9 +279,9 @@ function F(t, n) {
274
279
  e.method || e.url ? `Запрос: ${[e.method, e.url].filter(Boolean).join(" ")}` : void 0,
275
280
  e.requestId ? `ID запроса: ${e.requestId}` : void 0,
276
281
  e.serverMessage ? `${c ? "Ошибка интерфейса" : "Сообщение сервера"}: ${e.serverMessage}` : void 0,
277
- `Время: ${Q(e.time)}`,
282
+ `Время: ${H(e.time)}`,
278
283
  r ? `Браузер: ${X(r)}` : void 0,
279
- r ? `Система: ${H(r)}` : void 0,
284
+ r ? `Система: ${V(r)}` : void 0,
280
285
  o ? `Окно: ${window.innerWidth}×${window.innerHeight}, масштаб ${Math.round((window.devicePixelRatio || 1) * 100)}%` : void 0,
281
286
  typeof navigator < "u" && navigator.onLine === !1 ? "Сеть: браузер без связи" : void 0,
282
287
  s.user ? `Пользователь: ${s.user}` : void 0,
@@ -284,7 +289,7 @@ function F(t, n) {
284
289
  ].filter((d) => d !== void 0).join(`
285
290
  `);
286
291
  }
287
- function at(t, n = Y) {
292
+ function ct(t, n = Y) {
288
293
  const e = t.code !== null ? ` (${t.code})` : "", o = S(), r = `Ошибка в личном кабинете: ${o ? `${o} — ` : ""}${t.title}${e}`, i = [
289
294
  "Здравствуйте!",
290
295
  "",
@@ -297,4 +302,4 @@ function at(t, n = Y) {
297
302
  `);
298
303
  return `mailto:${n}?subject=${encodeURIComponent(r)}&body=${encodeURIComponent(i)}`;
299
304
  }
300
- export { N as DEFAULT_ERROR_TEXTS$u, Y as DEFAULT_SUPPORT_EMAIL$u, rt as DEFAULT_SUPPORT_LABEL$u, it as configureErrorReport$u, nt as configureErrorTexts$u, w as describeError$u, ot as describeFieldErrors$u, ut as formatErrorDetails$u, st as getErrorReportConfig$u, T as isHumanMessage$u, at as supportMailto$u };
305
+ export { N as DEFAULT_ERROR_TEXTS$u, Y as DEFAULT_SUPPORT_EMAIL$u, it as DEFAULT_SUPPORT_LABEL$u, st as configureErrorReport$u, nt as configureErrorTexts$u, w as describeError$u, rt as describeFieldErrors$u, ot as errorView$u, at as formatErrorDetails$u, ut as getErrorReportConfig$u, O as isHumanMessage$u, ct as supportMailto$u };
@@ -1,28 +1,41 @@
1
- const T = 0.4, O = (n, u, o, l, r, c, f) => {
2
- const b = n.length + Number(f), h = n.reduce((t, s) => t + u[s], 0) + (f ? c : 0) + Math.max(0, b - 1) * r - l;
3
- if (h <= 0.01) return 0;
4
- const a = n.reduce((t, s) => t + (o[s] ?? 0), 0);
5
- return a > 0 ? Math.min(1, (h + 0.5) / a) : 0;
6
- }, q = (n, u, o, l, r) => {
7
- const c = O(n, u, o, l, r, 0, !1);
1
+ const I = 0.4, T = (e, a, u, r, p, c, m, N = 0, O = !1) => {
2
+ const h = e.length + Number(m), g = Math.max(0, h - 1) * p, b = m ? N : 0;
3
+ if (O) {
4
+ const t = (l) => Math.max(0, ...e.map((o) => a[o] - l * (u[o] ?? 0))) * e.length + (m ? c - l * b : 0) + g;
5
+ if (t(0) - r <= 0.01) return 0;
6
+ const s = r - 0.5;
7
+ if (t(1) > s) return 1;
8
+ let A = 0, i = 1;
9
+ for (let l = 0; l < 24; l += 1) {
10
+ const o = (A + i) / 2;
11
+ t(o) > s ? A = o : i = o;
12
+ }
13
+ return i;
14
+ }
15
+ const n = e.reduce((t, s) => t + a[s], 0) + (m ? c : 0) + g - r;
16
+ if (n <= 0.01) return 0;
17
+ const f = e.reduce((t, s) => t + (u[s] ?? 0), 0) + b;
18
+ return f > 0 ? Math.min(1, (n + 0.5) / f) : 0;
19
+ }, M = (e, a, u, r, p) => {
20
+ const c = T(e, a, u, r, p, 0, !1);
8
21
  return c < 1 ? c : 0;
9
- }, z = (n, u, o, l, r, c, f = !1, b = []) => {
10
- const m = (e) => e <= o + 0.01, h = (e) => u[e] - (f ? 0 : b[e] ?? 0), a = (e, p) => {
11
- const g = f ? Math.max(0, ...e.map((i) => u[i])) * e.length : e.reduce((i, N) => i + h(N), 0), x = e.length + Number(p);
12
- return g + (p ? r : 0) + Math.max(0, x - 1) * l;
22
+ }, _ = (e, a, u, r, p, c, m = !1, N = [], O = 0) => {
23
+ const h = (t) => t <= u + 0.01, g = (t) => a[t] - (N[t] ?? 0), b = p - O, x = (t, s) => {
24
+ const A = m ? Math.max(0, ...t.map(g)) * t.length : t.reduce((l, o) => l + g(o), 0), i = t.length + Number(s);
25
+ return A + (s ? b : 0) + Math.max(0, i - 1) * r;
13
26
  };
14
- if (o <= 0 || m(a(n, !1)))
15
- return { visible: n, overflow: [] };
16
- const t = [];
17
- for (const e of n) {
18
- if (!m(a([...t, e], !0))) break;
19
- t.push(e);
27
+ if (u <= 0 || h(x(e, !1)))
28
+ return { visible: e, overflow: [] };
29
+ const n = [];
30
+ for (const t of e) {
31
+ if (!h(x([...n, t], !0))) break;
32
+ n.push(t);
20
33
  }
21
- const s = n.includes(c) ? c : n[0];
22
- for (s !== void 0 && !t.includes(s) && (t.length && t.pop(), t.push(s)); t.length > 1 && !m(a(t, !0)); ) {
23
- const e = t.map((p) => p !== s).lastIndexOf(!0);
24
- t.splice(e, 1);
34
+ const f = e.includes(c) ? c : e[0];
35
+ for (f !== void 0 && !n.includes(f) && (n.length && n.pop(), n.push(f)); n.length > 1 && !h(x(n, !0)); ) {
36
+ const t = n.map((s) => s !== f).lastIndexOf(!0);
37
+ n.splice(t, 1);
25
38
  }
26
- return { visible: t, overflow: n.filter((e) => !t.includes(e)) };
39
+ return { visible: n, overflow: e.filter((t) => !n.includes(t)) };
27
40
  };
28
- export { T as TAB_PADDING_MIN_RATIO$u, z as distributeTabs$u, q as lineTabsSqueeze$u, O as tabsSqueeze$u };
41
+ export { I as TAB_PADDING_MIN_RATIO$u, _ as distributeTabs$u, M as lineTabsSqueeze$u, T as tabsSqueeze$u };
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "license": "UNLICENSED",
14
14
  "private": false,
15
- "version": "2.1.7-next.2",
15
+ "version": "2.1.7-next.4",
16
16
  "type": "module",
17
17
  "main": "dist/urfu-ui-kit-react",
18
18
  "types": "dist/index.d.ts",