urfu-ui-kit-react 2.1.7-next.3 → 2.1.7-next.5
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/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.js +16 -15
- package/dist/components/BreadCrumbs/BreadCrumbs.d.ts.map +1 -1
- package/dist/components/BreadCrumbs/BreadCrumbs.js +23 -22
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +51 -50
- package/dist/components/Button/ButtonRefreshIcon.d.ts.map +1 -1
- package/dist/components/Button/ButtonRefreshIcon.js +9 -8
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +237 -216
- package/dist/components/Calendar/Calendar.types.d.ts +19 -0
- package/dist/components/Calendar/Calendar.types.d.ts.map +1 -1
- package/dist/components/Calendar/CalendarSelect.d.ts.map +1 -1
- package/dist/components/Calendar/CalendarSelect.js +41 -40
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.js +59 -58
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +20 -19
- package/dist/components/ColumnSettings/ColumnSettings.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettings.js +112 -111
- package/dist/components/ConfirmModal/ConfirmModal.d.ts.map +1 -1
- package/dist/components/ConfirmModal/ConfirmModal.js +30 -29
- package/dist/components/Drawer/Drawer.js +57 -57
- package/dist/components/ErrorScreen/ErrorScreen.d.ts.map +1 -1
- package/dist/components/ErrorScreen/ErrorScreen.js +151 -150
- package/dist/components/ErrorScreen/ErrorScreenIllustration.d.ts.map +1 -1
- package/dist/components/ErrorScreen/ErrorScreenIllustration.js +35 -34
- package/dist/components/FormField/FormField.d.ts.map +1 -1
- package/dist/components/FormField/FormField.js +30 -29
- package/dist/components/Icon/Icon.d.ts.map +1 -1
- package/dist/components/Icon/Icon.js +17 -16
- package/dist/components/InfiniteScroll/InfiniteScroll.d.ts.map +1 -1
- package/dist/components/InfiniteScroll/InfiniteScroll.js +23 -22
- package/dist/components/InputExpandTextarea/InputExpandTextarea.d.ts.map +1 -1
- package/dist/components/InputExpandTextarea/InputExpandTextarea.js +88 -87
- package/dist/components/InputFile/InputFile.d.ts.map +1 -1
- package/dist/components/InputFile/InputFile.js +99 -98
- package/dist/components/InputNumber/InputNumber.d.ts.map +1 -1
- package/dist/components/InputNumber/InputNumber.js +112 -111
- package/dist/components/InputText/InputAffix.d.ts.map +1 -1
- package/dist/components/InputText/InputAffix.js +69 -68
- package/dist/components/InputText/InputText.d.ts.map +1 -1
- package/dist/components/InputText/InputText.js +108 -107
- package/dist/components/InputTime/InputTime.d.ts.map +1 -1
- package/dist/components/InputTime/InputTime.js +202 -201
- package/dist/components/InputTime/InputTimeDropdown.d.ts.map +1 -1
- package/dist/components/InputTime/InputTimeDropdown.js +21 -20
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/Menu/Menu.js +58 -57
- package/dist/components/Message/Message.d.ts.map +1 -1
- package/dist/components/Message/Message.js +19 -18
- package/dist/components/Modal/Modal.js +66 -66
- package/dist/components/Modal/useModalTitleClearance.d.ts.map +1 -1
- package/dist/components/Modal/useModalTitleClearance.js +34 -33
- package/dist/components/Multiselect/Multiselect.js +222 -222
- package/dist/components/Notification/Notification.js +90 -90
- package/dist/components/OfflineBanner/OfflineBanner.d.ts.map +1 -1
- package/dist/components/OfflineBanner/OfflineBanner.js +40 -37
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +59 -58
- package/dist/components/Preloader/Preloader.d.ts.map +1 -1
- package/dist/components/Preloader/Preloader.js +28 -27
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/Radio.js +21 -20
- package/dist/components/Search/Search.d.ts.map +1 -1
- package/dist/components/Search/Search.js +33 -32
- package/dist/components/SearchSelect/SearchSelect.d.ts.map +1 -1
- package/dist/components/SearchSelect/SearchSelect.js +176 -166
- package/dist/components/SearchSelect/SearchSelectOption.d.ts.map +1 -1
- package/dist/components/SearchSelect/SearchSelectOption.js +21 -20
- package/dist/components/Select/MobileOptionSheet.d.ts.map +1 -1
- package/dist/components/Select/MobileOptionSheet.js +65 -64
- package/dist/components/Select/Select.js +184 -184
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.js +26 -25
- package/dist/components/Status/Status.d.ts.map +1 -1
- package/dist/components/Status/Status.js +36 -35
- package/dist/components/StickyActionBar/StickyActionBar.d.ts.map +1 -1
- package/dist/components/StickyActionBar/StickyActionBar.js +36 -35
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.js +19 -18
- package/dist/components/Table/Filter/DefaultInput.d.ts.map +1 -1
- package/dist/components/Table/Filter/DefaultInput.js +12 -11
- package/dist/components/Table/Filter/Filter.d.ts.map +1 -1
- package/dist/components/Table/Filter/Filter.js +99 -98
- package/dist/components/Table/Filter/FilterBooleanBox.d.ts.map +1 -1
- package/dist/components/Table/Filter/FilterBooleanBox.js +7 -6
- package/dist/components/Table/Filter/FilterBoxShell.js +48 -48
- package/dist/components/Table/Filter/FilterDateBox.d.ts.map +1 -1
- package/dist/components/Table/Filter/FilterDateBox.js +65 -64
- package/dist/components/Table/Filter/FilterSortIndicator.d.ts.map +1 -1
- package/dist/components/Table/Filter/FilterSortIndicator.js +8 -7
- package/dist/components/Table/Filter/SelectFilter.js +53 -53
- package/dist/components/Table/Filter/TableFilterOptions.d.ts.map +1 -1
- package/dist/components/Table/Filter/TableFilterOptions.js +141 -140
- package/dist/components/Table/Filter/TableFilterSortButton.d.ts.map +1 -1
- package/dist/components/Table/Filter/TableFilterSortButton.js +10 -9
- package/dist/components/Table/Filter/useVirtualOptionWindow.d.ts.map +1 -1
- package/dist/components/Table/Filter/useVirtualOptionWindow.js +9 -8
- package/dist/components/Table/Skeleton/createSkeletonColumns.d.ts.map +1 -1
- package/dist/components/Table/Skeleton/createSkeletonColumns.js +9 -8
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Table/Table.helpers.d.ts.map +1 -1
- package/dist/components/Table/Table.helpers.js +31 -30
- package/dist/components/Table/Table.js +253 -252
- package/dist/components/Table/TableHead.d.ts.map +1 -1
- package/dist/components/Table/TableHead.js +92 -91
- package/dist/components/Table/TableMobileCard.d.ts.map +1 -1
- package/dist/components/Table/TableMobileCard.js +121 -120
- package/dist/components/Table/TableMobileFilters.d.ts.map +1 -1
- package/dist/components/Table/TableMobileFilters.js +28 -27
- package/dist/components/Table/TableMobileView.d.ts.map +1 -1
- package/dist/components/Table/TableMobileView.js +178 -177
- package/dist/components/Table/TableRow.d.ts.map +1 -1
- package/dist/components/Table/TableRow.js +59 -58
- package/dist/components/Table/useTableColumnPinning.d.ts +2 -917
- package/dist/components/Table/useTableColumnPinning.d.ts.map +1 -1
- package/dist/components/Table/useTableColumnPinning.js +21 -20
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +101 -99
- 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/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +70 -69
- package/dist/components/Tooltip/Tooltip.js +106 -106
- package/dist/components/TreeView/TreeView.js +183 -183
- package/dist/components/VirtualList/VirtualList.d.ts.map +1 -1
- package/dist/components/VirtualList/VirtualList.js +42 -41
- package/dist/dev/index.js +2 -2
- package/dist/hooks/useAutoId.d.ts.map +1 -1
- package/dist/hooks/useAutoId.js +7 -6
- package/dist/hooks/useSelectEngine.d.ts.map +1 -1
- package/dist/hooks/useSelectEngine.js +31 -30
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/responsive/uiKitResponsive.d.ts +6 -0
- package/dist/responsive/uiKitResponsive.d.ts.map +1 -1
- package/dist/responsive/uiKitResponsive.js +27 -26
- package/dist/shared/kitCopy.js +1 -1
- package/dist/shared/optionStateColors.d.ts +3 -2
- package/dist/shared/optionStateColors.d.ts.map +1 -1
- package/dist/shared/optionStateColors.js +9 -4
- package/dist/shared/popupTransition.d.ts.map +1 -1
- package/dist/shared/popupTransition.js +7 -6
- package/dist/shared/sheetTitle.d.ts +2 -1
- package/dist/shared/sheetTitle.d.ts.map +1 -1
- package/dist/shared/size.d.ts.map +1 -1
- package/dist/shared/size.js +3 -2
- package/dist/shared/uiKitDefaults.d.ts +21 -0
- package/dist/shared/uiKitDefaults.d.ts.map +1 -1
- package/dist/shared/uiKitDefaults.js +32 -18
- 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/style.shell.lk.css +53 -0
- package/dist/urfu-ui-kit-react.js +29 -27
- package/dist/vanilla/core/dateLimits.js +21 -0
- package/dist/vanilla/core/describeError.js +1 -1
- package/dist/vanilla/core/distributeTabs.js +36 -23
- package/dist/vanilla/core/sheetTitle.js +7 -7
- package/package.json +3 -1
|
@@ -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 T, Fragment as ot } from "react/jsx-runtime";
|
|
2
|
+
import { getFieldAccessibility$u as nt } from "../../shared/fieldAccessibility.js";
|
|
3
|
+
import { useRef as he, useState as g, useInsertionEffect as it, useEffect as A, useMemo as m, useContext as at, createContext as lt } from "react";
|
|
4
|
+
import { createPortal as ct } from "react-dom";
|
|
5
|
+
import st, { registerLocale$u as dt } 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 ut } from "./MaskedDateInput.js";
|
|
8
|
+
import { Tooltip$u as pt } from "../Tooltip/Tooltip.js";
|
|
9
|
+
import { ru$u as mt } from "../../vendor/date-fns/locale/ru.js";
|
|
10
|
+
import { toCalendarDay$u as J, isCalendarRangeBlocked$u as ge, isCalendarDayBlocked$u as ft } 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 yt } from "../../hooks/useMountTransition.js";
|
|
13
|
+
import { POPUP_TRANSITION_MS$u as vt } from "../../shared/popupTransition.js";
|
|
14
|
+
import { useAutoId$u as bt } from "../../hooks/useAutoId.js";
|
|
15
|
+
import { isCompact$u as ht, sizeClassName$u as gt } from "../../shared/size.js";
|
|
16
|
+
import { getUiKitPrefix$u as a, kitCls$u as w, getPortalScopeProps$u as kt } from "../../shared/uiKitDefaults.js";
|
|
17
|
+
import { CalendarSelect$u as ke } from "./CalendarSelect.js";
|
|
18
|
+
import { resolveValidation$u as xt } from "../../vanilla/core/validation.js";
|
|
19
|
+
import { getYear$u as Q } from "../../vendor/date-fns/getYear.js";
|
|
20
|
+
import { getMonth$u as wt } from "../../vendor/date-fns/getMonth.js";
|
|
21
|
+
import { differenceInCalendarDays$u as xe } from "../../vendor/date-fns/differenceInCalendarDays.js";
|
|
22
|
+
import { isSameDay$u as Ct } from "../../vendor/date-fns/isSameDay.js";
|
|
23
|
+
dt(
|
|
23
24
|
"ru",
|
|
24
|
-
|
|
25
|
+
mt
|
|
25
26
|
);
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
28
|
-
const
|
|
29
|
-
return
|
|
27
|
+
const k = (d) => {
|
|
28
|
+
if (!d) return null;
|
|
29
|
+
const p = new Date(d);
|
|
30
|
+
return p.setHours(12, 0, 0, 0), p;
|
|
30
31
|
};
|
|
31
|
-
function
|
|
32
|
+
function Dt(d, p, B = 1) {
|
|
32
33
|
return {
|
|
33
34
|
*[Symbol.iterator]() {
|
|
34
|
-
for (let
|
|
35
|
-
yield
|
|
35
|
+
for (let f = d; f < p; f += B)
|
|
36
|
+
yield f;
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
|
-
const
|
|
40
|
+
const E = [
|
|
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:
|
|
74
|
-
isClearable:
|
|
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:
|
|
53
|
+
], $t = [
|
|
54
|
+
...Dt(Q(/* @__PURE__ */ new Date()) - 100, Q(/* @__PURE__ */ new Date()) + 15, 1)
|
|
55
|
+
], we = lt(null), St = ({ children: d }) => {
|
|
56
|
+
const p = at(we);
|
|
57
|
+
return p ? ct(/* @__PURE__ */ o("div", { children: d }), p) : /* @__PURE__ */ o(ot, { children: d });
|
|
58
|
+
}, Qt = ({
|
|
59
|
+
"aria-label": d,
|
|
60
|
+
"aria-labelledby": p,
|
|
61
|
+
"aria-describedby": B,
|
|
62
|
+
title: f = "",
|
|
63
|
+
selected: L,
|
|
64
|
+
onChange: b,
|
|
65
|
+
range: u = !1,
|
|
66
|
+
startDate: U,
|
|
67
|
+
endDate: X,
|
|
68
|
+
onRangeChange: j,
|
|
69
|
+
isFilter: Ce,
|
|
70
|
+
placeholder: De,
|
|
71
|
+
inline: F,
|
|
72
|
+
portalOn: Z = !1,
|
|
73
|
+
open: R,
|
|
74
|
+
greyIcon: $e,
|
|
75
|
+
isClearable: C,
|
|
76
|
+
setOptionState: ee,
|
|
77
|
+
tableView: te,
|
|
78
|
+
size: re,
|
|
79
|
+
id: Se,
|
|
80
|
+
required: oe = !1,
|
|
81
|
+
validationText: _e = "Заполните поле",
|
|
82
|
+
validationOn: Pe,
|
|
83
|
+
error: Ie,
|
|
84
|
+
validationOnWithoutText: Me,
|
|
85
|
+
absoluteValidationText: Oe,
|
|
86
|
+
lineUp: H = !1,
|
|
87
|
+
rowGap: Ne = 4,
|
|
88
|
+
columnGap: Te = 20,
|
|
89
|
+
styleInputContainer: Ae,
|
|
90
|
+
styleTitle: Ee,
|
|
91
|
+
disabled: ne,
|
|
92
|
+
wheelEdit: Be = !1,
|
|
93
|
+
showHint: Le = !1,
|
|
94
|
+
hintText: je = "Используйте колесо мыши или стрелки ↑↓ для изменения значения",
|
|
95
|
+
tooltipMaxWidth: Fe = 300,
|
|
96
|
+
minDate: ie,
|
|
97
|
+
maxDate: ae,
|
|
98
|
+
excludeDates: D,
|
|
99
|
+
allowDisabledInRange: le = !0
|
|
95
100
|
}) => {
|
|
96
|
-
const
|
|
101
|
+
const He = ht(re, te), qe = gt(re, te), $ = xt({ error: Ie, validationOn: Pe, validationOnWithoutText: Me, validationText: _e }), y = bt(Se, w("calendar")), ce = `${a()}-calendar-portal-${y}`, q = he(null), se = he(null), [ze] = g(
|
|
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
|
+
), l = Z && !F ? ze : null, S = nt(y, f, oe, $, {
|
|
104
|
+
"aria-label": d,
|
|
105
|
+
"aria-labelledby": p,
|
|
106
|
+
"aria-describedby": B
|
|
107
|
+
}), [x, _] = g(!1), {
|
|
108
|
+
shouldRender: P,
|
|
109
|
+
status: We,
|
|
110
|
+
isAnimated: Ge
|
|
111
|
+
} = yt({
|
|
112
|
+
isOpen: !!(R || x),
|
|
113
|
+
duration: vt
|
|
114
|
+
}), Ke = Ge && We === "exiting";
|
|
115
|
+
it(() => {
|
|
116
|
+
if (!l || !P) return;
|
|
117
|
+
l.id = ce;
|
|
118
|
+
const e = kt()["data-u-kit"];
|
|
119
|
+
return e ? l.setAttribute("data-u-kit", e) : l.removeAttribute("data-u-kit"), document.body.appendChild(l), () => l.remove();
|
|
120
|
+
}, [l, P, ce]);
|
|
121
|
+
const [de, h] = g(null), [Ve, Ye] = g(!1), [Je, Qe] = g(!1);
|
|
122
|
+
A(() => {
|
|
118
123
|
const e = () => {
|
|
119
|
-
|
|
124
|
+
Qe(window.innerWidth <= 900);
|
|
120
125
|
};
|
|
121
126
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
122
127
|
}, []);
|
|
123
|
-
const
|
|
128
|
+
const ue = m(() => k(L), [L]), pe = (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
|
+
b == null || b("", { source: r });
|
|
127
132
|
return;
|
|
128
133
|
}
|
|
129
|
-
const i =
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
const i = k(e);
|
|
135
|
+
b == null || b(i, { source: r });
|
|
136
|
+
}, z = m(() => J(ie), [ie]), W = m(() => J(ae), [ae]), G = m(
|
|
137
|
+
() => D == null ? void 0 : D.map(J).filter((e) => e !== null),
|
|
138
|
+
[D]
|
|
139
|
+
), I = m(
|
|
140
|
+
() => ({ minDate: z, maxDate: W, excludeDates: G }),
|
|
141
|
+
[z, W, G]
|
|
142
|
+
), me = (e) => ft(e, I), c = m(() => k(U), [U]), s = m(() => k(X), [X]), K = u && !le && c && !s ? c : null, V = m(
|
|
143
|
+
() => K ? (e) => !ge(K, e, I) : void 0,
|
|
144
|
+
[K, I]
|
|
145
|
+
), Ue = (e, t) => {
|
|
146
|
+
var N;
|
|
147
|
+
const r = (t == null ? void 0 : t.type) === "click" || (t == null ? void 0 : t.type) === "keydown" ? "calendar" : "input", [i, v] = e ?? [null, null];
|
|
148
|
+
if (!le && r === "input" && i && v && ge(i, v, I)) return;
|
|
149
|
+
j == null || j([k(i), k(v)], { source: r }), r === "calendar" && i && v && _(!1);
|
|
150
|
+
const O = v ?? i;
|
|
151
|
+
r === "input" && O && ((N = se.current) == null || N.setPreSelection(O));
|
|
137
152
|
};
|
|
138
|
-
|
|
153
|
+
A(() => {
|
|
139
154
|
const e = (t) => {
|
|
140
|
-
const r =
|
|
141
|
-
|
|
155
|
+
const r = q.current, i = r == null ? void 0 : r.querySelector(":scope > div > div > input");
|
|
156
|
+
x && (i && i.focus(), r && !r.contains(t.target) && !(l != null && l.contains(t.target)) && (_(!1), i && i.blur()));
|
|
142
157
|
};
|
|
143
158
|
return document.addEventListener("click", e), () => {
|
|
144
159
|
document.removeEventListener("click", e);
|
|
145
160
|
};
|
|
146
|
-
}, [
|
|
161
|
+
}, [x, l]), A(() => {
|
|
147
162
|
var e;
|
|
148
|
-
if (
|
|
149
|
-
const t = ((e =
|
|
163
|
+
if (C) {
|
|
164
|
+
const t = ((e = q.current) == null ? void 0 : e.querySelectorAll(".react-datepicker__close-icon")) ?? [];
|
|
150
165
|
for (const r of t)
|
|
151
|
-
r.innerHTML =
|
|
166
|
+
r.innerHTML = `<i class="${a()}-selectbox-select-icon-cross ${a()}-calendar-clear-icon"></i>`;
|
|
152
167
|
}
|
|
153
|
-
}, [
|
|
154
|
-
const
|
|
168
|
+
}, [L, c == null ? void 0 : c.getTime(), s == null ? void 0 : s.getTime()]);
|
|
169
|
+
const fe = (e) => typeof e == "number" ? `calc(${e} * var(--${a()}-preset-unit, 1px))` : String(e), Xe = (e) => typeof e == "number" ? `calc(${e} * var(--u-unit, 1px))` : String(e), ye = (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")) || _(!x);
|
|
172
|
+
}, Ze = u ? {
|
|
158
173
|
selectsRange: !0,
|
|
159
174
|
// Клик раньше выбранного начала завершает период «кликнутый день — прежнее начало», как и в Vue.
|
|
160
175
|
swapRange: !0,
|
|
161
|
-
startDate:
|
|
176
|
+
startDate: c,
|
|
162
177
|
endDate: s,
|
|
163
|
-
onChange: (e, t) =>
|
|
178
|
+
onChange: (e, t) => Ue(e, t)
|
|
164
179
|
} : {
|
|
165
|
-
selected:
|
|
166
|
-
onChange: (e, t) =>
|
|
167
|
-
}, [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}, [
|
|
171
|
-
const
|
|
172
|
-
if (!
|
|
173
|
-
const t =
|
|
174
|
-
if (
|
|
175
|
-
const r =
|
|
180
|
+
selected: ue,
|
|
181
|
+
onChange: (e, t) => pe(e, t)
|
|
182
|
+
}, [M, Y] = g(null), Re = (c == null ? void 0 : c.getTime()) ?? null, et = (s == null ? void 0 : s.getTime()) ?? null;
|
|
183
|
+
A(() => {
|
|
184
|
+
Y(null);
|
|
185
|
+
}, [Re, et, P]);
|
|
186
|
+
const tt = (e) => {
|
|
187
|
+
if (!c || s) return "";
|
|
188
|
+
const t = M === null ? 0 : xe(c, M);
|
|
189
|
+
if (M !== null && t > 0) {
|
|
190
|
+
const r = xe(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 Ct(e, c) ? w("calendar-day--range-pending") : "";
|
|
194
|
+
}, rt = u ? !!(c || s) : !!ue, ve = /* @__PURE__ */ o(
|
|
195
|
+
st,
|
|
181
196
|
{
|
|
182
|
-
ref:
|
|
183
|
-
ariaLabelledBy:
|
|
184
|
-
ariaDescribedBy:
|
|
185
|
-
ariaInvalid:
|
|
186
|
-
ariaRequired:
|
|
187
|
-
open:
|
|
188
|
-
inline:
|
|
189
|
-
popperContainer:
|
|
197
|
+
ref: se,
|
|
198
|
+
ariaLabelledBy: S["aria-labelledby"],
|
|
199
|
+
ariaDescribedBy: S["aria-describedby"],
|
|
200
|
+
ariaInvalid: S["aria-invalid"] ? "true" : void 0,
|
|
201
|
+
ariaRequired: S["aria-required"] ? "true" : void 0,
|
|
202
|
+
open: F ? R || x : P,
|
|
203
|
+
inline: F,
|
|
204
|
+
popperContainer: l ? St : void 0,
|
|
190
205
|
popperPlacement: "bottom-end",
|
|
191
|
-
popperClassName: [
|
|
192
|
-
dayClassName:
|
|
193
|
-
onDayMouseEnter:
|
|
194
|
-
onMonthMouseLeave:
|
|
195
|
-
|
|
206
|
+
popperClassName: [Ke ? w("calendar-popper--closing") : "", Z ? w("calendar-popper--portal") : ""].filter(Boolean).join(" ") || void 0,
|
|
207
|
+
dayClassName: u ? tt : void 0,
|
|
208
|
+
onDayMouseEnter: u ? (e) => Y(s || me(e) || V && !V(e) ? null : e.getTime()) : void 0,
|
|
209
|
+
onMonthMouseLeave: u ? () => Y(null) : void 0,
|
|
210
|
+
minDate: z ?? void 0,
|
|
211
|
+
maxDate: W ?? void 0,
|
|
212
|
+
excludeDates: G,
|
|
213
|
+
filterDate: V,
|
|
214
|
+
isClearable: C,
|
|
196
215
|
ariaLabelClose: "Очистить",
|
|
197
|
-
disabled:
|
|
216
|
+
disabled: ne,
|
|
198
217
|
renderCustomHeader: ({
|
|
199
218
|
date: e,
|
|
200
219
|
changeYear: t,
|
|
201
220
|
changeMonth: r,
|
|
202
221
|
decreaseMonth: i,
|
|
203
|
-
increaseMonth:
|
|
204
|
-
prevMonthButtonDisabled:
|
|
205
|
-
nextMonthButtonDisabled:
|
|
206
|
-
}) => /* @__PURE__ */
|
|
222
|
+
increaseMonth: v,
|
|
223
|
+
prevMonthButtonDisabled: O,
|
|
224
|
+
nextMonthButtonDisabled: N
|
|
225
|
+
}) => /* @__PURE__ */ T(
|
|
207
226
|
"div",
|
|
208
227
|
{
|
|
209
228
|
style: {
|
|
@@ -221,7 +240,7 @@ const O = [
|
|
|
221
240
|
{
|
|
222
241
|
style: {
|
|
223
242
|
width: "calc(25 * var(--u-unit, 1px))",
|
|
224
|
-
color:
|
|
243
|
+
color: `var(--${a()}-color-primary, #1E4391)`,
|
|
225
244
|
display: "flex",
|
|
226
245
|
// Без внутреннего отступа: стрелка прижата к краю карточки,
|
|
227
246
|
// а не поджата к году и месяцу.
|
|
@@ -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(), h(null), i();
|
|
233
252
|
},
|
|
234
|
-
disabled:
|
|
235
|
-
children: /* @__PURE__ */ o("i", { className:
|
|
253
|
+
disabled: O,
|
|
254
|
+
children: /* @__PURE__ */ o("i", { className: `${a()}-icon icon-left`, style: { fontSize: "calc(20 * var(--u-unit, 1px))" } })
|
|
236
255
|
}
|
|
237
256
|
),
|
|
238
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ T(
|
|
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
|
+
ke,
|
|
251
270
|
{
|
|
252
|
-
value:
|
|
253
|
-
options:
|
|
271
|
+
value: Q(e),
|
|
272
|
+
options: $t.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: de === "year",
|
|
277
|
+
onOpen: () => h("year"),
|
|
278
|
+
onClose: () => h(null)
|
|
260
279
|
}
|
|
261
280
|
),
|
|
262
281
|
/* @__PURE__ */ o(
|
|
263
|
-
|
|
282
|
+
ke,
|
|
264
283
|
{
|
|
265
|
-
value:
|
|
266
|
-
options:
|
|
284
|
+
value: E[wt(e)],
|
|
285
|
+
options: E.map((n) => ({ value: n, label: n })),
|
|
267
286
|
onChange: (n) => {
|
|
268
|
-
const
|
|
269
|
-
r(
|
|
287
|
+
const be = String(n);
|
|
288
|
+
r(E.indexOf(be)), ee && ee(be);
|
|
270
289
|
},
|
|
271
|
-
fallbackValue:
|
|
290
|
+
fallbackValue: E[(/* @__PURE__ */ new Date()).getMonth()],
|
|
272
291
|
width: 85,
|
|
273
|
-
isOpen:
|
|
274
|
-
onOpen: () =>
|
|
275
|
-
onClose: () =>
|
|
292
|
+
isOpen: de === "month",
|
|
293
|
+
onOpen: () => h("month"),
|
|
294
|
+
onClose: () => h(null)
|
|
276
295
|
}
|
|
277
296
|
)
|
|
278
297
|
]
|
|
@@ -283,112 +302,114 @@ const O = [
|
|
|
283
302
|
{
|
|
284
303
|
style: {
|
|
285
304
|
width: "calc(25 * var(--u-unit, 1px))",
|
|
286
|
-
color:
|
|
305
|
+
color: `var(--${a()}-color-primary, #1E4391)`,
|
|
287
306
|
display: "flex",
|
|
288
307
|
justifyContent: "flex-end",
|
|
289
308
|
padding: 0,
|
|
290
309
|
cursor: "pointer"
|
|
291
310
|
},
|
|
292
311
|
onClick: (n) => {
|
|
293
|
-
n.preventDefault(), n.stopPropagation(),
|
|
312
|
+
n.preventDefault(), n.stopPropagation(), h(null), v();
|
|
294
313
|
},
|
|
295
|
-
disabled:
|
|
296
|
-
children: /* @__PURE__ */ o("i", { className:
|
|
314
|
+
disabled: N,
|
|
315
|
+
children: /* @__PURE__ */ o("i", { className: `${a()}-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: De ?? (u ? "Выберите период" : "Выберите дату"),
|
|
303
322
|
customInput: /* @__PURE__ */ o(
|
|
304
|
-
|
|
323
|
+
ut,
|
|
305
324
|
{
|
|
306
|
-
"aria-label":
|
|
307
|
-
id: `custom-input-mask-${
|
|
308
|
-
isClearable:
|
|
309
|
-
range:
|
|
310
|
-
wheelEdit:
|
|
311
|
-
onWheelDate: (e) =>
|
|
312
|
-
|
|
313
|
-
|
|
325
|
+
"aria-label": d,
|
|
326
|
+
id: `custom-input-mask-${y}`,
|
|
327
|
+
isClearable: C,
|
|
328
|
+
range: u,
|
|
329
|
+
wheelEdit: Be && !u,
|
|
330
|
+
onWheelDate: (e) => {
|
|
331
|
+
me(e) || pe(e);
|
|
332
|
+
},
|
|
333
|
+
onOpenCalendar: () => _(!0),
|
|
334
|
+
onFocusChange: Ye
|
|
314
335
|
}
|
|
315
336
|
),
|
|
316
|
-
...
|
|
337
|
+
...Ze,
|
|
317
338
|
strictParsing: !0,
|
|
318
339
|
locale: "ru",
|
|
319
|
-
className: (
|
|
320
|
-
(
|
|
340
|
+
className: (Ce ? "custom-input dpc-filter custom-input-filter" : He ? "custom-input dpc-table custom-input-table" : `${$e ? "dpc-grey" : "dpc"} custom-input`) + ($.hasError ? ` ${a()}-input-required` : "") + // react-datepicker рисует крестик и у disabled-поля — отступ под него тоже есть, как во Vue.
|
|
341
|
+
(C && rt ? " dpc--clearable" : ""),
|
|
321
342
|
dateFormat: "dd.MM.yyyy"
|
|
322
343
|
}
|
|
323
344
|
);
|
|
324
|
-
return /* @__PURE__ */ o(
|
|
345
|
+
return /* @__PURE__ */ o(we.Provider, { value: l, children: /* @__PURE__ */ T(
|
|
325
346
|
"div",
|
|
326
347
|
{
|
|
327
|
-
ref:
|
|
328
|
-
id:
|
|
329
|
-
className:
|
|
330
|
-
style: { display: "flex", flexDirection: "column", rowGap:
|
|
348
|
+
ref: q,
|
|
349
|
+
id: `${a()}-datepicker${y}`,
|
|
350
|
+
className: qe || void 0,
|
|
351
|
+
style: { display: "flex", flexDirection: "column", rowGap: `calc(4 * var(--${a()}-preset-unit, 1px))` },
|
|
331
352
|
children: [
|
|
332
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ T(
|
|
333
354
|
"div",
|
|
334
355
|
{
|
|
335
356
|
style: Object.assign(
|
|
336
357
|
{
|
|
337
358
|
display: "flex",
|
|
338
|
-
flexDirection:
|
|
339
|
-
rowGap:
|
|
340
|
-
columnGap:
|
|
359
|
+
flexDirection: H ? "row" : "column",
|
|
360
|
+
rowGap: H ? null : fe(Ne),
|
|
361
|
+
columnGap: H ? fe(Te) : null
|
|
341
362
|
},
|
|
342
|
-
|
|
363
|
+
Ae
|
|
343
364
|
),
|
|
344
365
|
children: [
|
|
345
|
-
|
|
366
|
+
f && /* @__PURE__ */ o(
|
|
346
367
|
"div",
|
|
347
368
|
{
|
|
348
|
-
id: `${
|
|
349
|
-
className: `${
|
|
369
|
+
id: `${y}-label`,
|
|
370
|
+
className: `${oe ? w("required") : ""} ${a()}-react-input-title`,
|
|
350
371
|
style: Object.assign(
|
|
351
372
|
{
|
|
352
|
-
color:
|
|
353
|
-
fontSize:
|
|
373
|
+
color: `var(--${a()}-field-title-color, #545454)`,
|
|
374
|
+
fontSize: `var(--${a()}-field-label-size-main, calc(14 * var(--u-unit, 1px)))`
|
|
354
375
|
},
|
|
355
|
-
|
|
376
|
+
Ee
|
|
356
377
|
),
|
|
357
|
-
children:
|
|
378
|
+
children: f
|
|
358
379
|
}
|
|
359
380
|
),
|
|
360
|
-
|
|
361
|
-
|
|
381
|
+
Le ? /* @__PURE__ */ o(
|
|
382
|
+
pt,
|
|
362
383
|
{
|
|
363
384
|
portalOn: !0,
|
|
364
|
-
id: `calendar-hint-${
|
|
385
|
+
id: `calendar-hint-${y || "default"}`,
|
|
365
386
|
position: "top",
|
|
366
|
-
isActive:
|
|
387
|
+
isActive: Ve && !ne && !Je,
|
|
367
388
|
showWhenActive: !0,
|
|
368
389
|
tooltipStyle: {
|
|
369
|
-
maxWidth:
|
|
390
|
+
maxWidth: Xe(Fe),
|
|
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: je,
|
|
396
|
+
children: /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick: ye, children: ve })
|
|
376
397
|
}
|
|
377
|
-
) : /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick:
|
|
398
|
+
) : /* @__PURE__ */ o("div", { style: { width: "100%" }, onClick: ye, children: ve })
|
|
378
399
|
]
|
|
379
400
|
}
|
|
380
401
|
),
|
|
381
|
-
|
|
402
|
+
$.showText && /* @__PURE__ */ o(
|
|
382
403
|
"h5",
|
|
383
404
|
{
|
|
384
|
-
id: `${
|
|
405
|
+
id: `${y}-error`,
|
|
385
406
|
className: "h5 clr-red-main",
|
|
386
|
-
style:
|
|
387
|
-
children:
|
|
407
|
+
style: Oe ? { position: "absolute", bottom: "calc(-20 * var(--u-unit, 1px))" } : { position: "relative" },
|
|
408
|
+
children: $.text
|
|
388
409
|
}
|
|
389
410
|
)
|
|
390
411
|
]
|
|
391
412
|
}
|
|
392
413
|
) });
|
|
393
414
|
};
|
|
394
|
-
export {
|
|
415
|
+
export { Qt 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;
|