mimir-ui-kit 1.61.0 → 1.62.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/components/CopyText/CopyText.js +46 -46
- package/dist/components/DropdownSelect/DropdownSelect.js +25 -23
- package/dist/components/DropdownSelect/types.d.ts +4 -0
- package/dist/components/MultiSelectSearch/hooks/useRenderVirtualizedList.d.ts +2 -1
- package/dist/components/MultiSelectSearch/hooks/useRenderVirtualizedList.js +50 -48
- package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/components/SelectSearch/SelectSearch.js +53 -51
- package/dist/components/SelectSearch/types.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as E, useState as
|
|
1
|
+
import { jsxs as N, jsx as _ } from "react/jsx-runtime";
|
|
2
|
+
import { c as r } from "../../index-DIxK0V-G.js";
|
|
3
|
+
import { forwardRef as E, useState as c, useCallback as i } from "react";
|
|
4
4
|
import { Icon as H } from "../../icons/Icon.js";
|
|
5
5
|
import '../../assets/CopyText.css';const L = "_wrapper_1t6ix_2", R = "_container_1t6ix_7", k = "_disabled_1t6ix_14", B = "_hovered_1t6ix_19", q = "_text_1t6ix_23", z = "_pressed_1t6ix_26", G = "_icon_1t6ix_30", J = "_visible_1t6ix_40", K = "_toast_1t6ix_49", Q = "_fadeOut_1t6ix_66", e = {
|
|
6
6
|
wrapper: L,
|
|
@@ -15,58 +15,58 @@ import '../../assets/CopyText.css';const L = "_wrapper_1t6ix_2", R = "_container
|
|
|
15
15
|
"slide-in": "_slide-in_1t6ix_1",
|
|
16
16
|
fadeOut: Q,
|
|
17
17
|
"slide-out": "_slide-out_1t6ix_1"
|
|
18
|
-
},
|
|
19
|
-
(
|
|
18
|
+
}, T = 200, V = E(
|
|
19
|
+
(b, w) => {
|
|
20
20
|
const {
|
|
21
21
|
text: s,
|
|
22
|
-
className:
|
|
23
|
-
onCopy:
|
|
24
|
-
showToast:
|
|
25
|
-
toastDuration:
|
|
26
|
-
toastText:
|
|
22
|
+
className: M,
|
|
23
|
+
onCopy: n,
|
|
24
|
+
showToast: p = !0,
|
|
25
|
+
toastDuration: u = 2e3,
|
|
26
|
+
toastText: y = "Скопировано в буфер обмена",
|
|
27
27
|
disabled: t = !1,
|
|
28
|
-
showCopyButton:
|
|
28
|
+
showCopyButton: o = !1,
|
|
29
29
|
defaultText: C,
|
|
30
30
|
...O
|
|
31
|
-
} =
|
|
31
|
+
} = b, [f, x] = c(o), [a, m] = c(!1), [I, h] = c(!1), [D, d] = c(!1), v = i(async () => {
|
|
32
32
|
if (!t)
|
|
33
33
|
try {
|
|
34
|
-
if (await navigator.clipboard.writeText(s),
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
34
|
+
if (await navigator.clipboard.writeText(s), p) {
|
|
35
|
+
h(!0), d(!1);
|
|
36
|
+
const l = Math.max(
|
|
37
|
+
u - T,
|
|
38
38
|
0
|
|
39
39
|
);
|
|
40
40
|
setTimeout(() => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
},
|
|
41
|
+
d(!0), setTimeout(() => {
|
|
42
|
+
h(!1), d(!1);
|
|
43
|
+
}, T);
|
|
44
|
+
}, l);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
} catch (
|
|
48
|
-
console.error("Failed to copy text:",
|
|
46
|
+
n == null || n(s);
|
|
47
|
+
} catch (l) {
|
|
48
|
+
console.error("Failed to copy text:", l);
|
|
49
49
|
}
|
|
50
|
-
}, [s,
|
|
51
|
-
t || x(!0);
|
|
52
|
-
}, [t]), g =
|
|
53
|
-
x(!1);
|
|
54
|
-
}, []), A =
|
|
55
|
-
!t && s &&
|
|
56
|
-
}, [t, s]), F =
|
|
57
|
-
s && !t &&
|
|
58
|
-
}, [t,
|
|
50
|
+
}, [s, n, p, u, t]), S = i(() => {
|
|
51
|
+
o || t || x(!0);
|
|
52
|
+
}, [t, o]), g = i(() => {
|
|
53
|
+
o || x(!1);
|
|
54
|
+
}, [o]), A = i(() => {
|
|
55
|
+
!t && s && m(!0);
|
|
56
|
+
}, [t, s]), F = i(() => {
|
|
57
|
+
s && !t && a && (m(!1), v());
|
|
58
|
+
}, [t, a, s, v]), P = r(e.container, M, {
|
|
59
59
|
[e.disabled]: t,
|
|
60
|
-
[e.hovered]:
|
|
61
|
-
[e.pressed]:
|
|
62
|
-
}), U =
|
|
63
|
-
[e.pressed]:
|
|
64
|
-
}), j =
|
|
65
|
-
[e.pressed]:
|
|
66
|
-
[e.visible]:
|
|
60
|
+
[e.hovered]: f,
|
|
61
|
+
[e.pressed]: a
|
|
62
|
+
}), U = r(e.text, {
|
|
63
|
+
[e.pressed]: a
|
|
64
|
+
}), j = r(e.icon, {
|
|
65
|
+
[e.pressed]: a,
|
|
66
|
+
[e.visible]: f
|
|
67
67
|
});
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ N("div", { ref: w, className: e.wrapper, ...O, children: [
|
|
69
|
+
/* @__PURE__ */ N(
|
|
70
70
|
"div",
|
|
71
71
|
{
|
|
72
72
|
className: P,
|
|
@@ -75,18 +75,18 @@ import '../../assets/CopyText.css';const L = "_wrapper_1t6ix_2", R = "_container
|
|
|
75
75
|
onMouseDown: A,
|
|
76
76
|
onMouseUp: F,
|
|
77
77
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
s && /* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ _("span", { className: U, children: s || C }),
|
|
79
|
+
s && /* @__PURE__ */ _(H, { iconName: "CopyClipboard16px", className: j })
|
|
80
80
|
]
|
|
81
81
|
}
|
|
82
82
|
),
|
|
83
|
-
I && /* @__PURE__ */
|
|
83
|
+
I && /* @__PURE__ */ _(
|
|
84
84
|
"div",
|
|
85
85
|
{
|
|
86
|
-
className:
|
|
86
|
+
className: r(e.toast, {
|
|
87
87
|
[e.fadeOut]: D
|
|
88
88
|
}),
|
|
89
|
-
children:
|
|
89
|
+
children: y
|
|
90
90
|
}
|
|
91
91
|
)
|
|
92
92
|
] });
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as s, jsxs as d, Fragment as
|
|
1
|
+
import { jsx as s, jsxs as d, Fragment as b } from "react/jsx-runtime";
|
|
2
2
|
import { c as a } from "../../index-DIxK0V-G.js";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { EDropdownSelectSize as
|
|
3
|
+
import { forwardRef as y } from "react";
|
|
4
|
+
import { EDropdownSelectSize as S } from "./constants.js";
|
|
5
5
|
import { Icon as f } from "../../icons/Icon.js";
|
|
6
|
-
import { H as
|
|
7
|
-
import '../../assets/DropdownSelect.css';const
|
|
6
|
+
import { H as C, U as k, K as U, W as V } from "../../combobox-fIVOzEhl.js";
|
|
7
|
+
import '../../assets/DropdownSelect.css';const z = "_full_ow9jf_265", A = "_disabled_ow9jf_268", H = "_trigger_ow9jf_273", K = "_options_ow9jf_313", M = "_option_ow9jf_313", W = "_focused_ow9jf_356", B = "_s_ow9jf_381", E = "_m_ow9jf_390", F = "_l_ow9jf_399", e = {
|
|
8
8
|
"dropdown-select": "_dropdown-select_ow9jf_261",
|
|
9
|
-
full:
|
|
10
|
-
disabled:
|
|
11
|
-
trigger:
|
|
9
|
+
full: z,
|
|
10
|
+
disabled: A,
|
|
11
|
+
trigger: H,
|
|
12
12
|
"trigger-text": "_trigger-text_ow9jf_302",
|
|
13
|
-
options:
|
|
14
|
-
option:
|
|
13
|
+
options: K,
|
|
14
|
+
option: M,
|
|
15
15
|
focused: W,
|
|
16
16
|
"option-content": "_option-content_ow9jf_360",
|
|
17
17
|
"option-check": "_option-check_ow9jf_372",
|
|
18
18
|
s: B,
|
|
19
19
|
m: E,
|
|
20
20
|
l: F
|
|
21
|
-
}, I =
|
|
21
|
+
}, I = y(
|
|
22
22
|
(p, _) => {
|
|
23
23
|
const {
|
|
24
24
|
value: t,
|
|
@@ -31,17 +31,18 @@ import '../../assets/DropdownSelect.css';const V = "_full_ow9jf_265", z = "_disa
|
|
|
31
31
|
optionsClassName: j,
|
|
32
32
|
optionClassName: N,
|
|
33
33
|
full: c = !1,
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
isModal: h = !0,
|
|
35
|
+
size: l = S.M
|
|
36
|
+
} = p, x = (o) => {
|
|
36
37
|
n == null || n(o);
|
|
37
|
-
},
|
|
38
|
+
}, v = (o) => o ? o.displayValue ? o.displayValue : typeof o.name == "string" ? o.name : typeof o.value == "string" ? o.value : String(o.id) : "";
|
|
38
39
|
return /* @__PURE__ */ s(
|
|
39
|
-
|
|
40
|
+
C,
|
|
40
41
|
{
|
|
41
42
|
as: "div",
|
|
42
43
|
ref: _,
|
|
43
44
|
value: t,
|
|
44
|
-
onChange:
|
|
45
|
+
onChange: x,
|
|
45
46
|
disabled: i,
|
|
46
47
|
className: a(
|
|
47
48
|
e["dropdown-select"],
|
|
@@ -52,9 +53,9 @@ import '../../assets/DropdownSelect.css';const V = "_full_ow9jf_265", z = "_disa
|
|
|
52
53
|
},
|
|
53
54
|
g
|
|
54
55
|
),
|
|
55
|
-
children: ({ open: o }) => /* @__PURE__ */ d(
|
|
56
|
+
children: ({ open: o }) => /* @__PURE__ */ d(b, { children: [
|
|
56
57
|
/* @__PURE__ */ d(
|
|
57
|
-
|
|
58
|
+
k,
|
|
58
59
|
{
|
|
59
60
|
className: a(
|
|
60
61
|
e.trigger,
|
|
@@ -67,7 +68,7 @@ import '../../assets/DropdownSelect.css';const V = "_full_ow9jf_265", z = "_disa
|
|
|
67
68
|
),
|
|
68
69
|
"data-testid": "dropdown-select-trigger",
|
|
69
70
|
children: [
|
|
70
|
-
/* @__PURE__ */ s("span", { className: a(e["trigger-text"]), children: t ?
|
|
71
|
+
/* @__PURE__ */ s("span", { className: a(e["trigger-text"]), children: t ? v(t) : w }),
|
|
71
72
|
/* @__PURE__ */ s(
|
|
72
73
|
f,
|
|
73
74
|
{
|
|
@@ -78,19 +79,20 @@ import '../../assets/DropdownSelect.css';const V = "_full_ow9jf_265", z = "_disa
|
|
|
78
79
|
}
|
|
79
80
|
),
|
|
80
81
|
/* @__PURE__ */ s(
|
|
81
|
-
|
|
82
|
+
U,
|
|
82
83
|
{
|
|
84
|
+
modal: h,
|
|
83
85
|
className: a(e.options, e[l], j),
|
|
84
86
|
"data-testid": "dropdown-select-options",
|
|
85
87
|
children: m.map((r) => /* @__PURE__ */ d(
|
|
86
|
-
|
|
88
|
+
V,
|
|
87
89
|
{
|
|
88
90
|
value: r,
|
|
89
|
-
className: ({ focus:
|
|
91
|
+
className: ({ focus: D }) => a(
|
|
90
92
|
e.option,
|
|
91
93
|
e[l],
|
|
92
94
|
{
|
|
93
|
-
[e.focused]:
|
|
95
|
+
[e.focused]: D
|
|
94
96
|
},
|
|
95
97
|
N
|
|
96
98
|
),
|
|
@@ -25,6 +25,7 @@ type TUseRenderVirtualizedListProps = {
|
|
|
25
25
|
highlightMatches?: boolean;
|
|
26
26
|
internalSearchQuery?: string;
|
|
27
27
|
searchInHeaderGroupItems?: boolean;
|
|
28
|
+
isModal?: boolean;
|
|
28
29
|
};
|
|
29
|
-
export declare const useRenderVirtualizedList: ({ items, filteredItems, size, actualMenuPlacement, isVisible, noOptionsText, noMatchText, enableNestedSelection, renderNestedOptions, groupBy, parentRef, virtualItems, virtualizer, classNameOption, selectedItems, renderOptionContent, cls, useIconInsteadOfCheckbox, highlightMatches, internalSearchQuery, searchInHeaderGroupItems }: TUseRenderVirtualizedListProps) => () => ReactNode;
|
|
30
|
+
export declare const useRenderVirtualizedList: ({ items, filteredItems, size, actualMenuPlacement, isVisible, noOptionsText, noMatchText, enableNestedSelection, renderNestedOptions, groupBy, parentRef, virtualItems, virtualizer, classNameOption, selectedItems, renderOptionContent, cls, useIconInsteadOfCheckbox, highlightMatches, internalSearchQuery, searchInHeaderGroupItems, isModal }: TUseRenderVirtualizedListProps) => () => ReactNode;
|
|
30
31
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as n, jsxs as $, Fragment as D } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "../../../index-DIxK0V-G.js";
|
|
2
|
+
import { c as f } from "../../../index-DIxK0V-G.js";
|
|
3
3
|
import { Icon as k } from "../../../icons/Icon.js";
|
|
4
4
|
import { CheckboxMimir as b } from "../../CheckboxMimir/CheckboxMimir.js";
|
|
5
5
|
import { EMultiSelectSearchSize as j } from "../constants.js";
|
|
6
|
-
import { highlightReactNode as
|
|
7
|
-
import { W as E, K } from "../../../combobox-fIVOzEhl.js";
|
|
8
|
-
const
|
|
6
|
+
import { highlightReactNode as K } from "../utils.js";
|
|
7
|
+
import { W as E, K as W } from "../../../combobox-fIVOzEhl.js";
|
|
8
|
+
const w = (i, a, o, r, e) => /* @__PURE__ */ n(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
|
-
className:
|
|
11
|
+
className: f(
|
|
12
12
|
e.options,
|
|
13
13
|
e[i],
|
|
14
14
|
e["no-options"],
|
|
@@ -17,10 +17,10 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
|
|
|
17
17
|
),
|
|
18
18
|
children: r
|
|
19
19
|
}
|
|
20
|
-
),
|
|
20
|
+
), F = (i, a, o, r, e) => /* @__PURE__ */ n(
|
|
21
21
|
"div",
|
|
22
22
|
{
|
|
23
|
-
className:
|
|
23
|
+
className: f(
|
|
24
24
|
e.options,
|
|
25
25
|
e[i],
|
|
26
26
|
e["no-options"],
|
|
@@ -29,21 +29,21 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
|
|
|
29
29
|
),
|
|
30
30
|
children: r
|
|
31
31
|
}
|
|
32
|
-
),
|
|
32
|
+
), H = (i, a, o, r, e, p) => /* @__PURE__ */ n(
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
|
-
className:
|
|
35
|
+
className: f(p.options, p[i], p[a], {
|
|
36
36
|
[p.visible]: o
|
|
37
37
|
}),
|
|
38
38
|
children: e(r)
|
|
39
39
|
}
|
|
40
|
-
),
|
|
41
|
-
const u = new Set(
|
|
40
|
+
), T = (i, a, o, r, e, p, d, v, x, t, g, m, N, c, l) => {
|
|
41
|
+
const u = new Set(v.map((s) => s.id));
|
|
42
42
|
return /* @__PURE__ */ n(
|
|
43
43
|
"div",
|
|
44
44
|
{
|
|
45
45
|
ref: r,
|
|
46
|
-
className:
|
|
46
|
+
className: f(
|
|
47
47
|
t.options,
|
|
48
48
|
t[i],
|
|
49
49
|
t[a],
|
|
@@ -76,9 +76,9 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
|
|
|
76
76
|
{
|
|
77
77
|
className: t["group-header"],
|
|
78
78
|
"data-testid": `group-header-${h.name}`,
|
|
79
|
-
children:
|
|
79
|
+
children: N && c && l ? K(
|
|
80
80
|
h.name,
|
|
81
|
-
|
|
81
|
+
c,
|
|
82
82
|
t["highlighted-text"]
|
|
83
83
|
) : h.name
|
|
84
84
|
}
|
|
@@ -86,13 +86,13 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
|
|
|
86
86
|
E,
|
|
87
87
|
{
|
|
88
88
|
value: h,
|
|
89
|
-
className: ({ focus: L }) =>
|
|
90
|
-
[t["option-active"]]: L && !
|
|
89
|
+
className: ({ focus: L }) => f(t.option, d, i && t[i], {
|
|
90
|
+
[t["option-active"]]: L && !g
|
|
91
91
|
}),
|
|
92
92
|
"data-testid": `option-${h.id}`,
|
|
93
93
|
children: /* @__PURE__ */ $(D, { children: [
|
|
94
|
-
/* @__PURE__ */ n("div", { className: t["option-inner"], children:
|
|
95
|
-
|
|
94
|
+
/* @__PURE__ */ n("div", { className: t["option-inner"], children: x(h) }),
|
|
95
|
+
m ? S && /* @__PURE__ */ n(
|
|
96
96
|
k,
|
|
97
97
|
{
|
|
98
98
|
iconName: i === j.L ? "Done24px" : "Done16px",
|
|
@@ -117,35 +117,35 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
|
|
|
117
117
|
)
|
|
118
118
|
}
|
|
119
119
|
);
|
|
120
|
-
},
|
|
121
|
-
const
|
|
120
|
+
}, Y = (i, a, o, r, e, p, d, v, x, t) => {
|
|
121
|
+
const g = new Set(e.map((m) => m.id));
|
|
122
122
|
return /* @__PURE__ */ n(
|
|
123
|
-
|
|
123
|
+
W,
|
|
124
124
|
{
|
|
125
|
-
className:
|
|
125
|
+
className: f(d.options, d[i], d[a], {
|
|
126
126
|
[d.visible]: o
|
|
127
127
|
}),
|
|
128
|
-
modal:
|
|
128
|
+
modal: t,
|
|
129
129
|
static: !0,
|
|
130
130
|
children: ({ option: m }) => {
|
|
131
|
-
const
|
|
131
|
+
const N = g.has(m.id);
|
|
132
132
|
return /* @__PURE__ */ n(
|
|
133
133
|
E,
|
|
134
134
|
{
|
|
135
135
|
value: m,
|
|
136
|
-
className: ({ focus:
|
|
137
|
-
[d["option-active"]]:
|
|
136
|
+
className: ({ focus: c }) => f(d.option, r, i && d[i], {
|
|
137
|
+
[d["option-active"]]: c && !v
|
|
138
138
|
}),
|
|
139
139
|
"data-testid": `option-${m.id}`,
|
|
140
140
|
children: /* @__PURE__ */ $(D, { children: [
|
|
141
141
|
/* @__PURE__ */ n("div", { className: d["option-inner"], children: p(m) }),
|
|
142
|
-
|
|
142
|
+
x ? N && /* @__PURE__ */ n(
|
|
143
143
|
k,
|
|
144
144
|
{
|
|
145
145
|
iconName: i === j.L ? "Done24px" : "Done16px",
|
|
146
146
|
className: d["selected-icon"]
|
|
147
147
|
}
|
|
148
|
-
) : /* @__PURE__ */ n(b, { isInteractive: !1, checked:
|
|
148
|
+
) : /* @__PURE__ */ n(b, { isInteractive: !1, checked: N })
|
|
149
149
|
] })
|
|
150
150
|
},
|
|
151
151
|
m.id
|
|
@@ -153,7 +153,7 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
);
|
|
156
|
-
},
|
|
156
|
+
}, _ = ({
|
|
157
157
|
items: i,
|
|
158
158
|
filteredItems: a,
|
|
159
159
|
size: o,
|
|
@@ -161,35 +161,36 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
|
|
|
161
161
|
isVisible: e,
|
|
162
162
|
noOptionsText: p,
|
|
163
163
|
noMatchText: d,
|
|
164
|
-
enableNestedSelection:
|
|
165
|
-
renderNestedOptions:
|
|
164
|
+
enableNestedSelection: v,
|
|
165
|
+
renderNestedOptions: x,
|
|
166
166
|
groupBy: t,
|
|
167
|
-
parentRef:
|
|
168
|
-
virtualItems:
|
|
169
|
-
virtualizer:
|
|
170
|
-
classNameOption:
|
|
167
|
+
parentRef: g,
|
|
168
|
+
virtualItems: m,
|
|
169
|
+
virtualizer: N,
|
|
170
|
+
classNameOption: c,
|
|
171
171
|
selectedItems: l,
|
|
172
172
|
renderOptionContent: u,
|
|
173
173
|
cls: s,
|
|
174
174
|
useIconInsteadOfCheckbox: h = !1,
|
|
175
175
|
highlightMatches: S = !1,
|
|
176
176
|
internalSearchQuery: L,
|
|
177
|
-
searchInHeaderGroupItems: G = !1
|
|
178
|
-
|
|
177
|
+
searchInHeaderGroupItems: G = !1,
|
|
178
|
+
isModal: I = !0
|
|
179
|
+
}) => () => i.length ? a.length ? v ? H(
|
|
179
180
|
o,
|
|
180
181
|
r,
|
|
181
182
|
e,
|
|
182
183
|
a,
|
|
183
|
-
|
|
184
|
+
x,
|
|
184
185
|
s
|
|
185
|
-
) : t ?
|
|
186
|
+
) : t ? T(
|
|
186
187
|
o,
|
|
187
188
|
r,
|
|
188
189
|
e,
|
|
189
|
-
m,
|
|
190
|
-
f,
|
|
191
|
-
x,
|
|
192
190
|
g,
|
|
191
|
+
m,
|
|
192
|
+
N,
|
|
193
|
+
c,
|
|
193
194
|
l,
|
|
194
195
|
u,
|
|
195
196
|
s,
|
|
@@ -198,23 +199,24 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
|
|
|
198
199
|
S,
|
|
199
200
|
L,
|
|
200
201
|
G
|
|
201
|
-
) :
|
|
202
|
+
) : Y(
|
|
202
203
|
o,
|
|
203
204
|
r,
|
|
204
205
|
e,
|
|
205
|
-
|
|
206
|
+
c,
|
|
206
207
|
l,
|
|
207
208
|
u,
|
|
208
209
|
s,
|
|
209
210
|
t,
|
|
210
|
-
h
|
|
211
|
-
|
|
211
|
+
h,
|
|
212
|
+
I
|
|
213
|
+
) : F(
|
|
212
214
|
o,
|
|
213
215
|
r,
|
|
214
216
|
e,
|
|
215
217
|
d,
|
|
216
218
|
s
|
|
217
|
-
) :
|
|
219
|
+
) : w(
|
|
218
220
|
o,
|
|
219
221
|
r,
|
|
220
222
|
e,
|
|
@@ -222,5 +224,5 @@ const W = (i, a, o, r, e) => /* @__PURE__ */ n(
|
|
|
222
224
|
s
|
|
223
225
|
);
|
|
224
226
|
export {
|
|
225
|
-
|
|
227
|
+
_ as useRenderVirtualizedList
|
|
226
228
|
};
|
|
@@ -33,4 +33,5 @@ export declare const SelectSearch: import('react').ForwardRefExoticComponent<Pic
|
|
|
33
33
|
borderRadius?: ESelectSearchBorderRadius | `${ESelectSearchBorderRadius}`;
|
|
34
34
|
highlightMatches?: boolean;
|
|
35
35
|
searchInHeaderGroupItems?: boolean;
|
|
36
|
+
isModal?: boolean;
|
|
36
37
|
} & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p, Fragment as D } from "react/jsx-runtime";
|
|
2
|
-
import { u as
|
|
2
|
+
import { u as Ve } from "../../index-D5H8gPPn.js";
|
|
3
3
|
import { c as s } from "../../index-DIxK0V-G.js";
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { ESelectSearchSize as c, ELoadingIndicatorPlacement as w, ESelectSearchBorderRadius as
|
|
6
|
-
import { prepareGroupedItems as
|
|
4
|
+
import { forwardRef as ke, useRef as ie, useState as E, useMemo as T, useCallback as le, useEffect as ce } from "react";
|
|
5
|
+
import { ESelectSearchSize as c, ELoadingIndicatorPlacement as w, ESelectSearchBorderRadius as Ae } from "./constants.js";
|
|
6
|
+
import { prepareGroupedItems as Be, shouldShowMenuOnTop as Te, mapSizeToInputSize as de, getDropdownArrowIcon as Pe, highlightReactNode as ue } from "./utils.js";
|
|
7
7
|
import { Icon as P } from "../../icons/Icon.js";
|
|
8
|
-
import { Button as
|
|
8
|
+
import { Button as Ge } from "../Button/Button.js";
|
|
9
9
|
import { I as pe } from "../../Input-DPnH8pKc.js";
|
|
10
|
-
import { EInputVariant as
|
|
10
|
+
import { EInputVariant as qe } from "../Input/constants.js";
|
|
11
11
|
import { Loader as he } from "../Loader/Loader.js";
|
|
12
|
-
import { H as
|
|
13
|
-
import '../../assets/SelectSearch.css';const
|
|
14
|
-
container:
|
|
12
|
+
import { H as Re, U as me, G as _e, W as be, K as je } from "../../combobox-fIVOzEhl.js";
|
|
13
|
+
import '../../assets/SelectSearch.css';const Fe = "_container_11tdb_2", He = "_options_11tdb_15", $e = "_top_11tdb_26", Ke = "_bottom_11tdb_32", Ue = "_disabled_11tdb_63", We = "_full_11tdb_100", Qe = "_button_11tdb_112", Ye = "_s_11tdb_59", Je = "_m_11tdb_140", Xe = "_l_11tdb_153", Ze = "_loader_11tdb_186", et = "_option_11tdb_15", tt = "_clear_11tdb_225", e = {
|
|
14
|
+
container: Fe,
|
|
15
15
|
"container-open": "_container-open_11tdb_11",
|
|
16
|
-
options:
|
|
17
|
-
top:
|
|
18
|
-
bottom:
|
|
16
|
+
options: He,
|
|
17
|
+
top: $e,
|
|
18
|
+
bottom: Ke,
|
|
19
19
|
"no-options": "_no-options_11tdb_38",
|
|
20
20
|
"select-search": "_select-search_11tdb_59",
|
|
21
|
-
disabled:
|
|
21
|
+
disabled: Ue,
|
|
22
22
|
"border-radius-left": "_border-radius-left_11tdb_69",
|
|
23
23
|
"border-radius-right": "_border-radius-right_11tdb_81",
|
|
24
24
|
"border-radius-none": "_border-radius-none_11tdb_93",
|
|
25
|
-
full:
|
|
25
|
+
full: We,
|
|
26
26
|
"selected-icon": "_selected-icon_11tdb_104",
|
|
27
27
|
"selector-icon-open": "_selector-icon-open_11tdb_108",
|
|
28
|
-
button:
|
|
28
|
+
button: Qe,
|
|
29
29
|
"selector-icon": "_selector-icon_11tdb_108",
|
|
30
|
-
s:
|
|
31
|
-
m:
|
|
32
|
-
l:
|
|
30
|
+
s: Ye,
|
|
31
|
+
m: Je,
|
|
32
|
+
l: Xe,
|
|
33
33
|
"select-search-input": "_select-search-input_11tdb_166",
|
|
34
34
|
"select-search-input-disabled": "_select-search-input-disabled_11tdb_169",
|
|
35
35
|
"group-header": "_group-header_11tdb_176",
|
|
36
|
-
loader:
|
|
36
|
+
loader: Ze,
|
|
37
37
|
"input-container": "_input-container_11tdb_191",
|
|
38
|
-
option:
|
|
38
|
+
option: et,
|
|
39
39
|
"option-active": "_option-active_11tdb_205",
|
|
40
40
|
"option-inner": "_option-inner_11tdb_208",
|
|
41
41
|
"right-slot": "_right-slot_11tdb_215",
|
|
42
42
|
"required-mark": "_required-mark_11tdb_220",
|
|
43
|
-
clear:
|
|
43
|
+
clear: tt,
|
|
44
44
|
"icon-button": "_icon-button_11tdb_234",
|
|
45
45
|
"highlighted-text": "_highlighted-text_11tdb_238",
|
|
46
46
|
"highlighted-text-wrapper": "_highlighted-text-wrapper_11tdb_243"
|
|
47
|
-
},
|
|
47
|
+
}, ot = ke(
|
|
48
48
|
(fe, ge) => {
|
|
49
49
|
const {
|
|
50
50
|
placeholder: G,
|
|
@@ -59,7 +59,7 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
59
59
|
displayValue: y = "name",
|
|
60
60
|
filterOnSearch: j = !0,
|
|
61
61
|
onSearch: x,
|
|
62
|
-
variant: F =
|
|
62
|
+
variant: F = qe.DefaultGray,
|
|
63
63
|
menuPlacement: I = "bottom",
|
|
64
64
|
disabled: u = !1,
|
|
65
65
|
searchProps: H,
|
|
@@ -67,26 +67,27 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
67
67
|
disableInput: f = !1,
|
|
68
68
|
autocomplete: $ = "on",
|
|
69
69
|
immediate: Se = !1,
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
isModal: we = !0,
|
|
71
|
+
noOptionsText: ye = "Нет данных",
|
|
72
|
+
noMatchText: xe = "Ничего не найдено",
|
|
72
73
|
loadOnOpen: V,
|
|
73
74
|
loading: K,
|
|
74
75
|
loadingIndicatorPlacement: C = w.Dropdown,
|
|
75
76
|
groupBy: l,
|
|
76
77
|
getGroupTitle: U = (t) => t,
|
|
77
|
-
optionLayout:
|
|
78
|
+
optionLayout: Ie = "name-bottom",
|
|
78
79
|
autoPlacement: L = !1,
|
|
79
|
-
borderRadius: W =
|
|
80
|
+
borderRadius: W = Ae.All,
|
|
80
81
|
highlightMatches: Q = !1,
|
|
81
82
|
searchInHeaderGroupItems: z = !1
|
|
82
83
|
} = fe, k = (t) => {
|
|
83
84
|
if (!t) return "";
|
|
84
85
|
const o = t[y];
|
|
85
86
|
return typeof o == "string" ? o : String(o || "");
|
|
86
|
-
},
|
|
87
|
+
}, Ce = (t) => {
|
|
87
88
|
const o = t[y];
|
|
88
89
|
return typeof o == "string" ? o : String(o || "");
|
|
89
|
-
}, A = k(d), Y = ie(null), J = ie(null), [g, v] = E(A), [h, N] = E(d), [
|
|
90
|
+
}, A = k(d), Y = ie(null), J = ie(null), [g, v] = E(A), [h, N] = E(d), [Le, X] = E(!1), [M, Z] = E(I), ee = K !== void 0 ? K : Le, m = T(() => String(g || "").trim().toLowerCase(), [g]), S = T(() => {
|
|
90
91
|
if (!j)
|
|
91
92
|
return b;
|
|
92
93
|
if (l && z) {
|
|
@@ -95,7 +96,7 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
95
96
|
l && o[l] && String(o[l]).toLowerCase().includes(m) && t.add(o);
|
|
96
97
|
}), Array.from(t);
|
|
97
98
|
}
|
|
98
|
-
return m ? b.filter((t) =>
|
|
99
|
+
return m ? b.filter((t) => Ce(t).toLowerCase().includes(m)) : b;
|
|
99
100
|
}, [
|
|
100
101
|
m,
|
|
101
102
|
b,
|
|
@@ -103,11 +104,11 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
103
104
|
y,
|
|
104
105
|
l,
|
|
105
106
|
z
|
|
106
|
-
]), te = T(() => l ?
|
|
107
|
+
]), te = T(() => l ? Be(
|
|
107
108
|
S,
|
|
108
109
|
l,
|
|
109
110
|
U || ((t) => t)
|
|
110
|
-
) : S, [S, l, U]), B =
|
|
111
|
+
) : S, [S, l, U]), B = Ve({
|
|
111
112
|
count: te.length,
|
|
112
113
|
getScrollElement: () => Y.current,
|
|
113
114
|
estimateSize: () => n === c.L ? 65 : 49,
|
|
@@ -117,7 +118,7 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
117
118
|
Z(I);
|
|
118
119
|
return;
|
|
119
120
|
}
|
|
120
|
-
const t =
|
|
121
|
+
const t = Te(J, n);
|
|
121
122
|
Z(t ? "top" : I);
|
|
122
123
|
}, [L, I, n]);
|
|
123
124
|
ce(() => {
|
|
@@ -133,7 +134,7 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
133
134
|
} finally {
|
|
134
135
|
X(!1);
|
|
135
136
|
}
|
|
136
|
-
},
|
|
137
|
+
}, ze = (t) => {
|
|
137
138
|
if (t) {
|
|
138
139
|
const o = k(t);
|
|
139
140
|
v(o), N(t), i == null || i(t);
|
|
@@ -146,7 +147,7 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
146
147
|
v(o), x == null || x(o), h && o !== k(h) && N(null), !o && d && (i == null || i({ id: "", name: "" }));
|
|
147
148
|
},
|
|
148
149
|
[f, i, x, d, h, y]
|
|
149
|
-
),
|
|
150
|
+
), Me = () => {
|
|
150
151
|
v(""), N(null), i == null || i({ id: "", name: "" });
|
|
151
152
|
}, re = async (t) => {
|
|
152
153
|
f && t.target.blur(), _(), V && await oe();
|
|
@@ -155,10 +156,10 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
155
156
|
const t = !d || typeof d == "object" && !Object.keys(d).length;
|
|
156
157
|
v(t ? "" : A), N(t ? null : d);
|
|
157
158
|
}, [d, A]);
|
|
158
|
-
const
|
|
159
|
+
const De = () => ee && (C === w.Dropdown || C === w.Both) ? /* @__PURE__ */ p("div", { className: e.loader, children: [
|
|
159
160
|
/* @__PURE__ */ r(he, { size: "s" }),
|
|
160
161
|
"Загрузка..."
|
|
161
|
-
] }) :
|
|
162
|
+
] }) : ye, Ee = (t) => {
|
|
162
163
|
if (Ne)
|
|
163
164
|
return {
|
|
164
165
|
addonType: "react-node",
|
|
@@ -193,14 +194,14 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
193
194
|
e["highlighted-text"]
|
|
194
195
|
));
|
|
195
196
|
const a = t.bottom && /* @__PURE__ */ r("div", { children: t.bottom });
|
|
196
|
-
return
|
|
197
|
+
return Ie === "bottom-name" ? /* @__PURE__ */ p(D, { children: [
|
|
197
198
|
a,
|
|
198
199
|
o
|
|
199
200
|
] }) : /* @__PURE__ */ p(D, { children: [
|
|
200
201
|
o,
|
|
201
202
|
a
|
|
202
203
|
] });
|
|
203
|
-
},
|
|
204
|
+
}, Oe = (t) => b.length ? S.length ? l ? /* @__PURE__ */ r(
|
|
204
205
|
"div",
|
|
205
206
|
{
|
|
206
207
|
ref: Y,
|
|
@@ -289,8 +290,9 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
289
290
|
)
|
|
290
291
|
}
|
|
291
292
|
) : /* @__PURE__ */ r(
|
|
292
|
-
|
|
293
|
+
je,
|
|
293
294
|
{
|
|
295
|
+
modal: we,
|
|
294
296
|
className: s(
|
|
295
297
|
e.options,
|
|
296
298
|
e[n],
|
|
@@ -344,7 +346,7 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
344
346
|
e[M]
|
|
345
347
|
),
|
|
346
348
|
"data-headlessui-state": t ? "open" : "closed",
|
|
347
|
-
children:
|
|
349
|
+
children: xe
|
|
348
350
|
}
|
|
349
351
|
) : /* @__PURE__ */ r(
|
|
350
352
|
"div",
|
|
@@ -356,11 +358,11 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
356
358
|
e[M]
|
|
357
359
|
),
|
|
358
360
|
"data-headlessui-state": t ? "open" : "closed",
|
|
359
|
-
children:
|
|
361
|
+
children: De()
|
|
360
362
|
}
|
|
361
363
|
);
|
|
362
364
|
return /* @__PURE__ */ r(
|
|
363
|
-
|
|
365
|
+
Re,
|
|
364
366
|
{
|
|
365
367
|
as: "div",
|
|
366
368
|
value: h,
|
|
@@ -368,7 +370,7 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
368
370
|
[e.full]: ve,
|
|
369
371
|
[e.disabled]: u
|
|
370
372
|
}),
|
|
371
|
-
onChange:
|
|
373
|
+
onChange: ze,
|
|
372
374
|
ref: ge,
|
|
373
375
|
disabled: u,
|
|
374
376
|
virtual: l ? void 0 : { options: S },
|
|
@@ -408,7 +410,7 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
408
410
|
onFocus: re,
|
|
409
411
|
rightAddon: {
|
|
410
412
|
addonType: "icon",
|
|
411
|
-
addonContent:
|
|
413
|
+
addonContent: Pe(t, n)
|
|
412
414
|
},
|
|
413
415
|
autocomplete: $,
|
|
414
416
|
borderRadius: W,
|
|
@@ -418,7 +420,7 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
418
420
|
}
|
|
419
421
|
),
|
|
420
422
|
O && g && /* @__PURE__ */ r(
|
|
421
|
-
|
|
423
|
+
Ge,
|
|
422
424
|
{
|
|
423
425
|
tabIndex: -1,
|
|
424
426
|
className: s(e.clear, {
|
|
@@ -432,7 +434,7 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
432
434
|
disabled: u,
|
|
433
435
|
variant: "secondary-gray",
|
|
434
436
|
onClick: (o) => {
|
|
435
|
-
o.stopPropagation(),
|
|
437
|
+
o.stopPropagation(), Me();
|
|
436
438
|
},
|
|
437
439
|
"data-testid": "clear-button"
|
|
438
440
|
}
|
|
@@ -452,7 +454,7 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
452
454
|
variant: F,
|
|
453
455
|
withClearButton: O && !!g,
|
|
454
456
|
onChange: ne,
|
|
455
|
-
rightAddon:
|
|
457
|
+
rightAddon: Ee(t),
|
|
456
458
|
"data-testid": "select-search-input",
|
|
457
459
|
onFocus: re,
|
|
458
460
|
autocomplete: $,
|
|
@@ -463,13 +465,13 @@ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_o
|
|
|
463
465
|
]
|
|
464
466
|
}
|
|
465
467
|
),
|
|
466
|
-
t &&
|
|
468
|
+
t && Oe(t)
|
|
467
469
|
] })
|
|
468
470
|
}
|
|
469
471
|
);
|
|
470
472
|
}
|
|
471
473
|
);
|
|
472
|
-
|
|
474
|
+
ot.displayName = "SelectSearch";
|
|
473
475
|
export {
|
|
474
|
-
|
|
476
|
+
ot as SelectSearch
|
|
475
477
|
};
|
|
@@ -114,4 +114,8 @@ export type TSelectSearchProps = Pick<TInputProps, 'withClearButton' | 'variant'
|
|
|
114
114
|
* @default false
|
|
115
115
|
*/
|
|
116
116
|
searchInHeaderGroupItems?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Если `false`, разрешает прокрутку страницы и клики по внешним элементам при открытом списке, иначе блокирует скролл.
|
|
119
|
+
*/
|
|
120
|
+
isModal?: boolean;
|
|
117
121
|
};
|