mimir-ui-kit 1.43.17 → 1.43.19
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/assets/Drawer.css +1 -1
- package/dist/assets/index2.css +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +8 -0
- package/dist/components/DatePicker/DatePicker.js +296 -185
- package/dist/components/DatePicker/DatePickerModal.d.ts +2 -1
- package/dist/components/DatePicker/DatePickerModal.js +62 -61
- package/dist/components/DatePicker/MonthPickerModal.d.ts +2 -1
- package/dist/components/DatePicker/MonthPickerModal.js +50 -49
- package/dist/components/Drawer/Drawer.js +177 -137
- package/dist/components/Drawer/ScrollWrapper/index.d.ts +11 -0
- package/dist/components/Drawer/ScrollWrapper/index.js +27 -0
- package/package.json +1 -1
@@ -1,38 +1,41 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as a, Fragment as oe, 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 z, useRef as L, useEffect as M, useCallback as g } from "react";
|
4
|
+
import { EDrawerPosition as R } from "./constants.js";
|
5
|
+
import { useContainer as re } from "./hooks.js";
|
6
|
+
import { ScrollWrapper as se } from "./ScrollWrapper/index.js";
|
7
|
+
import { useMediaQuery as ie } from "../../hooks/useMediaQuery/useMediaQuery.js";
|
8
|
+
import { EMediaQuery as le } from "../../hooks/useMediaQuery/constants.js";
|
9
|
+
import { useLockBodyScroll as ae } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
|
10
|
+
import { useResizeObserver as ce } from "../../hooks/useResizeObserver/useResizeObserver.js";
|
11
|
+
import { Button as H } from "../Button/Button.js";
|
12
|
+
import { EButtonVariantDefault as ue, EButtonSize as c } from "../Button/constants.js";
|
13
|
+
import { Loader as me } from "../Loader/Loader.js";
|
14
|
+
import { Portal as de } from "../Portal/Portal.js";
|
15
|
+
import { EScrollBarVariant as fe, EScrollBarSize as _e } from "../ScrollBar/constants.js";
|
16
|
+
import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14uzm_26", ze = "_header_14uzm_45", ge = "_title_14uzm_59", ye = "_space_14uzm_73", ve = "_inner_14uzm_84", be = "_button_14uzm_95", Ce = "_footer_14uzm_100", we = "_left_14uzm_116", Ne = "_right_14uzm_120", ke = "_full_14uzm_124", Se = "_bottom_14uzm_134", Be = "_opened_14uzm_151", Ee = "_overlay_14uzm_207", Ie = "_unmount_14uzm_223", e = {
|
17
|
+
drawer: he,
|
18
|
+
content: pe,
|
19
|
+
"is-loading": "_is-loading_14uzm_41",
|
20
|
+
header: ze,
|
21
|
+
"sticky-header": "_sticky-header_14uzm_53",
|
22
|
+
title: ge,
|
23
|
+
space: ye,
|
24
|
+
inner: ve,
|
25
|
+
button: be,
|
26
|
+
footer: Ce,
|
27
|
+
"has-scroll": "_has-scroll_14uzm_109",
|
28
|
+
"footer-button": "_footer-button_14uzm_112",
|
29
|
+
left: we,
|
30
|
+
right: Ne,
|
31
|
+
full: ke,
|
32
|
+
bottom: Se,
|
33
|
+
"full-bottom-height": "_full-bottom-height_14uzm_145",
|
34
|
+
opened: Be,
|
35
|
+
"is-closing": "_is-closing_14uzm_170",
|
36
|
+
overlay: Ee,
|
37
|
+
unmount: Ie
|
38
|
+
}, Oe = 300, Le = (u) => u ? {
|
36
39
|
drawer: {
|
37
40
|
position: "absolute",
|
38
41
|
zIndex: 100
|
@@ -41,120 +44,157 @@ 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
|
+
(u, T) => {
|
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: x = "div",
|
51
|
+
isOpen: r,
|
52
|
+
onClose: m,
|
53
|
+
title: D,
|
54
|
+
className: A,
|
55
|
+
unmount: y = !0,
|
56
|
+
isLoading: s = !1,
|
57
|
+
stickyHeader: P,
|
58
|
+
fullBottomHeight: X = !1,
|
59
|
+
position: d = R.RIGHT,
|
60
|
+
paddingRight: j = 8,
|
61
|
+
footer: f,
|
62
|
+
children: F,
|
63
|
+
classNameTitle: G,
|
64
|
+
classNameHeader: Q,
|
65
|
+
classNameInner: V,
|
66
|
+
classNameContent: W,
|
67
|
+
classNameFooter: K,
|
68
|
+
closeOnClickOutside: v = !0,
|
69
|
+
showCloseButton: b = !0,
|
70
|
+
getContainer: _,
|
71
|
+
...Y
|
72
|
+
} = u, [C, w] = z(!1), [q, N] = z(!1), k = L(), h = ie(le.XS1), { ref: J } = ce({
|
73
|
+
enabled: d === R.BOTTOM
|
74
|
+
}), S = re(_), i = L(null), [U, Z] = z(!1);
|
75
|
+
M(() => {
|
76
|
+
const l = () => {
|
77
|
+
if (i.current) {
|
78
|
+
const { scrollHeight: ee, clientHeight: te } = i.current;
|
79
|
+
Z(ee > te);
|
80
|
+
}
|
81
|
+
};
|
82
|
+
l();
|
83
|
+
const O = new ResizeObserver(l);
|
84
|
+
return i.current && O.observe(i.current), () => {
|
85
|
+
O.disconnect();
|
86
|
+
};
|
87
|
+
}, [r, s]), ae({
|
88
|
+
on: r && !C,
|
89
|
+
paddingRight: j
|
75
90
|
});
|
76
|
-
const o =
|
77
|
-
|
78
|
-
|
79
|
-
},
|
80
|
-
}, [
|
81
|
-
|
82
|
-
}, [
|
83
|
-
(
|
84
|
-
|
91
|
+
const o = g(() => {
|
92
|
+
m && (w(!0), k.current = setTimeout(() => {
|
93
|
+
m(), w(!1);
|
94
|
+
}, Oe));
|
95
|
+
}, [m]), $ = g(() => {
|
96
|
+
v && o();
|
97
|
+
}, [v, o]), p = g(
|
98
|
+
(l) => {
|
99
|
+
l.key === "Escape" && o();
|
85
100
|
},
|
86
101
|
[o]
|
87
102
|
);
|
88
|
-
|
89
|
-
N(!1), clearTimeout(
|
90
|
-
}), [
|
91
|
-
const
|
92
|
-
[e.opened]:
|
103
|
+
M(() => (r && (N(!0), window.addEventListener("keydown", p)), () => {
|
104
|
+
N(!1), clearTimeout(k.current), window.removeEventListener("keydown", p);
|
105
|
+
}), [r, p]);
|
106
|
+
const B = {
|
107
|
+
[e.opened]: q,
|
93
108
|
[e["is-closing"]]: C,
|
94
|
-
[e["full-bottom-height"]]:
|
95
|
-
[e["is-loading"]]:
|
109
|
+
[e["full-bottom-height"]]: X,
|
110
|
+
[e["is-loading"]]: s
|
96
111
|
};
|
97
|
-
if (!
|
112
|
+
if (!r && y)
|
98
113
|
return null;
|
99
|
-
const
|
100
|
-
/* @__PURE__ */
|
101
|
-
|
114
|
+
const E = Le(_ !== void 0 && _ !== !1), I = /* @__PURE__ */ a(oe, { children: [
|
115
|
+
/* @__PURE__ */ a(
|
116
|
+
x,
|
102
117
|
{
|
103
|
-
ref:
|
104
|
-
"aria-hidden": !
|
118
|
+
ref: T,
|
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: E.drawer,
|
122
|
+
className: n(e.drawer, e[d], B, A),
|
123
|
+
...Y,
|
124
|
+
children: [
|
125
|
+
/* @__PURE__ */ a(
|
126
|
+
"section",
|
127
|
+
{
|
128
|
+
ref: J,
|
129
|
+
className: n(
|
130
|
+
e.content,
|
131
|
+
W,
|
132
|
+
e[d],
|
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"]]: !!s
|
142
135
|
}
|
143
136
|
),
|
144
|
-
|
145
|
-
|
146
|
-
|
137
|
+
children: [
|
138
|
+
/* @__PURE__ */ a(
|
139
|
+
"header",
|
140
|
+
{
|
141
|
+
className: n(e.header, Q, {
|
142
|
+
[e["sticky-header"]]: P
|
143
|
+
}),
|
144
|
+
children: [
|
145
|
+
/* @__PURE__ */ t("h2", { className: n(e.title, G), children: D }),
|
146
|
+
/* @__PURE__ */ t("div", { className: e.space, children: b && /* @__PURE__ */ t(
|
147
|
+
H,
|
148
|
+
{
|
149
|
+
variant: ue.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: i,
|
164
|
+
className: n(
|
165
|
+
e.inner,
|
166
|
+
{
|
167
|
+
[e["is-loading"]]: !!s
|
168
|
+
},
|
169
|
+
V
|
170
|
+
),
|
171
|
+
variant: fe.LIGHT,
|
172
|
+
size: _e.M,
|
173
|
+
children: s ? /* @__PURE__ */ t(me, {}) : F
|
174
|
+
}
|
175
|
+
)
|
176
|
+
]
|
177
|
+
}
|
178
|
+
),
|
179
|
+
/* @__PURE__ */ t(
|
180
|
+
"footer",
|
181
|
+
{
|
182
|
+
className: n(e.footer, K, {
|
183
|
+
[e["has-scroll"]]: U
|
184
|
+
}),
|
185
|
+
children: typeof f == "function" ? f({ handleClose: o }) : f || b && /* @__PURE__ */ t(
|
186
|
+
H,
|
147
187
|
{
|
148
|
-
size:
|
149
|
-
full:
|
188
|
+
size: h ? c.L : c.XXL,
|
189
|
+
full: h,
|
150
190
|
onClick: o,
|
151
191
|
className: e["footer-button"],
|
152
192
|
children: "Закрыть"
|
153
193
|
}
|
154
|
-
)
|
155
|
-
|
156
|
-
|
157
|
-
|
194
|
+
)
|
195
|
+
}
|
196
|
+
)
|
197
|
+
]
|
158
198
|
}
|
159
199
|
),
|
160
200
|
/* @__PURE__ */ t(
|
@@ -163,20 +203,20 @@ import '../../assets/Drawer.css';const ae = "_drawer_13ua6_2", ie = "_content_13
|
|
163
203
|
className: n(
|
164
204
|
e.overlay,
|
165
205
|
{
|
166
|
-
[e.unmount]: !
|
206
|
+
[e.unmount]: !y
|
167
207
|
},
|
168
|
-
|
208
|
+
B
|
169
209
|
),
|
170
|
-
style:
|
210
|
+
style: E.overlay,
|
171
211
|
"data-testid": "drawer-overlay",
|
172
|
-
onClick:
|
212
|
+
onClick: $
|
173
213
|
}
|
174
214
|
)
|
175
215
|
] });
|
176
|
-
return
|
216
|
+
return S === !1 ? I : /* @__PURE__ */ t(de, { element: S, children: I });
|
177
217
|
}
|
178
218
|
);
|
179
219
|
export {
|
180
|
-
|
181
|
-
|
220
|
+
Oe as ANIMATION_DELAY,
|
221
|
+
Ye as Drawer
|
182
222
|
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { default as React } from 'react';
|
2
|
+
import { EScrollBarSize, EScrollBarVariant } from '../../ScrollBar/constants';
|
3
|
+
|
4
|
+
type TProps = {
|
5
|
+
children: React.ReactNode;
|
6
|
+
className?: string;
|
7
|
+
variant?: `${EScrollBarVariant}`;
|
8
|
+
size?: `${EScrollBarSize}`;
|
9
|
+
};
|
10
|
+
export declare const ScrollWrapper: React.ForwardRefExoticComponent<TProps & React.RefAttributes<HTMLDivElement>>;
|
11
|
+
export {};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
2
|
+
import { c as t } from "../../../index-DIxK0V-G.js";
|
3
|
+
import { forwardRef as i } from "react";
|
4
|
+
import { EScrollBarVariant as e, EScrollBarSize as m } from "../../ScrollBar/constants.js";
|
5
|
+
import '../../../assets/index2.css';const n = {
|
6
|
+
"scroll-container": "_scroll-container_7yixd_2"
|
7
|
+
}, p = i(
|
8
|
+
({
|
9
|
+
children: r,
|
10
|
+
className: a,
|
11
|
+
variant: o = e.LIGHT,
|
12
|
+
size: l = m.M
|
13
|
+
}, c) => /* @__PURE__ */ s(
|
14
|
+
"div",
|
15
|
+
{
|
16
|
+
ref: c,
|
17
|
+
className: t(n["scroll-container"], a),
|
18
|
+
"data-variant": o,
|
19
|
+
"data-size": l,
|
20
|
+
children: r
|
21
|
+
}
|
22
|
+
)
|
23
|
+
);
|
24
|
+
p.displayName = "ScrollWrapper";
|
25
|
+
export {
|
26
|
+
p as ScrollWrapper
|
27
|
+
};
|