mimir-ui-kit 1.45.0 → 1.47.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.
Files changed (35) hide show
  1. package/dist/assets/CheckboxMimir.css +1 -1
  2. package/dist/assets/SelectSearch.css +1 -1
  3. package/dist/assets/useNestedSelection.css +1 -0
  4. package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +2 -0
  5. package/dist/components/CheckboxMimir/CheckboxMimir.js +42 -41
  6. package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +5 -1
  7. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +277 -467
  8. package/dist/components/MultiSelectSearch/hooks/useChips.d.ts +18 -0
  9. package/dist/components/MultiSelectSearch/hooks/useChips.js +101 -0
  10. package/dist/components/MultiSelectSearch/hooks/useDataLoading.d.ts +10 -0
  11. package/dist/components/MultiSelectSearch/hooks/useDataLoading.js +21 -0
  12. package/dist/components/MultiSelectSearch/hooks/useEventHandling.d.ts +12 -0
  13. package/dist/components/MultiSelectSearch/hooks/useEventHandling.js +31 -0
  14. package/dist/components/MultiSelectSearch/hooks/useMenuPlacement.d.ts +19 -0
  15. package/dist/components/MultiSelectSearch/hooks/useMenuPlacement.js +38 -0
  16. package/dist/components/MultiSelectSearch/hooks/useMultiSelectState.d.ts +21 -0
  17. package/dist/components/MultiSelectSearch/hooks/useMultiSelectState.js +31 -0
  18. package/dist/components/MultiSelectSearch/hooks/useNestedSelection.d.ts +26 -0
  19. package/dist/components/MultiSelectSearch/hooks/useNestedSelection.js +12 -0
  20. package/dist/components/MultiSelectSearch/hooks/useRenderVirtualizedList.d.ts +30 -0
  21. package/dist/components/MultiSelectSearch/hooks/useRenderVirtualizedList.js +226 -0
  22. package/dist/components/MultiSelectSearch/hooks/useSearch.d.ts +17 -0
  23. package/dist/components/MultiSelectSearch/hooks/useSearch.js +68 -0
  24. package/dist/components/MultiSelectSearch/hooks/useVirtualization.d.ts +18 -0
  25. package/dist/components/MultiSelectSearch/hooks/useVirtualization.js +38 -0
  26. package/dist/components/MultiSelectSearch/types.d.ts +26 -0
  27. package/dist/components/MultiSelectSearch/utils.d.ts +32 -0
  28. package/dist/components/MultiSelectSearch/utils.js +145 -59
  29. package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
  30. package/dist/components/SelectSearch/SelectSearch.js +304 -324
  31. package/dist/components/SelectSearch/types.d.ts +5 -0
  32. package/dist/components/SelectSearch/utils.js +18 -17
  33. package/dist/useNestedSelection-bo9wXvE-.js +181 -0
  34. package/package.json +1 -1
  35. package/dist/assets/MultiSelectSearch.css +0 -1
@@ -1,189 +1,181 @@
1
- import { jsx as r, jsxs as c, Fragment as B } from "react/jsx-runtime";
2
- import { u as Ge } from "../../index-D5H8gPPn.js";
1
+ import { jsx as r, jsxs as p, Fragment as D } from "react/jsx-runtime";
2
+ import { u as Oe } from "../../index-D5H8gPPn.js";
3
3
  import { c as s } from "../../index-DIxK0V-G.js";
4
- import { forwardRef as qe, useRef as he, useState as w, useMemo as P, useCallback as me, useEffect as R } from "react";
5
- import { ESelectSearchSize as l, ELoadingIndicatorPlacement as I, ESelectSearchBorderRadius as je } from "./constants.js";
6
- import { prepareGroupedItems as Fe, shouldShowMenuOnTop as He, mapSizeToInputSize as _e, getDropdownArrowIcon as Re, highlightReactNode as $e } from "./utils.js";
7
- import { Icon as $ } from "../../icons/Icon.js";
8
- import { Button as Ke } from "../Button/Button.js";
9
- import { I as fe } from "../../Input-IzZ6B9kw.js";
10
- import { EInputVariant as Ue } from "../Input/constants.js";
11
- import { Loader as ve } from "../Loader/Loader.js";
12
- import { H as We, U as ge, G as be, W as ye, K as Qe } from "../../combobox-fIVOzEhl.js";
13
- import '../../assets/SelectSearch.css';const Ye = "_container_rnc9v_2", Je = "_options_rnc9v_15", Xe = "_top_rnc9v_26", Ze = "_bottom_rnc9v_32", et = "_disabled_rnc9v_63", tt = "_full_rnc9v_100", nt = "_button_rnc9v_112", ot = "_s_rnc9v_59", rt = "_m_rnc9v_140", it = "_l_rnc9v_153", st = "_loader_rnc9v_191", at = "_option_rnc9v_15", ct = "_clear_rnc9v_230", e = {
14
- container: Ye,
15
- "container-open": "_container-open_rnc9v_11",
16
- options: Je,
17
- top: Xe,
18
- bottom: Ze,
19
- "no-options": "_no-options_rnc9v_38",
20
- "select-search": "_select-search_rnc9v_59",
21
- disabled: et,
22
- "border-radius-left": "_border-radius-left_rnc9v_69",
23
- "border-radius-right": "_border-radius-right_rnc9v_81",
24
- "border-radius-none": "_border-radius-none_rnc9v_93",
25
- full: tt,
26
- "selected-icon": "_selected-icon_rnc9v_104",
27
- "selector-icon-open": "_selector-icon-open_rnc9v_108",
28
- button: nt,
29
- "selector-icon": "_selector-icon_rnc9v_108",
30
- s: ot,
31
- m: rt,
32
- l: it,
33
- "select-search-input": "_select-search-input_rnc9v_166",
34
- "select-search-input-disabled": "_select-search-input-disabled_rnc9v_169",
35
- "group-header": "_group-header_rnc9v_176",
36
- "sticky-active": "_sticky-active_rnc9v_187",
37
- loader: st,
38
- "input-container": "_input-container_rnc9v_196",
39
- option: at,
40
- "option-active": "_option-active_rnc9v_210",
41
- "option-inner": "_option-inner_rnc9v_213",
42
- "right-slot": "_right-slot_rnc9v_220",
43
- "required-mark": "_required-mark_rnc9v_225",
44
- clear: ct,
45
- "icon-button": "_icon-button_rnc9v_239",
46
- "highlighted-text": "_highlighted-text_rnc9v_243",
47
- "highlighted-text-wrapper": "_highlighted-text-wrapper_rnc9v_248"
48
- }, lt = qe(
49
- (xe, Ne) => {
4
+ import { forwardRef as Ve, 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 ke } from "./constants.js";
6
+ import { prepareGroupedItems as Ae, shouldShowMenuOnTop as Be, mapSizeToInputSize as de, getDropdownArrowIcon as Te, highlightReactNode as ue } from "./utils.js";
7
+ import { Icon as P } from "../../icons/Icon.js";
8
+ import { Button as Pe } from "../Button/Button.js";
9
+ import { I as pe } from "../../Input-IzZ6B9kw.js";
10
+ import { EInputVariant as Ge } from "../Input/constants.js";
11
+ import { Loader as he } from "../Loader/Loader.js";
12
+ import { H as qe, U as me, G as _e, W as be, K as Re } from "../../combobox-fIVOzEhl.js";
13
+ import '../../assets/SelectSearch.css';const je = "_container_11tdb_2", Fe = "_options_11tdb_15", He = "_top_11tdb_26", $e = "_bottom_11tdb_32", Ke = "_disabled_11tdb_63", Ue = "_full_11tdb_100", We = "_button_11tdb_112", Qe = "_s_11tdb_59", Ye = "_m_11tdb_140", Je = "_l_11tdb_153", Xe = "_loader_11tdb_186", Ze = "_option_11tdb_15", et = "_clear_11tdb_225", e = {
14
+ container: je,
15
+ "container-open": "_container-open_11tdb_11",
16
+ options: Fe,
17
+ top: He,
18
+ bottom: $e,
19
+ "no-options": "_no-options_11tdb_38",
20
+ "select-search": "_select-search_11tdb_59",
21
+ disabled: Ke,
22
+ "border-radius-left": "_border-radius-left_11tdb_69",
23
+ "border-radius-right": "_border-radius-right_11tdb_81",
24
+ "border-radius-none": "_border-radius-none_11tdb_93",
25
+ full: Ue,
26
+ "selected-icon": "_selected-icon_11tdb_104",
27
+ "selector-icon-open": "_selector-icon-open_11tdb_108",
28
+ button: We,
29
+ "selector-icon": "_selector-icon_11tdb_108",
30
+ s: Qe,
31
+ m: Ye,
32
+ l: Je,
33
+ "select-search-input": "_select-search-input_11tdb_166",
34
+ "select-search-input-disabled": "_select-search-input-disabled_11tdb_169",
35
+ "group-header": "_group-header_11tdb_176",
36
+ loader: Xe,
37
+ "input-container": "_input-container_11tdb_191",
38
+ option: Ze,
39
+ "option-active": "_option-active_11tdb_205",
40
+ "option-inner": "_option-inner_11tdb_208",
41
+ "right-slot": "_right-slot_11tdb_215",
42
+ "required-mark": "_required-mark_11tdb_220",
43
+ clear: et,
44
+ "icon-button": "_icon-button_11tdb_234",
45
+ "highlighted-text": "_highlighted-text_11tdb_238",
46
+ "highlighted-text-wrapper": "_highlighted-text-wrapper_11tdb_243"
47
+ }, tt = Ve(
48
+ (fe, ge) => {
50
49
  const {
51
- placeholder: K,
52
- size: o = l.L,
50
+ placeholder: G,
51
+ size: n = c.L,
53
52
  value: d,
54
- onChange: a,
55
- full: Se,
56
- showArrow: we = !0,
57
- items: g = [],
58
- classNameOption: U,
59
- classNameOptionInner: W,
60
- displayValue: k = "name",
61
- filterOnSearch: Q = !0,
62
- onSearch: C,
63
- variant: Y = Ue.DefaultGray,
64
- menuPlacement: L = "bottom",
53
+ onChange: i,
54
+ full: ve,
55
+ showArrow: Ne = !0,
56
+ items: b = [],
57
+ classNameOption: q,
58
+ classNameOptionInner: R,
59
+ displayValue: y = "name",
60
+ filterOnSearch: j = !0,
61
+ onSearch: x,
62
+ variant: F = Ge.DefaultGray,
63
+ menuPlacement: I = "bottom",
65
64
  disabled: u = !1,
66
- searchProps: J,
67
- withClearButton: G = !1,
68
- disableInput: _ = !1,
69
- autocomplete: X = "on",
70
- immediate: Ie = !1,
71
- noOptionsText: ke = "Нет данных",
72
- noMatchText: Ce = "Ничего не найдено",
73
- loadOnOpen: q,
74
- loading: Z,
75
- loadingIndicatorPlacement: z = I.Dropdown,
76
- groupBy: m,
77
- getGroupTitle: ee = (t) => t,
78
- optionLayout: Le = "name-bottom",
79
- autoPlacement: O = !1,
80
- borderRadius: te = je.All,
81
- highlightMatches: ze = !1
82
- } = xe, j = (t) => {
65
+ searchProps: H,
66
+ withClearButton: O = !1,
67
+ disableInput: f = !1,
68
+ autocomplete: $ = "on",
69
+ immediate: Se = !1,
70
+ noOptionsText: we = "Нет данных",
71
+ noMatchText: ye = "Ничего не найдено",
72
+ loadOnOpen: V,
73
+ loading: K,
74
+ loadingIndicatorPlacement: C = w.Dropdown,
75
+ groupBy: l,
76
+ getGroupTitle: U = (t) => t,
77
+ optionLayout: xe = "name-bottom",
78
+ autoPlacement: L = !1,
79
+ borderRadius: W = ke.All,
80
+ highlightMatches: Q = !1,
81
+ searchInHeaderGroupItems: z = !1
82
+ } = fe, k = (t) => {
83
83
  if (!t) return "";
84
- const n = t[k];
85
- return typeof n == "string" ? n : String(n || "");
86
- }, Oe = (t) => {
87
- const n = t[k];
88
- return typeof n == "string" ? n : String(n || "");
89
- }, F = j(d), E = he(null), ne = he(null), [f, b] = w(F), [p, y] = w(d), [Ee, oe] = w(!1), [H, De] = w(null), [D, re] = w(L), ie = Z !== void 0 ? Z : Ee, x = P(() => String(f || "").trim().toLowerCase(), [f]), N = P(() => Q && x ? g.filter((t) => Oe(t).toLowerCase().includes(x)) : g, [x, g, Q, k]), S = P(() => m ? Fe(
90
- N,
84
+ const o = t[y];
85
+ return typeof o == "string" ? o : String(o || "");
86
+ }, Ie = (t) => {
87
+ const o = t[y];
88
+ 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), [Ce, X] = E(!1), [M, Z] = E(I), ee = K !== void 0 ? K : Ce, m = T(() => String(g || "").trim().toLowerCase(), [g]), S = T(() => {
90
+ if (!j)
91
+ return b;
92
+ if (l && z) {
93
+ const t = /* @__PURE__ */ new Set();
94
+ return b.forEach((o) => {
95
+ l && o[l] && String(o[l]).toLowerCase().includes(m) && t.add(o);
96
+ }), Array.from(t);
97
+ }
98
+ return m ? b.filter((t) => Ie(t).toLowerCase().includes(m)) : b;
99
+ }, [
91
100
  m,
92
- ee || ((t) => t)
93
- ) : N, [N, m, ee]), M = P(() => {
94
- const t = [];
95
- return S.forEach((n, i) => {
96
- n.isGroupHeader && t.push(i);
97
- }), t;
98
- }, [S]), v = Ge({
99
- count: S.length,
100
- getScrollElement: () => E.current,
101
- estimateSize: () => o === l.L ? 65 : 49,
101
+ b,
102
+ j,
103
+ y,
104
+ l,
105
+ z
106
+ ]), te = T(() => l ? Ae(
107
+ S,
108
+ l,
109
+ U || ((t) => t)
110
+ ) : S, [S, l, U]), B = Oe({
111
+ count: te.length,
112
+ getScrollElement: () => Y.current,
113
+ estimateSize: () => n === c.L ? 65 : 49,
102
114
  overscan: 10
103
- }), h = me(() => {
104
- if (!O) {
105
- re(L);
115
+ }), _ = le(() => {
116
+ if (!L) {
117
+ Z(I);
106
118
  return;
107
119
  }
108
- const t = He(ne, o);
109
- re(t ? "top" : L);
110
- }, [O, L, o]);
111
- R(() => {
112
- if (O)
113
- return h(), window.addEventListener("scroll", h), window.addEventListener("resize", h), () => {
114
- window.removeEventListener("scroll", h), window.removeEventListener("resize", h);
120
+ const t = Be(J, n);
121
+ Z(t ? "top" : I);
122
+ }, [L, I, n]);
123
+ ce(() => {
124
+ if (L)
125
+ return _(), window.addEventListener("scroll", _), window.addEventListener("resize", _), () => {
126
+ window.removeEventListener("scroll", _), window.removeEventListener("resize", _);
115
127
  };
116
- }, [O, h]), R(() => {
117
- const t = E.current;
118
- if (!t || !m) return;
119
- const n = () => {
120
- var de, ue;
121
- const i = t.scrollTop;
122
- let V = null;
123
- for (let T = 0; T < M.length; T++) {
124
- const pe = M[T];
125
- if ((((de = v.getVirtualItems().find((A) => A.index === pe)) == null ? void 0 : de.start) || 0) <= i) {
126
- V = pe;
127
- const A = M[T + 1];
128
- if (A !== void 0 && (((ue = v.getVirtualItems().find((Pe) => Pe.index === A)) == null ? void 0 : ue.start) || 0) <= i)
129
- continue;
130
- } else
131
- break;
132
- }
133
- De(V);
134
- };
135
- return t.addEventListener("scroll", n), () => t.removeEventListener("scroll", n);
136
- }, [v, M, m, E.current]);
137
- const se = async () => {
138
- if (q)
128
+ }, [L, _]);
129
+ const oe = async () => {
130
+ if (V)
139
131
  try {
140
- oe(!0), await q();
132
+ X(!0), await V();
141
133
  } finally {
142
- oe(!1);
134
+ X(!1);
143
135
  }
144
- }, Me = (t) => {
136
+ }, Le = (t) => {
145
137
  if (t) {
146
- const n = j(t);
147
- b(n), y(t), a == null || a(t);
138
+ const o = k(t);
139
+ v(o), N(t), i == null || i(t);
148
140
  } else
149
- b(""), y(null), a == null || a({ id: "", name: "" });
150
- }, ae = me(
141
+ v(""), N(null), i == null || i({ id: "", name: "" });
142
+ }, ne = le(
151
143
  (t) => {
152
- if (_) return;
153
- const n = t.target.value;
154
- b(n), C == null || C(n), p && n !== j(p) && y(null), !n && d && (a == null || a({ id: "", name: "" }));
144
+ if (f) return;
145
+ const o = t.target.value;
146
+ v(o), x == null || x(o), h && o !== k(h) && N(null), !o && d && (i == null || i({ id: "", name: "" }));
155
147
  },
156
- [_, a, C, d, p, k]
157
- ), Ve = () => {
158
- b(""), y(null), a == null || a({ id: "", name: "" });
159
- }, ce = async (t) => {
160
- _ && t.target.blur(), h(), q && await se();
148
+ [f, i, x, d, h, y]
149
+ ), ze = () => {
150
+ v(""), N(null), i == null || i({ id: "", name: "" });
151
+ }, re = async (t) => {
152
+ f && t.target.blur(), _(), V && await oe();
161
153
  };
162
- R(() => {
154
+ ce(() => {
163
155
  const t = !d || typeof d == "object" && !Object.keys(d).length;
164
- b(t ? "" : F), y(t ? null : d);
165
- }, [d, F]);
166
- const Te = () => ie && (z === I.Dropdown || z === I.Both) ? /* @__PURE__ */ c("div", { className: e.loader, children: [
167
- /* @__PURE__ */ r(ve, { size: "s" }),
156
+ v(t ? "" : A), N(t ? null : d);
157
+ }, [d, A]);
158
+ const Me = () => ee && (C === w.Dropdown || C === w.Both) ? /* @__PURE__ */ p("div", { className: e.loader, children: [
159
+ /* @__PURE__ */ r(he, { size: "s" }),
168
160
  "Загрузка..."
169
- ] }) : ke, Ae = (t) => {
170
- if (we)
161
+ ] }) : we, De = (t) => {
162
+ if (Ne)
171
163
  return {
172
164
  addonType: "react-node",
173
- addonContent: /* @__PURE__ */ c(B, { children: [
174
- ie && (z === I.Input || z === I.Both) && /* @__PURE__ */ r(ve, { size: "s" }),
165
+ addonContent: /* @__PURE__ */ p(D, { children: [
166
+ ee && (C === w.Input || C === w.Both) && /* @__PURE__ */ r(he, { size: "s" }),
175
167
  /* @__PURE__ */ r(
176
- ge,
168
+ me,
177
169
  {
178
170
  className: s(e.button, {
179
171
  [e.disabled]: u
180
172
  }),
181
173
  disabled: u,
182
- onClick: h,
174
+ onClick: _,
183
175
  children: /* @__PURE__ */ r(
184
- $,
176
+ P,
185
177
  {
186
- iconName: o == l.M || o == l.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
178
+ iconName: n == c.M || n == c.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
187
179
  className: s(e["selector-icon"], {
188
180
  [e["selector-icon-open"]]: t
189
181
  })
@@ -193,143 +185,131 @@ import '../../assets/SelectSearch.css';const Ye = "_container_rnc9v_2", Je = "_o
193
185
  )
194
186
  ] })
195
187
  };
196
- }, le = (t) => {
197
- let n = t.name;
198
- ze && x && (n = $e(
188
+ }, ae = (t) => {
189
+ let o = t.name;
190
+ Q && m && !z && (o = ue(
199
191
  t.name,
200
- x,
192
+ m,
201
193
  e["highlighted-text"]
202
194
  ));
203
- const i = t.bottom && /* @__PURE__ */ r("div", { children: t.bottom });
204
- return Le === "bottom-name" ? /* @__PURE__ */ c(B, { children: [
205
- i,
206
- n
207
- ] }) : /* @__PURE__ */ c(B, { children: [
208
- n,
209
- i
195
+ const a = t.bottom && /* @__PURE__ */ r("div", { children: t.bottom });
196
+ return xe === "bottom-name" ? /* @__PURE__ */ p(D, { children: [
197
+ a,
198
+ o
199
+ ] }) : /* @__PURE__ */ p(D, { children: [
200
+ o,
201
+ a
210
202
  ] });
211
- }, Be = (t) => g.length ? N.length ? m ? /* @__PURE__ */ c(
203
+ }, Ee = (t) => b.length ? S.length ? l ? /* @__PURE__ */ r(
212
204
  "div",
213
205
  {
214
- ref: E,
206
+ ref: Y,
215
207
  "data-testid": "select-search-options",
216
208
  className: s(
217
209
  e.options,
218
- e[o],
219
- e[D]
210
+ e[n],
211
+ e[M]
220
212
  ),
221
213
  style: {
222
- height: o === l.M || o === l.S ? "240px" : "320px",
214
+ height: n === c.M || n === c.S ? "240px" : "320px",
223
215
  overflow: "auto"
224
216
  },
225
- children: [
226
- H !== null && /* @__PURE__ */ r(
227
- "div",
228
- {
229
- className: e["group-header"],
230
- style: {
231
- position: "sticky",
232
- top: 0,
233
- zIndex: 3
234
- },
235
- children: S[H].name
236
- }
237
- ),
238
- /* @__PURE__ */ r(
239
- "div",
240
- {
241
- style: {
242
- height: `${v.getTotalSize()}px`,
243
- width: "100%"
244
- },
245
- children: v.getVirtualItems().map((n) => {
246
- const i = S[n.index];
247
- return /* @__PURE__ */ r(
248
- "div",
249
- {
250
- "data-index": n.index,
251
- ref: v.measureElement,
252
- style: {
253
- position: "absolute",
254
- top: 0,
255
- left: 0,
256
- width: "100%",
257
- transform: `translateY(${n.start}px)`
258
- },
259
- children: i.isGroupHeader ? /* @__PURE__ */ r(
260
- "div",
261
- {
262
- className: e["group-header"],
263
- style: {
264
- visibility: H === n.index ? "hidden" : "visible"
265
- },
266
- children: i.name
267
- }
268
- ) : /* @__PURE__ */ c(
269
- ye,
270
- {
271
- value: i,
272
- className: ({ focus: V }) => s(
273
- e.option,
274
- U,
275
- o && e[o],
217
+ children: /* @__PURE__ */ r(
218
+ "div",
219
+ {
220
+ style: {
221
+ height: `${B.getTotalSize()}px`,
222
+ width: "100%"
223
+ },
224
+ children: B.getVirtualItems().map((o) => {
225
+ const a = te[o.index];
226
+ return /* @__PURE__ */ r(
227
+ "div",
228
+ {
229
+ "data-index": o.index,
230
+ ref: B.measureElement,
231
+ style: {
232
+ position: "absolute",
233
+ top: 0,
234
+ left: 0,
235
+ width: "100%",
236
+ transform: `translateY(${o.start}px)`
237
+ },
238
+ children: a.isGroupHeader ? /* @__PURE__ */ r(
239
+ "div",
240
+ {
241
+ className: e["group-header"],
242
+ "data-testid": `group-header-${a.name}`,
243
+ children: Q && m && z ? ue(
244
+ a.name,
245
+ m,
246
+ e["highlighted-text"]
247
+ ) : a.name
248
+ }
249
+ ) : /* @__PURE__ */ p(
250
+ be,
251
+ {
252
+ value: a,
253
+ className: ({ focus: se }) => s(
254
+ e.option,
255
+ q,
256
+ n && e[n],
257
+ {
258
+ [e["option-active"]]: se && !l
259
+ }
260
+ ),
261
+ "data-testid": `select-search-option-${a.id}`,
262
+ children: [
263
+ /* @__PURE__ */ r(
264
+ "div",
276
265
  {
277
- [e["option-active"]]: V
266
+ className: s(
267
+ e["option-inner"],
268
+ R
269
+ ),
270
+ children: ae(a)
278
271
  }
279
272
  ),
280
- "data-testid": `select-search-option-${i.id}`,
281
- children: [
282
- /* @__PURE__ */ r(
283
- "div",
284
- {
285
- className: s(
286
- e["option-inner"],
287
- W
288
- ),
289
- children: le(i)
290
- }
291
- ),
292
- p && p.id === i.id && /* @__PURE__ */ r(
293
- $,
294
- {
295
- iconName: o === l.M || o === l.S ? "Done16px" : "Done24px",
296
- className: e["selected-icon"]
297
- }
298
- )
299
- ]
300
- },
301
- i.id
302
- )
303
- },
304
- n.key
305
- );
306
- })
307
- }
308
- )
309
- ]
273
+ h && h.id === a.id && /* @__PURE__ */ r(
274
+ P,
275
+ {
276
+ iconName: n === c.M || n === c.S ? "Done16px" : "Done24px",
277
+ className: e["selected-icon"]
278
+ }
279
+ )
280
+ ]
281
+ },
282
+ a.id
283
+ )
284
+ },
285
+ o.key
286
+ );
287
+ })
288
+ }
289
+ )
310
290
  }
311
291
  ) : /* @__PURE__ */ r(
312
- Qe,
292
+ Re,
313
293
  {
314
294
  className: s(
315
295
  e.options,
316
- e[o],
317
- e[D]
296
+ e[n],
297
+ e[M]
318
298
  ),
319
299
  "data-testid": "select-search-options",
320
300
  style: { width: "100%" },
321
301
  static: !0,
322
- children: ({ option: n }) => /* @__PURE__ */ c(
323
- ye,
302
+ children: ({ option: o }) => /* @__PURE__ */ p(
303
+ be,
324
304
  {
325
- value: n,
326
- className: ({ focus: i }) => s(
305
+ value: o,
306
+ className: ({ focus: a }) => s(
327
307
  e.option,
328
- U,
308
+ q,
329
309
  {
330
- [e["option-active"]]: i
310
+ [e["option-active"]]: a
331
311
  },
332
- o && e[o]
312
+ n && e[n]
333
313
  ),
334
314
  children: [
335
315
  /* @__PURE__ */ r(
@@ -337,21 +317,21 @@ import '../../assets/SelectSearch.css';const Ye = "_container_rnc9v_2", Je = "_o
337
317
  {
338
318
  className: s(
339
319
  e["option-inner"],
340
- W
320
+ R
341
321
  ),
342
- children: le(n)
322
+ children: ae(o)
343
323
  }
344
324
  ),
345
- p && p.id === n.id && /* @__PURE__ */ r(
346
- $,
325
+ h && h.id === o.id && /* @__PURE__ */ r(
326
+ P,
347
327
  {
348
- iconName: o === l.M || o === l.S ? "Done16px" : "Done24px",
328
+ iconName: n === c.M || n === c.S ? "Done16px" : "Done24px",
349
329
  className: e["selected-icon"]
350
330
  }
351
331
  )
352
332
  ]
353
333
  },
354
- n.id
334
+ o.id
355
335
  )
356
336
  }
357
337
  ) : /* @__PURE__ */ r(
@@ -359,86 +339,86 @@ import '../../assets/SelectSearch.css';const Ye = "_container_rnc9v_2", Je = "_o
359
339
  {
360
340
  className: s(
361
341
  e.options,
362
- e[o],
342
+ e[n],
363
343
  e["no-options"],
364
- e[D]
344
+ e[M]
365
345
  ),
366
346
  "data-headlessui-state": t ? "open" : "closed",
367
- children: Ce
347
+ children: ye
368
348
  }
369
349
  ) : /* @__PURE__ */ r(
370
350
  "div",
371
351
  {
372
352
  className: s(
373
353
  e.options,
374
- e[o],
354
+ e[n],
375
355
  e["no-options"],
376
- e[D]
356
+ e[M]
377
357
  ),
378
358
  "data-headlessui-state": t ? "open" : "closed",
379
- children: Te()
359
+ children: Me()
380
360
  }
381
361
  );
382
362
  return /* @__PURE__ */ r(
383
- We,
363
+ qe,
384
364
  {
385
365
  as: "div",
386
- value: p,
366
+ value: h,
387
367
  className: s(e["select-search"], {
388
- [e.full]: Se,
368
+ [e.full]: ve,
389
369
  [e.disabled]: u
390
370
  }),
391
- onChange: Me,
392
- ref: Ne,
371
+ onChange: Le,
372
+ ref: ge,
393
373
  disabled: u,
394
- virtual: m ? void 0 : { options: N },
395
- immediate: Ie,
396
- children: ({ open: t }) => /* @__PURE__ */ c(B, { children: [
397
- /* @__PURE__ */ c(
374
+ virtual: l ? void 0 : { options: S },
375
+ immediate: Se,
376
+ children: ({ open: t }) => /* @__PURE__ */ p(D, { children: [
377
+ /* @__PURE__ */ p(
398
378
  "div",
399
379
  {
400
- ref: ne,
401
- className: s(e.container, e[o], {
380
+ ref: J,
381
+ className: s(e.container, e[n], {
402
382
  [e["container-open"]]: t
403
383
  }),
404
384
  children: [
405
- _ && /* @__PURE__ */ c("div", { className: e["input-container"], children: [
385
+ f && /* @__PURE__ */ p("div", { className: e["input-container"], children: [
406
386
  /* @__PURE__ */ r(
407
- ge,
387
+ me,
408
388
  {
409
389
  disabled: u,
410
390
  style: { width: "100%" },
411
- onClick: se,
391
+ onClick: oe,
412
392
  children: /* @__PURE__ */ r(
413
- be,
393
+ _e,
414
394
  {
415
- as: fe,
416
- label: K,
417
- size: _e(o),
395
+ as: pe,
396
+ label: G,
397
+ size: de(n),
418
398
  className: s(e["select-search-input"], {
419
- [e["select-search-input-disabled"]]: _ && G
399
+ [e["select-search-input-disabled"]]: f && O
420
400
  }),
421
- onChange: ae,
422
- value: f,
401
+ onChange: ne,
402
+ value: g,
423
403
  disabled: u,
424
- variant: Y,
404
+ variant: F,
425
405
  rightSlotClassName: e["right-slot"],
426
406
  requiredMarkClassName: e["required-mark"],
427
407
  "data-testid": "select-search-input",
428
- onFocus: ce,
408
+ onFocus: re,
429
409
  rightAddon: {
430
410
  addonType: "icon",
431
- addonContent: Re(t, o)
411
+ addonContent: Te(t, n)
432
412
  },
433
- autocomplete: X,
434
- borderRadius: te,
435
- ...J
413
+ autocomplete: $,
414
+ borderRadius: W,
415
+ ...H
436
416
  }
437
417
  )
438
418
  }
439
419
  ),
440
- G && f && /* @__PURE__ */ r(
441
- Ke,
420
+ O && g && /* @__PURE__ */ r(
421
+ Pe,
442
422
  {
443
423
  tabIndex: -1,
444
424
  className: s(e.clear, {
@@ -451,45 +431,45 @@ import '../../assets/SelectSearch.css';const Ye = "_container_rnc9v_2", Je = "_o
451
431
  clear: !0,
452
432
  disabled: u,
453
433
  variant: "secondary-gray",
454
- onClick: (n) => {
455
- n.stopPropagation(), Ve();
434
+ onClick: (o) => {
435
+ o.stopPropagation(), ze();
456
436
  },
457
437
  "data-testid": "clear-button"
458
438
  }
459
439
  )
460
440
  ] }),
461
- !_ && /* @__PURE__ */ r(
462
- be,
441
+ !f && /* @__PURE__ */ r(
442
+ _e,
463
443
  {
464
- as: fe,
465
- label: K,
466
- size: _e(o),
444
+ as: pe,
445
+ label: G,
446
+ size: de(n),
467
447
  className: e["select-search-input"],
468
448
  rightSlotClassName: e["right-slot"],
469
449
  requiredMarkClassName: e["required-mark"],
470
- value: f,
450
+ value: g,
471
451
  disabled: u,
472
- variant: Y,
473
- withClearButton: G && !!f,
474
- onChange: ae,
475
- rightAddon: Ae(t),
452
+ variant: F,
453
+ withClearButton: O && !!g,
454
+ onChange: ne,
455
+ rightAddon: De(t),
476
456
  "data-testid": "select-search-input",
477
- onFocus: ce,
478
- autocomplete: X,
479
- borderRadius: te,
480
- ...J
457
+ onFocus: re,
458
+ autocomplete: $,
459
+ borderRadius: W,
460
+ ...H
481
461
  }
482
462
  )
483
463
  ]
484
464
  }
485
465
  ),
486
- t && Be(t)
466
+ t && Ee(t)
487
467
  ] })
488
468
  }
489
469
  );
490
470
  }
491
471
  );
492
- lt.displayName = "SelectSearch";
472
+ tt.displayName = "SelectSearch";
493
473
  export {
494
- lt as SelectSearch
474
+ tt as SelectSearch
495
475
  };