mimir-ui-kit 1.38.5 → 1.38.6
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
1
|
+
import { jsx as a, jsxs as m, 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 j, useMemo as R, useCallback as $, useEffect as J } from "react";
|
|
4
4
|
import { ESelectSearchSize as g } from "./constants.js";
|
|
@@ -8,7 +8,7 @@ import { Button as W } from "../Button/Button.js";
|
|
|
8
8
|
import { I as O } from "../../Input-BYrIS5GU.js";
|
|
9
9
|
import { EInputVariant as X } from "../Input/constants.js";
|
|
10
10
|
import { H as Y, U as B, G as M, K as Z, j as ee } from "../../combobox-DgSZTriw.js";
|
|
11
|
-
import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_container_1bph7_13", ne = "_full_1bph7_28", se = "_button_1bph7_40", ae = "_options_1bph7_54", ie = "_top_1bph7_65", le = "_bottom_1bph7_71", re = "_m_1bph7_98", ce = "_l_1bph7_113",
|
|
11
|
+
import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_container_1bph7_13", ne = "_full_1bph7_28", se = "_button_1bph7_40", ae = "_options_1bph7_54", ie = "_top_1bph7_65", le = "_bottom_1bph7_71", re = "_m_1bph7_98", ce = "_l_1bph7_113", de = "_option_1bph7_54", pe = "_clear_1bph7_167", e = {
|
|
12
12
|
"select-search": "_select-search_1bph7_2",
|
|
13
13
|
disabled: te,
|
|
14
14
|
container: oe,
|
|
@@ -26,12 +26,12 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
26
26
|
l: ce,
|
|
27
27
|
"select-input": "_select-input_1bph7_128",
|
|
28
28
|
"select-input-disabled": "_select-input-disabled_1bph7_131",
|
|
29
|
-
option:
|
|
29
|
+
option: de,
|
|
30
30
|
"option-active": "_option-active_1bph7_147",
|
|
31
31
|
"option-inner": "_option-inner_1bph7_150",
|
|
32
32
|
"right-slot": "_right-slot_1bph7_157",
|
|
33
33
|
"required-mark": "_required-mark_1bph7_162",
|
|
34
|
-
clear:
|
|
34
|
+
clear: pe,
|
|
35
35
|
"icon-button": "_icon-button_1bph7_176"
|
|
36
36
|
}, Ce = U(
|
|
37
37
|
(E, L) => {
|
|
@@ -42,7 +42,7 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
42
42
|
onChange: s,
|
|
43
43
|
full: V,
|
|
44
44
|
showArrow: C = !0,
|
|
45
|
-
items:
|
|
45
|
+
items: p = [],
|
|
46
46
|
classNameOption: F,
|
|
47
47
|
displayValue: G = "name",
|
|
48
48
|
filterOnSearch: I = !0,
|
|
@@ -55,23 +55,23 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
55
55
|
disableInput: c = !1,
|
|
56
56
|
autocomplete: k = "on",
|
|
57
57
|
immediate: P = !1
|
|
58
|
-
} = E, N = String((n == null ? void 0 : n[G]) || ""), [
|
|
59
|
-
(
|
|
60
|
-
) :
|
|
61
|
-
|
|
58
|
+
} = E, N = String((n == null ? void 0 : n[G]) || ""), [d, u] = j(N), [v, h] = j(n), x = R(() => !I || n && (n.id || n.name) ? p : d.trim().toLowerCase() ? p.filter(
|
|
59
|
+
(t) => t.name.toLowerCase().includes(d.toLowerCase())
|
|
60
|
+
) : p, [d, p, n, I]), T = (t) => {
|
|
61
|
+
t ? (u(t.name), h(t), s == null || s(t)) : (u(""), h(null), s == null || s({ id: "", name: "" }));
|
|
62
62
|
}, z = $(
|
|
63
|
-
(
|
|
63
|
+
(t) => {
|
|
64
64
|
if (c) return;
|
|
65
|
-
const
|
|
66
|
-
|
|
65
|
+
const o = t.target.value;
|
|
66
|
+
u(o), _ == null || _(o), !o && n && (s == null || s({ id: "", name: "" }));
|
|
67
67
|
},
|
|
68
68
|
[c, s, _, n]
|
|
69
69
|
), H = () => {
|
|
70
|
-
|
|
70
|
+
u(""), h(null), s == null || s({ id: "", name: "" });
|
|
71
71
|
};
|
|
72
72
|
return J(() => {
|
|
73
|
-
const
|
|
74
|
-
|
|
73
|
+
const t = !n || typeof n == "object" && !Object.keys(n).length;
|
|
74
|
+
u(t ? "" : N), h(t ? null : n);
|
|
75
75
|
}, [n, N]), /* @__PURE__ */ a(
|
|
76
76
|
Y,
|
|
77
77
|
{
|
|
@@ -86,15 +86,15 @@ 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:
|
|
90
|
-
/* @__PURE__ */
|
|
89
|
+
children: ({ open: t }) => /* @__PURE__ */ m(D, { children: [
|
|
90
|
+
/* @__PURE__ */ m(
|
|
91
91
|
"div",
|
|
92
92
|
{
|
|
93
93
|
className: l(e.container, e[i], {
|
|
94
|
-
[e["container-open"]]:
|
|
94
|
+
[e["container-open"]]: t
|
|
95
95
|
}),
|
|
96
96
|
children: [
|
|
97
|
-
c && /* @__PURE__ */
|
|
97
|
+
c && /* @__PURE__ */ m("div", { style: { position: "relative", width: "100%" }, children: [
|
|
98
98
|
/* @__PURE__ */ a(B, { disabled: r, style: { width: "100%" }, children: /* @__PURE__ */ a(
|
|
99
99
|
M,
|
|
100
100
|
{
|
|
@@ -105,24 +105,24 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
105
105
|
[e["select-input-disabled"]]: c && f
|
|
106
106
|
}),
|
|
107
107
|
onChange: z,
|
|
108
|
-
value:
|
|
108
|
+
value: d,
|
|
109
109
|
disabled: r,
|
|
110
110
|
variant: S,
|
|
111
111
|
rightSlotClassName: e["right-slot"],
|
|
112
112
|
requiredMarkClassName: e["required-mark"],
|
|
113
113
|
"data-testid": "select-search-input",
|
|
114
|
-
onFocus: (
|
|
115
|
-
c &&
|
|
114
|
+
onFocus: (o) => {
|
|
115
|
+
c && o.target.blur();
|
|
116
116
|
},
|
|
117
117
|
rightAddon: {
|
|
118
118
|
addonType: "icon",
|
|
119
|
-
addonContent: Q(
|
|
119
|
+
addonContent: Q(t, i)
|
|
120
120
|
},
|
|
121
121
|
autocomplete: k,
|
|
122
122
|
...y
|
|
123
123
|
}
|
|
124
124
|
) }),
|
|
125
|
-
f &&
|
|
125
|
+
f && d && /* @__PURE__ */ a(
|
|
126
126
|
W,
|
|
127
127
|
{
|
|
128
128
|
tabIndex: -1,
|
|
@@ -136,8 +136,8 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
136
136
|
clear: !0,
|
|
137
137
|
disabled: r,
|
|
138
138
|
variant: "secondary-gray",
|
|
139
|
-
onClick: (
|
|
140
|
-
|
|
139
|
+
onClick: (o) => {
|
|
140
|
+
o.stopPropagation(), H();
|
|
141
141
|
},
|
|
142
142
|
"data-testid": "clear-button"
|
|
143
143
|
}
|
|
@@ -151,7 +151,7 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
151
151
|
size: q(i),
|
|
152
152
|
className: e["select-input"],
|
|
153
153
|
onChange: z,
|
|
154
|
-
value:
|
|
154
|
+
value: d,
|
|
155
155
|
disabled: r,
|
|
156
156
|
variant: S,
|
|
157
157
|
withClearButton: f,
|
|
@@ -172,15 +172,15 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
172
172
|
{
|
|
173
173
|
iconName: i == g.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
|
174
174
|
className: l(e["selector-icon"], {
|
|
175
|
-
[e["selector-icon-open"]]:
|
|
175
|
+
[e["selector-icon-open"]]: t
|
|
176
176
|
})
|
|
177
177
|
}
|
|
178
178
|
)
|
|
179
179
|
}
|
|
180
180
|
)
|
|
181
181
|
} : void 0,
|
|
182
|
-
onFocus: (
|
|
183
|
-
c &&
|
|
182
|
+
onFocus: (o) => {
|
|
183
|
+
c && o.target.blur();
|
|
184
184
|
},
|
|
185
185
|
autocomplete: k,
|
|
186
186
|
...y
|
|
@@ -189,7 +189,7 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
189
189
|
]
|
|
190
190
|
}
|
|
191
191
|
),
|
|
192
|
-
|
|
192
|
+
t && /* @__PURE__ */ a(D, { children: p.length ? x.length ? /* @__PURE__ */ a(
|
|
193
193
|
Z,
|
|
194
194
|
{
|
|
195
195
|
"data-testid": "select-search-options",
|
|
@@ -198,10 +198,10 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
198
198
|
e[i],
|
|
199
199
|
e[b]
|
|
200
200
|
),
|
|
201
|
-
children: ({ option:
|
|
201
|
+
children: ({ option: o }) => /* @__PURE__ */ m(
|
|
202
202
|
ee,
|
|
203
203
|
{
|
|
204
|
-
value:
|
|
204
|
+
value: o,
|
|
205
205
|
className: ({ focus: K }) => l(
|
|
206
206
|
e.option,
|
|
207
207
|
F,
|
|
@@ -210,13 +210,13 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
210
210
|
[e["option-active"]]: K
|
|
211
211
|
}
|
|
212
212
|
),
|
|
213
|
-
"data-testid": `select-search-option-${
|
|
213
|
+
"data-testid": `select-search-option-${o.id}`,
|
|
214
214
|
children: [
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
/* @__PURE__ */ m("div", { className: e["option-inner"], children: [
|
|
216
|
+
o.name,
|
|
217
|
+
o.bottom && /* @__PURE__ */ a("div", { children: o.bottom })
|
|
218
218
|
] }),
|
|
219
|
-
v && v.id ===
|
|
219
|
+
v && v.id === o.id && /* @__PURE__ */ a(
|
|
220
220
|
A,
|
|
221
221
|
{
|
|
222
222
|
iconName: i === g.M ? "Done16px" : "Done24px",
|
|
@@ -225,7 +225,7 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
225
225
|
)
|
|
226
226
|
]
|
|
227
227
|
},
|
|
228
|
-
|
|
228
|
+
o.id
|
|
229
229
|
)
|
|
230
230
|
}
|
|
231
231
|
) : /* @__PURE__ */ a(
|
|
@@ -237,6 +237,7 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
237
237
|
e["no-options"],
|
|
238
238
|
e[b]
|
|
239
239
|
),
|
|
240
|
+
"data-headlessui-state": t ? "open" : "closed",
|
|
240
241
|
children: "Ничего не найдено"
|
|
241
242
|
}
|
|
242
243
|
) : /* @__PURE__ */ a(
|
|
@@ -248,6 +249,7 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
248
249
|
e["no-options"],
|
|
249
250
|
e[b]
|
|
250
251
|
),
|
|
252
|
+
"data-headlessui-state": t ? "open" : "closed",
|
|
251
253
|
children: "Нет данных"
|
|
252
254
|
}
|
|
253
255
|
) })
|