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.
- package/README.md +2 -2
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +226 -205
- package/dist/components/Calendar/Calendar.types.d.ts +19 -0
- package/dist/components/Calendar/Calendar.types.d.ts.map +1 -1
- package/dist/components/ErrorScreen/ErrorScreen.js +117 -115
- package/dist/components/SearchSelect/SearchSelect.d.ts.map +1 -1
- package/dist/components/SearchSelect/SearchSelect.js +162 -152
- package/dist/components/Table/Filter/FilterStringBox.js +8 -8
- 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/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +34 -33
- package/dist/components/Tabs/distributeTabs.d.ts +7 -3
- package/dist/components/Tabs/distributeTabs.d.ts.map +1 -1
- package/dist/components/Tabs/useTabsOverflow.d.ts +4 -0
- package/dist/components/Tabs/useTabsOverflow.d.ts.map +1 -1
- package/dist/components/Tabs/useTabsOverflow.js +40 -41
- package/dist/dev/index.js +2 -2
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/shared/kitCopy.js +1 -1
- 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 +2 -2
- package/dist/urfu-ui-kit-react.js +10 -9
- package/dist/utils/describeError.d.ts +27 -0
- package/dist/utils/describeError.d.ts.map +1 -1
- package/dist/vanilla/core/dateLimits.js +21 -0
- package/dist/vanilla/core/describeError.js +44 -39
- package/dist/vanilla/core/distributeTabs.js +36 -23
- 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
|
-
|
|
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;
|
|
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
|
|
2
|
-
import { getFieldAccessibility$u as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import
|
|
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
|
|
8
|
-
import { Tooltip$u as
|
|
9
|
-
import { ru$u as
|
|
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
|
|
12
|
-
import { POPUP_TRANSITION_MS$u as
|
|
13
|
-
import { useAutoId$u as
|
|
14
|
-
import { isCompact$u as
|
|
15
|
-
import { getPortalScopeProps$u as
|
|
16
|
-
import { CalendarSelect$u as
|
|
17
|
-
import { resolveValidation$u as
|
|
18
|
-
import { getYear$u as
|
|
19
|
-
import { getMonth$u as
|
|
20
|
-
import { differenceInCalendarDays$u as
|
|
21
|
-
import { isSameDay$u as
|
|
22
|
-
|
|
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
|
-
|
|
25
|
+
dt
|
|
25
26
|
);
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
28
|
-
const
|
|
29
|
-
return
|
|
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
|
|
32
|
+
function wt(s, d, E = 1) {
|
|
32
33
|
return {
|
|
33
34
|
*[Symbol.iterator]() {
|
|
34
|
-
for (let
|
|
35
|
-
yield
|
|
35
|
+
for (let m = s; m < d; m += E)
|
|
36
|
+
yield m;
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
|
-
const
|
|
40
|
+
const A = [
|
|
40
41
|
"Январь",
|
|
41
42
|
"Февраль",
|
|
42
43
|
"Март",
|
|
@@ -49,161 +50,179 @@ const O = [
|
|
|
49
50
|
"Октябрь",
|
|
50
51
|
"Ноябрь",
|
|
51
52
|
"Декабрь"
|
|
52
|
-
],
|
|
53
|
-
...
|
|
54
|
-
],
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
-
},
|
|
58
|
-
"aria-label":
|
|
59
|
-
"aria-labelledby":
|
|
60
|
-
"aria-describedby":
|
|
61
|
-
title:
|
|
62
|
-
selected:
|
|
63
|
-
onChange:
|
|
64
|
-
range:
|
|
65
|
-
startDate:
|
|
66
|
-
endDate:
|
|
67
|
-
onRangeChange:
|
|
68
|
-
isFilter:
|
|
69
|
-
placeholder:
|
|
70
|
-
inline:
|
|
71
|
-
portalOn:
|
|
72
|
-
open:
|
|
73
|
-
greyIcon:
|
|
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:
|
|
76
|
-
tableView:
|
|
77
|
-
size:
|
|
78
|
-
id:
|
|
79
|
-
required:
|
|
80
|
-
validationText:
|
|
81
|
-
validationOn:
|
|
82
|
-
error:
|
|
83
|
-
validationOnWithoutText:
|
|
84
|
-
absoluteValidationText:
|
|
85
|
-
lineUp:
|
|
86
|
-
rowGap:
|
|
87
|
-
columnGap:
|
|
88
|
-
styleInputContainer:
|
|
89
|
-
styleTitle:
|
|
90
|
-
disabled:
|
|
91
|
-
wheelEdit:
|
|
92
|
-
showHint:
|
|
93
|
-
hintText:
|
|
94
|
-
tooltipMaxWidth:
|
|
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
|
|
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
|
-
),
|
|
99
|
-
"aria-label":
|
|
100
|
-
"aria-labelledby":
|
|
101
|
-
"aria-describedby":
|
|
102
|
-
}), [
|
|
103
|
-
shouldRender:
|
|
104
|
-
status:
|
|
105
|
-
isAnimated:
|
|
106
|
-
} =
|
|
107
|
-
isOpen: !!(
|
|
108
|
-
duration:
|
|
109
|
-
}),
|
|
110
|
-
|
|
111
|
-
if (!
|
|
112
|
-
|
|
113
|
-
const e =
|
|
114
|
-
return e ?
|
|
115
|
-
}, [
|
|
116
|
-
const [
|
|
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
|
-
|
|
124
|
+
Ye(window.innerWidth <= 900);
|
|
120
125
|
};
|
|
121
126
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
122
127
|
}, []);
|
|
123
|
-
const
|
|
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
|
-
|
|
131
|
+
v == null || v("", { source: r });
|
|
127
132
|
return;
|
|
128
133
|
}
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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 =
|
|
141
|
-
|
|
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
|
-
}, [
|
|
161
|
+
}, [k, i]), T(() => {
|
|
147
162
|
var e;
|
|
148
163
|
if (x) {
|
|
149
|
-
const t = ((e =
|
|
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
|
-
}, [
|
|
154
|
-
const
|
|
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") && (
|
|
157
|
-
},
|
|
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:
|
|
163
|
-
onChange: (e, t) =>
|
|
177
|
+
endDate: c,
|
|
178
|
+
onChange: (e, t) => Je(e, t)
|
|
164
179
|
} : {
|
|
165
|
-
selected:
|
|
166
|
-
onChange: (e, t) =>
|
|
167
|
-
}, [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}, [
|
|
171
|
-
const
|
|
172
|
-
if (!l ||
|
|
173
|
-
const t =
|
|
174
|
-
if (
|
|
175
|
-
const r =
|
|
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
|
|
179
|
-
},
|
|
180
|
-
|
|
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:
|
|
183
|
-
ariaLabelledBy:
|
|
184
|
-
ariaDescribedBy:
|
|
185
|
-
ariaInvalid:
|
|
186
|
-
ariaRequired:
|
|
187
|
-
open:
|
|
188
|
-
inline:
|
|
189
|
-
popperContainer:
|
|
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: [
|
|
192
|
-
dayClassName:
|
|
193
|
-
onDayMouseEnter:
|
|
194
|
-
onMonthMouseLeave:
|
|
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:
|
|
216
|
+
disabled: re,
|
|
198
217
|
renderCustomHeader: ({
|
|
199
218
|
date: e,
|
|
200
219
|
changeYear: t,
|
|
201
220
|
changeMonth: r,
|
|
202
|
-
decreaseMonth:
|
|
203
|
-
increaseMonth:
|
|
204
|
-
prevMonthButtonDisabled:
|
|
205
|
-
nextMonthButtonDisabled:
|
|
206
|
-
}) => /* @__PURE__ */
|
|
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(),
|
|
251
|
+
n.preventDefault(), n.stopPropagation(), b(null), a();
|
|
233
252
|
},
|
|
234
|
-
disabled:
|
|
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__ */
|
|
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
|
-
|
|
269
|
+
he,
|
|
251
270
|
{
|
|
252
|
-
value:
|
|
253
|
-
options:
|
|
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:
|
|
258
|
-
onOpen: () =>
|
|
259
|
-
onClose: () =>
|
|
276
|
+
isOpen: ce === "year",
|
|
277
|
+
onOpen: () => b("year"),
|
|
278
|
+
onClose: () => b(null)
|
|
260
279
|
}
|
|
261
280
|
),
|
|
262
281
|
/* @__PURE__ */ o(
|
|
263
|
-
|
|
282
|
+
he,
|
|
264
283
|
{
|
|
265
|
-
value:
|
|
266
|
-
options:
|
|
284
|
+
value: A[kt(e)],
|
|
285
|
+
options: A.map((n) => ({ value: n, label: n })),
|
|
267
286
|
onChange: (n) => {
|
|
268
|
-
const
|
|
269
|
-
r(
|
|
287
|
+
const ye = String(n);
|
|
288
|
+
r(A.indexOf(ye)), U && U(ye);
|
|
270
289
|
},
|
|
271
|
-
fallbackValue:
|
|
290
|
+
fallbackValue: A[(/* @__PURE__ */ new Date()).getMonth()],
|
|
272
291
|
width: 85,
|
|
273
|
-
isOpen:
|
|
274
|
-
onOpen: () =>
|
|
275
|
-
onClose: () =>
|
|
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(),
|
|
312
|
+
n.preventDefault(), n.stopPropagation(), b(null), y();
|
|
294
313
|
},
|
|
295
|
-
disabled:
|
|
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:
|
|
321
|
+
placeholderText: we ?? (u ? "Выберите период" : "Выберите дату"),
|
|
303
322
|
customInput: /* @__PURE__ */ o(
|
|
304
|
-
|
|
323
|
+
st,
|
|
305
324
|
{
|
|
306
|
-
"aria-label":
|
|
307
|
-
id: `custom-input-mask-${
|
|
325
|
+
"aria-label": s,
|
|
326
|
+
id: `custom-input-mask-${f}`,
|
|
308
327
|
isClearable: x,
|
|
309
|
-
range:
|
|
310
|
-
wheelEdit:
|
|
311
|
-
onWheelDate: (e) =>
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
...
|
|
337
|
+
...Xe,
|
|
317
338
|
strictParsing: !0,
|
|
318
339
|
locale: "ru",
|
|
319
|
-
className: (
|
|
320
|
-
(x &&
|
|
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(
|
|
345
|
+
return /* @__PURE__ */ o(ke.Provider, { value: i, children: /* @__PURE__ */ N(
|
|
325
346
|
"div",
|
|
326
347
|
{
|
|
327
|
-
ref:
|
|
328
|
-
id: `u-datepicker${
|
|
329
|
-
className:
|
|
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__ */
|
|
353
|
+
/* @__PURE__ */ N(
|
|
333
354
|
"div",
|
|
334
355
|
{
|
|
335
356
|
style: Object.assign(
|
|
336
357
|
{
|
|
337
358
|
display: "flex",
|
|
338
|
-
flexDirection:
|
|
339
|
-
rowGap:
|
|
340
|
-
columnGap:
|
|
359
|
+
flexDirection: j ? "row" : "column",
|
|
360
|
+
rowGap: j ? null : pe(Oe),
|
|
361
|
+
columnGap: j ? pe(Ne) : null
|
|
341
362
|
},
|
|
342
|
-
|
|
363
|
+
Te
|
|
343
364
|
),
|
|
344
365
|
children: [
|
|
345
|
-
|
|
366
|
+
m && /* @__PURE__ */ o(
|
|
346
367
|
"div",
|
|
347
368
|
{
|
|
348
|
-
id: `${
|
|
349
|
-
className: `${
|
|
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
|
-
|
|
376
|
+
Ae
|
|
356
377
|
),
|
|
357
|
-
children:
|
|
378
|
+
children: m
|
|
358
379
|
}
|
|
359
380
|
),
|
|
360
|
-
|
|
361
|
-
|
|
381
|
+
$e ? /* @__PURE__ */ o(
|
|
382
|
+
ut,
|
|
362
383
|
{
|
|
363
384
|
portalOn: !0,
|
|
364
|
-
id: `calendar-hint-${
|
|
385
|
+
id: `calendar-hint-${f || "default"}`,
|
|
365
386
|
position: "top",
|
|
366
|
-
isActive:
|
|
387
|
+
isActive: Ge && !re && !Ke,
|
|
367
388
|
showWhenActive: !0,
|
|
368
389
|
tooltipStyle: {
|
|
369
|
-
maxWidth:
|
|
390
|
+
maxWidth: Qe(Le),
|
|
370
391
|
width: "auto",
|
|
371
392
|
whiteSpace: "normal",
|
|
372
393
|
overflowWrap: "break-word"
|
|
373
394
|
},
|
|
374
|
-
tooltipText:
|
|
375
|
-
children: /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick:
|
|
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:
|
|
398
|
+
) : /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick: me, children: fe })
|
|
378
399
|
]
|
|
379
400
|
}
|
|
380
401
|
),
|
|
381
|
-
|
|
402
|
+
D.showText && /* @__PURE__ */ o(
|
|
382
403
|
"h5",
|
|
383
404
|
{
|
|
384
|
-
id: `${
|
|
405
|
+
id: `${f}-error`,
|
|
385
406
|
className: "h5 clr-red-main",
|
|
386
|
-
style:
|
|
387
|
-
children:
|
|
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 {
|
|
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;
|