mimir-ui-kit 1.38.17 → 1.38.18
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
|
|
1
|
-
import { jsx as
|
1
|
+
import { jsx as s, jsxs as h, Fragment as D } from "react/jsx-runtime";
|
2
2
|
import { c as l } from "../../index-DIxK0V-G.js";
|
3
3
|
import { forwardRef as U, useState as q, useMemo as W, useCallback as R, useEffect as $ } from "react";
|
4
4
|
import { ESelectSearchSize as g } from "./constants.js";
|
@@ -37,46 +37,46 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
37
37
|
(E, L) => {
|
38
38
|
const {
|
39
39
|
placeholder: w,
|
40
|
-
size:
|
41
|
-
value:
|
42
|
-
onChange:
|
40
|
+
size: a = g.L,
|
41
|
+
value: i,
|
42
|
+
onChange: n,
|
43
43
|
full: V,
|
44
44
|
showArrow: C = !0,
|
45
|
-
items:
|
45
|
+
items: u = [],
|
46
46
|
classNameOption: F,
|
47
47
|
displayValue: G = "name",
|
48
48
|
filterOnSearch: I = !0,
|
49
|
-
onSearch:
|
49
|
+
onSearch: b,
|
50
50
|
variant: S = X.DefaultGray,
|
51
|
-
menuPlacement:
|
51
|
+
menuPlacement: f = "bottom",
|
52
52
|
disabled: r = !1,
|
53
53
|
searchProps: y,
|
54
|
-
withClearButton:
|
54
|
+
withClearButton: N = !1,
|
55
55
|
disableInput: c = !1,
|
56
56
|
autocomplete: k = "on",
|
57
57
|
immediate: P = !1
|
58
|
-
} = E,
|
58
|
+
} = E, v = String((i == null ? void 0 : i[G]) || ""), [d, m] = q(v), [p, _] = q(i), x = W(() => I && d.trim().toLowerCase() ? u.filter(
|
59
59
|
(t) => t.name.toLowerCase().includes(d.toLowerCase())
|
60
|
-
) :
|
61
|
-
t ? (
|
60
|
+
) : u, [d, u, I]), T = (t) => {
|
61
|
+
t ? (m(t.name), _(t), n == null || n(t)) : (m(""), _(null), n == null || n({ id: "", name: "" }));
|
62
62
|
}, z = R(
|
63
63
|
(t) => {
|
64
64
|
if (c) return;
|
65
65
|
const o = t.target.value;
|
66
|
-
|
66
|
+
m(o), b == null || b(o), p && o !== p.name && _(null), !o && i && (n == null || n({ id: "", name: "" }));
|
67
67
|
},
|
68
|
-
[c,
|
68
|
+
[c, n, b, i, p]
|
69
69
|
), H = () => {
|
70
|
-
|
70
|
+
m(""), _(null), n == null || n({ id: "", name: "" });
|
71
71
|
};
|
72
72
|
return $(() => {
|
73
|
-
const t = !
|
74
|
-
|
75
|
-
}, [
|
73
|
+
const t = !i || typeof i == "object" && !Object.keys(i).length;
|
74
|
+
m(t ? "" : v), _(t ? null : i);
|
75
|
+
}, [i, v]), /* @__PURE__ */ s(
|
76
76
|
Y,
|
77
77
|
{
|
78
78
|
as: "div",
|
79
|
-
value:
|
79
|
+
value: p,
|
80
80
|
className: l(e["select-search"], {
|
81
81
|
[e.full]: V,
|
82
82
|
[e.disabled]: r
|
@@ -86,23 +86,23 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
86
86
|
disabled: r,
|
87
87
|
virtual: { options: x },
|
88
88
|
immediate: P,
|
89
|
-
children: ({ open: t }) => /* @__PURE__ */
|
90
|
-
/* @__PURE__ */
|
89
|
+
children: ({ open: t }) => /* @__PURE__ */ h(D, { children: [
|
90
|
+
/* @__PURE__ */ h(
|
91
91
|
"div",
|
92
92
|
{
|
93
|
-
className: l(e.container, e[
|
93
|
+
className: l(e.container, e[a], {
|
94
94
|
[e["container-open"]]: t
|
95
95
|
}),
|
96
96
|
children: [
|
97
|
-
c && /* @__PURE__ */
|
98
|
-
/* @__PURE__ */
|
97
|
+
c && /* @__PURE__ */ h("div", { style: { position: "relative", width: "100%" }, children: [
|
98
|
+
/* @__PURE__ */ s(M, { disabled: r, style: { width: "100%" }, children: /* @__PURE__ */ s(
|
99
99
|
j,
|
100
100
|
{
|
101
101
|
as: B,
|
102
102
|
label: w,
|
103
|
-
size: A(
|
103
|
+
size: A(a),
|
104
104
|
className: l(e["select-input"], {
|
105
|
-
[e["select-input-disabled"]]: c &&
|
105
|
+
[e["select-input-disabled"]]: c && N
|
106
106
|
}),
|
107
107
|
onChange: z,
|
108
108
|
value: d,
|
@@ -116,13 +116,13 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
116
116
|
},
|
117
117
|
rightAddon: {
|
118
118
|
addonType: "icon",
|
119
|
-
addonContent: J(t,
|
119
|
+
addonContent: J(t, a)
|
120
120
|
},
|
121
121
|
autocomplete: k,
|
122
122
|
...y
|
123
123
|
}
|
124
124
|
) }),
|
125
|
-
|
125
|
+
N && d && /* @__PURE__ */ s(
|
126
126
|
Q,
|
127
127
|
{
|
128
128
|
tabIndex: -1,
|
@@ -143,34 +143,34 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
143
143
|
}
|
144
144
|
)
|
145
145
|
] }),
|
146
|
-
!c && /* @__PURE__ */
|
146
|
+
!c && /* @__PURE__ */ s(
|
147
147
|
j,
|
148
148
|
{
|
149
149
|
as: B,
|
150
150
|
label: w,
|
151
|
-
size: A(
|
151
|
+
size: A(a),
|
152
152
|
className: e["select-input"],
|
153
153
|
onChange: z,
|
154
154
|
value: d,
|
155
155
|
disabled: r,
|
156
156
|
variant: S,
|
157
|
-
withClearButton:
|
157
|
+
withClearButton: N,
|
158
158
|
rightSlotClassName: e["right-slot"],
|
159
159
|
requiredMarkClassName: e["required-mark"],
|
160
160
|
"data-testid": "select-search-input",
|
161
161
|
rightAddon: C ? {
|
162
162
|
addonType: "react-node",
|
163
|
-
addonContent: C && /* @__PURE__ */
|
163
|
+
addonContent: C && /* @__PURE__ */ s(
|
164
164
|
M,
|
165
165
|
{
|
166
166
|
className: l(e.button, {
|
167
167
|
[e.disabled]: r
|
168
168
|
}),
|
169
169
|
disabled: r,
|
170
|
-
children: /* @__PURE__ */
|
170
|
+
children: /* @__PURE__ */ s(
|
171
171
|
O,
|
172
172
|
{
|
173
|
-
iconName:
|
173
|
+
iconName: a == g.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
174
174
|
className: l(e["selector-icon"], {
|
175
175
|
[e["selector-icon-open"]]: t
|
176
176
|
})
|
@@ -189,37 +189,37 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
189
189
|
]
|
190
190
|
}
|
191
191
|
),
|
192
|
-
t && /* @__PURE__ */
|
192
|
+
t && /* @__PURE__ */ s(D, { children: u.length ? x.length ? /* @__PURE__ */ s(
|
193
193
|
Z,
|
194
194
|
{
|
195
195
|
"data-testid": "select-search-options",
|
196
196
|
className: l(
|
197
197
|
e.options,
|
198
|
-
e[
|
199
|
-
e[
|
198
|
+
e[a],
|
199
|
+
e[f]
|
200
200
|
),
|
201
|
-
children: ({ option: o }) => /* @__PURE__ */
|
201
|
+
children: ({ option: o }) => /* @__PURE__ */ h(
|
202
202
|
ee,
|
203
203
|
{
|
204
204
|
value: o,
|
205
205
|
className: ({ focus: K }) => l(
|
206
206
|
e.option,
|
207
207
|
F,
|
208
|
-
|
208
|
+
a && e[a],
|
209
209
|
{
|
210
210
|
[e["option-active"]]: K
|
211
211
|
}
|
212
212
|
),
|
213
213
|
"data-testid": `select-search-option-${o.id}`,
|
214
214
|
children: [
|
215
|
-
/* @__PURE__ */
|
215
|
+
/* @__PURE__ */ h("div", { className: e["option-inner"], children: [
|
216
216
|
o.name,
|
217
|
-
o.bottom && /* @__PURE__ */
|
217
|
+
o.bottom && /* @__PURE__ */ s("div", { children: o.bottom })
|
218
218
|
] }),
|
219
|
-
|
219
|
+
p && p.id === o.id && /* @__PURE__ */ s(
|
220
220
|
O,
|
221
221
|
{
|
222
|
-
iconName:
|
222
|
+
iconName: a === g.M ? "Done16px" : "Done24px",
|
223
223
|
className: e["selected-icon"]
|
224
224
|
}
|
225
225
|
)
|
@@ -228,26 +228,26 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
228
228
|
o.id
|
229
229
|
)
|
230
230
|
}
|
231
|
-
) : /* @__PURE__ */
|
231
|
+
) : /* @__PURE__ */ s(
|
232
232
|
"div",
|
233
233
|
{
|
234
234
|
className: l(
|
235
235
|
e.options,
|
236
|
-
e[
|
236
|
+
e[a],
|
237
237
|
e["no-options"],
|
238
|
-
e[
|
238
|
+
e[f]
|
239
239
|
),
|
240
240
|
"data-headlessui-state": t ? "open" : "closed",
|
241
241
|
children: "Ничего не найдено"
|
242
242
|
}
|
243
|
-
) : /* @__PURE__ */
|
243
|
+
) : /* @__PURE__ */ s(
|
244
244
|
"div",
|
245
245
|
{
|
246
246
|
className: l(
|
247
247
|
e.options,
|
248
|
-
e[
|
248
|
+
e[a],
|
249
249
|
e["no-options"],
|
250
|
-
e[
|
250
|
+
e[f]
|
251
251
|
),
|
252
252
|
"data-headlessui-state": t ? "open" : "closed",
|
253
253
|
children: "Нет данных"
|