mimir-ui-kit 1.64.4 → 1.65.0
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/components/DatePicker/DatePicker.d.ts +5 -4
- package/dist/components/DatePicker/DatePicker.js +195 -194
- package/dist/components/Drawer/Drawer.js +79 -78
- package/dist/components/Drawer/constants.d.ts +2 -1
- package/dist/components/Drawer/constants.js +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +11 -2
- package/dist/components/Dropdown/Dropdown.js +374 -358
- package/dist/components/Dropdown/hooks.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "../../index-DIxK0V-G.js";
|
|
3
|
+
import { forwardRef as re, useState as C, useRef as x, useEffect as D, useCallback as w } from "react";
|
|
4
4
|
import { EDrawerPosition as A } from "./constants.js";
|
|
5
|
-
import { useContainer as
|
|
5
|
+
import { useContainer as se } from "./hooks.js";
|
|
6
6
|
import { ScrollWrapper as ie } from "./ScrollWrapper/index.js";
|
|
7
|
-
import { useMediaQuery as
|
|
7
|
+
import { useMediaQuery as ae } from "../../hooks/useMediaQuery/useMediaQuery.js";
|
|
8
8
|
import { EMediaQuery as le } from "../../hooks/useMediaQuery/constants.js";
|
|
9
|
-
import { useLockBodyScroll as
|
|
9
|
+
import { useLockBodyScroll as ce } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
|
|
10
10
|
import { useResizeObserver as ue } from "../../hooks/useResizeObserver/useResizeObserver.js";
|
|
11
11
|
import { Button as P } from "../Button/Button.js";
|
|
12
12
|
import { EButtonVariantDefault as de, EButtonSize as u } from "../Button/constants.js";
|
|
13
13
|
import { Loader as me } from "../Loader/Loader.js";
|
|
14
|
-
import { Portal as
|
|
15
|
-
import { EScrollBarVariant as
|
|
16
|
-
import '../../assets/Drawer.css';const he = "
|
|
14
|
+
import { Portal as _e } from "../Portal/Portal.js";
|
|
15
|
+
import { EScrollBarVariant as fe, EScrollBarSize as be } from "../ScrollBar/constants.js";
|
|
16
|
+
import '../../assets/Drawer.css';const he = "_drawerContainer_abn3o_2", pe = "_drawer_abn3o_2", Ce = "_content_abn3o_31", we = "_header_abn3o_46", ye = "_title_abn3o_60", ge = "_space_abn3o_74", ve = "_inner_abn3o_85", Ne = "_button_abn3o_101", ke = "_footer_abn3o_106", Se = "_left_abn3o_122", Be = "_right_abn3o_126", Ee = "_center_abn3o_130", ze = "_full_abn3o_139", Oe = "_bottom_abn3o_149", Le = "_opened_abn3o_166", He = "_overlay_abn3o_230", xe = "_unmount_abn3o_248", e = {
|
|
17
17
|
drawerContainer: he,
|
|
18
|
-
drawer:
|
|
18
|
+
drawer: pe,
|
|
19
19
|
content: Ce,
|
|
20
20
|
header: we,
|
|
21
|
-
"sticky-header": "_sticky-
|
|
21
|
+
"sticky-header": "_sticky-header_abn3o_54",
|
|
22
22
|
title: ye,
|
|
23
23
|
space: ge,
|
|
24
24
|
inner: ve,
|
|
25
|
-
"is-loading": "_is-
|
|
26
|
-
button:
|
|
27
|
-
footer:
|
|
28
|
-
"has-scroll": "_has-
|
|
29
|
-
"footer-button": "_footer-
|
|
30
|
-
left:
|
|
31
|
-
right:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
"is-loading": "_is-loading_abn3o_90",
|
|
26
|
+
button: Ne,
|
|
27
|
+
footer: ke,
|
|
28
|
+
"has-scroll": "_has-scroll_abn3o_115",
|
|
29
|
+
"footer-button": "_footer-button_abn3o_118",
|
|
30
|
+
left: Se,
|
|
31
|
+
right: Be,
|
|
32
|
+
center: Ee,
|
|
33
|
+
full: ze,
|
|
34
|
+
bottom: Oe,
|
|
35
|
+
"full-bottom-height": "_full-bottom-height_abn3o_160",
|
|
36
|
+
opened: Le,
|
|
37
|
+
"is-closing": "_is-closing_abn3o_189",
|
|
38
|
+
overlay: He,
|
|
39
|
+
unmount: xe
|
|
40
|
+
}, De = 300, Ae = (d) => d ? {
|
|
40
41
|
drawer: {
|
|
41
42
|
position: "absolute",
|
|
42
43
|
zIndex: 100
|
|
@@ -45,11 +46,11 @@ import '../../assets/Drawer.css';const he = "_drawerContainer_zs4pc_2", ze = "_d
|
|
|
45
46
|
position: "absolute",
|
|
46
47
|
zIndex: 90
|
|
47
48
|
}
|
|
48
|
-
} : {},
|
|
49
|
+
} : {}, Ze = re(
|
|
49
50
|
(d, X) => {
|
|
50
51
|
const {
|
|
51
52
|
as: j = "div",
|
|
52
|
-
isOpen:
|
|
53
|
+
isOpen: s,
|
|
53
54
|
onClose: m,
|
|
54
55
|
title: G,
|
|
55
56
|
className: Q,
|
|
@@ -57,9 +58,9 @@ import '../../assets/Drawer.css';const he = "_drawerContainer_zs4pc_2", ze = "_d
|
|
|
57
58
|
isLoading: i = !1,
|
|
58
59
|
stickyHeader: V,
|
|
59
60
|
fullBottomHeight: W = !1,
|
|
60
|
-
position:
|
|
61
|
+
position: _ = A.RIGHT,
|
|
61
62
|
paddingRight: F = 8,
|
|
62
|
-
footer:
|
|
63
|
+
footer: f,
|
|
63
64
|
children: I,
|
|
64
65
|
classNameTitle: K,
|
|
65
66
|
classNameHeader: Y,
|
|
@@ -69,88 +70,88 @@ import '../../assets/Drawer.css';const he = "_drawerContainer_zs4pc_2", ze = "_d
|
|
|
69
70
|
classNameFooter: R,
|
|
70
71
|
closeOnClickOutside: g = !0,
|
|
71
72
|
showCloseButton: v = !0,
|
|
72
|
-
getContainer:
|
|
73
|
+
getContainer: b,
|
|
73
74
|
dataTestIdReactMap: o,
|
|
74
75
|
...U
|
|
75
|
-
} = d, [
|
|
76
|
-
enabled:
|
|
77
|
-
}),
|
|
76
|
+
} = d, [N, k] = C(!1), [Z, S] = C(!1), B = x(), h = ae(le.XS1), { ref: $ } = ue({
|
|
77
|
+
enabled: _ === A.BOTTOM
|
|
78
|
+
}), E = se(b), a = x(null), [T, ee] = C(!1);
|
|
78
79
|
D(() => {
|
|
79
80
|
const l = () => {
|
|
80
|
-
if (
|
|
81
|
-
const { scrollHeight: te, clientHeight:
|
|
82
|
-
ee(te >
|
|
81
|
+
if (a.current) {
|
|
82
|
+
const { scrollHeight: te, clientHeight: ne } = a.current;
|
|
83
|
+
ee(te > ne);
|
|
83
84
|
}
|
|
84
85
|
};
|
|
85
86
|
l();
|
|
86
87
|
const H = new ResizeObserver(l);
|
|
87
|
-
return
|
|
88
|
+
return a.current && H.observe(a.current), () => {
|
|
88
89
|
H.disconnect();
|
|
89
90
|
};
|
|
90
|
-
}, [
|
|
91
|
-
on:
|
|
91
|
+
}, [s, i]), ce({
|
|
92
|
+
on: s && !N,
|
|
92
93
|
paddingRight: F
|
|
93
94
|
});
|
|
94
|
-
const
|
|
95
|
-
m && (
|
|
96
|
-
m(),
|
|
97
|
-
},
|
|
95
|
+
const r = w(() => {
|
|
96
|
+
m && (k(!0), B.current = setTimeout(() => {
|
|
97
|
+
m(), k(!1);
|
|
98
|
+
}, De));
|
|
98
99
|
}, [m]), oe = w(() => {
|
|
99
|
-
g &&
|
|
100
|
-
}, [g,
|
|
100
|
+
g && r();
|
|
101
|
+
}, [g, r]), p = w(
|
|
101
102
|
(l) => {
|
|
102
|
-
l.key === "Escape" &&
|
|
103
|
+
l.key === "Escape" && r();
|
|
103
104
|
},
|
|
104
|
-
[
|
|
105
|
+
[r]
|
|
105
106
|
);
|
|
106
|
-
D(() => (
|
|
107
|
-
|
|
108
|
-
}), [
|
|
109
|
-
const
|
|
107
|
+
D(() => (s && (S(!0), window.addEventListener("keydown", p)), () => {
|
|
108
|
+
S(!1), clearTimeout(B.current), window.removeEventListener("keydown", p);
|
|
109
|
+
}), [s, p]);
|
|
110
|
+
const z = {
|
|
110
111
|
[e.opened]: Z,
|
|
111
|
-
[e["is-closing"]]:
|
|
112
|
+
[e["is-closing"]]: N,
|
|
112
113
|
[e["full-bottom-height"]]: W,
|
|
113
114
|
[e["is-loading"]]: i
|
|
114
115
|
};
|
|
115
|
-
if (!
|
|
116
|
+
if (!s && y)
|
|
116
117
|
return null;
|
|
117
|
-
const O =
|
|
118
|
+
const O = Ae(b !== void 0 && b !== !1), L = /* @__PURE__ */ c(
|
|
118
119
|
"div",
|
|
119
120
|
{
|
|
120
121
|
"data-testid-react": o == null ? void 0 : o.drawer,
|
|
121
|
-
className:
|
|
122
|
+
className: n(e.drawerContainer, J),
|
|
122
123
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ c(
|
|
124
125
|
j,
|
|
125
126
|
{
|
|
126
127
|
ref: X,
|
|
127
|
-
"aria-hidden": !
|
|
128
|
+
"aria-hidden": !s,
|
|
128
129
|
role: "dialog",
|
|
129
130
|
style: O.drawer,
|
|
130
|
-
className:
|
|
131
|
+
className: n(e.drawer, e[_], z, Q),
|
|
131
132
|
...U,
|
|
132
133
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ c(
|
|
134
135
|
"section",
|
|
135
136
|
{
|
|
136
137
|
ref: $,
|
|
137
|
-
className:
|
|
138
|
+
className: n(
|
|
138
139
|
e.content,
|
|
139
140
|
M,
|
|
140
|
-
e[
|
|
141
|
+
e[_],
|
|
141
142
|
{
|
|
142
143
|
[e["is-loading"]]: !!i
|
|
143
144
|
}
|
|
144
145
|
),
|
|
145
146
|
children: [
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ c(
|
|
147
148
|
"header",
|
|
148
149
|
{
|
|
149
|
-
className:
|
|
150
|
+
className: n(e.header, Y, {
|
|
150
151
|
[e["sticky-header"]]: V
|
|
151
152
|
}),
|
|
152
153
|
children: [
|
|
153
|
-
/* @__PURE__ */ t("h2", { className:
|
|
154
|
+
/* @__PURE__ */ t("h2", { className: n(e.title, K), children: G }),
|
|
154
155
|
/* @__PURE__ */ t("div", { className: e.space, children: v && /* @__PURE__ */ t(
|
|
155
156
|
P,
|
|
156
157
|
{
|
|
@@ -159,7 +160,7 @@ import '../../assets/Drawer.css';const he = "_drawerContainer_zs4pc_2", ze = "_d
|
|
|
159
160
|
isIconButton: !0,
|
|
160
161
|
size: h ? u.S : u.M,
|
|
161
162
|
iconName: "Close16px",
|
|
162
|
-
onClick:
|
|
163
|
+
onClick: r,
|
|
163
164
|
className: e.button
|
|
164
165
|
}
|
|
165
166
|
) })
|
|
@@ -169,16 +170,16 @@ import '../../assets/Drawer.css';const he = "_drawerContainer_zs4pc_2", ze = "_d
|
|
|
169
170
|
/* @__PURE__ */ t(
|
|
170
171
|
ie,
|
|
171
172
|
{
|
|
172
|
-
ref:
|
|
173
|
-
className:
|
|
173
|
+
ref: a,
|
|
174
|
+
className: n(
|
|
174
175
|
e.inner,
|
|
175
176
|
{
|
|
176
177
|
[e["is-loading"]]: !!i
|
|
177
178
|
},
|
|
178
179
|
q
|
|
179
180
|
),
|
|
180
|
-
variant:
|
|
181
|
-
size:
|
|
181
|
+
variant: fe.LIGHT,
|
|
182
|
+
size: be.M,
|
|
182
183
|
children: i ? /* @__PURE__ */ t(me, {}) : I
|
|
183
184
|
}
|
|
184
185
|
)
|
|
@@ -189,16 +190,16 @@ import '../../assets/Drawer.css';const he = "_drawerContainer_zs4pc_2", ze = "_d
|
|
|
189
190
|
"footer",
|
|
190
191
|
{
|
|
191
192
|
"data-testid-react": o == null ? void 0 : o.footer,
|
|
192
|
-
className:
|
|
193
|
+
className: n(e.footer, R, {
|
|
193
194
|
[e["has-scroll"]]: T
|
|
194
195
|
}),
|
|
195
|
-
children: typeof
|
|
196
|
+
children: typeof f == "function" ? f({ handleClose: r }) : f || v && /* @__PURE__ */ t(
|
|
196
197
|
P,
|
|
197
198
|
{
|
|
198
199
|
"data-testid-react": o == null ? void 0 : o.footerCloseButton,
|
|
199
200
|
size: h ? u.L : u.XXL,
|
|
200
201
|
full: h,
|
|
201
|
-
onClick:
|
|
202
|
+
onClick: r,
|
|
202
203
|
className: e["footer-button"],
|
|
203
204
|
children: "Закрыть"
|
|
204
205
|
}
|
|
@@ -212,12 +213,12 @@ import '../../assets/Drawer.css';const he = "_drawerContainer_zs4pc_2", ze = "_d
|
|
|
212
213
|
"div",
|
|
213
214
|
{
|
|
214
215
|
"data-testid-react": o == null ? void 0 : o.overlay,
|
|
215
|
-
className:
|
|
216
|
+
className: n(
|
|
216
217
|
e.overlay,
|
|
217
218
|
{
|
|
218
219
|
[e.unmount]: !y
|
|
219
220
|
},
|
|
220
|
-
|
|
221
|
+
z
|
|
221
222
|
),
|
|
222
223
|
style: O.overlay,
|
|
223
224
|
"data-testid": "drawer-overlay",
|
|
@@ -227,10 +228,10 @@ import '../../assets/Drawer.css';const he = "_drawerContainer_zs4pc_2", ze = "_d
|
|
|
227
228
|
]
|
|
228
229
|
}
|
|
229
230
|
);
|
|
230
|
-
return
|
|
231
|
+
return E === !1 ? L : /* @__PURE__ */ t(_e, { element: E, children: L });
|
|
231
232
|
}
|
|
232
233
|
);
|
|
233
234
|
export {
|
|
234
|
-
|
|
235
|
-
|
|
235
|
+
De as ANIMATION_DELAY,
|
|
236
|
+
Ze as Drawer
|
|
236
237
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var l = /* @__PURE__ */ ((T) => (T.LEFT = "left", T.RIGHT = "right", T.BOTTOM = "bottom", T.FULL = "full", T))(l || {});
|
|
1
|
+
var l = /* @__PURE__ */ ((T) => (T.LEFT = "left", T.RIGHT = "right", T.BOTTOM = "bottom", T.FULL = "full", T.CENTER = "center", T))(l || {});
|
|
2
2
|
export {
|
|
3
3
|
l as EDrawerPosition
|
|
4
4
|
};
|
|
@@ -45,10 +45,18 @@ type TProps = {
|
|
|
45
45
|
* Нужна ли кнопка закрытия.
|
|
46
46
|
*/
|
|
47
47
|
needCloseButton?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Флаг указывающий, что компонент котроллируемый.
|
|
50
|
+
*/
|
|
51
|
+
isControlled?: boolean;
|
|
48
52
|
/**
|
|
49
53
|
* Флаг открытия.
|
|
50
54
|
*/
|
|
51
55
|
isOpen?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Коллбэк изменения состояния (управляемый режим).
|
|
58
|
+
*/
|
|
59
|
+
onOpenChange?: (open?: boolean) => void;
|
|
52
60
|
/**
|
|
53
61
|
* Время автоматического закрытия в миллисекундах.
|
|
54
62
|
*/
|
|
@@ -58,7 +66,8 @@ type TProps = {
|
|
|
58
66
|
* Если указан, то buttonContent игнорируется.
|
|
59
67
|
*/
|
|
60
68
|
triggerElement?: ReactNode | ((props: {
|
|
61
|
-
open
|
|
69
|
+
open?: boolean;
|
|
70
|
+
close: () => void;
|
|
62
71
|
}) => JSX.Element);
|
|
63
72
|
/**
|
|
64
73
|
* Вариант оформления выпадающего меню.
|
|
@@ -74,5 +83,5 @@ type TProps = {
|
|
|
74
83
|
/**
|
|
75
84
|
* Компонент Dropdown, содержит в себе кнопку и панель выпадающего меню
|
|
76
85
|
*/
|
|
77
|
-
export declare const Dropdown: import('react').MemoExoticComponent<({ children, position, popoverProps, className, buttonClassName, panelClassName, menuItemsClassName, buttonContent, needCloseButton, openOnHover, isOpen, autoCloseTimeout, triggerElement, variant, arrow }: TProps) => import("react/jsx-runtime").JSX.Element>;
|
|
86
|
+
export declare const Dropdown: import('react').MemoExoticComponent<({ children, position, popoverProps, className, buttonClassName, panelClassName, menuItemsClassName, buttonContent, needCloseButton, openOnHover, isOpen, isControlled, onOpenChange, autoCloseTimeout, triggerElement, variant, arrow }: TProps) => import("react/jsx-runtime").JSX.Element>;
|
|
78
87
|
export {};
|