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
package/README.md CHANGED
@@ -90,9 +90,9 @@ npm run docsb
90
90
  1. Обновить историю версий и документацию затронутых компонентов.
91
91
  2. Проверить lint, тесты, сборку библиотеки и документации; проверить локальные tarball в потребителях.
92
92
  3. Vanilla берётся из соседней папки монорепозитория `packages/vanilla` и собирается внутрь пакета: зависимости `urfu-ui-kit-vanilla` нет, в npm vanilla отдельно не выходит (с 20.10.2026). Собирать и тестировать кит — только в полном checkout монорепозитория.
93
- 4. Публикацию выполняет владелец выпуска. Обновление документации само по себе не меняет версию пакета.
93
+ 4. Публикацию выполняет CI: версию поднимают вручную в `package.json` и `docs/versioning.md` и вливают в `main`, CI кладёт её в очередь npm, владелец пакета в npm подтверждает с 2FA, затем CI ставит тег `react-vX.Y.Z` и выкладывает документацию — [docs/ci.md](../../docs/ci.md#выпуск-версии). Обновление документации само по себе не меняет версию пакета.
94
94
 
95
- Версию поднимают вручную в `package.json` и `docs/versioning.md` и коммитят. `npm run pub` номер не меняет: прогоняет тесты, сборку и контракт пакета, публикует версию из `package.json` и ставит тег `react-vX.Y.Z`; повторный запуск после сбоя публикует ту же версию. `npm run pub:next` — то же для предварительной версии `X.Y.Z-next.N` с тегом `next`.
95
+ Запасной путь, если CI недоступен, — `npm run pub` в этой папке. Он номер не меняет: прогоняет тесты, сборку и контракт пакета, публикует версию из `package.json` и ставит тег `react-vX.Y.Z`; повторный запуск после сбоя публикует ту же версию. `npm run pub:next` — то же для предварительной версии `X.Y.Z-next.N` с тегом `next`.
96
96
 
97
97
  **Важно:** это публичная библиотека; все изменения API ломают потребителей (meetings, youth-science, kpis-npr). Избегайте breaking changes без координации.
98
98
 
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/Calendar.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8F,MAAM,OAAO,CAAC;AAInH,OAAO,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAwB,kBAAkB,EAAiB,MAAM,kBAAkB,CAAC;AAShG,OAAO,iBAAiB,CAAC;AAgEzB,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkejD,CAAC"}
1
+ {"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/Calendar.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8F,MAAM,OAAO,CAAC;AAInH,OAAO,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAwB,kBAAkB,EAAiB,MAAM,kBAAkB,CAAC;AAUhG,OAAO,iBAAiB,CAAC;AAgEzB,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA4gBjD,CAAC"}
@@ -1,42 +1,43 @@
1
- import { jsx as o, jsxs as P, Fragment as ze } from "react/jsx-runtime";
2
- import { getFieldAccessibility$u as We } from "../../shared/fieldAccessibility.js";
3
- import { useRef as ne, useState as v, useInsertionEffect as Ge, useEffect as _, useMemo as F, useContext as Ve, createContext as Ke } from "react";
4
- import { createPortal as Ye } from "react-dom";
5
- import Je, { registerLocale$u as Qe } from "../../vendor/react-datepicker/dist/es/index.js";
1
+ import { jsx as o, jsxs as N, Fragment as tt } from "react/jsx-runtime";
2
+ import { getFieldAccessibility$u as rt } from "../../shared/fieldAccessibility.js";
3
+ import { useRef as ve, useState as h, useInsertionEffect as ot, useEffect as T, useMemo as p, useContext as nt, createContext as at } from "react";
4
+ import { createPortal as it } from "react-dom";
5
+ import lt, { registerLocale$u as ct } from "../../vendor/react-datepicker/dist/es/index.js";
6
6
  /* empty css */
7
- import { MaskedDateInput$u as Xe } from "./MaskedDateInput.js";
8
- import { Tooltip$u as Ze } from "../Tooltip/Tooltip.js";
9
- import { ru$u as Ue } from "../../vendor/date-fns/locale/ru.js";
7
+ import { MaskedDateInput$u as st } from "./MaskedDateInput.js";
8
+ import { Tooltip$u as ut } from "../Tooltip/Tooltip.js";
9
+ import { ru$u as dt } from "../../vendor/date-fns/locale/ru.js";
10
+ import { toCalendarDay$u as K, isCalendarRangeBlocked$u as be, isCalendarDayBlocked$u as pt } from "../../vanilla/core/dateLimits.js";
10
11
  /* empty css */
11
- import { useMountTransition$u as Re } from "../../hooks/useMountTransition.js";
12
- import { POPUP_TRANSITION_MS$u as et } from "../../shared/popupTransition.js";
13
- import { useAutoId$u as tt } from "../../hooks/useAutoId.js";
14
- import { isCompact$u as rt, sizeClassName$u as ot } from "../../shared/size.js";
15
- import { getPortalScopeProps$u as nt } from "../../shared/uiKitDefaults.js";
16
- import { CalendarSelect$u as ae } from "./CalendarSelect.js";
17
- import { resolveValidation$u as at } from "../../vanilla/core/validation.js";
18
- import { getYear$u as B } from "../../vendor/date-fns/getYear.js";
19
- import { getMonth$u as it } from "../../vendor/date-fns/getMonth.js";
20
- import { differenceInCalendarDays$u as ie } from "../../vendor/date-fns/differenceInCalendarDays.js";
21
- import { isSameDay$u as lt } from "../../vendor/date-fns/isSameDay.js";
22
- Qe(
12
+ import { useMountTransition$u as mt } from "../../hooks/useMountTransition.js";
13
+ import { POPUP_TRANSITION_MS$u as ft } from "../../shared/popupTransition.js";
14
+ import { useAutoId$u as yt } from "../../hooks/useAutoId.js";
15
+ import { isCompact$u as vt, sizeClassName$u as bt } from "../../shared/size.js";
16
+ import { getPortalScopeProps$u as ht } from "../../shared/uiKitDefaults.js";
17
+ import { CalendarSelect$u as he } from "./CalendarSelect.js";
18
+ import { resolveValidation$u as gt } from "../../vanilla/core/validation.js";
19
+ import { getYear$u as Y } from "../../vendor/date-fns/getYear.js";
20
+ import { getMonth$u as kt } from "../../vendor/date-fns/getMonth.js";
21
+ import { differenceInCalendarDays$u as ge } from "../../vendor/date-fns/differenceInCalendarDays.js";
22
+ import { isSameDay$u as xt } from "../../vendor/date-fns/isSameDay.js";
23
+ ct(
23
24
  "ru",
24
- Ue
25
+ dt
25
26
  );
26
- const b = (c) => {
27
- if (!c) return null;
28
- const u = new Date(c);
29
- return u.setHours(12, 0, 0, 0), u;
27
+ const g = (s) => {
28
+ if (!s) return null;
29
+ const d = new Date(s);
30
+ return d.setHours(12, 0, 0, 0), d;
30
31
  };
31
- function ct(c, u, N = 1) {
32
+ function wt(s, d, E = 1) {
32
33
  return {
33
34
  *[Symbol.iterator]() {
34
- for (let p = c; p < u; p += N)
35
- yield p;
35
+ for (let m = s; m < d; m += E)
36
+ yield m;
36
37
  }
37
38
  };
38
39
  }
39
- const O = [
40
+ const A = [
40
41
  "Январь",
41
42
  "Февраль",
42
43
  "Март",
@@ -49,161 +50,179 @@ const O = [
49
50
  "Октябрь",
50
51
  "Ноябрь",
51
52
  "Декабрь"
52
- ], st = [
53
- ...ct(B(/* @__PURE__ */ new Date()) - 100, B(/* @__PURE__ */ new Date()) + 15, 1)
54
- ], le = Ke(null), ut = ({ children: c }) => {
55
- const u = Ve(le);
56
- return u ? Ye(/* @__PURE__ */ o("div", { children: c }), u) : /* @__PURE__ */ o(ze, { children: c });
57
- }, Tt = ({
58
- "aria-label": c,
59
- "aria-labelledby": u,
60
- "aria-describedby": N,
61
- title: p = "",
62
- selected: T,
63
- onChange: f,
64
- range: d = !1,
65
- startDate: H,
66
- endDate: q,
67
- onRangeChange: A,
68
- isFilter: ce,
69
- placeholder: se,
70
- inline: E,
71
- portalOn: z = !1,
72
- open: W,
73
- greyIcon: ue,
53
+ ], Dt = [
54
+ ...wt(Y(/* @__PURE__ */ new Date()) - 100, Y(/* @__PURE__ */ new Date()) + 15, 1)
55
+ ], ke = at(null), Ct = ({ children: s }) => {
56
+ const d = nt(ke);
57
+ return d ? it(/* @__PURE__ */ o("div", { children: s }), d) : /* @__PURE__ */ o(tt, { children: s });
58
+ }, Yt = ({
59
+ "aria-label": s,
60
+ "aria-labelledby": d,
61
+ "aria-describedby": E,
62
+ title: m = "",
63
+ selected: $,
64
+ onChange: v,
65
+ range: u = !1,
66
+ startDate: J,
67
+ endDate: Q,
68
+ onRangeChange: B,
69
+ isFilter: xe,
70
+ placeholder: we,
71
+ inline: L,
72
+ portalOn: X = !1,
73
+ open: Z,
74
+ greyIcon: De,
74
75
  isClearable: x,
75
- setOptionState: G,
76
- tableView: V,
77
- size: K,
78
- id: de,
79
- required: Y = !1,
80
- validationText: pe = "Заполните поле",
81
- validationOn: me,
82
- error: fe,
83
- validationOnWithoutText: ye,
84
- absoluteValidationText: ve,
85
- lineUp: $ = !1,
86
- rowGap: be = 4,
87
- columnGap: he = 20,
88
- styleInputContainer: ge,
89
- styleTitle: xe,
90
- disabled: J,
91
- wheelEdit: we = !1,
92
- showHint: ke = !1,
93
- hintText: Ce = "Используйте колесо мыши или стрелки ↑↓ для изменения значения",
94
- tooltipMaxWidth: De = 300
76
+ setOptionState: U,
77
+ tableView: R,
78
+ size: ee,
79
+ id: Ce,
80
+ required: te = !1,
81
+ validationText: Se = "Заполните поле",
82
+ validationOn: _e,
83
+ error: Ie,
84
+ validationOnWithoutText: Me,
85
+ absoluteValidationText: Pe,
86
+ lineUp: j = !1,
87
+ rowGap: Oe = 4,
88
+ columnGap: Ne = 20,
89
+ styleInputContainer: Te,
90
+ styleTitle: Ae,
91
+ disabled: re,
92
+ wheelEdit: Ee = !1,
93
+ showHint: $e = !1,
94
+ hintText: Be = "Используйте колесо мыши или стрелки ↑↓ для изменения значения",
95
+ tooltipMaxWidth: Le = 300,
96
+ minDate: oe,
97
+ maxDate: ne,
98
+ excludeDates: w,
99
+ allowDisabledInRange: ae = !0
95
100
  }) => {
96
- const Se = rt(K, V), Ie = ot(K, V), w = at({ error: fe, validationOn: me, validationOnWithoutText: ye, validationText: pe }), m = tt(de, "u-calendar"), Q = `u-calendar-portal-${m}`, j = ne(null), X = ne(null), [Me] = v(
101
+ const je = vt(ee, R), Fe = bt(ee, R), D = gt({ error: Ie, validationOn: _e, validationOnWithoutText: Me, validationText: Se }), f = yt(Ce, "u-calendar"), ie = `u-calendar-portal-${f}`, F = ve(null), le = ve(null), [He] = h(
97
102
  () => typeof document > "u" ? null : document.createElement("div")
98
- ), a = z && !E ? Me : null, k = We(m, p, Y, w, {
99
- "aria-label": c,
100
- "aria-labelledby": u,
101
- "aria-describedby": N
102
- }), [h, C] = v(!1), {
103
- shouldRender: D,
104
- status: Pe,
105
- isAnimated: _e
106
- } = Re({
107
- isOpen: !!(W || h),
108
- duration: et
109
- }), Oe = _e && Pe === "exiting";
110
- Ge(() => {
111
- if (!a || !D) return;
112
- a.id = Q;
113
- const e = nt()["data-u-kit"];
114
- return e ? a.setAttribute("data-u-kit", e) : a.removeAttribute("data-u-kit"), document.body.appendChild(a), () => a.remove();
115
- }, [a, D, Q]);
116
- const [Z, y] = v(null), [Ne, Te] = v(!1), [Ae, Ee] = v(!1);
117
- _(() => {
103
+ ), i = X && !L ? He : null, C = rt(f, m, te, D, {
104
+ "aria-label": s,
105
+ "aria-labelledby": d,
106
+ "aria-describedby": E
107
+ }), [k, S] = h(!1), {
108
+ shouldRender: _,
109
+ status: qe,
110
+ isAnimated: ze
111
+ } = mt({
112
+ isOpen: !!(Z || k),
113
+ duration: ft
114
+ }), We = ze && qe === "exiting";
115
+ ot(() => {
116
+ if (!i || !_) return;
117
+ i.id = ie;
118
+ const e = ht()["data-u-kit"];
119
+ return e ? i.setAttribute("data-u-kit", e) : i.removeAttribute("data-u-kit"), document.body.appendChild(i), () => i.remove();
120
+ }, [i, _, ie]);
121
+ const [ce, b] = h(null), [Ge, Ve] = h(!1), [Ke, Ye] = h(!1);
122
+ T(() => {
118
123
  const e = () => {
119
- Ee(window.innerWidth <= 900);
124
+ Ye(window.innerWidth <= 900);
120
125
  };
121
126
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
122
127
  }, []);
123
- const U = F(() => b(T), [T]), R = (e, t) => {
128
+ const se = p(() => g($), [$]), ue = (e, t) => {
124
129
  const r = (t == null ? void 0 : t.type) === "click" || (t == null ? void 0 : t.type) === "keydown" ? "calendar" : "input";
125
130
  if (!e) {
126
- f == null || f("", { source: r });
131
+ v == null || v("", { source: r });
127
132
  return;
128
133
  }
129
- const i = b(e);
130
- f == null || f(i, { source: r });
131
- }, l = F(() => b(H), [H]), s = F(() => b(q), [q]), $e = (e, t) => {
132
- var M;
133
- const r = (t == null ? void 0 : t.type) === "click" || (t == null ? void 0 : t.type) === "keydown" ? "calendar" : "input", [i, g] = e ?? [null, null];
134
- A == null || A([b(i), b(g)], { source: r }), r === "calendar" && i && g && C(!1);
135
- const I = g ?? i;
136
- r === "input" && I && ((M = X.current) == null || M.setPreSelection(I));
134
+ const a = g(e);
135
+ v == null || v(a, { source: r });
136
+ }, H = p(() => K(oe), [oe]), q = p(() => K(ne), [ne]), z = p(
137
+ () => w == null ? void 0 : w.map(K).filter((e) => e !== null),
138
+ [w]
139
+ ), I = p(
140
+ () => ({ minDate: H, maxDate: q, excludeDates: z }),
141
+ [H, q, z]
142
+ ), de = (e) => pt(e, I), l = p(() => g(J), [J]), c = p(() => g(Q), [Q]), W = u && !ae && l && !c ? l : null, G = p(
143
+ () => W ? (e) => !be(W, e, I) : void 0,
144
+ [W, I]
145
+ ), Je = (e, t) => {
146
+ var O;
147
+ const r = (t == null ? void 0 : t.type) === "click" || (t == null ? void 0 : t.type) === "keydown" ? "calendar" : "input", [a, y] = e ?? [null, null];
148
+ if (!ae && r === "input" && a && y && be(a, y, I)) return;
149
+ B == null || B([g(a), g(y)], { source: r }), r === "calendar" && a && y && S(!1);
150
+ const P = y ?? a;
151
+ r === "input" && P && ((O = le.current) == null || O.setPreSelection(P));
137
152
  };
138
- _(() => {
153
+ T(() => {
139
154
  const e = (t) => {
140
- const r = j.current, i = r == null ? void 0 : r.querySelector(":scope > div > div > input");
141
- h && (i && i.focus(), r && !r.contains(t.target) && !(a != null && a.contains(t.target)) && (C(!1), i && i.blur()));
155
+ const r = F.current, a = r == null ? void 0 : r.querySelector(":scope > div > div > input");
156
+ k && (a && a.focus(), r && !r.contains(t.target) && !(i != null && i.contains(t.target)) && (S(!1), a && a.blur()));
142
157
  };
143
158
  return document.addEventListener("click", e), () => {
144
159
  document.removeEventListener("click", e);
145
160
  };
146
- }, [h, a]), _(() => {
161
+ }, [k, i]), T(() => {
147
162
  var e;
148
163
  if (x) {
149
- const t = ((e = j.current) == null ? void 0 : e.querySelectorAll(".react-datepicker__close-icon")) ?? [];
164
+ const t = ((e = F.current) == null ? void 0 : e.querySelectorAll(".react-datepicker__close-icon")) ?? [];
150
165
  for (const r of t)
151
166
  r.innerHTML = '<i class="u-selectbox-select-icon-cross u-calendar-clear-icon"></i>';
152
167
  }
153
- }, [T, l == null ? void 0 : l.getTime(), s == null ? void 0 : s.getTime()]);
154
- const ee = (e) => typeof e == "number" ? `calc(${e} * var(--u-preset-unit, 1px))` : String(e), je = (e) => typeof e == "number" ? `calc(${e} * var(--u-unit, 1px))` : String(e), te = (e) => {
168
+ }, [$, l == null ? void 0 : l.getTime(), c == null ? void 0 : c.getTime()]);
169
+ const pe = (e) => typeof e == "number" ? `calc(${e} * var(--u-preset-unit, 1px))` : String(e), Qe = (e) => typeof e == "number" ? `calc(${e} * var(--u-unit, 1px))` : String(e), me = (e) => {
155
170
  const t = e.target;
156
- t.closest(".react-datepicker") && (d || !t.closest(".react-datepicker__day")) || C(!h);
157
- }, Le = d ? {
171
+ t.closest(".react-datepicker") && (u || !t.closest(".react-datepicker__day") || t.closest(".react-datepicker__day--disabled")) || S(!k);
172
+ }, Xe = u ? {
158
173
  selectsRange: !0,
159
174
  // Клик раньше выбранного начала завершает период «кликнутый день — прежнее начало», как и в Vue.
160
175
  swapRange: !0,
161
176
  startDate: l,
162
- endDate: s,
163
- onChange: (e, t) => $e(e, t)
177
+ endDate: c,
178
+ onChange: (e, t) => Je(e, t)
164
179
  } : {
165
- selected: U,
166
- onChange: (e, t) => R(e, t)
167
- }, [S, L] = v(null), Fe = (l == null ? void 0 : l.getTime()) ?? null, Be = (s == null ? void 0 : s.getTime()) ?? null;
168
- _(() => {
169
- L(null);
170
- }, [Fe, Be, D]);
171
- const He = (e) => {
172
- if (!l || s) return "";
173
- const t = S === null ? 0 : ie(l, S);
174
- if (S !== null && t > 0) {
175
- const r = ie(e, S);
180
+ selected: se,
181
+ onChange: (e, t) => ue(e, t)
182
+ }, [M, V] = h(null), Ze = (l == null ? void 0 : l.getTime()) ?? null, Ue = (c == null ? void 0 : c.getTime()) ?? null;
183
+ T(() => {
184
+ V(null);
185
+ }, [Ze, Ue, _]);
186
+ const Re = (e) => {
187
+ if (!l || c) return "";
188
+ const t = M === null ? 0 : ge(l, M);
189
+ if (M !== null && t > 0) {
190
+ const r = ge(e, M);
176
191
  return r === 0 ? "react-datepicker__day--in-selecting-range react-datepicker__day--selecting-range-start" : r === t ? "react-datepicker__day--in-selecting-range react-datepicker__day--selecting-range-end" : r > 0 && r < t ? "react-datepicker__day--in-selecting-range" : "";
177
192
  }
178
- return lt(e, l) ? "u-calendar-day--range-pending" : "";
179
- }, qe = d ? !!(l || s) : !!U, re = /* @__PURE__ */ o(
180
- Je,
193
+ return xt(e, l) ? "u-calendar-day--range-pending" : "";
194
+ }, et = u ? !!(l || c) : !!se, fe = /* @__PURE__ */ o(
195
+ lt,
181
196
  {
182
- ref: X,
183
- ariaLabelledBy: k["aria-labelledby"],
184
- ariaDescribedBy: k["aria-describedby"],
185
- ariaInvalid: k["aria-invalid"] ? "true" : void 0,
186
- ariaRequired: k["aria-required"] ? "true" : void 0,
187
- open: E ? W || h : D,
188
- inline: E,
189
- popperContainer: a ? ut : void 0,
197
+ ref: le,
198
+ ariaLabelledBy: C["aria-labelledby"],
199
+ ariaDescribedBy: C["aria-describedby"],
200
+ ariaInvalid: C["aria-invalid"] ? "true" : void 0,
201
+ ariaRequired: C["aria-required"] ? "true" : void 0,
202
+ open: L ? Z || k : _,
203
+ inline: L,
204
+ popperContainer: i ? Ct : void 0,
190
205
  popperPlacement: "bottom-end",
191
- popperClassName: [Oe ? "u-calendar-popper--closing" : "", z ? "u-calendar-popper--portal" : ""].filter(Boolean).join(" ") || void 0,
192
- dayClassName: d ? He : void 0,
193
- onDayMouseEnter: d ? (e) => L(s ? null : e.getTime()) : void 0,
194
- onMonthMouseLeave: d ? () => L(null) : void 0,
206
+ popperClassName: [We ? "u-calendar-popper--closing" : "", X ? "u-calendar-popper--portal" : ""].filter(Boolean).join(" ") || void 0,
207
+ dayClassName: u ? Re : void 0,
208
+ onDayMouseEnter: u ? (e) => V(c || de(e) || G && !G(e) ? null : e.getTime()) : void 0,
209
+ onMonthMouseLeave: u ? () => V(null) : void 0,
210
+ minDate: H ?? void 0,
211
+ maxDate: q ?? void 0,
212
+ excludeDates: z,
213
+ filterDate: G,
195
214
  isClearable: x,
196
215
  ariaLabelClose: "Очистить",
197
- disabled: J,
216
+ disabled: re,
198
217
  renderCustomHeader: ({
199
218
  date: e,
200
219
  changeYear: t,
201
220
  changeMonth: r,
202
- decreaseMonth: i,
203
- increaseMonth: g,
204
- prevMonthButtonDisabled: I,
205
- nextMonthButtonDisabled: M
206
- }) => /* @__PURE__ */ P(
221
+ decreaseMonth: a,
222
+ increaseMonth: y,
223
+ prevMonthButtonDisabled: P,
224
+ nextMonthButtonDisabled: O
225
+ }) => /* @__PURE__ */ N(
207
226
  "div",
208
227
  {
209
228
  style: {
@@ -229,13 +248,13 @@ const O = [
229
248
  cursor: "pointer"
230
249
  },
231
250
  onClick: (n) => {
232
- n.preventDefault(), n.stopPropagation(), y(null), i();
251
+ n.preventDefault(), n.stopPropagation(), b(null), a();
233
252
  },
234
- disabled: I,
253
+ disabled: P,
235
254
  children: /* @__PURE__ */ o("i", { className: "u-icon icon-left", style: { fontSize: "calc(20 * var(--u-unit, 1px))" } })
236
255
  }
237
256
  ),
238
- /* @__PURE__ */ P(
257
+ /* @__PURE__ */ N(
239
258
  "div",
240
259
  {
241
260
  style: {
@@ -247,32 +266,32 @@ const O = [
247
266
  },
248
267
  children: [
249
268
  /* @__PURE__ */ o(
250
- ae,
269
+ he,
251
270
  {
252
- value: B(e),
253
- options: st.map((n) => ({ value: n, label: n })),
271
+ value: Y(e),
272
+ options: Dt.map((n) => ({ value: n, label: n })),
254
273
  onChange: (n) => t(Number(n)),
255
274
  fallbackValue: (/* @__PURE__ */ new Date()).getFullYear(),
256
275
  width: 45,
257
- isOpen: Z === "year",
258
- onOpen: () => y("year"),
259
- onClose: () => y(null)
276
+ isOpen: ce === "year",
277
+ onOpen: () => b("year"),
278
+ onClose: () => b(null)
260
279
  }
261
280
  ),
262
281
  /* @__PURE__ */ o(
263
- ae,
282
+ he,
264
283
  {
265
- value: O[it(e)],
266
- options: O.map((n) => ({ value: n, label: n })),
284
+ value: A[kt(e)],
285
+ options: A.map((n) => ({ value: n, label: n })),
267
286
  onChange: (n) => {
268
- const oe = String(n);
269
- r(O.indexOf(oe)), G && G(oe);
287
+ const ye = String(n);
288
+ r(A.indexOf(ye)), U && U(ye);
270
289
  },
271
- fallbackValue: O[(/* @__PURE__ */ new Date()).getMonth()],
290
+ fallbackValue: A[(/* @__PURE__ */ new Date()).getMonth()],
272
291
  width: 85,
273
- isOpen: Z === "month",
274
- onOpen: () => y("month"),
275
- onClose: () => y(null)
292
+ isOpen: ce === "month",
293
+ onOpen: () => b("month"),
294
+ onClose: () => b(null)
276
295
  }
277
296
  )
278
297
  ]
@@ -290,105 +309,107 @@ const O = [
290
309
  cursor: "pointer"
291
310
  },
292
311
  onClick: (n) => {
293
- n.preventDefault(), n.stopPropagation(), y(null), g();
312
+ n.preventDefault(), n.stopPropagation(), b(null), y();
294
313
  },
295
- disabled: M,
314
+ disabled: O,
296
315
  children: /* @__PURE__ */ o("i", { className: "u-icon icon-right", style: { fontSize: "calc(20 * var(--u-unit, 1px))" } })
297
316
  }
298
317
  )
299
318
  ]
300
319
  }
301
320
  ),
302
- placeholderText: se ?? (d ? "Выберите период" : "Выберите дату"),
321
+ placeholderText: we ?? (u ? "Выберите период" : "Выберите дату"),
303
322
  customInput: /* @__PURE__ */ o(
304
- Xe,
323
+ st,
305
324
  {
306
- "aria-label": c,
307
- id: `custom-input-mask-${m}`,
325
+ "aria-label": s,
326
+ id: `custom-input-mask-${f}`,
308
327
  isClearable: x,
309
- range: d,
310
- wheelEdit: we && !d,
311
- onWheelDate: (e) => R(e),
312
- onOpenCalendar: () => C(!0),
313
- onFocusChange: Te
328
+ range: u,
329
+ wheelEdit: Ee && !u,
330
+ onWheelDate: (e) => {
331
+ de(e) || ue(e);
332
+ },
333
+ onOpenCalendar: () => S(!0),
334
+ onFocusChange: Ve
314
335
  }
315
336
  ),
316
- ...Le,
337
+ ...Xe,
317
338
  strictParsing: !0,
318
339
  locale: "ru",
319
- className: (ce ? "custom-input dpc-filter custom-input-filter" : Se ? "custom-input dpc-table custom-input-table" : `${ue ? "dpc-grey" : "dpc"} custom-input`) + (w.hasError ? " u-input-required" : "") + // react-datepicker рисует крестик и у disabled-поля — отступ под него тоже есть, как во Vue.
320
- (x && qe ? " dpc--clearable" : ""),
340
+ className: (xe ? "custom-input dpc-filter custom-input-filter" : je ? "custom-input dpc-table custom-input-table" : `${De ? "dpc-grey" : "dpc"} custom-input`) + (D.hasError ? " u-input-required" : "") + // react-datepicker рисует крестик и у disabled-поля — отступ под него тоже есть, как во Vue.
341
+ (x && et ? " dpc--clearable" : ""),
321
342
  dateFormat: "dd.MM.yyyy"
322
343
  }
323
344
  );
324
- return /* @__PURE__ */ o(le.Provider, { value: a, children: /* @__PURE__ */ P(
345
+ return /* @__PURE__ */ o(ke.Provider, { value: i, children: /* @__PURE__ */ N(
325
346
  "div",
326
347
  {
327
- ref: j,
328
- id: `u-datepicker${m}`,
329
- className: Ie || void 0,
348
+ ref: F,
349
+ id: `u-datepicker${f}`,
350
+ className: Fe || void 0,
330
351
  style: { display: "flex", flexDirection: "column", rowGap: "calc(4 * var(--u-preset-unit, 1px))" },
331
352
  children: [
332
- /* @__PURE__ */ P(
353
+ /* @__PURE__ */ N(
333
354
  "div",
334
355
  {
335
356
  style: Object.assign(
336
357
  {
337
358
  display: "flex",
338
- flexDirection: $ ? "row" : "column",
339
- rowGap: $ ? null : ee(be),
340
- columnGap: $ ? ee(he) : null
359
+ flexDirection: j ? "row" : "column",
360
+ rowGap: j ? null : pe(Oe),
361
+ columnGap: j ? pe(Ne) : null
341
362
  },
342
- ge
363
+ Te
343
364
  ),
344
365
  children: [
345
- p && /* @__PURE__ */ o(
366
+ m && /* @__PURE__ */ o(
346
367
  "div",
347
368
  {
348
- id: `${m}-label`,
349
- className: `${Y ? "u-required" : ""} u-react-input-title`,
369
+ id: `${f}-label`,
370
+ className: `${te ? "u-required" : ""} u-react-input-title`,
350
371
  style: Object.assign(
351
372
  {
352
373
  color: "var(--u-field-title-color, #545454)",
353
374
  fontSize: "var(--u-field-label-size-main, calc(14 * var(--u-unit, 1px)))"
354
375
  },
355
- xe
376
+ Ae
356
377
  ),
357
- children: p
378
+ children: m
358
379
  }
359
380
  ),
360
- ke ? /* @__PURE__ */ o(
361
- Ze,
381
+ $e ? /* @__PURE__ */ o(
382
+ ut,
362
383
  {
363
384
  portalOn: !0,
364
- id: `calendar-hint-${m || "default"}`,
385
+ id: `calendar-hint-${f || "default"}`,
365
386
  position: "top",
366
- isActive: Ne && !J && !Ae,
387
+ isActive: Ge && !re && !Ke,
367
388
  showWhenActive: !0,
368
389
  tooltipStyle: {
369
- maxWidth: je(De),
390
+ maxWidth: Qe(Le),
370
391
  width: "auto",
371
392
  whiteSpace: "normal",
372
393
  overflowWrap: "break-word"
373
394
  },
374
- tooltipText: Ce,
375
- children: /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick: te, children: re })
395
+ tooltipText: Be,
396
+ children: /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick: me, children: fe })
376
397
  }
377
- ) : /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick: te, children: re })
398
+ ) : /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick: me, children: fe })
378
399
  ]
379
400
  }
380
401
  ),
381
- w.showText && /* @__PURE__ */ o(
402
+ D.showText && /* @__PURE__ */ o(
382
403
  "h5",
383
404
  {
384
- id: `${m}-error`,
405
+ id: `${f}-error`,
385
406
  className: "h5 clr-red-main",
386
- style: ve ? { position: "absolute", bottom: "calc(-20 * var(--u-unit, 1px))" } : { position: "relative" },
387
- children: w.text
407
+ style: Pe ? { position: "absolute", bottom: "calc(-20 * var(--u-unit, 1px))" } : { position: "relative" },
408
+ children: D.text
388
409
  }
389
410
  )
390
411
  ]
391
412
  }
392
413
  ) });
393
414
  };
394
- export { Tt as Calendar$u };
415
+ export { Yt as Calendar$u };
@@ -32,6 +32,25 @@ export type CalendarProperties = FieldAccessibilityProperties & Partial<{
32
32
  onChange(date: Date | '' | null, meta?: {
33
33
  source: CalendarChangeSource;
34
34
  }): void;
35
+ /**
36
+ * Самый ранний день, который можно выбрать: Date, строка или число, которые понимает
37
+ * `new Date()`. Дни раньше него неактивны в попапе (`aria-disabled`), а набранная в поле
38
+ * такая дата не принимается — как неверная (31.02): `onChange` её не получает. Сравнение
39
+ * по дню, время не учитывается.
40
+ */
41
+ minDate: Date | string | number | null;
42
+ /** Самый поздний день, который можно выбрать; как `minDate`, только с другой стороны. */
43
+ maxDate: Date | string | number | null;
44
+ /** Отдельные дни, которые нельзя выбрать (праздники, занятые даты); ведут себя как дни за `minDate`/`maxDate`. */
45
+ excludeDates: ReadonlyArray<Date | string | number>;
46
+ /**
47
+ * Режим `range`: можно ли выбрать период, внутри которого есть недоступные дни
48
+ * (`minDate`/`maxDate`/`excludeDates`). По умолчанию `true` — можно (границы периода при
49
+ * этом доступны). `false`: после выбора начала дни за первым недоступным, в обе стороны,
50
+ * неактивны для конца периода, а набранный период с недоступным днём внутри не принимается —
51
+ * как неверная дата: `onRangeChange` его не получает.
52
+ */
53
+ allowDisabledInRange: boolean;
35
54
  isError: boolean;
36
55
  isFilter: boolean;
37
56
  placeholder: string;