urfu-ui-kit-react 2.1.7-next.3 → 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.
@@ -13,9 +13,9 @@ 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 D } from "./components/Checkbox/Checkbox.js";
18
- import { ConfirmModal$u as _ } from "./components/ConfirmModal/ConfirmModal.js";
16
+ import { useEnterMotion$u as D } from "./hooks/useEnterMotion.js";
17
+ import { Checkbox$u as h } from "./components/Checkbox/Checkbox.js";
18
+ import { ConfirmModal$u as w } from "./components/ConfirmModal/ConfirmModal.js";
19
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";
@@ -28,7 +28,7 @@ import { Menu$u as $ } from "./components/Menu/Menu.js";
28
28
  import { Message$u as or } from "./components/Message/Message.js";
29
29
  import { Modal$u as tr } from "./components/Modal/Modal.js";
30
30
  import { Drawer$u as mr } from "./components/Drawer/Drawer.js";
31
- import { Multiselect$u as fr } from "./components/Multiselect/Multiselect.js";
31
+ import { Multiselect$u as ir } from "./components/Multiselect/Multiselect.js";
32
32
  import { NotificationProvider$u as ar, useNotification$u as nr } from "./components/Notification/Notification.js";
33
33
  import { Preloader$u as lr } from "./components/Preloader/Preloader.js";
34
34
  import { Radio$u as cr } from "./components/Radio/Radio.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 wr } from "./components/Tabs/Tabs.js";
44
- import { TabPanels$u as Vr } from "./components/TabPanels/TabPanels.js";
45
- import { Textarea$u as kr } from "./components/Textarea/Textarea.js";
43
+ import { Tabs$u as Vr } from "./components/Tabs/Tabs.js";
44
+ import { TabPanels$u as kr } from "./components/TabPanels/TabPanels.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";
@@ -53,13 +53,14 @@ import { useTableSort$u as Wr } from "./hooks/useTableSort.js";
53
53
  import { usePagination$u as Zr } from "./hooks/usePagination.js";
54
54
  import { compareValues$u as ro, nextSort$u as oo, sortRows$u as eo } from "./shared/sortRows.js";
55
55
  import { configureUiKit$u as po, useUiKitViewport$u as mo } from "./responsive/uiKitResponsive.js";
56
- import { TableFilterOptions$u as fo } from "./components/Table/Filter/TableFilterOptions.js";
56
+ import { TableFilterOptions$u as io } from "./components/Table/Filter/TableFilterOptions.js";
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
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
61
  import { hasPreviousPage$u as Lo } from "./vanilla/core/hasPreviousPage.js";
62
- import { reconcileColumnOrder$u as Oo } from "./vanilla/core/reconcileColumnOrder.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, D as Checkbox, B as ColumnSettings, _ 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, fr 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, Vr as TabPanels, Or as Table, ao as TableFilterDates, fo as TableFilterOptions, wr as Tabs, kr 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 nextSort, Oo as reconcileColumnOrder, eo as sortRows, Io 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 };
@@ -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 };
@@ -230,7 +230,7 @@ function G() {
230
230
  return `${e <= 576 ? "mobile" : e <= 900 ? "tablet" : "desktop"} (по ширине окна, шкала urfu не включена)`;
231
231
  }
232
232
  function T() {
233
- return "2.1.7-next.3";
233
+ return "2.1.7-next.4";
234
234
  }
235
235
  function z(t) {
236
236
  if (!(!s.roles && !t))
@@ -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.3",
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",