mimir-ui-kit 1.43.10 → 1.43.11
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/Input-CGZoshMl.js +224 -0
- package/dist/assets/Accordion.css +1 -1
- package/dist/assets/AccordionItem.css +1 -1
- package/dist/assets/Avatar.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/CarBodyButton.css +1 -0
- package/dist/assets/CheckboxMimir.css +1 -1
- package/dist/assets/Chip.css +1 -1
- package/dist/assets/Drawer.css +1 -1
- package/dist/assets/GosZnak.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/InputPassword.css +1 -1
- package/dist/assets/InputRangeSlider.css +1 -1
- package/dist/assets/Link.css +1 -1
- package/dist/assets/ListFiles.css +1 -1
- package/dist/assets/ListPhotos.css +1 -1
- package/dist/assets/MessageShortReply.css +1 -1
- package/dist/assets/MiniButton.css +1 -0
- package/dist/assets/MultiSelectSearch.css +1 -1
- package/dist/assets/NotificationBadge.css +1 -1
- package/dist/assets/OtpInput.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/RoundButton.css +1 -0
- package/dist/assets/ScrollWrapper.css +1 -0
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/hooks.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/components/Accordion/Accordion.d.ts +10 -3
- package/dist/components/Accordion/Accordion.js +286 -212
- package/dist/components/Accordion/AccordionItem/AccordionItem.js +3 -3
- package/dist/components/Accordion/constants.d.ts +0 -4
- package/dist/components/Accordion/constants.js +4 -5
- package/dist/components/AnchorLink/Link.js +21 -20
- package/dist/components/Avatar/Avatar.js +26 -26
- package/dist/components/Button/Button.js +110 -87
- package/dist/components/Button/constants.d.ts +8 -2
- package/dist/components/Button/constants.js +6 -5
- package/dist/components/CarBodyButton/CarBodyButton.d.ts +26 -0
- package/dist/components/CarBodyButton/CarBodyButton.js +40 -0
- package/dist/components/CarBodyButton/index.d.ts +1 -0
- package/dist/components/CarBodyButton/index.js +4 -0
- package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +2 -0
- package/dist/components/CheckboxMimir/CheckboxMimir.js +37 -35
- package/dist/components/Chip/Chip.js +17 -17
- package/dist/components/DatePicker/DatePicker.d.ts +8 -0
- package/dist/components/DatePicker/DatePicker.js +182 -169
- package/dist/components/DatePicker/DatePickerModal.js +134 -98
- package/dist/components/DatePicker/MonthPickerModal.js +115 -95
- package/dist/components/DatePicker/YearPickerModal.js +109 -89
- package/dist/components/DatePicker/constants.d.ts +1 -0
- package/dist/components/DatePicker/constants.js +1 -1
- package/dist/components/DatePicker/hooks.d.ts +2 -1
- package/dist/components/DatePicker/hooks.js +12 -12
- package/dist/components/Drawer/Drawer.js +172 -138
- package/dist/components/Drawer/ScrollWrapper/ScrollWrapper.d.ts +11 -0
- package/dist/components/Drawer/ScrollWrapper/ScrollWrapper.js +27 -0
- package/dist/components/Dropdown/Dropdown.js +1 -1
- package/dist/components/Dropdown/hooks.js +1 -1
- package/dist/components/GosZnak/GosZnak.js +47 -38
- package/dist/components/GosZnak/utils.d.ts +6 -0
- package/dist/components/GosZnak/utils.js +15 -0
- package/dist/components/Input/Input.d.ts +4 -0
- package/dist/components/Input/Input.js +2 -2
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputPassword/InputPassword.js +38 -42
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/InputRangeSlider/InputRangeSlider.js +159 -139
- package/dist/components/InputRangeSlider/constants.d.ts +5 -0
- package/dist/components/InputRangeSlider/constants.js +11 -6
- package/dist/components/ListFiles/ListFiles.js +41 -39
- package/dist/components/ListPhotos/ListPhotos.js +17 -18
- package/dist/components/MessageShortReply/MessageShortReply.js +34 -34
- package/dist/components/{InputClearButton/ClearButton.d.ts → MiniButton/MiniButton.d.ts} +17 -8
- package/dist/components/MiniButton/MiniButton.js +44 -0
- package/dist/components/MiniButton/constants.d.ts +9 -0
- package/dist/components/MiniButton/constants.js +5 -0
- package/dist/components/MiniButton/index.d.ts +4 -0
- package/dist/components/MiniButton/index.js +6 -0
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +153 -152
- package/dist/components/MultiSelectSearch/constants.d.ts +1 -0
- package/dist/components/MultiSelectSearch/constants.js +7 -7
- package/dist/components/MultiSelectSearch/utils.d.ts +1 -1
- package/dist/components/MultiSelectSearch/utils.js +18 -16
- package/dist/components/NotificationBadge/NotificationBadge.js +49 -33
- package/dist/components/NotificationBadge/constants.d.ts +9 -2
- package/dist/components/NotificationBadge/constants.js +3 -2
- package/dist/components/NotificationBadge/types.d.ts +11 -1
- package/dist/components/NotificationBadge/utils.d.ts +8 -0
- package/dist/components/NotificationBadge/utils.js +4 -0
- package/dist/components/OtpInput/OtpInput.js +44 -40
- package/dist/components/OtpInput/constants.d.ts +4 -0
- package/dist/components/OtpInput/constants.js +6 -4
- package/dist/components/OtpInput/index.d.ts +1 -0
- package/dist/components/OtpInput/index.js +2 -0
- package/dist/components/Pagination/Pagination.js +23 -23
- package/dist/components/RoundButton/RoundButton.d.ts +82 -0
- package/dist/components/RoundButton/RoundButton.js +69 -0
- package/dist/components/RoundButton/constants.d.ts +11 -0
- package/dist/components/RoundButton/constants.js +5 -0
- package/dist/components/RoundButton/index.d.ts +2 -0
- package/dist/components/RoundButton/index.js +7 -0
- package/dist/components/RoundButton/types.d.ts +20 -0
- package/dist/components/SelectSearch/SelectSearch.js +241 -241
- package/dist/components/SelectSearch/utils.d.ts +1 -1
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/Slider/Slider.d.ts +1 -5
- package/dist/components/Slider/Slider.js +34 -36
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +55 -51
- package/dist/hooks-Cd4Ez6_j.js +117 -0
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/components/16px/DropdownArrowDown16px.js +23 -0
- package/dist/icons/components/24px/EyeClosed24px.js +65 -0
- package/dist/icons/components/Avito.js +36 -13
- package/dist/icons/components/Site.js +13 -36
- package/dist/icons/components/index.js +564 -591
- package/dist/{index-C2dQUuc9.js → index-DrVFMaBi.js} +1184 -1346
- package/dist/index.js +73 -69
- package/dist/styles.module-BfkM1-KJ.js +32 -0
- package/package.json +1 -1
- package/dist/Input-BU_6U1CW.js +0 -227
- package/dist/assets/ClearButton.css +0 -1
- package/dist/components/InputClearButton/ClearButton.js +0 -41
- package/dist/components/InputClearButton/constants.d.ts +0 -8
- package/dist/components/InputClearButton/constants.js +0 -5
- package/dist/components/InputClearButton/index.d.ts +0 -4
- package/dist/components/InputClearButton/index.js +0 -6
- package/dist/hooks-HgN6Yauq.js +0 -117
- package/dist/icons/components/64px/AdvancePaymentDiscount64px.js +0 -59
- package/dist/icons/components/64px/AtsVendors64px.js +0 -37
- package/dist/icons/components/64px/ButtonOn64px.js +0 -31
- package/dist/icons/components/64px/BuyoutAuto64px.js +0 -45
- package/dist/icons/components/64px/CarAssistance64px.js +0 -44
- package/dist/icons/components/64px/CarDelivery64px.js +0 -37
- package/dist/icons/components/64px/CarSearchReturn64px.js +0 -45
- package/dist/icons/components/64px/CarService64px.js +0 -37
- package/dist/icons/components/64px/Case64px.js +0 -33
- package/dist/icons/components/64px/CoatOfArms64px.js +0 -149
- package/dist/icons/components/64px/CoffeeCup64px.js +0 -44
- package/dist/icons/components/64px/Cup64px.js +0 -38
- package/dist/icons/components/64px/ExpertAdvice64px.js +0 -40
- package/dist/icons/components/64px/Fines64px.js +0 -88
- package/dist/icons/components/64px/Fuel64px.js +0 -38
- package/dist/icons/components/64px/GazprombankIcon24px.js +0 -21
- package/dist/icons/components/64px/Kasko64px.js +0 -44
- package/dist/icons/components/64px/LegalSupport64px.js +0 -58
- package/dist/icons/components/64px/Microphone64px.js +0 -37
- package/dist/icons/components/64px/Money64px.js +0 -60
- package/dist/icons/components/64px/PaymentSchedule64px.js +0 -39
- package/dist/icons/components/64px/PersonalManager64px.js +0 -100
- package/dist/icons/components/64px/PreApproval64px.js +0 -44
- package/dist/icons/components/64px/Questions64px.js +0 -37
- package/dist/icons/components/64px/SupportGeography64px.js +0 -51
- package/dist/icons/components/64px/Timer64px.js +0 -45
- package/dist/icons/components/64px/Twogis64px.js +0 -51
- package/dist/icons/components/64px/Vehicles64px.js +0 -45
- package/dist/icons/components/64px/Workplace64px.js +0 -38
- package/dist/styles.module-Cuqm31CO.js +0 -28
@@ -1,117 +1,137 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import { useState as
|
4
|
-
import { useDatePickerPosition as
|
5
|
-
import { c as
|
6
|
-
import { formating as
|
7
|
-
import { Button as
|
8
|
-
const
|
9
|
-
date:
|
10
|
-
selectedDate:
|
1
|
+
import { jsxs as F, jsx as c } from "react/jsx-runtime";
|
2
|
+
import { c as P } from "../../index-DIxK0V-G.js";
|
3
|
+
import { useState as C } from "react";
|
4
|
+
import { useDatePickerPosition as L } from "./hooks.js";
|
5
|
+
import { c as o } from "../../styles.module-BfkM1-KJ.js";
|
6
|
+
import { formating as _ } from "../../utils/index.js";
|
7
|
+
import { Button as v } from "../Button/Button.js";
|
8
|
+
const N = 15, O = 7, T = ({
|
9
|
+
date: y,
|
10
|
+
selectedDate: d,
|
11
11
|
onChangeValue: E,
|
12
12
|
before: Y,
|
13
|
-
onChangeType:
|
14
|
-
onChangeYear:
|
15
|
-
disableFuture:
|
16
|
-
disablePast:
|
17
|
-
disabledDate:
|
13
|
+
onChangeType: l,
|
14
|
+
onChangeYear: g,
|
15
|
+
disableFuture: M = !1,
|
16
|
+
disablePast: S = !1,
|
17
|
+
disabledDate: r,
|
18
18
|
validRange: k
|
19
19
|
}) => {
|
20
|
-
const
|
21
|
-
y:
|
22
|
-
d:
|
23
|
-
m:
|
20
|
+
const [G, Q] = L(), i = new Date(y), u = d ? new Date(d) : i, D = /* @__PURE__ */ new Date(), $ = {
|
21
|
+
y: u.getFullYear(),
|
22
|
+
d: u.getDate(),
|
23
|
+
m: u.getMonth() + 1
|
24
24
|
}, e = {
|
25
25
|
y: i.getFullYear(),
|
26
26
|
d: i.getDate(),
|
27
27
|
m: i.getMonth() + 1
|
28
|
-
},
|
29
|
-
(
|
30
|
-
|
31
|
-
|
32
|
-
},
|
33
|
-
|
34
|
-
|
28
|
+
}, B = {
|
29
|
+
y: D.getFullYear(),
|
30
|
+
d: D.getDate(),
|
31
|
+
m: D.getMonth() + 1
|
32
|
+
}, [w, h] = C(e.y), H = w - O, R = Array.from(Array(N).keys()).map(
|
33
|
+
(t) => t + H
|
34
|
+
), j = () => {
|
35
|
+
h(w + N);
|
36
|
+
}, z = () => {
|
37
|
+
h(w - N);
|
38
|
+
}, x = (t) => {
|
35
39
|
const s = (/* @__PURE__ */ new Date()).getFullYear();
|
36
40
|
if (k) {
|
37
|
-
const [a,
|
38
|
-
let
|
41
|
+
const [a, p] = k;
|
42
|
+
let n;
|
39
43
|
if (e.m && e.d)
|
40
|
-
|
44
|
+
n = new Date(t, e.m - 1, e.d);
|
41
45
|
else {
|
42
46
|
const A = /* @__PURE__ */ new Date();
|
43
|
-
|
47
|
+
n = new Date(t, A.getMonth(), A.getDate());
|
44
48
|
}
|
45
|
-
|
46
|
-
const m = new Date(a), f = new Date(
|
47
|
-
if (m.setHours(0, 0, 0, 0), f.setHours(23, 59, 59, 999),
|
49
|
+
n.setHours(0, 0, 0, 0);
|
50
|
+
const m = new Date(a), f = new Date(p);
|
51
|
+
if (m.setHours(0, 0, 0, 0), f.setHours(23, 59, 59, 999), n < m || n > f)
|
48
52
|
return !0;
|
49
53
|
}
|
50
|
-
if (Y && Y.getFullYear() > t ||
|
54
|
+
if (Y && Y.getFullYear() > t || M && t > s || S && t < s)
|
51
55
|
return !0;
|
52
|
-
if (
|
56
|
+
if (r) {
|
53
57
|
const a = new Date(t, e.m - 1, e.d);
|
54
|
-
if (!
|
55
|
-
const
|
56
|
-
return
|
58
|
+
if (!r(a)) return !1;
|
59
|
+
const p = new Date(t, 2, 15), n = new Date(t, 5, 15), m = new Date(t, 8, 15), f = new Date(t, 11, 15);
|
60
|
+
return r(p) && r(n) && r(m) && r(f);
|
57
61
|
}
|
58
62
|
return !1;
|
59
|
-
},
|
60
|
-
|
63
|
+
}, I = (t) => {
|
64
|
+
x(t) || (g ? g(t) : E(
|
61
65
|
/* @__PURE__ */ new Date(
|
62
|
-
`${t}-${
|
66
|
+
`${t}-${_.Number(2, e.m)}-${_.Number(2, e.d)}`
|
63
67
|
)
|
64
68
|
));
|
65
69
|
};
|
66
|
-
return /* @__PURE__ */
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
iconName: "DropdownArrowLeft16px",
|
73
|
-
onClick: H,
|
74
|
-
variant: "secondary-gray",
|
75
|
-
size: "l"
|
76
|
-
}
|
70
|
+
return /* @__PURE__ */ F(
|
71
|
+
"div",
|
72
|
+
{
|
73
|
+
className: P(
|
74
|
+
o["calendar-block"],
|
75
|
+
o[`calendar-block--position-${Q}`]
|
77
76
|
),
|
78
|
-
|
79
|
-
|
80
|
-
{
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
},
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
77
|
+
ref: G,
|
78
|
+
children: [
|
79
|
+
/* @__PURE__ */ F("div", { className: o.h, children: [
|
80
|
+
/* @__PURE__ */ c(
|
81
|
+
v,
|
82
|
+
{
|
83
|
+
isIconButton: !0,
|
84
|
+
iconName: "DropdownArrowLeft16px",
|
85
|
+
onClick: z,
|
86
|
+
variant: "secondary-gray",
|
87
|
+
size: "l"
|
88
|
+
}
|
89
|
+
),
|
90
|
+
/* @__PURE__ */ c(
|
91
|
+
"button",
|
92
|
+
{
|
93
|
+
type: "button",
|
94
|
+
onClick: () => l == null ? void 0 : l("years"),
|
95
|
+
className: o.d
|
96
|
+
}
|
97
|
+
),
|
98
|
+
/* @__PURE__ */ c(
|
99
|
+
v,
|
100
|
+
{
|
101
|
+
isIconButton: !0,
|
102
|
+
iconName: "DropdownArrowRight16px",
|
103
|
+
onClick: j,
|
104
|
+
variant: "secondary-gray",
|
105
|
+
size: "l"
|
106
|
+
}
|
107
|
+
)
|
108
|
+
] }),
|
109
|
+
/* @__PURE__ */ c("div", { className: o.monthGrid, "data-testid": "year-picker", children: R.map((t, b) => {
|
110
|
+
const s = x(t);
|
111
|
+
return /* @__PURE__ */ c(
|
112
|
+
"button",
|
113
|
+
{
|
114
|
+
type: "button",
|
115
|
+
onClick: () => I(t),
|
116
|
+
disabled: s,
|
117
|
+
className: P(
|
118
|
+
s ? o.m : o.a,
|
119
|
+
{
|
120
|
+
[o.current]: B.y === t
|
121
|
+
},
|
122
|
+
{
|
123
|
+
[o.selecte]: d && $.y === t
|
124
|
+
}
|
125
|
+
),
|
126
|
+
children: t
|
127
|
+
},
|
128
|
+
b
|
129
|
+
);
|
130
|
+
}) })
|
131
|
+
]
|
132
|
+
}
|
133
|
+
);
|
114
134
|
};
|
115
135
|
export {
|
116
|
-
|
136
|
+
T as YearPickerModal
|
117
137
|
};
|
@@ -10,6 +10,7 @@ export declare enum EDatePickerValue {
|
|
10
10
|
CurrentDate = "20240510",
|
11
11
|
CurrentDate3 = "2024-09-10"
|
12
12
|
}
|
13
|
+
export type TCalendarBlockPosition = 'top' | 'medium' | 'bottom';
|
13
14
|
export declare const BLOCK_WIDTH = 368;
|
14
15
|
export declare const COUNT_WORK_DAYS = 4;
|
15
16
|
export declare const MAX_DAY = 31;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
var n = /* @__PURE__ */ ((t) => (t.CurrentDate1 = "2024-08-01", t.CurrentDate2 = "2024-07-01", t.CurrentDate3 = "1995-07-11", t))(n || {});
|
2
|
-
const s = ["
|
2
|
+
const s = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], C = [
|
3
3
|
"Январь",
|
4
4
|
"Февраль",
|
5
5
|
"Март",
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { DependencyList } from 'react';
|
2
|
+
import { TCalendarBlockPosition } from './constants';
|
2
3
|
|
3
|
-
export declare const useDatePickerPosition: (deps?: DependencyList) => import('react').RefObject<HTMLDivElement
|
4
|
+
export declare const useDatePickerPosition: (deps?: DependencyList) => (import('react').RefObject<HTMLDivElement> | TCalendarBlockPosition | null)[];
|
@@ -1,20 +1,20 @@
|
|
1
|
-
import { useRef as
|
1
|
+
import { useRef as w, useState as g, useLayoutEffect as H } from "react";
|
2
2
|
import { BLOCK_WIDTH as r } from "./constants.js";
|
3
|
-
const
|
4
|
-
const t =
|
5
|
-
return
|
6
|
-
var
|
7
|
-
const
|
3
|
+
const E = (d) => {
|
4
|
+
const t = w(null), [y, o] = g(null);
|
5
|
+
return H(() => {
|
6
|
+
var s, c, l, u, p, a;
|
7
|
+
const h = window.innerHeight, m = window.innerWidth;
|
8
8
|
if (t.current !== null) {
|
9
|
-
const
|
10
|
-
if (
|
11
|
-
const e =
|
9
|
+
const x = ((c = (s = t == null ? void 0 : t.current) == null ? void 0 : s.parentElement) == null ? void 0 : c.offsetWidth) ?? 0, f = ((u = (l = t == null ? void 0 : t.current) == null ? void 0 : l.parentElement) == null ? void 0 : u.offsetHeight) ?? 0, n = (a = (p = t == null ? void 0 : t.current) == null ? void 0 : p.parentElement) == null ? void 0 : a.getBoundingClientRect(), i = t.current.offsetHeight;
|
10
|
+
if (m < n.x + r) {
|
11
|
+
const e = x - r;
|
12
12
|
n.x - Math.abs(e) < 0 ? t.current.style.left = (e < 0 ? e / 2 : e) + "px" : t.current.style.left = e + "px";
|
13
13
|
}
|
14
|
-
|
14
|
+
h < n.y + i + f ? n.y - i > 0 ? (t.current.style.top = -i + "px", o("top")) : (t.current.style.position = "fixed", t.current.style.top = `calc(50vh - ${i / 2}px)`, t.current.style.left = `calc(50vw - ${r / 2}px)`, o("medium")) : (t.current.style.top = f + "px", o("bottom")), t.current.style.opacity = "1";
|
15
15
|
}
|
16
|
-
}, [
|
16
|
+
}, [d]), [t, y];
|
17
17
|
};
|
18
18
|
export {
|
19
|
-
|
19
|
+
E as useDatePickerPosition
|
20
20
|
};
|
@@ -1,38 +1,41 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as l, Fragment as L, jsx as t } from "react/jsx-runtime";
|
2
2
|
import { c as n } from "../../index-DIxK0V-G.js";
|
3
|
-
import { forwardRef as
|
4
|
-
import { EDrawerPosition as
|
5
|
-
import { useContainer as
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
"
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
3
|
+
import { forwardRef as ne, useState as p, useRef as M, useEffect as R, useCallback as g } from "react";
|
4
|
+
import { EDrawerPosition as H } from "./constants.js";
|
5
|
+
import { useContainer as re } from "./hooks.js";
|
6
|
+
import { ScrollWrapper as se } from "./ScrollWrapper/ScrollWrapper.js";
|
7
|
+
import { useMediaQuery as ae } from "../../hooks/useMediaQuery/useMediaQuery.js";
|
8
|
+
import { EMediaQuery as ie } from "../../hooks/useMediaQuery/constants.js";
|
9
|
+
import { useLockBodyScroll as le } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
|
10
|
+
import { useResizeObserver as ce } from "../../hooks/useResizeObserver/useResizeObserver.js";
|
11
|
+
import { Button as T } from "../Button/Button.js";
|
12
|
+
import { EButtonVariantDefault as de, EButtonSize as c } from "../Button/constants.js";
|
13
|
+
import { Loader as ue } from "../Loader/Loader.js";
|
14
|
+
import { Portal as me } from "../Portal/Portal.js";
|
15
|
+
import { EScrollBarVariant as fe, EScrollBarSize as _e } from "../ScrollBar/constants.js";
|
16
|
+
import '../../assets/Drawer.css';const he = "_drawer_1btea_2", be = "_content_1btea_26", pe = "_header_1btea_45", ge = "_title_1btea_58", ye = "_space_1btea_74", ve = "_inner_1btea_82", Ce = "_button_1btea_87", we = "_footer_1btea_92", Ne = "_left_1btea_109", ke = "_right_1btea_113", Se = "_full_1btea_117", Be = "_bottom_1btea_127", Ee = "_opened_1btea_144", ze = "_overlay_1btea_208", Ie = "_unmount_1btea_224", e = {
|
17
|
+
drawer: he,
|
18
|
+
content: be,
|
19
|
+
"is-loading": "_is-loading_1btea_41",
|
20
|
+
header: pe,
|
21
|
+
"sticky-header": "_sticky-header_1btea_52",
|
22
|
+
title: ge,
|
23
|
+
space: ye,
|
24
|
+
inner: ve,
|
25
|
+
button: Ce,
|
26
|
+
footer: we,
|
27
|
+
"has-scroll": "_has-scroll_1btea_102",
|
28
|
+
"footer-button": "_footer-button_1btea_105",
|
29
|
+
left: Ne,
|
30
|
+
right: ke,
|
31
|
+
full: Se,
|
32
|
+
bottom: Be,
|
33
|
+
"full-bottom-height": "_full-bottom-height_1btea_138",
|
34
|
+
opened: Ee,
|
35
|
+
"is-closing": "_is-closing_1btea_165",
|
36
|
+
overlay: ze,
|
37
|
+
unmount: Ie
|
38
|
+
}, Oe = 300, Le = (d) => d ? {
|
36
39
|
drawer: {
|
37
40
|
position: "absolute",
|
38
41
|
zIndex: 100
|
@@ -41,120 +44,151 @@ import '../../assets/Drawer.css';const ae = "_drawer_13ua6_2", ie = "_content_13
|
|
41
44
|
position: "absolute",
|
42
45
|
zIndex: 90
|
43
46
|
}
|
44
|
-
} : {},
|
45
|
-
(
|
47
|
+
} : {}, Ye = ne(
|
48
|
+
(d, x) => {
|
46
49
|
const {
|
47
|
-
as:
|
48
|
-
isOpen:
|
49
|
-
onClose:
|
50
|
-
title:
|
51
|
-
className:
|
52
|
-
unmount:
|
53
|
-
isLoading:
|
54
|
-
stickyHeader:
|
55
|
-
fullBottomHeight:
|
56
|
-
position:
|
57
|
-
paddingRight:
|
58
|
-
footer:
|
59
|
-
children:
|
60
|
-
classNameTitle:
|
61
|
-
classNameHeader:
|
62
|
-
classNameInner:
|
63
|
-
classNameContent:
|
64
|
-
classNameFooter:
|
65
|
-
closeOnClickOutside:
|
66
|
-
showCloseButton:
|
67
|
-
getContainer:
|
68
|
-
...
|
69
|
-
} =
|
70
|
-
enabled:
|
71
|
-
}),
|
72
|
-
|
73
|
-
|
74
|
-
|
50
|
+
as: D = "div",
|
51
|
+
isOpen: r,
|
52
|
+
onClose: u,
|
53
|
+
title: A,
|
54
|
+
className: P,
|
55
|
+
unmount: y = !0,
|
56
|
+
isLoading: a = !1,
|
57
|
+
stickyHeader: X,
|
58
|
+
fullBottomHeight: j = !1,
|
59
|
+
position: m = H.RIGHT,
|
60
|
+
paddingRight: F = 8,
|
61
|
+
footer: f,
|
62
|
+
children: G,
|
63
|
+
classNameTitle: Q,
|
64
|
+
classNameHeader: V,
|
65
|
+
classNameInner: W,
|
66
|
+
classNameContent: K,
|
67
|
+
classNameFooter: Y,
|
68
|
+
closeOnClickOutside: v = !0,
|
69
|
+
showCloseButton: C = !0,
|
70
|
+
getContainer: _,
|
71
|
+
...q
|
72
|
+
} = d, [w, N] = p(!1), [J, k] = p(!1), S = M(), h = ae(ie.XS1), { ref: U } = ce({
|
73
|
+
enabled: m === H.BOTTOM
|
74
|
+
}), B = re(_), s = M(null), [Z, $] = p(!1);
|
75
|
+
R(() => {
|
76
|
+
const i = () => {
|
77
|
+
if (s.current) {
|
78
|
+
const { scrollHeight: te, clientHeight: oe } = s.current;
|
79
|
+
$(te > oe);
|
80
|
+
}
|
81
|
+
};
|
82
|
+
i();
|
83
|
+
const O = new ResizeObserver(i);
|
84
|
+
return s.current && O.observe(s.current), () => {
|
85
|
+
O.disconnect();
|
86
|
+
};
|
87
|
+
}, [r, a]), le({
|
88
|
+
on: r && !w,
|
89
|
+
paddingRight: F
|
75
90
|
});
|
76
|
-
const o =
|
77
|
-
|
78
|
-
|
79
|
-
},
|
80
|
-
}, [
|
81
|
-
|
82
|
-
}, [
|
83
|
-
(
|
84
|
-
|
91
|
+
const o = g(() => {
|
92
|
+
u && (N(!0), S.current = setTimeout(() => {
|
93
|
+
u(), N(!1);
|
94
|
+
}, Oe));
|
95
|
+
}, [u]), ee = g(() => {
|
96
|
+
v && o();
|
97
|
+
}, [v, o]), b = g(
|
98
|
+
(i) => {
|
99
|
+
i.key === "Escape" && o();
|
85
100
|
},
|
86
101
|
[o]
|
87
102
|
);
|
88
|
-
|
89
|
-
|
90
|
-
}), [
|
91
|
-
const
|
92
|
-
[e.opened]:
|
93
|
-
[e["is-closing"]]:
|
94
|
-
[e["full-bottom-height"]]:
|
95
|
-
[e["is-loading"]]:
|
103
|
+
R(() => (r && (k(!0), window.addEventListener("keydown", b)), () => {
|
104
|
+
k(!1), clearTimeout(S.current), window.removeEventListener("keydown", b);
|
105
|
+
}), [r, b]);
|
106
|
+
const E = {
|
107
|
+
[e.opened]: J,
|
108
|
+
[e["is-closing"]]: w,
|
109
|
+
[e["full-bottom-height"]]: j,
|
110
|
+
[e["is-loading"]]: a
|
96
111
|
};
|
97
|
-
if (!
|
112
|
+
if (!r && y)
|
98
113
|
return null;
|
99
|
-
const
|
100
|
-
/* @__PURE__ */
|
101
|
-
|
114
|
+
const z = Le(_ !== void 0 && _ !== !1), I = /* @__PURE__ */ l(L, { children: [
|
115
|
+
/* @__PURE__ */ l(
|
116
|
+
D,
|
102
117
|
{
|
103
|
-
ref:
|
104
|
-
"aria-hidden": !
|
118
|
+
ref: x,
|
119
|
+
"aria-hidden": !r,
|
105
120
|
role: "dialog",
|
106
|
-
style:
|
107
|
-
className: n(e.drawer, e[
|
108
|
-
...
|
109
|
-
children:
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
[e["is-loading"]]: !!l
|
119
|
-
}
|
120
|
-
),
|
121
|
-
children: l ? /* @__PURE__ */ t(se, {}) : /* @__PURE__ */ f(I, { children: [
|
122
|
-
/* @__PURE__ */ f(
|
123
|
-
"header",
|
121
|
+
style: z.drawer,
|
122
|
+
className: n(e.drawer, e[m], E, P),
|
123
|
+
...q,
|
124
|
+
children: [
|
125
|
+
/* @__PURE__ */ t(
|
126
|
+
"section",
|
127
|
+
{
|
128
|
+
ref: U,
|
129
|
+
className: n(
|
130
|
+
e.content,
|
131
|
+
K,
|
132
|
+
e[m],
|
124
133
|
{
|
125
|
-
|
126
|
-
[e["sticky-header"]]: z
|
127
|
-
}),
|
128
|
-
children: [
|
129
|
-
/* @__PURE__ */ t("h2", { className: n(e.title, P), children: T }),
|
130
|
-
/* @__PURE__ */ t("div", { className: e.space, children: g && /* @__PURE__ */ t(
|
131
|
-
S,
|
132
|
-
{
|
133
|
-
variant: ne.SecondaryWhite,
|
134
|
-
isIconButton: !0,
|
135
|
-
size: m ? r.S : r.M,
|
136
|
-
iconName: "Close16px",
|
137
|
-
onClick: o,
|
138
|
-
className: e.button
|
139
|
-
}
|
140
|
-
) })
|
141
|
-
]
|
134
|
+
[e["is-loading"]]: !!a
|
142
135
|
}
|
143
136
|
),
|
144
|
-
/* @__PURE__ */ t(
|
145
|
-
|
146
|
-
|
137
|
+
children: a ? /* @__PURE__ */ t(ue, {}) : /* @__PURE__ */ l(L, { children: [
|
138
|
+
/* @__PURE__ */ l(
|
139
|
+
"header",
|
140
|
+
{
|
141
|
+
className: n(e.header, V, {
|
142
|
+
[e["sticky-header"]]: X
|
143
|
+
}),
|
144
|
+
children: [
|
145
|
+
/* @__PURE__ */ t("h2", { className: n(e.title, Q), children: A }),
|
146
|
+
/* @__PURE__ */ t("div", { className: e.space, children: C && /* @__PURE__ */ t(
|
147
|
+
T,
|
148
|
+
{
|
149
|
+
variant: de.SecondaryWhite,
|
150
|
+
isIconButton: !0,
|
151
|
+
size: h ? c.S : c.M,
|
152
|
+
iconName: "Close16px",
|
153
|
+
onClick: o,
|
154
|
+
className: e.button
|
155
|
+
}
|
156
|
+
) })
|
157
|
+
]
|
158
|
+
}
|
159
|
+
),
|
160
|
+
/* @__PURE__ */ t(
|
161
|
+
se,
|
162
|
+
{
|
163
|
+
ref: s,
|
164
|
+
className: n(e.inner, W),
|
165
|
+
variant: fe.LIGHT,
|
166
|
+
size: _e.M,
|
167
|
+
children: G
|
168
|
+
}
|
169
|
+
)
|
170
|
+
] })
|
171
|
+
}
|
172
|
+
),
|
173
|
+
/* @__PURE__ */ t(
|
174
|
+
"footer",
|
175
|
+
{
|
176
|
+
className: n(e.footer, Y, {
|
177
|
+
[e["has-scroll"]]: Z
|
178
|
+
}),
|
179
|
+
children: typeof f == "function" ? f({ handleClose: o }) : f || C && /* @__PURE__ */ t(
|
180
|
+
T,
|
147
181
|
{
|
148
|
-
size:
|
149
|
-
full:
|
182
|
+
size: h ? c.L : c.XXL,
|
183
|
+
full: h,
|
150
184
|
onClick: o,
|
151
185
|
className: e["footer-button"],
|
152
186
|
children: "Закрыть"
|
153
187
|
}
|
154
|
-
)
|
155
|
-
|
156
|
-
|
157
|
-
|
188
|
+
)
|
189
|
+
}
|
190
|
+
)
|
191
|
+
]
|
158
192
|
}
|
159
193
|
),
|
160
194
|
/* @__PURE__ */ t(
|
@@ -163,20 +197,20 @@ import '../../assets/Drawer.css';const ae = "_drawer_13ua6_2", ie = "_content_13
|
|
163
197
|
className: n(
|
164
198
|
e.overlay,
|
165
199
|
{
|
166
|
-
[e.unmount]: !
|
200
|
+
[e.unmount]: !y
|
167
201
|
},
|
168
|
-
|
202
|
+
E
|
169
203
|
),
|
170
|
-
style:
|
204
|
+
style: z.overlay,
|
171
205
|
"data-testid": "drawer-overlay",
|
172
|
-
onClick:
|
206
|
+
onClick: ee
|
173
207
|
}
|
174
208
|
)
|
175
209
|
] });
|
176
|
-
return
|
210
|
+
return B === !1 ? I : /* @__PURE__ */ t(me, { element: B, children: I });
|
177
211
|
}
|
178
212
|
);
|
179
213
|
export {
|
180
|
-
|
181
|
-
|
214
|
+
Oe as ANIMATION_DELAY,
|
215
|
+
Ye as Drawer
|
182
216
|
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { default as React } from 'react';
|
2
|
+
import { EScrollBarSize, EScrollBarVariant } from '../../ScrollBar/constants';
|
3
|
+
|
4
|
+
type Props = {
|
5
|
+
children: React.ReactNode;
|
6
|
+
className?: string;
|
7
|
+
variant?: `${EScrollBarVariant}`;
|
8
|
+
size?: `${EScrollBarSize}`;
|
9
|
+
};
|
10
|
+
export declare const ScrollWrapper: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
11
|
+
export {};
|