@reportportal/ui-kit 0.0.1-alpha.128 → 0.0.1-alpha.129
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/common/hooks/useOnClickOutside.d.ts +4 -1
- package/dist/components/dropdown/constants.d.ts +1 -0
- package/dist/components/dropdown/index.d.ts +1 -0
- package/dist/{datePicker-1a104b97.js → datePicker-12bb6fb4.js} +1 -1
- package/dist/datePicker.js +3 -3
- package/dist/{dropdown-1f7b1881.js → dropdown-a99520ba.js} +133 -128
- package/dist/dropdown.js +3 -1
- package/dist/index.js +2 -2
- package/dist/modal.js +123 -100
- package/package.json +1 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export interface UseOnClickOutsideOptions {
|
|
4
|
+
ignoreSelectors?: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function useOnClickOutside<T extends HTMLElement = HTMLDivElement>(ref: RefObject<T>, handler?: (e?: MouseEvent) => void, options?: UseOnClickOutsideOptions): void;
|
|
@@ -3,7 +3,7 @@ import B from "react-datepicker/dist/es/index.js";
|
|
|
3
3
|
import { c as R } from "./bind-06a7ff84.js";
|
|
4
4
|
import { useMemo as P, useRef as D } from "react";
|
|
5
5
|
import { F as I } from "./fieldText-17fcba4f.js";
|
|
6
|
-
import { D as E } from "./dropdown-
|
|
6
|
+
import { D as E } from "./dropdown-a99520ba.js";
|
|
7
7
|
import { S as T } from "./calendarArrow-44c7e60e.js";
|
|
8
8
|
import { registerLocale as j } from "react-datepicker";
|
|
9
9
|
const ie = (n, s) => {
|
package/dist/datePicker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as t } from "./datePicker-
|
|
2
|
-
import { r as z } from "./datePicker-
|
|
1
|
+
import { D as t } from "./datePicker-12bb6fb4.js";
|
|
2
|
+
import { r as z } from "./datePicker-12bb6fb4.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react-datepicker/dist/es/index.js";
|
|
5
5
|
import "./bind-06a7ff84.js";
|
|
@@ -11,7 +11,7 @@ import "./baseIconButton-251479f7.js";
|
|
|
11
11
|
import "./spinLoader-c4a53718.js";
|
|
12
12
|
import "./maxValueDisplay-9be01a75.js";
|
|
13
13
|
import "./fieldLabel.js";
|
|
14
|
-
import "./dropdown-
|
|
14
|
+
import "./dropdown-a99520ba.js";
|
|
15
15
|
import "react-dom";
|
|
16
16
|
import "@floating-ui/react-dom";
|
|
17
17
|
import "downshift";
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { jsxs as L, jsx as d, Fragment as
|
|
2
|
-
import { forwardRef as or, useState as ie, useRef as
|
|
1
|
+
import { jsxs as L, jsx as d, Fragment as Te } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as or, useState as ie, useRef as K, useMemo as O, useCallback as N, useLayoutEffect as Ie, useEffect as Q } from "react";
|
|
3
3
|
import { createPortal as ar } from "react-dom";
|
|
4
4
|
import { c as Le } from "./bind-06a7ff84.js";
|
|
5
5
|
import { useFloating as lr, offset as ir, flip as cr, size as dr, autoUpdate as ur } from "@floating-ui/react-dom";
|
|
6
6
|
import { useSelect as ce } from "downshift";
|
|
7
7
|
import { Scrollbars as fr } from "rc-scrollbars";
|
|
8
|
-
import { K as
|
|
8
|
+
import { K as E } from "./keyCodes-f63c0e11.js";
|
|
9
9
|
import { B as hr } from "./baseIconButton-251479f7.js";
|
|
10
10
|
import { S as _r } from "./clear-53660571.js";
|
|
11
11
|
import { S as pr } from "./dropdown-0260bb66.js";
|
|
12
12
|
import { Tooltip as gr } from "./tooltip.js";
|
|
13
13
|
import { FieldLabel as wr } from "./fieldLabel.js";
|
|
14
14
|
import { C as mr } from "./checkbox-ed6cc375.js";
|
|
15
|
-
const yr = "_disabled_14s7v_12",
|
|
15
|
+
const yr = "_disabled_14s7v_12", Er = "_hidden_14s7v_16", vr = "_hover_14s7v_22", Cr = "_selected_14s7v_38", Or = {
|
|
16
16
|
"dropdown-option": "_dropdown-option_14s7v_1",
|
|
17
17
|
disabled: yr,
|
|
18
|
-
hidden:
|
|
19
|
-
hover:
|
|
18
|
+
hidden: Er,
|
|
19
|
+
hover: vr,
|
|
20
20
|
"depth-1": "_depth-1_14s7v_32",
|
|
21
21
|
selected: Cr,
|
|
22
22
|
"multi-select": "_multi-select_14s7v_38",
|
|
23
23
|
"single-option": "_single-option_14s7v_43",
|
|
24
24
|
"sub-option": "_sub-option_14s7v_50"
|
|
25
|
-
},
|
|
25
|
+
}, xe = Le.bind(Or), Ke = or(
|
|
26
26
|
(n, t) => {
|
|
27
27
|
const {
|
|
28
|
-
option: { value: l, disabled: a, hidden: u, label:
|
|
29
|
-
selected:
|
|
28
|
+
option: { value: l, disabled: a, hidden: u, label: _, title: v, groupRef: g },
|
|
29
|
+
selected: V,
|
|
30
30
|
onChange: Y,
|
|
31
|
-
render:
|
|
31
|
+
render: W,
|
|
32
32
|
highlightHovered: S,
|
|
33
33
|
onMouseEnter: Z,
|
|
34
|
-
multiSelect:
|
|
34
|
+
multiSelect: D,
|
|
35
35
|
isPartiallyChecked: H = !1,
|
|
36
36
|
depth: $ = 0,
|
|
37
37
|
hasChildren: ee = !1
|
|
@@ -41,41 +41,41 @@ const yr = "_disabled_14s7v_12", vr = "_hidden_14s7v_16", Er = "_hover_14s7v_22"
|
|
|
41
41
|
return /* @__PURE__ */ L(
|
|
42
42
|
"div",
|
|
43
43
|
{
|
|
44
|
-
className:
|
|
45
|
-
selected:
|
|
44
|
+
className: xe("dropdown-option", {
|
|
45
|
+
selected: V,
|
|
46
46
|
disabled: a,
|
|
47
47
|
hidden: u,
|
|
48
48
|
hover: S,
|
|
49
|
-
"multi-select":
|
|
49
|
+
"multi-select": D,
|
|
50
50
|
"has-children": ee,
|
|
51
51
|
[`depth-${$}`]: $ > 0
|
|
52
52
|
}),
|
|
53
|
-
title:
|
|
53
|
+
title: v,
|
|
54
54
|
onClick: re,
|
|
55
55
|
ref: t,
|
|
56
56
|
onMouseEnter: Z,
|
|
57
57
|
children: [
|
|
58
|
-
|
|
58
|
+
D && /* @__PURE__ */ d(mr, { value: !!V, partiallyChecked: H }),
|
|
59
59
|
/* @__PURE__ */ d(
|
|
60
60
|
"div",
|
|
61
61
|
{
|
|
62
|
-
className:
|
|
62
|
+
className: xe("single-option", {
|
|
63
63
|
"sub-option": !!g
|
|
64
64
|
}),
|
|
65
|
-
children:
|
|
65
|
+
children: W ? W(n) : _
|
|
66
66
|
}
|
|
67
67
|
)
|
|
68
68
|
]
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
|
-
),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
],
|
|
72
|
+
), Nr = [
|
|
73
|
+
E.ENTER_KEY_CODE,
|
|
74
|
+
E.SPACE_KEY_CODE,
|
|
75
|
+
E.ARROW_DOWN_KEY_CODE
|
|
76
|
+
], Dr = [E.ESCAPE_KEY_CODE, E.TAB_KEY_CODE];
|
|
77
77
|
var k = /* @__PURE__ */ ((n) => (n.ON_KEY_DOWN = "onKeyDown", n.ON_CLICK = "onClick", n))(k || {});
|
|
78
|
-
const
|
|
78
|
+
const br = 216, Ar = "data-dropdown-portal-menu", Tr = (n, t) => {
|
|
79
79
|
const l = Array.isArray(t) ? t : [t];
|
|
80
80
|
return n.findIndex(({ value: a }) => l.includes(a));
|
|
81
81
|
}, Ir = (n, t) => (n % t + t) % t, de = (n, t = 0, l = 1) => {
|
|
@@ -91,80 +91,80 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
91
91
|
l
|
|
92
92
|
);
|
|
93
93
|
}, xr = (n, t) => de(n, t), Kr = (n, t) => de(n, t, -1), ke = (n, t = 0, l) => !n || n.length === 0 ? [] : n.reduce((a, u) => {
|
|
94
|
-
var
|
|
95
|
-
return u && (a.push({ option: u, depth: t, parent: l }), (
|
|
94
|
+
var _;
|
|
95
|
+
return u && (a.push({ option: u, depth: t, parent: l }), (_ = u.children) != null && _.length && a.push(...ke(u.children, t + 1, u))), a;
|
|
96
96
|
}, []), Ye = (n) => !n || n.length === 0 ? [] : n.reduce((t, l) => {
|
|
97
97
|
var a;
|
|
98
98
|
return l && ((a = l.children) != null && a.length ? t.push(...Ye(l.children)) : t.push(l)), t;
|
|
99
99
|
}, []), Pe = (n) => {
|
|
100
100
|
var t;
|
|
101
101
|
return n ? (t = n.children) != null && t.length ? n.children.reduce((l, a) => (a && l.push(...Pe(a)), l), []) : [n.value] : [];
|
|
102
|
-
},
|
|
103
|
-
container:
|
|
104
|
-
icon:
|
|
105
|
-
arrow:
|
|
102
|
+
}, Lr = "_container_owe49_1", kr = "_icon_owe49_7", Yr = "_arrow_owe49_13", Pr = "_dropdown_owe49_27", Mr = "_disabled_owe49_44", Rr = "_value_owe49_51", Vr = "_error_owe49_54", Wr = "_touched_owe49_54", Sr = "_opened_owe49_58", Hr = "_placeholder_owe49_93", $r = "_ghost_owe49_139", zr = "_divider_owe49_160", Br = {
|
|
103
|
+
container: Lr,
|
|
104
|
+
icon: kr,
|
|
105
|
+
arrow: Yr,
|
|
106
106
|
"clear-button": "_clear-button_owe49_19",
|
|
107
|
-
dropdown:
|
|
107
|
+
dropdown: Pr,
|
|
108
108
|
"transparent-background": "_transparent-background_owe49_41",
|
|
109
|
-
disabled:
|
|
110
|
-
value:
|
|
109
|
+
disabled: Mr,
|
|
110
|
+
value: Rr,
|
|
111
111
|
error: Vr,
|
|
112
112
|
touched: Wr,
|
|
113
|
-
opened:
|
|
114
|
-
placeholder:
|
|
113
|
+
opened: Sr,
|
|
114
|
+
placeholder: Hr,
|
|
115
115
|
"mobile-disabled": "_mobile-disabled_owe49_97",
|
|
116
116
|
"value-wrapper": "_value-wrapper_owe49_102",
|
|
117
117
|
"value-tooltip": "_value-tooltip_owe49_108",
|
|
118
118
|
"select-list": "_select-list_owe49_113",
|
|
119
119
|
"limited-width": "_limited-width_owe49_130",
|
|
120
120
|
"options-container": "_options-container_owe49_134",
|
|
121
|
-
ghost:
|
|
122
|
-
divider:
|
|
123
|
-
}, f = Le.bind(
|
|
121
|
+
ghost: $r,
|
|
122
|
+
divider: zr
|
|
123
|
+
}, f = Le.bind(Br), at = ({
|
|
124
124
|
multiSelect: n = !1,
|
|
125
125
|
value: t = n ? [] : "",
|
|
126
126
|
options: l = [],
|
|
127
127
|
disabled: a = !1,
|
|
128
128
|
error: u,
|
|
129
|
-
onChange:
|
|
130
|
-
onFocus:
|
|
129
|
+
onChange: _,
|
|
130
|
+
onFocus: v,
|
|
131
131
|
onBlur: g,
|
|
132
|
-
mobileDisabled:
|
|
132
|
+
mobileDisabled: V,
|
|
133
133
|
title: Y,
|
|
134
|
-
touched:
|
|
134
|
+
touched: W = !1,
|
|
135
135
|
icon: S,
|
|
136
136
|
variant: Z,
|
|
137
|
-
placeholder:
|
|
137
|
+
placeholder: D = "",
|
|
138
138
|
label: H = "",
|
|
139
139
|
renderOption: $,
|
|
140
140
|
transparentBackground: ee = !1,
|
|
141
141
|
className: re,
|
|
142
142
|
toggleButtonClassName: z,
|
|
143
143
|
selectListClassName: Me,
|
|
144
|
-
isListWidthLimited:
|
|
144
|
+
isListWidthLimited: Re = !1,
|
|
145
145
|
optionAll: te = { value: "all", label: "All" },
|
|
146
146
|
isOptionAllVisible: ue = !1,
|
|
147
|
-
onSelectAll:
|
|
147
|
+
onSelectAll: Ve = () => {
|
|
148
148
|
},
|
|
149
149
|
formatDisplayedValue: fe,
|
|
150
150
|
notScrollable: P = !1,
|
|
151
151
|
footer: B,
|
|
152
152
|
includeGroupValue: he = !1,
|
|
153
|
-
clearable:
|
|
153
|
+
clearable: We = !1,
|
|
154
154
|
onClear: _e = () => {
|
|
155
155
|
},
|
|
156
156
|
clearButtonAriaLabel: Se = "Clear selection",
|
|
157
157
|
tooltipPortalRoot: He,
|
|
158
158
|
tooltipZIndex: $e,
|
|
159
|
-
menuPortalRoot:
|
|
159
|
+
menuPortalRoot: h
|
|
160
160
|
}) => {
|
|
161
|
-
const [i,
|
|
162
|
-
() =>
|
|
163
|
-
[
|
|
164
|
-
), q = O(() =>
|
|
161
|
+
const [i, U] = ie(!1), pe = K(null), ge = K(null), M = K(null), ne = K(0), se = K(null), [ze, we] = ie(!1), [Be, j] = ie(null), b = K(null), R = O(() => ke(l), [l]), p = O(
|
|
162
|
+
() => R.map(({ option: e }) => e),
|
|
163
|
+
[R]
|
|
164
|
+
), q = O(() => R.filter(({ option: e }) => {
|
|
165
165
|
var r;
|
|
166
166
|
return (r = e.children) == null ? void 0 : r.length;
|
|
167
|
-
}).map(({ option: e }) => e), [
|
|
167
|
+
}).map(({ option: e }) => e), [R]), me = O(() => Ye(l), [l]), w = O(
|
|
168
168
|
() => me.map(({ value: e }) => e),
|
|
169
169
|
[me]
|
|
170
170
|
), F = O(() => {
|
|
@@ -172,30 +172,30 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
172
172
|
return q.forEach((r) => {
|
|
173
173
|
e.set(r.value, Pe(r));
|
|
174
174
|
}), e;
|
|
175
|
-
}, [q]), X =
|
|
175
|
+
}, [q]), X = N(
|
|
176
176
|
(e) => (q.forEach((r) => {
|
|
177
177
|
const s = F.get(r.value) ?? [], o = s.length > 0 && s.every((c) => e.has(c));
|
|
178
178
|
he && o ? e.add(r.value) : e.delete(r.value);
|
|
179
179
|
}), e),
|
|
180
180
|
[q, he, F]
|
|
181
|
-
), A = O(() => !n || !Array.isArray(t) ? /* @__PURE__ */ new Set() : X(new Set(t)), [n, t, X]), ye = n ? Array.isArray(t) && t.length > 0 : t || t === !1 || t === 0,
|
|
181
|
+
), A = O(() => !n || !Array.isArray(t) ? /* @__PURE__ */ new Set() : X(new Set(t)), [n, t, X]), ye = n ? Array.isArray(t) && t.length > 0 : t || t === !1 || t === 0, Ue = We && ye && !a, je = N((e) => {
|
|
182
182
|
ne.current = e.scrollTop;
|
|
183
183
|
}, []);
|
|
184
|
-
|
|
185
|
-
i && !P && M.current && !(n &&
|
|
184
|
+
Ie(() => {
|
|
185
|
+
i && !P && M.current && !(n && b.current !== null) && M.current.scrollTop(ne.current);
|
|
186
186
|
}, [i, P, t, n]);
|
|
187
|
-
const { refs:
|
|
187
|
+
const { refs: I, floatingStyles: Ee } = lr({
|
|
188
188
|
placement: "bottom-start",
|
|
189
189
|
middleware: [
|
|
190
190
|
ir(5),
|
|
191
191
|
cr({
|
|
192
192
|
fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"],
|
|
193
|
-
...
|
|
193
|
+
...h && {
|
|
194
194
|
boundary: document.documentElement,
|
|
195
195
|
rootBoundary: "viewport"
|
|
196
196
|
}
|
|
197
197
|
}),
|
|
198
|
-
|
|
198
|
+
h ? dr({
|
|
199
199
|
apply({ rects: e, elements: r }) {
|
|
200
200
|
const s = e.reference.width;
|
|
201
201
|
Object.assign(r.floating.style, {
|
|
@@ -206,7 +206,7 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
206
206
|
}
|
|
207
207
|
}) : null
|
|
208
208
|
].filter(Boolean),
|
|
209
|
-
whileElementsMounted: i &&
|
|
209
|
+
whileElementsMounted: i && h ? (e, r, s) => ur(e, r, s, {
|
|
210
210
|
animationFrame: !0
|
|
211
211
|
}) : void 0
|
|
212
212
|
}), qe = () => {
|
|
@@ -217,22 +217,22 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
217
217
|
s ? r.add(c) : r.delete(c);
|
|
218
218
|
});
|
|
219
219
|
const o = X(r);
|
|
220
|
-
|
|
221
|
-
}, m =
|
|
222
|
-
|
|
223
|
-
}, [g]), oe =
|
|
220
|
+
_(Array.from(o)), Ve();
|
|
221
|
+
}, m = N(() => {
|
|
222
|
+
U(!1), g == null || g();
|
|
223
|
+
}, [g]), oe = N(() => {
|
|
224
224
|
if (a)
|
|
225
225
|
return;
|
|
226
|
-
|
|
227
|
-
const r =
|
|
226
|
+
_(n ? [] : ""), _e(), m(), requestAnimationFrame(() => {
|
|
227
|
+
const r = I.reference.current;
|
|
228
228
|
r && r instanceof HTMLElement && r.focus();
|
|
229
229
|
});
|
|
230
|
-
}, [a, n,
|
|
230
|
+
}, [a, n, _, _e, m, I]), Fe = N(
|
|
231
231
|
(e) => {
|
|
232
232
|
e.preventDefault(), e.stopPropagation(), oe();
|
|
233
233
|
},
|
|
234
234
|
[oe]
|
|
235
|
-
),
|
|
235
|
+
), ve = N(
|
|
236
236
|
(e) => {
|
|
237
237
|
var c, y;
|
|
238
238
|
if (!i)
|
|
@@ -249,41 +249,41 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
249
249
|
if (!i)
|
|
250
250
|
return;
|
|
251
251
|
const e = (r) => {
|
|
252
|
-
|
|
252
|
+
ve(r);
|
|
253
253
|
};
|
|
254
254
|
return document.addEventListener("pointerdown", e), () => {
|
|
255
255
|
document.removeEventListener("pointerdown", e);
|
|
256
256
|
};
|
|
257
|
-
}, [i,
|
|
257
|
+
}, [i, ve]);
|
|
258
258
|
const Ce = (e) => {
|
|
259
259
|
var r;
|
|
260
260
|
if (!e.disabled) {
|
|
261
261
|
if (n) {
|
|
262
262
|
const s = Array.isArray(t) ? t : [], o = new Set(s);
|
|
263
263
|
if ((r = e.children) != null && r.length) {
|
|
264
|
-
const y = F.get(e.value) ?? [], C = y.some((
|
|
265
|
-
y.forEach((
|
|
266
|
-
C ? o.add(
|
|
264
|
+
const y = F.get(e.value) ?? [], C = y.some((T) => !o.has(T));
|
|
265
|
+
y.forEach((T) => {
|
|
266
|
+
C ? o.add(T) : o.delete(T);
|
|
267
267
|
});
|
|
268
268
|
} else
|
|
269
269
|
o.has(e.value) ? o.delete(e.value) : o.add(e.value);
|
|
270
270
|
const c = X(o);
|
|
271
|
-
|
|
271
|
+
_(Array.from(c));
|
|
272
272
|
} else
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
_(e.value);
|
|
274
|
+
U((s) => n || !s);
|
|
275
275
|
}
|
|
276
|
-
}, Xe = () => p.find(({ value: e }) => e === t), Oe =
|
|
276
|
+
}, Xe = () => p.find(({ value: e }) => e === t), Oe = Tr(p, t), {
|
|
277
277
|
getToggleButtonProps: Ge,
|
|
278
278
|
getLabelProps: Je,
|
|
279
|
-
getMenuProps:
|
|
279
|
+
getMenuProps: Ne,
|
|
280
280
|
getItemProps: Qe,
|
|
281
|
-
setHighlightedIndex:
|
|
281
|
+
setHighlightedIndex: x,
|
|
282
282
|
highlightedIndex: ae,
|
|
283
283
|
selectedItem: G
|
|
284
284
|
} = ce({
|
|
285
285
|
items: p,
|
|
286
|
-
itemToString: (e) => (e != null && e.label ? String(e.label) :
|
|
286
|
+
itemToString: (e) => (e != null && e.label ? String(e.label) : D) || "",
|
|
287
287
|
selectedItem: Xe(),
|
|
288
288
|
isOpen: i,
|
|
289
289
|
circularNavigation: !0,
|
|
@@ -291,36 +291,36 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
291
291
|
onHighlightedIndexChange: (e) => {
|
|
292
292
|
switch (e.type) {
|
|
293
293
|
case ce.stateChangeTypes.MenuKeyDownArrowUp:
|
|
294
|
-
return
|
|
294
|
+
return j(k.ON_KEY_DOWN), x(Kr(p, e.highlightedIndex)), e;
|
|
295
295
|
case ce.stateChangeTypes.MenuKeyDownArrowDown:
|
|
296
|
-
return
|
|
296
|
+
return j(k.ON_KEY_DOWN), x(xr(p, e.highlightedIndex)), e;
|
|
297
297
|
default:
|
|
298
298
|
return e;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
}),
|
|
301
|
+
}), De = N(
|
|
302
302
|
(e) => {
|
|
303
|
-
ge.current = e,
|
|
303
|
+
ge.current = e, I.setFloating(e);
|
|
304
304
|
},
|
|
305
|
-
[
|
|
306
|
-
), Ze =
|
|
305
|
+
[I]
|
|
306
|
+
), Ze = N(
|
|
307
307
|
(e = {}) => {
|
|
308
|
-
const r =
|
|
308
|
+
const r = Ne(e), s = r.ref;
|
|
309
309
|
return {
|
|
310
310
|
...r,
|
|
311
311
|
ref: (o) => {
|
|
312
|
-
|
|
312
|
+
De(o), typeof s == "function" ? s(o) : s && (s.current = o);
|
|
313
313
|
}
|
|
314
314
|
};
|
|
315
315
|
},
|
|
316
|
-
[
|
|
316
|
+
[Ne, De]
|
|
317
317
|
);
|
|
318
318
|
Q(() => {
|
|
319
|
-
n && i &&
|
|
319
|
+
n && i && b.current !== null && b.current >= 0 && b.current < p.length && (x(b.current), b.current = null, requestAnimationFrame(() => {
|
|
320
320
|
M.current && !P && M.current.scrollTop(ne.current);
|
|
321
321
|
}));
|
|
322
|
-
}, [n, i, t, p.length,
|
|
323
|
-
if (!i || !
|
|
322
|
+
}, [n, i, t, p.length, x, P]), Ie(() => {
|
|
323
|
+
if (!i || !h)
|
|
324
324
|
return;
|
|
325
325
|
let e = window.scrollY, r = !0;
|
|
326
326
|
const s = 300, o = () => {
|
|
@@ -339,8 +339,8 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
339
339
|
return () => {
|
|
340
340
|
clearTimeout(y), window.removeEventListener("scroll", c, { capture: !0 });
|
|
341
341
|
};
|
|
342
|
-
}, [i,
|
|
343
|
-
if (!i || !
|
|
342
|
+
}, [i, h]), Q(() => {
|
|
343
|
+
if (!i || !h)
|
|
344
344
|
return;
|
|
345
345
|
const e = () => {
|
|
346
346
|
m();
|
|
@@ -348,9 +348,9 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
348
348
|
return window.addEventListener("resize", e), () => {
|
|
349
349
|
window.removeEventListener("resize", e);
|
|
350
350
|
};
|
|
351
|
-
}, [i,
|
|
351
|
+
}, [i, h, m]);
|
|
352
352
|
const er = () => {
|
|
353
|
-
a || (
|
|
353
|
+
a || (U((e) => !e), i ? g == null || g() : v == null || v(), j(k.ON_CLICK));
|
|
354
354
|
}, J = O(() => {
|
|
355
355
|
if (n && Array.isArray(t) && w.length > 0 && w.every((r) => A.has(r)))
|
|
356
356
|
return te.label;
|
|
@@ -358,7 +358,7 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
358
358
|
if (e.length > 0)
|
|
359
359
|
return e.join(", ");
|
|
360
360
|
if (!t && t !== !1 && t !== 0 || Array.isArray(t) && !t.length)
|
|
361
|
-
return
|
|
361
|
+
return D;
|
|
362
362
|
}, [
|
|
363
363
|
n,
|
|
364
364
|
t,
|
|
@@ -366,7 +366,7 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
366
366
|
A,
|
|
367
367
|
te.label,
|
|
368
368
|
p,
|
|
369
|
-
|
|
369
|
+
D
|
|
370
370
|
]);
|
|
371
371
|
Q(() => {
|
|
372
372
|
if (se.current) {
|
|
@@ -377,21 +377,21 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
377
377
|
}, [J]);
|
|
378
378
|
const rr = (e) => {
|
|
379
379
|
const { keyCode: r } = e;
|
|
380
|
-
|
|
380
|
+
Nr.includes(r) && e.target === e.currentTarget && (e.preventDefault(), e.stopPropagation(), !i && (x(Oe), U(!0), v == null || v(), j(k.ON_KEY_DOWN)));
|
|
381
381
|
}, tr = (e) => {
|
|
382
382
|
const { keyCode: r } = e;
|
|
383
|
-
if (r ===
|
|
383
|
+
if (r === E.ENTER_KEY_CODE || r === E.SPACE_KEY_CODE) {
|
|
384
384
|
const s = p[ae];
|
|
385
385
|
if (!s)
|
|
386
386
|
return;
|
|
387
|
-
n && (
|
|
387
|
+
n && (b.current = ae), Ce(s), n || m();
|
|
388
388
|
return;
|
|
389
389
|
}
|
|
390
|
-
|
|
391
|
-
},
|
|
392
|
-
n && ue && /* @__PURE__ */ L(
|
|
390
|
+
Dr.includes(r) && (e.stopPropagation(), m());
|
|
391
|
+
}, be = () => /* @__PURE__ */ L("div", { className: f("options-container"), children: [
|
|
392
|
+
n && ue && /* @__PURE__ */ L(Te, { children: [
|
|
393
393
|
/* @__PURE__ */ d(
|
|
394
|
-
|
|
394
|
+
Ke,
|
|
395
395
|
{
|
|
396
396
|
option: te,
|
|
397
397
|
selected: Array.isArray(t) && w.length > 0 && w.every((e) => A.has(e)),
|
|
@@ -403,11 +403,11 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
403
403
|
/* @__PURE__ */ d("div", { className: f("divider") }),
|
|
404
404
|
" "
|
|
405
405
|
] }),
|
|
406
|
-
|
|
407
|
-
var C,
|
|
406
|
+
R.map(({ option: e, depth: r }, s) => {
|
|
407
|
+
var C, T;
|
|
408
408
|
const o = F.get(e.value) ?? [e.value], c = n && o.every((le) => A.has(le)), y = n && ((C = e.children) == null ? void 0 : C.length) && o.some((le) => A.has(le)) && !c;
|
|
409
409
|
return /* @__PURE__ */ d(
|
|
410
|
-
|
|
410
|
+
Ke,
|
|
411
411
|
{
|
|
412
412
|
...Qe({
|
|
413
413
|
item: e,
|
|
@@ -419,15 +419,15 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
419
419
|
highlightHovered: ae === s && Be !== k.ON_CLICK,
|
|
420
420
|
render: $,
|
|
421
421
|
onChange: e.disabled ? null : () => Ce(e),
|
|
422
|
-
onMouseEnter: () =>
|
|
422
|
+
onMouseEnter: () => x(s),
|
|
423
423
|
depth: r,
|
|
424
|
-
hasChildren: !!((
|
|
424
|
+
hasChildren: !!((T = e.children) != null && T.length),
|
|
425
425
|
isPartiallyChecked: y
|
|
426
426
|
},
|
|
427
427
|
e.value
|
|
428
428
|
);
|
|
429
429
|
}),
|
|
430
|
-
B && /* @__PURE__ */ L(
|
|
430
|
+
B && /* @__PURE__ */ L(Te, { children: [
|
|
431
431
|
/* @__PURE__ */ d("div", { className: f("divider") }),
|
|
432
432
|
typeof B == "function" ? B(m) : B
|
|
433
433
|
] })
|
|
@@ -437,7 +437,7 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
437
437
|
{
|
|
438
438
|
ref: se,
|
|
439
439
|
className: f("value", {
|
|
440
|
-
placeholder: J ===
|
|
440
|
+
placeholder: J === D
|
|
441
441
|
}),
|
|
442
442
|
children: e
|
|
443
443
|
}
|
|
@@ -459,13 +459,13 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
459
459
|
opened: i,
|
|
460
460
|
disabled: a,
|
|
461
461
|
error: u,
|
|
462
|
-
touched:
|
|
463
|
-
"mobile-disabled":
|
|
462
|
+
touched: W,
|
|
463
|
+
"mobile-disabled": V
|
|
464
464
|
}),
|
|
465
465
|
onClick: er,
|
|
466
466
|
onKeyDown: rr,
|
|
467
|
-
ref:
|
|
468
|
-
}), { type:
|
|
467
|
+
ref: I.setReference
|
|
468
|
+
}), { type: Ur, ...Ae } = sr;
|
|
469
469
|
return /* @__PURE__ */ L("div", { ref: pe, className: f("container", re), title: Y, children: [
|
|
470
470
|
H && /* @__PURE__ */ d(wr, { ...Je(), children: H }),
|
|
471
471
|
/* @__PURE__ */ L(
|
|
@@ -478,14 +478,14 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
478
478
|
children: [
|
|
479
479
|
S && /* @__PURE__ */ d("span", { className: f("icon"), children: S }),
|
|
480
480
|
/* @__PURE__ */ d("div", { className: f("value-wrapper"), children: nr() }),
|
|
481
|
-
|
|
481
|
+
Ue && /* @__PURE__ */ d(
|
|
482
482
|
hr,
|
|
483
483
|
{
|
|
484
484
|
className: f("clear-button"),
|
|
485
485
|
onClick: Fe,
|
|
486
486
|
onKeyDown: (e) => {
|
|
487
487
|
const { keyCode: r } = e;
|
|
488
|
-
(r ===
|
|
488
|
+
(r === E.ENTER_KEY_CODE || r === E.SPACE_KEY_CODE) && (e.preventDefault(), e.stopPropagation(), oe());
|
|
489
489
|
},
|
|
490
490
|
"aria-label": Se,
|
|
491
491
|
children: /* @__PURE__ */ d(_r, {})
|
|
@@ -497,42 +497,47 @@ const Dr = 216, Ar = (n, t) => {
|
|
|
497
497
|
),
|
|
498
498
|
i && (() => {
|
|
499
499
|
var o;
|
|
500
|
-
const e = (o =
|
|
501
|
-
...
|
|
500
|
+
const e = (o = I.reference.current) == null ? void 0 : o.getBoundingClientRect().width, r = h && e ? {
|
|
501
|
+
...Ee,
|
|
502
502
|
width: `${e}px`,
|
|
503
503
|
minWidth: `${e}px`,
|
|
504
504
|
maxWidth: `${e}px`
|
|
505
|
-
} :
|
|
505
|
+
} : Ee, s = /* @__PURE__ */ d(
|
|
506
506
|
"div",
|
|
507
507
|
{
|
|
508
508
|
style: r,
|
|
509
509
|
className: f(
|
|
510
510
|
"select-list",
|
|
511
|
-
{
|
|
511
|
+
{
|
|
512
|
+
opened: i,
|
|
513
|
+
"limited-width": Re
|
|
514
|
+
},
|
|
512
515
|
Me
|
|
513
516
|
),
|
|
517
|
+
...h && { [Ar]: "" },
|
|
514
518
|
...Ze({
|
|
515
519
|
onKeyDown: tr
|
|
516
520
|
}),
|
|
517
|
-
children: P ?
|
|
521
|
+
children: P ? be() : /* @__PURE__ */ d(
|
|
518
522
|
fr,
|
|
519
523
|
{
|
|
520
524
|
autoHeight: !0,
|
|
521
|
-
autoHeightMax:
|
|
525
|
+
autoHeightMax: br,
|
|
522
526
|
hideTracksWhenNotNeeded: !0,
|
|
523
527
|
ref: (c) => {
|
|
524
528
|
M.current = c;
|
|
525
529
|
},
|
|
526
|
-
onScrollFrame:
|
|
527
|
-
children:
|
|
530
|
+
onScrollFrame: je,
|
|
531
|
+
children: be()
|
|
528
532
|
}
|
|
529
533
|
)
|
|
530
534
|
}
|
|
531
535
|
);
|
|
532
|
-
return
|
|
536
|
+
return h ? ar(s, h) : s;
|
|
533
537
|
})()
|
|
534
538
|
] });
|
|
535
539
|
};
|
|
536
540
|
export {
|
|
537
|
-
|
|
541
|
+
at as D,
|
|
542
|
+
Ar as a
|
|
538
543
|
};
|
package/dist/dropdown.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { D as r } from "./dropdown-
|
|
1
|
+
import { D as r } from "./dropdown-a99520ba.js";
|
|
2
|
+
import { a as l } from "./dropdown-a99520ba.js";
|
|
2
3
|
import "react/jsx-runtime";
|
|
3
4
|
import "react";
|
|
4
5
|
import "react-dom";
|
|
@@ -16,6 +17,7 @@ import "./floatingUi-41f8c7b5.js";
|
|
|
16
17
|
import "./fieldLabel.js";
|
|
17
18
|
import "./checkbox-ed6cc375.js";
|
|
18
19
|
export {
|
|
20
|
+
l as DROPDOWN_PORTAL_MENU_ATTR,
|
|
19
21
|
r as Dropdown,
|
|
20
22
|
r as default
|
|
21
23
|
};
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import { B as D } from "./breadcrumbs-8e5ca8d7.js";
|
|
|
4
4
|
import { B } from "./bubblesLoader-f3ffa240.js";
|
|
5
5
|
import { B as b } from "./button-97d9e587.js";
|
|
6
6
|
import { C as A } from "./checkbox-ed6cc375.js";
|
|
7
|
-
import { D as M } from "./datePicker-
|
|
7
|
+
import { D as M } from "./datePicker-12bb6fb4.js";
|
|
8
8
|
import "react-datepicker";
|
|
9
|
-
import { D as k } from "./dropdown-
|
|
9
|
+
import { D as k } from "./dropdown-a99520ba.js";
|
|
10
10
|
import { FieldLabel as L } from "./fieldLabel.js";
|
|
11
11
|
import { F as O } from "./fieldNumber-d1b5a7a1.js";
|
|
12
12
|
import { F as H } from "./fieldText-17fcba4f.js";
|
package/dist/modal.js
CHANGED
|
@@ -1,157 +1,180 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { Scrollbars as
|
|
4
|
-
import { AnimatePresence as
|
|
5
|
-
import { c as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as u, Fragment as F } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as C, useEffect as w, useState as y, useMemo as G } from "react";
|
|
3
|
+
import { Scrollbars as K } from "rc-scrollbars";
|
|
4
|
+
import { AnimatePresence as U, motion as Y } from "framer-motion";
|
|
5
|
+
import { c as x } from "./bind-06a7ff84.js";
|
|
6
|
+
import { a as X } from "./dropdown-a99520ba.js";
|
|
7
|
+
import { K as J } from "./keyCodes-f63c0e11.js";
|
|
8
|
+
import { B as D } from "./button-97d9e587.js";
|
|
9
|
+
import { Tooltip as Q } from "./tooltip.js";
|
|
10
|
+
import { B as V } from "./baseIconButton-251479f7.js";
|
|
11
|
+
import { S as Z } from "./close-4d480ef7.js";
|
|
11
12
|
import "react-dom";
|
|
13
|
+
import "@floating-ui/react-dom";
|
|
14
|
+
import "downshift";
|
|
15
|
+
import "./clear-53660571.js";
|
|
16
|
+
import "./dropdown-0260bb66.js";
|
|
17
|
+
import "./fieldLabel.js";
|
|
18
|
+
import "./checkbox-ed6cc375.js";
|
|
12
19
|
import "@floating-ui/react";
|
|
13
20
|
import "./floatingUi-41f8c7b5.js";
|
|
14
|
-
function
|
|
15
|
-
|
|
21
|
+
function tt(e, o, n) {
|
|
22
|
+
const c = C(n);
|
|
23
|
+
w(() => {
|
|
24
|
+
c.current = n;
|
|
25
|
+
}, [n]), w(() => {
|
|
16
26
|
if (!o)
|
|
17
27
|
return;
|
|
18
|
-
const
|
|
19
|
-
|
|
28
|
+
const s = (a) => {
|
|
29
|
+
var r, d;
|
|
30
|
+
if (e && e.current && !e.current.contains(a.target)) {
|
|
31
|
+
const l = a.target;
|
|
32
|
+
((d = (r = c.current) == null ? void 0 : r.ignoreSelectors) == null ? void 0 : d.some(
|
|
33
|
+
(v) => l == null ? void 0 : l.closest(v)
|
|
34
|
+
)) || o(a);
|
|
35
|
+
}
|
|
20
36
|
};
|
|
21
|
-
return document.addEventListener("pointerdown",
|
|
22
|
-
document.removeEventListener("pointerdown",
|
|
37
|
+
return document.addEventListener("pointerdown", s), () => {
|
|
38
|
+
document.removeEventListener("pointerdown", s);
|
|
23
39
|
};
|
|
24
|
-
}, [
|
|
40
|
+
}, [e, o]);
|
|
25
41
|
}
|
|
26
|
-
const
|
|
27
|
-
const [
|
|
28
|
-
return
|
|
29
|
-
const
|
|
42
|
+
const et = () => {
|
|
43
|
+
const [e, o] = y({ width: 0, height: 0 });
|
|
44
|
+
return w(() => {
|
|
45
|
+
const n = () => {
|
|
30
46
|
o({
|
|
31
47
|
width: window.innerWidth,
|
|
32
48
|
height: window.innerHeight
|
|
33
49
|
});
|
|
34
50
|
};
|
|
35
|
-
return window.addEventListener("resize",
|
|
36
|
-
}, []),
|
|
37
|
-
},
|
|
51
|
+
return window.addEventListener("resize", n), n(), () => window.removeEventListener("resize", n);
|
|
52
|
+
}, []), e;
|
|
53
|
+
}, ot = "_scrollable_zh8d2_12", nt = {
|
|
38
54
|
"modal-content": "_modal-content_zh8d2_1",
|
|
39
|
-
scrollable:
|
|
40
|
-
},
|
|
55
|
+
scrollable: ot
|
|
56
|
+
}, it = x.bind(nt), S = ({ scrollable: e = !1, children: o }) => /* @__PURE__ */ t("div", { className: it("modal-content", { scrollable: e }), children: o }), st = {
|
|
41
57
|
"buttons-block": "_buttons-block_1mwne_1",
|
|
42
58
|
"button-container": "_button-container_1mwne_7",
|
|
43
59
|
"modal-footer": "_modal-footer_1mwne_12",
|
|
44
60
|
"with-extra-node": "_with-extra-node_1mwne_19",
|
|
45
61
|
"size-small": "_size-small_1mwne_23"
|
|
46
|
-
},
|
|
47
|
-
footerNode:
|
|
62
|
+
}, f = x.bind(st), lt = ({
|
|
63
|
+
footerNode: e,
|
|
48
64
|
closeHandler: o,
|
|
49
|
-
okButton:
|
|
50
|
-
cancelButton:
|
|
65
|
+
okButton: n,
|
|
66
|
+
cancelButton: c,
|
|
51
67
|
size: s
|
|
52
68
|
}) => {
|
|
53
|
-
const { tooltipNode:
|
|
54
|
-
const
|
|
55
|
-
return
|
|
69
|
+
const { tooltipNode: a, ...r } = n || {}, d = () => {
|
|
70
|
+
const l = /* @__PURE__ */ t(D, { adjustWidthOn: s === "small" ? "parent" : "min-width", ...r });
|
|
71
|
+
return a ? /* @__PURE__ */ t(Q, { content: a, placement: "top", width: 270, children: l }) : l;
|
|
56
72
|
};
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
61
|
-
|
|
73
|
+
return /* @__PURE__ */ u("div", { className: f("modal-footer", { "with-extra-node": e, [`size-${s}`]: s }), children: [
|
|
74
|
+
e && e,
|
|
75
|
+
/* @__PURE__ */ u("div", { className: f("buttons-block"), children: [
|
|
76
|
+
c && /* @__PURE__ */ t("div", { className: f("button-container"), children: /* @__PURE__ */ t(
|
|
77
|
+
D,
|
|
62
78
|
{
|
|
63
79
|
variant: "ghost",
|
|
64
80
|
adjustWidthOn: s === "small" ? "parent" : "min-width",
|
|
65
81
|
onClick: o,
|
|
66
|
-
...
|
|
82
|
+
...c
|
|
67
83
|
}
|
|
68
84
|
) }),
|
|
69
|
-
|
|
85
|
+
n && /* @__PURE__ */ t("div", { className: f("button-container"), children: d() })
|
|
70
86
|
] })
|
|
71
87
|
] });
|
|
72
|
-
},
|
|
88
|
+
}, at = {
|
|
73
89
|
"modal-header": "_modal-header_w4aaf_1",
|
|
74
90
|
"width-description": "_width-description_w4aaf_10",
|
|
75
91
|
"modal-header-content": "_modal-header-content_w4aaf_14",
|
|
76
92
|
"modal-title": "_modal-title_w4aaf_20",
|
|
77
93
|
"close-modal-icon": "_close-modal-icon_w4aaf_29"
|
|
78
|
-
},
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
] }),
|
|
82
|
-
modal:
|
|
94
|
+
}, p = x.bind(at), rt = ({ title: e, onClose: o, withDescription: n = !1 }) => /* @__PURE__ */ u("div", { className: p("modal-header", { "width-description": n }), children: [
|
|
95
|
+
/* @__PURE__ */ t("div", { className: p("modal-header-content"), children: e && /* @__PURE__ */ t("div", { className: p("modal-title"), children: e }) }),
|
|
96
|
+
/* @__PURE__ */ t(V, { className: p("close-modal-icon"), onClick: o, children: /* @__PURE__ */ t(Z, {}) })
|
|
97
|
+
] }), ct = "_modal_yxql5_1", dt = "_description_yxql5_43", mt = "_scrollable_yxql5_53", _t = {
|
|
98
|
+
modal: ct,
|
|
83
99
|
"overlay-default": "_overlay-default_yxql5_12",
|
|
84
100
|
"overlay-light-cyan": "_overlay-light-cyan_yxql5_16",
|
|
85
101
|
"scrolling-content": "_scrolling-content_yxql5_20",
|
|
86
102
|
"modal-window": "_modal-window_yxql5_26",
|
|
87
|
-
description:
|
|
88
|
-
scrollable:
|
|
103
|
+
description: dt,
|
|
104
|
+
scrollable: mt,
|
|
89
105
|
"size-default": "_size-default_yxql5_57",
|
|
90
106
|
"size-small": "_size-small_yxql5_69",
|
|
91
107
|
"size-large": "_size-large_yxql5_81"
|
|
92
|
-
},
|
|
93
|
-
title:
|
|
108
|
+
}, g = x.bind(_t), ut = 0.9, ht = 32 + 24, wt = 32 + 8, ft = 36 + 16, pt = 32 * 2, $t = ({
|
|
109
|
+
title: e,
|
|
94
110
|
children: o,
|
|
95
|
-
footerNode:
|
|
96
|
-
okButton:
|
|
111
|
+
footerNode: n,
|
|
112
|
+
okButton: c,
|
|
97
113
|
cancelButton: s,
|
|
98
|
-
className:
|
|
114
|
+
className: a,
|
|
99
115
|
size: r = "default",
|
|
100
|
-
onClose:
|
|
116
|
+
onClose: d = () => {
|
|
101
117
|
},
|
|
102
|
-
overlay:
|
|
103
|
-
zIndex:
|
|
104
|
-
allowCloseOutside:
|
|
105
|
-
scrollable:
|
|
106
|
-
withoutFooter:
|
|
107
|
-
createFooter:
|
|
108
|
-
description:
|
|
118
|
+
overlay: l = "default",
|
|
119
|
+
zIndex: E = 2,
|
|
120
|
+
allowCloseOutside: v = !0,
|
|
121
|
+
scrollable: H = !1,
|
|
122
|
+
withoutFooter: O = !1,
|
|
123
|
+
createFooter: M = null,
|
|
124
|
+
description: m = null
|
|
109
125
|
}) => {
|
|
110
|
-
const [
|
|
111
|
-
let
|
|
112
|
-
return
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
}, z = (
|
|
116
|
-
const { keyCode:
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
var
|
|
120
|
-
|
|
126
|
+
const [I, N] = y(!1), [L, R] = y(0), [k, $] = y(!1), _ = C(null), A = et(), T = A.height, q = T * ut, b = (T - L) / 2, W = () => {
|
|
127
|
+
let i = q - pt;
|
|
128
|
+
return O || (i = i - ft), m ? i = i - wt : i = i - ht, i;
|
|
129
|
+
}, h = () => {
|
|
130
|
+
N(!1);
|
|
131
|
+
}, z = (i) => {
|
|
132
|
+
const { keyCode: j } = i;
|
|
133
|
+
j === J.ESCAPE_KEY_CODE && h();
|
|
134
|
+
}, P = () => {
|
|
135
|
+
var i;
|
|
136
|
+
k || ((i = _.current) == null || i.focus(), $(!0));
|
|
121
137
|
};
|
|
122
|
-
|
|
123
|
-
if (
|
|
124
|
-
const { clientHeight:
|
|
125
|
-
|
|
138
|
+
w(() => {
|
|
139
|
+
if (_ && _.current) {
|
|
140
|
+
const { clientHeight: i } = _.current;
|
|
141
|
+
R(i);
|
|
126
142
|
}
|
|
127
|
-
}, [o,
|
|
128
|
-
|
|
143
|
+
}, [o, A]), w(() => (N(!0), document.addEventListener("keydown", z, !1), () => document.removeEventListener("keydown", z, !1)), []);
|
|
144
|
+
const B = G(
|
|
145
|
+
() => ({
|
|
146
|
+
ignoreSelectors: [`[${X}]`]
|
|
147
|
+
}),
|
|
148
|
+
[]
|
|
149
|
+
);
|
|
150
|
+
return tt(_, v ? h : void 0, B), /* @__PURE__ */ t(U, { onExitComplete: d, children: I && /* @__PURE__ */ t("div", { className: g("modal", { [`overlay-${l}`]: l }), style: { zIndex: E }, children: /* @__PURE__ */ u(
|
|
151
|
+
Y.div,
|
|
129
152
|
{
|
|
130
|
-
className:
|
|
131
|
-
ref:
|
|
153
|
+
className: g("modal-window", { [`size-${r}`]: r }, a),
|
|
154
|
+
ref: _,
|
|
132
155
|
tabIndex: 0,
|
|
133
|
-
initial: { opacity: 0, marginTop: -
|
|
134
|
-
animate: { opacity: 1, marginTop:
|
|
135
|
-
exit: { opacity: 0, marginTop: -
|
|
156
|
+
initial: { opacity: 0, marginTop: -b },
|
|
157
|
+
animate: { opacity: 1, marginTop: b },
|
|
158
|
+
exit: { opacity: 0, marginTop: -b },
|
|
136
159
|
transition: { duration: 0.3 },
|
|
137
|
-
onAnimationStart:
|
|
160
|
+
onAnimationStart: P,
|
|
138
161
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
] }) : /* @__PURE__ */
|
|
144
|
-
|
|
145
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ t(rt, { title: e, onClose: h, withDescription: !!m }),
|
|
163
|
+
H ? /* @__PURE__ */ u(K, { autoHeight: !0, autoHeightMax: W(), hideTracksWhenNotNeeded: !0, children: [
|
|
164
|
+
m && /* @__PURE__ */ t("span", { className: g("description", { scrollable: H }), children: m }),
|
|
165
|
+
/* @__PURE__ */ t(S, { scrollable: !0, children: o })
|
|
166
|
+
] }) : /* @__PURE__ */ u(F, { children: [
|
|
167
|
+
m && /* @__PURE__ */ t("span", { className: g("description"), children: m }),
|
|
168
|
+
/* @__PURE__ */ t(S, { children: o })
|
|
146
169
|
] }),
|
|
147
|
-
!
|
|
148
|
-
|
|
170
|
+
!O && (M ? M(h) : /* @__PURE__ */ t(
|
|
171
|
+
lt,
|
|
149
172
|
{
|
|
150
173
|
size: r,
|
|
151
|
-
footerNode:
|
|
152
|
-
okButton:
|
|
174
|
+
footerNode: n,
|
|
175
|
+
okButton: c,
|
|
153
176
|
cancelButton: s,
|
|
154
|
-
closeHandler:
|
|
177
|
+
closeHandler: h
|
|
155
178
|
}
|
|
156
179
|
))
|
|
157
180
|
]
|
|
@@ -160,8 +183,8 @@ const V = () => {
|
|
|
160
183
|
) }) });
|
|
161
184
|
};
|
|
162
185
|
export {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
186
|
+
$t as Modal,
|
|
187
|
+
S as ModalContent,
|
|
188
|
+
lt as ModalFooter,
|
|
189
|
+
rt as ModalHeader
|
|
167
190
|
};
|