urfu-ui-kit-react 2.1.7-next.4 → 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.js +232 -232
- 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.js +178 -178
- 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 +102 -101
- 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 +1 -1
- 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 +2 -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.shell.lk.css +53 -0
- package/dist/urfu-ui-kit-react.js +27 -26
- package/dist/vanilla/core/describeError.js +1 -1
- package/dist/vanilla/core/sheetTitle.js +7 -7
- package/package.json +3 -1
|
@@ -1,335 +1,336 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as U, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { useMountTransition$u as
|
|
7
|
-
import { getPopupTransitionStyle$u as
|
|
8
|
-
import { InputTimeDropdown$u as
|
|
9
|
-
import { useRef as
|
|
10
|
-
import { Icon$u as
|
|
11
|
-
import { Tooltip$u as
|
|
12
|
-
import { handleTimeKeyDown$u as
|
|
13
|
-
import { useInputTimeWheel$u as
|
|
14
|
-
import { useAutoId$u as
|
|
15
|
-
import { useInputOverflow$u as
|
|
16
|
-
import { getFieldAccessibility$u as
|
|
17
|
-
import { sizeClassName$u as
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
import { useMountTransition$u as Yt } from "../../hooks/useMountTransition.js";
|
|
7
|
+
import { getPopupTransitionStyle$u as te, POPUP_TRANSITION_MS$u as ee } from "../../shared/popupTransition.js";
|
|
8
|
+
import { InputTimeDropdown$u as ne } from "./InputTimeDropdown.js";
|
|
9
|
+
import { useRef as d, useState as g, useEffect as P, useMemo as v, useCallback as z, useLayoutEffect as ct } from "react";
|
|
10
|
+
import { Icon$u as re } from "../Icon/Icon.js";
|
|
11
|
+
import { Tooltip$u as oe } from "../Tooltip/Tooltip.js";
|
|
12
|
+
import { handleTimeKeyDown$u as ie } from "./inputTimeKeyDown.js";
|
|
13
|
+
import { useInputTimeWheel$u as se } from "./useInputTimeWheel.js";
|
|
14
|
+
import { useAutoId$u as ce } from "../../hooks/useAutoId.js";
|
|
15
|
+
import { useInputOverflow$u as ue } from "../../hooks/useInputOverflow.js";
|
|
16
|
+
import { getFieldAccessibility$u as le } from "../../shared/fieldAccessibility.js";
|
|
17
|
+
import { sizeClassName$u as ae } from "../../shared/size.js";
|
|
18
|
+
import { getUiKitPrefix$u as u, kitCls$u as h } from "../../shared/uiKitDefaults.js";
|
|
19
|
+
import { resolveValidation$u as pe } from "../../vanilla/core/validation.js";
|
|
20
|
+
const Ae = ({
|
|
21
|
+
title: E = "",
|
|
22
|
+
placeholder: ut = "Введите время",
|
|
23
|
+
defaultValue: x,
|
|
23
24
|
value: i,
|
|
24
|
-
id:
|
|
25
|
-
name:
|
|
26
|
-
onChange:
|
|
27
|
-
required:
|
|
25
|
+
id: lt,
|
|
26
|
+
name: I = "",
|
|
27
|
+
onChange: V,
|
|
28
|
+
required: G = !1,
|
|
28
29
|
disabled: s = !1,
|
|
29
|
-
isClearable:
|
|
30
|
-
lineUp:
|
|
31
|
-
rowGap:
|
|
32
|
-
columnGap:
|
|
33
|
-
styleInputContainer:
|
|
34
|
-
styleTitle:
|
|
35
|
-
styleInput:
|
|
36
|
-
tooltipMaxWidth:
|
|
37
|
-
wheelEdit:
|
|
38
|
-
showHint:
|
|
39
|
-
hintText:
|
|
40
|
-
className:
|
|
41
|
-
size:
|
|
42
|
-
validationText:
|
|
43
|
-
validationOn:
|
|
44
|
-
error:
|
|
45
|
-
validationOnWithoutText:
|
|
46
|
-
absoluteValidationText:
|
|
47
|
-
"aria-label":
|
|
48
|
-
"aria-labelledby":
|
|
49
|
-
"aria-describedby":
|
|
30
|
+
isClearable: X = !1,
|
|
31
|
+
lineUp: j = !1,
|
|
32
|
+
rowGap: at = 4,
|
|
33
|
+
columnGap: pt = 20,
|
|
34
|
+
styleInputContainer: mt,
|
|
35
|
+
styleTitle: ft,
|
|
36
|
+
styleInput: dt,
|
|
37
|
+
tooltipMaxWidth: gt = 300,
|
|
38
|
+
wheelEdit: a = !1,
|
|
39
|
+
showHint: ht = !1,
|
|
40
|
+
hintText: St = "Используйте колесо мыши или стрелки ↑↓ для изменения значения. Нажмите Enter для подтверждения.",
|
|
41
|
+
className: $t = "",
|
|
42
|
+
size: yt,
|
|
43
|
+
validationText: bt = "Заполните поле",
|
|
44
|
+
validationOn: wt,
|
|
45
|
+
error: vt,
|
|
46
|
+
validationOnWithoutText: xt,
|
|
47
|
+
absoluteValidationText: Rt,
|
|
48
|
+
"aria-label": Tt,
|
|
49
|
+
"aria-labelledby": It,
|
|
50
|
+
"aria-describedby": Mt
|
|
50
51
|
}) => {
|
|
51
|
-
const
|
|
52
|
-
"aria-label":
|
|
53
|
-
"aria-labelledby":
|
|
54
|
-
"aria-describedby":
|
|
55
|
-
}),
|
|
56
|
-
isOpen:
|
|
57
|
-
duration:
|
|
58
|
-
}), [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, [i,
|
|
62
|
-
const o =
|
|
63
|
-
if (
|
|
52
|
+
const M = pe({ error: vt, validationOn: wt, validationOnWithoutText: xt, validationText: bt }), p = ce(lt, h("input-time")), Ct = le(p, E, G, M, {
|
|
53
|
+
"aria-label": Tt,
|
|
54
|
+
"aria-labelledby": It,
|
|
55
|
+
"aria-describedby": Mt
|
|
56
|
+
}), Z = ae(yt), L = d(null), r = d(null), C = d(!1), q = d(null), K = d(null), [S, R] = g(!1), { shouldRender: J, status: Dt, isAnimated: kt } = Yt({
|
|
57
|
+
isOpen: S && !s,
|
|
58
|
+
duration: ee
|
|
59
|
+
}), [$, m] = g(null), [At, f] = g(0), [Q, Nt] = g(0), [Ft, Ht] = g(0), [y, Y] = g(!1), [D, tt] = g(() => String(i ?? x ?? "")), et = d(i), [Ot, Bt] = g(!1);
|
|
60
|
+
P(() => {
|
|
61
|
+
y || i !== et.current && (tt(String(i ?? "")), et.current = i);
|
|
62
|
+
}, [i, y]);
|
|
63
|
+
const o = v(() => {
|
|
64
|
+
if (y) return D;
|
|
64
65
|
const t = String(i ?? "").trim();
|
|
65
|
-
return t ||
|
|
66
|
-
}, [
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
/^\d{2}:\d{2}$/.test(String(i ??
|
|
70
|
-
),
|
|
71
|
-
|
|
66
|
+
return t || D;
|
|
67
|
+
}, [D, i, y]);
|
|
68
|
+
ue(r, o, s);
|
|
69
|
+
const k = v(() => /^\d{2}:\d{2}$/.test(o || ""), [o]), W = d(String(i ?? x ?? "")), A = d(
|
|
70
|
+
/^\d{2}:\d{2}$/.test(String(i ?? x ?? "")) ? String(i ?? x ?? "") : ""
|
|
71
|
+
), N = v(() => k ? (o || "").split(":")[0] : null, [o, k]), F = v(() => k ? (o || "").split(":")[1] : null, [o, k]), Pt = v(() => Array.from({ length: 24 }, (t, e) => String(e).padStart(2, "0")), []), zt = v(() => Array.from({ length: 60 }, (t, e) => String(e).padStart(2, "0")), []);
|
|
72
|
+
P(() => {
|
|
72
73
|
const t = () => {
|
|
73
|
-
|
|
74
|
+
Bt(window.innerWidth <= 900);
|
|
74
75
|
};
|
|
75
76
|
return t(), window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
|
|
76
|
-
}, []),
|
|
77
|
+
}, []), P(() => {
|
|
77
78
|
const t = (e) => {
|
|
78
|
-
if (!
|
|
79
|
+
if (!L.current) return;
|
|
79
80
|
const n = e.target;
|
|
80
|
-
n && !
|
|
81
|
+
n && !L.current.contains(n) && R(!1);
|
|
81
82
|
};
|
|
82
83
|
return document.addEventListener("pointerdown", t), () => document.removeEventListener("pointerdown", t);
|
|
83
|
-
}, []),
|
|
84
|
-
if (!
|
|
84
|
+
}, []), P(() => {
|
|
85
|
+
if (!S) return;
|
|
85
86
|
const t = (e, n) => {
|
|
86
87
|
if (!e || !n) return;
|
|
87
|
-
const
|
|
88
|
-
|
|
88
|
+
const O = e.querySelector(
|
|
89
|
+
`.${u()}-react-input-time-option[data-time-value="${n}"]`
|
|
89
90
|
);
|
|
90
|
-
if (!
|
|
91
|
-
const
|
|
92
|
-
|
|
91
|
+
if (!O) return;
|
|
92
|
+
const B = e.getBoundingClientRect(), w = O.getBoundingClientRect(), T = w.top - B.top;
|
|
93
|
+
T >= 0 && T + w.height <= e.clientHeight || (e.scrollTop += T - (e.clientHeight - w.height) / 2);
|
|
93
94
|
};
|
|
94
|
-
t(
|
|
95
|
-
}, [
|
|
96
|
-
const c =
|
|
97
|
-
if (
|
|
98
|
-
|
|
95
|
+
t(q.current, N), t(K.current, F);
|
|
96
|
+
}, [S, J, N, F]);
|
|
97
|
+
const c = z((t) => {
|
|
98
|
+
if (tt(t), W.current = t, /^\d{2}:\d{2}$/.test(t) && (A.current = t), !V) return;
|
|
99
|
+
V({
|
|
99
100
|
target: {
|
|
100
101
|
value: t,
|
|
101
|
-
id:
|
|
102
|
-
name:
|
|
102
|
+
id: p,
|
|
103
|
+
name: I
|
|
103
104
|
},
|
|
104
105
|
currentTarget: {
|
|
105
106
|
value: t,
|
|
106
|
-
id:
|
|
107
|
-
name:
|
|
107
|
+
id: p,
|
|
108
|
+
name: I
|
|
108
109
|
}
|
|
109
110
|
});
|
|
110
|
-
}, [
|
|
111
|
+
}, [p, I, V]), nt = X && !s && !!o, Et = () => {
|
|
111
112
|
var t;
|
|
112
|
-
c(""),
|
|
113
|
-
},
|
|
114
|
-
s ||
|
|
115
|
-
},
|
|
113
|
+
c(""), R(!1), (t = r.current) == null || t.focus();
|
|
114
|
+
}, _ = () => {
|
|
115
|
+
s || R(!0);
|
|
116
|
+
}, Vt = (t) => {
|
|
116
117
|
const e = String(t.target.value ?? "");
|
|
117
118
|
if (/[^0-9:]/.test(e)) {
|
|
118
119
|
c(e.replaceAll(/[^0-9:]/g, ""));
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
121
|
-
t.target.value || (
|
|
122
|
-
},
|
|
122
|
+
t.target.value || (m("hour"), f(0)), c(t.target.value);
|
|
123
|
+
}, b = z((t) => {
|
|
123
124
|
r.current && (t === "hour" ? r.current.setSelectionRange(0, 2) : r.current.setSelectionRange(3, 5));
|
|
124
|
-
}, []),
|
|
125
|
+
}, []), H = z((t) => {
|
|
125
126
|
requestAnimationFrame(() => {
|
|
126
|
-
|
|
127
|
+
b(t), requestAnimationFrame(() => b(t));
|
|
127
128
|
});
|
|
128
|
-
}, [
|
|
129
|
-
|
|
130
|
-
if (!
|
|
129
|
+
}, [b]);
|
|
130
|
+
ct(() => {
|
|
131
|
+
if (!a) return;
|
|
131
132
|
const t = r.current;
|
|
132
|
-
!t || document.activeElement !== t ||
|
|
133
|
-
}, [o,
|
|
134
|
-
if (!
|
|
133
|
+
!t || document.activeElement !== t || !$ || b($);
|
|
134
|
+
}, [o, $, b, Ft, a]), ct(() => {
|
|
135
|
+
if (!a || Q === 0) return;
|
|
135
136
|
const t = r.current;
|
|
136
137
|
!t || document.activeElement !== t || t.setSelectionRange(0, t.value.length);
|
|
137
|
-
}, [
|
|
138
|
-
const
|
|
139
|
-
const e = r.current,
|
|
140
|
-
if ((
|
|
141
|
-
const
|
|
142
|
-
c(`${
|
|
138
|
+
}, [Q, a]);
|
|
139
|
+
const rt = (t, e, n) => t < e ? n : t > n ? e : t, ot = z((t) => {
|
|
140
|
+
const e = r.current, O = /^\d{2}:\d{2}$/.test(o || "") ? o : "00:00", [B, w] = O.split(":"), T = (e == null ? void 0 : e.selectionStart) ?? 0;
|
|
141
|
+
if (($ ?? (T <= 2 ? "hour" : "minute")) === "hour") {
|
|
142
|
+
const Jt = rt(Number(B) + t, 0, 23), Qt = String(Jt).padStart(2, "0");
|
|
143
|
+
c(`${Qt}:${w}`), m("hour"), f(0), H("hour");
|
|
143
144
|
return;
|
|
144
145
|
}
|
|
145
|
-
const
|
|
146
|
-
c(`${
|
|
147
|
-
}, [
|
|
146
|
+
const Xt = rt(Number(w) + t, 0, 59), Zt = String(Xt).padStart(2, "0");
|
|
147
|
+
c(`${B}:${Zt}`), m("minute"), f(0), H("minute");
|
|
148
|
+
}, [$, o, c, H]), jt = (t) => {
|
|
148
149
|
if (s) return;
|
|
149
150
|
const n = t.currentTarget.getBoundingClientRect().right - 44;
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
if (!
|
|
151
|
+
C.current = t.clientX >= n, _();
|
|
152
|
+
}, Lt = (t) => {
|
|
153
|
+
if (!a) return;
|
|
153
154
|
if (t.preventDefault(), t.detail >= 2) {
|
|
154
|
-
|
|
155
|
+
C.current = !1, m(null), f(0), Nt((n) => n + 1);
|
|
155
156
|
return;
|
|
156
157
|
}
|
|
157
|
-
const e =
|
|
158
|
-
|
|
159
|
-
},
|
|
158
|
+
const e = C.current || (t.currentTarget.selectionStart ?? 0) <= 2 ? "hour" : "minute";
|
|
159
|
+
C.current = !1, m(e), f(0), Ht((n) => n + 1);
|
|
160
|
+
}, qt = () => {
|
|
160
161
|
var e;
|
|
161
|
-
const t = ((e = r.current) == null ? void 0 : e.value) ??
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
const t =
|
|
162
|
+
const t = ((e = r.current) == null ? void 0 : e.value) ?? D ?? "";
|
|
163
|
+
W.current = t, /^\d{2}:\d{2}$/.test(t) && (A.current = t), Y(!0), a && (m("hour"), f(0), H("hour"));
|
|
164
|
+
}, Kt = () => {
|
|
165
|
+
Y(!1);
|
|
166
|
+
const t = W.current;
|
|
166
167
|
if (/^\d{2}:\d{2}$/.test(t)) return;
|
|
167
|
-
!(
|
|
168
|
-
}, qt = (t) => {
|
|
169
|
-
c(`${t}:${k ?? "00"}`);
|
|
168
|
+
!(X && t.trim() === "") && /^\d{2}:\d{2}$/.test(A.current) && (c(A.current), m(null), f(0));
|
|
170
169
|
}, Wt = (t) => {
|
|
171
|
-
c(`${
|
|
170
|
+
c(`${t}:${F ?? "00"}`);
|
|
171
|
+
}, _t = (t) => {
|
|
172
|
+
c(`${N ?? "00"}:${t}`), R(!1);
|
|
172
173
|
};
|
|
173
|
-
|
|
174
|
+
se({
|
|
174
175
|
disabled: s,
|
|
175
176
|
inputRef: r,
|
|
176
|
-
changeActiveSegmentBy:
|
|
177
|
-
wheelEdit:
|
|
178
|
-
isInputFocused:
|
|
179
|
-
hoursColumnRef:
|
|
180
|
-
minutesColumnRef:
|
|
181
|
-
isOpen:
|
|
177
|
+
changeActiveSegmentBy: ot,
|
|
178
|
+
wheelEdit: a,
|
|
179
|
+
isInputFocused: y,
|
|
180
|
+
hoursColumnRef: q,
|
|
181
|
+
minutesColumnRef: K,
|
|
182
|
+
isOpen: S
|
|
182
183
|
});
|
|
183
|
-
const
|
|
184
|
+
const it = (t) => typeof t == "number" ? `calc(${t} * var(--${u()}-preset-unit, 1px))` : String(t), Ut = (t) => typeof t == "number" ? `calc(${t} * var(--u-unit, 1px))` : String(t), st = /* @__PURE__ */ U(
|
|
184
185
|
"div",
|
|
185
186
|
{
|
|
186
|
-
className:
|
|
187
|
-
ref:
|
|
187
|
+
className: `${u()}-react-input-time-field ${S ? h("react-input-time-field--open") : ""}`,
|
|
188
|
+
ref: L,
|
|
188
189
|
onKeyDown: (t) => {
|
|
189
190
|
var e;
|
|
190
|
-
t.key !== "Escape" || !
|
|
191
|
+
t.key !== "Escape" || !S || (t.preventDefault(), t.stopPropagation(), R(!1), (e = r.current) == null || e.focus());
|
|
191
192
|
},
|
|
192
193
|
children: [
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ l(
|
|
194
195
|
"input",
|
|
195
196
|
{
|
|
196
|
-
className:
|
|
197
|
-
id:
|
|
198
|
-
...
|
|
199
|
-
name:
|
|
197
|
+
className: `${u()}-react-input ${u()}-input ${M.hasError ? h("input-required") : ""}`,
|
|
198
|
+
id: p,
|
|
199
|
+
...Ct,
|
|
200
|
+
name: I,
|
|
200
201
|
type: "text",
|
|
201
202
|
inputMode: "numeric",
|
|
202
203
|
autoComplete: "off",
|
|
203
|
-
placeholder:
|
|
204
|
+
placeholder: ut,
|
|
204
205
|
value: o || "",
|
|
205
|
-
defaultValue:
|
|
206
|
-
style: Object.assign({ paddingRight:
|
|
206
|
+
defaultValue: x,
|
|
207
|
+
style: Object.assign({ paddingRight: nt ? "calc(68 * var(--u-unit, 1px))" : "calc(44 * var(--u-unit, 1px))" }, dt),
|
|
207
208
|
disabled: s,
|
|
208
209
|
ref: r,
|
|
209
|
-
onChange:
|
|
210
|
-
onMouseDown:
|
|
211
|
-
onMouseUp:
|
|
212
|
-
onKeyDown: (t) =>
|
|
210
|
+
onChange: Vt,
|
|
211
|
+
onMouseDown: jt,
|
|
212
|
+
onMouseUp: Lt,
|
|
213
|
+
onKeyDown: (t) => ie(t, {
|
|
213
214
|
disabled: s,
|
|
214
215
|
inputRef: r,
|
|
215
216
|
displayedValue: o,
|
|
216
|
-
activeSegment:
|
|
217
|
-
segmentInputCount:
|
|
218
|
-
wheelEdit:
|
|
219
|
-
openDropdown:
|
|
220
|
-
changeActiveSegmentBy:
|
|
221
|
-
selectSegment:
|
|
217
|
+
activeSegment: $,
|
|
218
|
+
segmentInputCount: At,
|
|
219
|
+
wheelEdit: a,
|
|
220
|
+
openDropdown: _,
|
|
221
|
+
changeActiveSegmentBy: ot,
|
|
222
|
+
selectSegment: b,
|
|
222
223
|
emitChange: c,
|
|
223
|
-
setActiveSegment:
|
|
224
|
-
setSegmentInputCount:
|
|
224
|
+
setActiveSegment: m,
|
|
225
|
+
setSegmentInputCount: f
|
|
225
226
|
}),
|
|
226
|
-
onFocus:
|
|
227
|
-
onBlur:
|
|
227
|
+
onFocus: qt,
|
|
228
|
+
onBlur: Kt
|
|
228
229
|
}
|
|
229
230
|
),
|
|
230
|
-
|
|
231
|
+
nt && // Как у Select: место слева от значка (vanilla right 44u), вне обхода по Tab;
|
|
231
232
|
// mousedown не уводит фокус из поля, иначе blur откатил бы время.
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ l(
|
|
233
234
|
"i",
|
|
234
235
|
{
|
|
235
|
-
className: "
|
|
236
|
+
className: h("selectbox-select-icon-cross"),
|
|
236
237
|
role: "button",
|
|
237
238
|
"aria-label": "Очистить",
|
|
238
239
|
style: { cursor: "pointer" },
|
|
239
240
|
onMouseDown: (t) => t.preventDefault(),
|
|
240
|
-
onClick:
|
|
241
|
+
onClick: Et
|
|
241
242
|
}
|
|
242
243
|
),
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ l(
|
|
244
245
|
"button",
|
|
245
246
|
{
|
|
246
247
|
type: "button",
|
|
247
|
-
className: "
|
|
248
|
+
className: h("react-input-time-icon-button"),
|
|
248
249
|
disabled: s,
|
|
249
250
|
onClick: () => {
|
|
250
251
|
var t;
|
|
251
|
-
|
|
252
|
+
_(), (t = r.current) == null || t.focus();
|
|
252
253
|
},
|
|
253
254
|
"aria-label": "Открыть выбор времени",
|
|
254
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ l("span", { className: h("react-input-time-icon"), "aria-hidden": !0, children: /* @__PURE__ */ l(re, { name: "clock", color: `var(--${u()}-color-primary, #1E4391)`, size: 20 }) })
|
|
255
256
|
}
|
|
256
257
|
),
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
J && /* @__PURE__ */ l(
|
|
259
|
+
ne,
|
|
259
260
|
{
|
|
260
|
-
hours:
|
|
261
|
-
minutes:
|
|
262
|
-
selectedHour:
|
|
263
|
-
selectedMinute:
|
|
264
|
-
hoursColumnRef:
|
|
265
|
-
minutesColumnRef:
|
|
266
|
-
onSelectHour:
|
|
267
|
-
onSelectMinute:
|
|
268
|
-
style:
|
|
261
|
+
hours: Pt,
|
|
262
|
+
minutes: zt,
|
|
263
|
+
selectedHour: N,
|
|
264
|
+
selectedMinute: F,
|
|
265
|
+
hoursColumnRef: q,
|
|
266
|
+
minutesColumnRef: K,
|
|
267
|
+
onSelectHour: Wt,
|
|
268
|
+
onSelectMinute: _t,
|
|
269
|
+
style: te(Dt, kt)
|
|
269
270
|
}
|
|
270
271
|
)
|
|
271
272
|
]
|
|
272
273
|
}
|
|
273
274
|
);
|
|
274
|
-
return /* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
275
|
+
return /* @__PURE__ */ U("div", { className: `${u()}-react-input-container${Z ? ` ${Z}` : ""} ${$t}`, style: { position: "relative" }, children: [
|
|
276
|
+
/* @__PURE__ */ U(
|
|
276
277
|
"div",
|
|
277
278
|
{
|
|
278
279
|
style: Object.assign(
|
|
279
280
|
{
|
|
280
281
|
display: "flex",
|
|
281
|
-
flexDirection:
|
|
282
|
-
rowGap:
|
|
283
|
-
columnGap:
|
|
282
|
+
flexDirection: j ? "row" : "column",
|
|
283
|
+
rowGap: j ? null : it(at),
|
|
284
|
+
columnGap: j ? it(pt) : null
|
|
284
285
|
},
|
|
285
|
-
|
|
286
|
+
mt
|
|
286
287
|
),
|
|
287
288
|
children: [
|
|
288
|
-
|
|
289
|
+
E && /* @__PURE__ */ l(
|
|
289
290
|
"div",
|
|
290
291
|
{
|
|
291
|
-
id: `${
|
|
292
|
-
className: `${
|
|
292
|
+
id: `${p}-label`,
|
|
293
|
+
className: `${G ? h("required") : ""} ${u()}-react-input-title`,
|
|
293
294
|
style: Object.assign(
|
|
294
295
|
{
|
|
295
|
-
color:
|
|
296
|
-
fontSize:
|
|
296
|
+
color: `var(--${u()}-field-title-color, #545454)`,
|
|
297
|
+
fontSize: `var(--${u()}-field-label-size-main, calc(14 * var(--u-unit, 1px)))`
|
|
297
298
|
},
|
|
298
|
-
|
|
299
|
+
ft
|
|
299
300
|
),
|
|
300
|
-
children:
|
|
301
|
+
children: E
|
|
301
302
|
}
|
|
302
303
|
),
|
|
303
|
-
|
|
304
|
-
|
|
304
|
+
ht ? /* @__PURE__ */ l(
|
|
305
|
+
oe,
|
|
305
306
|
{
|
|
306
307
|
portalOn: !0,
|
|
307
|
-
id: `input-time-wheel-${
|
|
308
|
+
id: `input-time-wheel-${p || "default"}`,
|
|
308
309
|
position: "top",
|
|
309
|
-
isActive:
|
|
310
|
+
isActive: y && !s && !Ot,
|
|
310
311
|
showWhenActive: !0,
|
|
311
312
|
tooltipStyle: {
|
|
312
|
-
maxWidth:
|
|
313
|
+
maxWidth: Ut(gt),
|
|
313
314
|
width: "auto",
|
|
314
315
|
whiteSpace: "normal",
|
|
315
316
|
overflowWrap: "break-word"
|
|
316
317
|
},
|
|
317
|
-
tooltipText:
|
|
318
|
-
children:
|
|
318
|
+
tooltipText: St,
|
|
319
|
+
children: st
|
|
319
320
|
}
|
|
320
|
-
) :
|
|
321
|
+
) : st
|
|
321
322
|
]
|
|
322
323
|
}
|
|
323
324
|
),
|
|
324
|
-
|
|
325
|
+
M.showText && /* @__PURE__ */ l(
|
|
325
326
|
"h5",
|
|
326
327
|
{
|
|
327
|
-
id: `${
|
|
328
|
+
id: `${p}-error`,
|
|
328
329
|
className: "h5 clr-red-main",
|
|
329
|
-
style:
|
|
330
|
-
children:
|
|
330
|
+
style: Rt ? { position: "absolute", bottom: "calc(-20 * var(--u-unit, 1px))" } : { position: "relative", marginTop: "calc(4 * var(--u-unit, 1px))" },
|
|
331
|
+
children: M.text
|
|
331
332
|
}
|
|
332
333
|
)
|
|
333
334
|
] });
|
|
334
335
|
};
|
|
335
|
-
export {
|
|
336
|
+
export { Ae as InputTime$u };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputTimeDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/InputTime/InputTimeDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InputTimeDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/InputTime/InputTimeDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtD,KAAK,KAAK,GAAG;IACT,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,cAAc,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,gBAAgB,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AA6BF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,0HAU/B,KAAK,4CAKP,CAAC"}
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { kitCls$u as m, getUiKitPrefix$u as u } from "../../shared/uiKitDefaults.js";
|
|
3
|
+
const s = ({
|
|
4
|
+
values: i,
|
|
4
5
|
selected: o,
|
|
5
|
-
onSelect:
|
|
6
|
-
columnRef:
|
|
7
|
-
}) => /* @__PURE__ */ t("div", { className: "
|
|
6
|
+
onSelect: n,
|
|
7
|
+
columnRef: c
|
|
8
|
+
}) => /* @__PURE__ */ t("div", { className: m("react-input-time-column"), ref: c, children: i.map((e) => /* @__PURE__ */ t(
|
|
8
9
|
"button",
|
|
9
10
|
{
|
|
10
11
|
type: "button",
|
|
11
|
-
className:
|
|
12
|
+
className: `${u()}-react-input-time-option ${o === e ? m("react-input-time-option--selected") : ""}`,
|
|
12
13
|
"data-time-value": e,
|
|
13
|
-
onClick: () =>
|
|
14
|
+
onClick: () => n(e),
|
|
14
15
|
children: e
|
|
15
16
|
},
|
|
16
17
|
e
|
|
17
|
-
)) }),
|
|
18
|
-
hours:
|
|
18
|
+
)) }), h = ({
|
|
19
|
+
hours: i,
|
|
19
20
|
minutes: o,
|
|
20
|
-
selectedHour:
|
|
21
|
-
selectedMinute:
|
|
21
|
+
selectedHour: n,
|
|
22
|
+
selectedMinute: c,
|
|
22
23
|
hoursColumnRef: e,
|
|
23
|
-
minutesColumnRef:
|
|
24
|
-
onSelectHour:
|
|
25
|
-
onSelectMinute:
|
|
26
|
-
style:
|
|
27
|
-
}) => /* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */ t(
|
|
29
|
-
/* @__PURE__ */ t(
|
|
24
|
+
minutesColumnRef: l,
|
|
25
|
+
onSelectHour: r,
|
|
26
|
+
onSelectMinute: p,
|
|
27
|
+
style: a
|
|
28
|
+
}) => /* @__PURE__ */ d("div", { className: m("react-input-time-dropdown"), style: a, children: [
|
|
29
|
+
/* @__PURE__ */ t(s, { values: i, selected: n, onSelect: r, columnRef: e }),
|
|
30
|
+
/* @__PURE__ */ t(s, { values: o, selected: c, onSelect: p, columnRef: l })
|
|
30
31
|
] });
|
|
31
|
-
export {
|
|
32
|
+
export { h as InputTimeDropdown$u };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AACA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,mDAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AACA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,mDAAmD,CAAC;AAG3D,eAAO,MAAM,IAAI,GAAI,4LAgBlB,cAAc,4CAmJhB,CAAA"}
|