mimir-ui-kit 1.42.2 → 1.43.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 (83) hide show
  1. package/dist/ProgressBar-COdzy3fY.js +67 -0
  2. package/dist/assets/MultiSelectSearch.css +1 -1
  3. package/dist/assets/Pagination.css +1 -1
  4. package/dist/assets/SelectSearch.css +1 -1
  5. package/dist/assets/Switcher.css +1 -1
  6. package/dist/assets/TabTrail.css +1 -1
  7. package/dist/assets/hooks.css +1 -0
  8. package/dist/{combobox-Dv6-ANkb.js → combobox-fIVOzEhl.js} +6 -6
  9. package/dist/components/Accordion/Accordion.d.ts +6 -0
  10. package/dist/components/Accordion/Accordion.js +202 -182
  11. package/dist/components/AnchorLink/Link.d.ts +2 -0
  12. package/dist/components/AnchorLink/Link.js +54 -42
  13. package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
  14. package/dist/components/DatePicker/DatePicker.d.ts +32 -0
  15. package/dist/components/DatePicker/DatePicker.js +125 -111
  16. package/dist/components/DatePicker/DatePickerModal.d.ts +5 -1
  17. package/dist/components/DatePicker/DatePickerModal.js +97 -75
  18. package/dist/components/DatePicker/MonthPickerModal.d.ts +5 -1
  19. package/dist/components/DatePicker/MonthPickerModal.js +96 -58
  20. package/dist/components/DatePicker/YearPickerModal.d.ts +5 -1
  21. package/dist/components/DatePicker/YearPickerModal.js +75 -57
  22. package/dist/components/Drawer/Drawer.d.ts +7 -1
  23. package/dist/components/Drawer/Drawer.js +122 -106
  24. package/dist/components/Drawer/hooks.d.ts +9 -0
  25. package/dist/components/Drawer/hooks.js +24 -0
  26. package/dist/components/Dropdown/Dropdown.d.ts +18 -1
  27. package/dist/components/Dropdown/Dropdown.js +361 -343
  28. package/dist/components/Dropdown/constants.d.ts +11 -0
  29. package/dist/components/Dropdown/constants.js +5 -0
  30. package/dist/components/Dropdown/hooks.d.ts +19 -0
  31. package/dist/components/Dropdown/hooks.js +11 -0
  32. package/dist/components/Dropdown/index.d.ts +1 -0
  33. package/dist/components/Dropdown/index.js +5 -2
  34. package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +8 -1
  35. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +461 -302
  36. package/dist/components/MultiSelectSearch/constants.d.ts +6 -0
  37. package/dist/components/MultiSelectSearch/constants.js +7 -5
  38. package/dist/components/MultiSelectSearch/index.d.ts +1 -1
  39. package/dist/components/MultiSelectSearch/index.js +5 -4
  40. package/dist/components/MultiSelectSearch/types.d.ts +33 -1
  41. package/dist/components/MultiSelectSearch/utils.d.ts +1 -0
  42. package/dist/components/MultiSelectSearch/utils.js +31 -17
  43. package/dist/components/Pagination/Pagination.d.ts +23 -0
  44. package/dist/components/Pagination/Pagination.js +137 -99
  45. package/dist/components/RadioGroup/RadioGroup.js +3 -3
  46. package/dist/components/SelectSearch/SelectSearch.d.ts +8 -1
  47. package/dist/components/SelectSearch/SelectSearch.js +381 -220
  48. package/dist/components/SelectSearch/constants.d.ts +6 -0
  49. package/dist/components/SelectSearch/constants.js +3 -2
  50. package/dist/components/SelectSearch/index.d.ts +1 -1
  51. package/dist/components/SelectSearch/index.js +5 -4
  52. package/dist/components/SelectSearch/types.d.ts +32 -1
  53. package/dist/components/SelectSearch/utils.d.ts +2 -0
  54. package/dist/components/SelectSearch/utils.js +28 -14
  55. package/dist/components/Switcher/Switcher.js +66 -59
  56. package/dist/components/Switcher/types.d.ts +1 -0
  57. package/dist/components/TabTrail/TabTrail.d.ts +9 -0
  58. package/dist/components/TabTrail/TabTrail.js +198 -190
  59. package/dist/components/Toasts/ProgressBar.d.ts +4 -2
  60. package/dist/components/Toasts/ProgressBar.js +1 -1
  61. package/dist/components/Toasts/Toast.d.ts +5 -1
  62. package/dist/components/Toasts/Toast.js +59 -44
  63. package/dist/components/Toasts/ToastList.js +1 -1
  64. package/dist/components/Toasts/ToastsProvider.js +1 -1
  65. package/dist/components/index.d.ts +3 -2
  66. package/dist/components/index.js +154 -149
  67. package/dist/{field-BP5-U1Nr.js → field-BLi5834s.js} +2 -2
  68. package/dist/{focus-management-Dp2_vbQ3.js → focus-management-BAl0GmRk.js} +1 -1
  69. package/dist/{hidden-Dn4lM6EL.js → hidden-CkTYbiNM.js} +1 -1
  70. package/dist/hooks/useTimer/index.d.ts +2 -1
  71. package/dist/hooks/useTimer/index.js +55 -41
  72. package/dist/hooks-HgN6Yauq.js +117 -0
  73. package/dist/index.js +182 -177
  74. package/dist/{keyboard-CUMsrFX1.js → keyboard-wis2TUql.js} +2 -2
  75. package/dist/{label-DOlEWXBl.js → label-BmphTIGY.js} +2 -2
  76. package/dist/{open-closed-CkTbpRyi.js → open-closed-CJijMeI2.js} +1 -1
  77. package/dist/{portal-C_u5auU1.js → portal-BnEqSZwo.js} +2 -2
  78. package/dist/{use-active-press-BVQqDQ3V.js → use-active-press-CnDeVvQq.js} +1 -1
  79. package/dist/{use-is-mounted-D7cq4xsa.js → use-is-mounted-MBU4fiLr.js} +1 -1
  80. package/package.json +3 -1
  81. package/dist/ProgressBar-DEFs1tWq.js +0 -55
  82. package/dist/assets/Dropdown.css +0 -1
  83. package/dist/components/Pagination/types.d.ts +0 -0
@@ -1,264 +1,425 @@
1
- import { jsx as n, jsxs as h, Fragment as D } from "react/jsx-runtime";
2
- import { c as i } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as U, useState as q, useMemo as W, useCallback as R, useEffect as $ } from "react";
4
- import { ESelectSearchSize as b } from "./constants.js";
5
- import { mapSizeToInputSize as A, getDropdownArrowIcon as J } from "./utils.js";
6
- import { Icon as O } from "../../icons/Icon.js";
7
- import { Button as Q } from "../Button/Button.js";
8
- import { I as B } from "../../Input-BU_6U1CW.js";
9
- import { EInputVariant as X } from "../Input/constants.js";
10
- import { H as Y, U as M, G as j, K as Z, W as ee } from "../../combobox-Dv6-ANkb.js";
11
- import '../../assets/SelectSearch.css';const te = "_disabled_lhab4_6", oe = "_container_lhab4_13", ae = "_full_lhab4_26", se = "_button_lhab4_38", ne = "_options_lhab4_52", le = "_top_lhab4_63", ie = "_bottom_lhab4_69", re = "_s_lhab4_2", ce = "_m_lhab4_110", de = "_l_lhab4_123", pe = "_option_lhab4_52", ue = "_clear_lhab4_175", e = {
12
- "select-search": "_select-search_lhab4_2",
13
- disabled: te,
14
- container: oe,
15
- "container-open": "_container-open_lhab4_22",
16
- full: ae,
17
- "selected-icon": "_selected-icon_lhab4_30",
18
- "selector-icon-open": "_selector-icon-open_lhab4_34",
19
- button: se,
20
- "selector-icon": "_selector-icon_lhab4_34",
21
- options: ne,
22
- top: le,
23
- bottom: ie,
24
- "no-options": "_no-options_lhab4_75",
25
- s: re,
26
- m: ce,
27
- l: de,
28
- "select-input": "_select-input_lhab4_136",
29
- "select-input-disabled": "_select-input-disabled_lhab4_139",
30
- option: pe,
31
- "option-active": "_option-active_lhab4_155",
32
- "option-inner": "_option-inner_lhab4_158",
33
- "right-slot": "_right-slot_lhab4_165",
34
- "required-mark": "_required-mark_lhab4_170",
35
- clear: ue,
36
- "icon-button": "_icon-button_lhab4_184"
37
- }, Ce = U(
38
- (E, L) => {
1
+ import { jsx as s, jsxs as l, Fragment as ee } from "react/jsx-runtime";
2
+ import { u as Se } from "../../index-D5H8gPPn.js";
3
+ import { c as a } from "../../index-DIxK0V-G.js";
4
+ import { forwardRef as ke, useRef as we, useState as D, useMemo as A, useEffect as te, useCallback as ze } from "react";
5
+ import { ESelectSearchSize as d, ELoadingIndicatorPlacement as x } from "./constants.js";
6
+ import { prepareGroupedItems as Ce, mapSizeToInputSize as ne, getDropdownArrowIcon as Le } from "./utils.js";
7
+ import { Icon as G } from "../../icons/Icon.js";
8
+ import { Button as Oe } from "../Button/Button.js";
9
+ import { I as oe } from "../../Input-BU_6U1CW.js";
10
+ import { EInputVariant as De } from "../Input/constants.js";
11
+ import { Loader as se } from "../Loader/Loader.js";
12
+ import { H as Ee, U as ie, G as re, W as ae, K as Te } from "../../combobox-fIVOzEhl.js";
13
+ import '../../assets/SelectSearch.css';const Be = "_disabled_1rthm_6", Ve = "_container_1rthm_13", Ae = "_full_1rthm_26", Ge = "_button_1rthm_38", Me = "_options_1rthm_52", qe = "_top_1rthm_63", Pe = "_bottom_1rthm_69", je = "_s_1rthm_2", Fe = "_m_1rthm_110", He = "_l_1rthm_123", $e = "_loader_1rthm_161", Ke = "_option_1rthm_52", Ue = "_clear_1rthm_200", e = {
14
+ "select-search": "_select-search_1rthm_2",
15
+ disabled: Be,
16
+ container: Ve,
17
+ "container-open": "_container-open_1rthm_22",
18
+ full: Ae,
19
+ "selected-icon": "_selected-icon_1rthm_30",
20
+ "selector-icon-open": "_selector-icon-open_1rthm_34",
21
+ button: Ge,
22
+ "selector-icon": "_selector-icon_1rthm_34",
23
+ options: Me,
24
+ top: qe,
25
+ bottom: Pe,
26
+ "no-options": "_no-options_1rthm_75",
27
+ s: je,
28
+ m: Fe,
29
+ l: He,
30
+ "select-search-input": "_select-search-input_1rthm_136",
31
+ "select-search-input-disabled": "_select-search-input-disabled_1rthm_139",
32
+ "group-header": "_group-header_1rthm_146",
33
+ "sticky-active": "_sticky-active_1rthm_157",
34
+ loader: $e,
35
+ "input-container": "_input-container_1rthm_166",
36
+ option: Ke,
37
+ "option-active": "_option-active_1rthm_180",
38
+ "option-inner": "_option-inner_1rthm_183",
39
+ "right-slot": "_right-slot_1rthm_190",
40
+ "required-mark": "_required-mark_1rthm_195",
41
+ clear: Ue,
42
+ "icon-button": "_icon-button_1rthm_209"
43
+ }, We = ke(
44
+ (ce, le) => {
39
45
  const {
40
- placeholder: w,
41
- size: a = b.L,
42
- value: l,
43
- onChange: s,
44
- full: V,
45
- showArrow: S = !0,
46
- items: u = [],
47
- classNameOption: F,
48
- displayValue: G = "name",
49
- filterOnSearch: C = !0,
50
- onSearch: f,
51
- variant: I = X.DefaultGray,
52
- menuPlacement: N = "bottom",
53
- disabled: r = !1,
54
- searchProps: y,
55
- withClearButton: v = !1,
56
- disableInput: c = !1,
57
- autocomplete: k = "on",
58
- immediate: P = !1
59
- } = E, g = String((l == null ? void 0 : l[G]) || ""), [d, _] = q(g), [p, m] = q(l), x = W(() => C && d.trim().toLowerCase() ? u.filter(
60
- (t) => t.name.toLowerCase().includes(d.toLowerCase())
61
- ) : u, [d, u, C]), T = (t) => {
62
- t ? (_(t.name), m(t), s == null || s(t)) : (_(""), m(null), s == null || s({ id: "", name: "" }));
63
- }, z = R(
46
+ placeholder: M,
47
+ size: o = d.L,
48
+ value: c,
49
+ onChange: r,
50
+ full: de,
51
+ showArrow: me = !0,
52
+ items: g = [],
53
+ classNameOption: q,
54
+ displayValue: ue = "name",
55
+ filterOnSearch: P = !0,
56
+ onSearch: I,
57
+ variant: j = De.DefaultGray,
58
+ menuPlacement: S = "bottom",
59
+ disabled: m = !1,
60
+ searchProps: F,
61
+ withClearButton: E = !1,
62
+ disableInput: _ = !1,
63
+ autocomplete: H = "on",
64
+ immediate: pe = !1,
65
+ noOptionsText: he = "Нет данных",
66
+ noMatchText: _e = "Ничего не найдено",
67
+ loadOnOpen: T,
68
+ loading: $,
69
+ loadingIndicatorPlacement: k = x.Dropdown,
70
+ groupBy: p,
71
+ getGroupTitle: K = (t) => t
72
+ } = ce, B = String((c == null ? void 0 : c[ue]) || ""), w = we(null), [h, v] = D(B), [u, b] = D(c), [fe, U] = D(!1), [V, ge] = D(null), W = $ !== void 0 ? $ : fe, N = A(() => P && h.trim().toLowerCase() ? g.filter(
73
+ (t) => t.name.toLowerCase().includes(h.toLowerCase())
74
+ ) : g, [h, g, P]), y = A(() => p ? Ce(
75
+ N,
76
+ p,
77
+ K || ((t) => t)
78
+ ) : N, [N, p, K]), z = A(() => {
79
+ const t = [];
80
+ return y.forEach((n, i) => {
81
+ n.isGroupHeader && t.push(i);
82
+ }), t;
83
+ }, [y]), f = Se({
84
+ count: y.length,
85
+ getScrollElement: () => w.current,
86
+ estimateSize: () => o === d.L ? 65 : 49,
87
+ overscan: 10
88
+ });
89
+ te(() => {
90
+ const t = w.current;
91
+ if (!t || !p) return;
92
+ const n = () => {
93
+ var R, X;
94
+ const i = t.scrollTop;
95
+ let C = null;
96
+ for (let L = 0; L < z.length; L++) {
97
+ const Z = z[L];
98
+ if ((((R = f.getVirtualItems().find((O) => O.index === Z)) == null ? void 0 : R.start) || 0) <= i) {
99
+ C = Z;
100
+ const O = z[L + 1];
101
+ if (O !== void 0 && (((X = f.getVirtualItems().find((Ie) => Ie.index === O)) == null ? void 0 : X.start) || 0) <= i)
102
+ continue;
103
+ } else
104
+ break;
105
+ }
106
+ ge(C);
107
+ };
108
+ return t.addEventListener("scroll", n), () => t.removeEventListener("scroll", n);
109
+ }, [f, z, p, w.current]);
110
+ const Y = async () => {
111
+ if (T)
112
+ try {
113
+ U(!0), await T();
114
+ } finally {
115
+ U(!1);
116
+ }
117
+ }, ve = (t) => {
118
+ t ? (v(t.name), b(t), r == null || r(t)) : (v(""), b(null), r == null || r({ id: "", name: "" }));
119
+ }, J = ze(
64
120
  (t) => {
65
- if (c) return;
66
- const o = t.target.value;
67
- _(o), f == null || f(o), p && o !== p.name && m(null), !o && l && (s == null || s({ id: "", name: "" }));
121
+ if (_) return;
122
+ const n = t.target.value;
123
+ v(n), I == null || I(n), u && n !== u.name && b(null), !n && c && (r == null || r({ id: "", name: "" }));
68
124
  },
69
- [c, s, f, l, p]
70
- ), H = () => {
71
- _(""), m(null), s == null || s({ id: "", name: "" });
125
+ [_, r, I, c, u]
126
+ ), be = () => {
127
+ v(""), b(null), r == null || r({ id: "", name: "" });
128
+ }, Q = async (t) => {
129
+ _ && t.target.blur(), T && await Y();
72
130
  };
73
- return $(() => {
74
- const t = !l || typeof l == "object" && !Object.keys(l).length;
75
- _(t ? "" : g), m(t ? null : l);
76
- }, [l, g]), /* @__PURE__ */ n(
77
- Y,
131
+ te(() => {
132
+ const t = !c || typeof c == "object" && !Object.keys(c).length;
133
+ v(t ? "" : B), b(t ? null : c);
134
+ }, [c, B]);
135
+ const Ne = () => W && (k === x.Dropdown || k === x.Both) ? /* @__PURE__ */ l("div", { className: e.loader, children: [
136
+ /* @__PURE__ */ s(se, { size: "s" }),
137
+ "Загрузка..."
138
+ ] }) : he, ye = (t) => {
139
+ if (me)
140
+ return {
141
+ addonType: "react-node",
142
+ addonContent: /* @__PURE__ */ l(ee, { children: [
143
+ W && (k === x.Input || k === x.Both) && /* @__PURE__ */ s(se, { size: "s" }),
144
+ /* @__PURE__ */ s(
145
+ ie,
146
+ {
147
+ className: a(e.button, {
148
+ [e.disabled]: m
149
+ }),
150
+ disabled: m,
151
+ children: /* @__PURE__ */ s(
152
+ G,
153
+ {
154
+ iconName: o == d.M || o == d.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
155
+ className: a(e["selector-icon"], {
156
+ [e["selector-icon-open"]]: t
157
+ })
158
+ }
159
+ )
160
+ }
161
+ )
162
+ ] })
163
+ };
164
+ }, xe = (t) => g.length ? N.length ? p ? /* @__PURE__ */ l(
165
+ "div",
166
+ {
167
+ ref: w,
168
+ "data-testid": "select-search-options",
169
+ className: a(e.options, e[o], e[S]),
170
+ style: {
171
+ height: o === d.M || o === d.S ? "240px" : "320px",
172
+ overflow: "auto"
173
+ },
174
+ children: [
175
+ V !== null && /* @__PURE__ */ s(
176
+ "div",
177
+ {
178
+ className: e["group-header"],
179
+ style: {
180
+ position: "sticky",
181
+ top: 0,
182
+ zIndex: 3
183
+ },
184
+ children: y[V].name
185
+ }
186
+ ),
187
+ /* @__PURE__ */ s(
188
+ "div",
189
+ {
190
+ style: {
191
+ height: `${f.getTotalSize()}px`,
192
+ width: "100%"
193
+ },
194
+ children: f.getVirtualItems().map((n) => {
195
+ const i = y[n.index];
196
+ return /* @__PURE__ */ s(
197
+ "div",
198
+ {
199
+ "data-index": n.index,
200
+ ref: f.measureElement,
201
+ style: {
202
+ position: "absolute",
203
+ top: 0,
204
+ left: 0,
205
+ width: "100%",
206
+ transform: `translateY(${n.start}px)`
207
+ },
208
+ children: i.isGroupHeader ? /* @__PURE__ */ s(
209
+ "div",
210
+ {
211
+ className: e["group-header"],
212
+ style: {
213
+ visibility: V === n.index ? "hidden" : "visible"
214
+ },
215
+ children: i.name
216
+ }
217
+ ) : /* @__PURE__ */ l(
218
+ ae,
219
+ {
220
+ value: i,
221
+ className: ({ focus: C }) => a(
222
+ e.option,
223
+ q,
224
+ o && e[o],
225
+ {
226
+ [e["option-active"]]: C
227
+ }
228
+ ),
229
+ "data-testid": `select-search-option-${i.id}`,
230
+ children: [
231
+ /* @__PURE__ */ l("div", { className: e["option-inner"], children: [
232
+ i.name,
233
+ i.bottom && /* @__PURE__ */ s("div", { children: i.bottom })
234
+ ] }),
235
+ u && u.id === i.id && /* @__PURE__ */ s(
236
+ G,
237
+ {
238
+ iconName: o === d.M || o === d.S ? "Done16px" : "Done24px",
239
+ className: e["selected-icon"]
240
+ }
241
+ )
242
+ ]
243
+ },
244
+ i.id
245
+ )
246
+ },
247
+ n.key
248
+ );
249
+ })
250
+ }
251
+ )
252
+ ]
253
+ }
254
+ ) : /* @__PURE__ */ s(
255
+ Te,
256
+ {
257
+ className: a(e.options, e[o], e[S]),
258
+ "data-testid": "select-search-options",
259
+ style: { width: "100%" },
260
+ static: !0,
261
+ children: ({ option: n }) => /* @__PURE__ */ l(
262
+ ae,
263
+ {
264
+ value: n,
265
+ className: ({ focus: i }) => a(
266
+ e.option,
267
+ q,
268
+ {
269
+ [e["option-active"]]: i
270
+ },
271
+ o && e[o]
272
+ ),
273
+ children: [
274
+ /* @__PURE__ */ l("div", { className: e["option-inner"], children: [
275
+ n.name,
276
+ n.bottom && /* @__PURE__ */ s("div", { children: n.bottom })
277
+ ] }),
278
+ u && u.id === n.id && /* @__PURE__ */ s(
279
+ G,
280
+ {
281
+ iconName: o === d.M || o === d.S ? "Done16px" : "Done24px",
282
+ className: e["selected-icon"]
283
+ }
284
+ )
285
+ ]
286
+ },
287
+ n.id
288
+ )
289
+ }
290
+ ) : /* @__PURE__ */ s(
291
+ "div",
292
+ {
293
+ className: a(
294
+ e.options,
295
+ e[o],
296
+ e["no-options"],
297
+ e[S]
298
+ ),
299
+ "data-headlessui-state": t ? "open" : "closed",
300
+ children: _e
301
+ }
302
+ ) : /* @__PURE__ */ s(
303
+ "div",
304
+ {
305
+ className: a(
306
+ e.options,
307
+ e[o],
308
+ e["no-options"],
309
+ e[S]
310
+ ),
311
+ "data-headlessui-state": t ? "open" : "closed",
312
+ children: Ne()
313
+ }
314
+ );
315
+ return /* @__PURE__ */ s(
316
+ Ee,
78
317
  {
79
318
  as: "div",
80
- value: p,
81
- className: i(e["select-search"], {
82
- [e.full]: V,
83
- [e.disabled]: r
319
+ value: u,
320
+ className: a(e["select-search"], {
321
+ [e.full]: de,
322
+ [e.disabled]: m
84
323
  }),
85
- onChange: T,
86
- ref: L,
87
- disabled: r,
88
- virtual: { options: x },
89
- immediate: P,
90
- children: ({ open: t }) => /* @__PURE__ */ h(D, { children: [
91
- /* @__PURE__ */ h(
324
+ onChange: ve,
325
+ ref: le,
326
+ disabled: m,
327
+ virtual: p ? void 0 : { options: N },
328
+ immediate: pe,
329
+ children: ({ open: t }) => /* @__PURE__ */ l(ee, { children: [
330
+ /* @__PURE__ */ l(
92
331
  "div",
93
332
  {
94
- className: i(e.container, e[a], {
333
+ className: a(e.container, e[o], {
95
334
  [e["container-open"]]: t
96
335
  }),
97
336
  children: [
98
- c && /* @__PURE__ */ h("div", { style: { position: "relative", width: "100%" }, children: [
99
- /* @__PURE__ */ n(M, { disabled: r, style: { width: "100%" }, children: /* @__PURE__ */ n(
100
- j,
337
+ _ && /* @__PURE__ */ l("div", { className: e["input-container"], children: [
338
+ /* @__PURE__ */ s(
339
+ ie,
101
340
  {
102
- as: B,
103
- label: w,
104
- size: A(a),
105
- className: i(e["select-input"], {
106
- [e["select-input-disabled"]]: c && v
107
- }),
108
- onChange: z,
109
- value: d,
110
- disabled: r,
111
- variant: I,
112
- rightSlotClassName: e["right-slot"],
113
- requiredMarkClassName: e["required-mark"],
114
- "data-testid": "select-search-input",
115
- onFocus: (o) => {
116
- c && o.target.blur();
117
- },
118
- rightAddon: {
119
- addonType: "icon",
120
- addonContent: J(t, a)
121
- },
122
- autocomplete: k,
123
- ...y
341
+ disabled: m,
342
+ style: { width: "100%" },
343
+ onClick: Y,
344
+ children: /* @__PURE__ */ s(
345
+ re,
346
+ {
347
+ as: oe,
348
+ label: M,
349
+ size: ne(o),
350
+ className: a(e["select-search-input"], {
351
+ [e["select-search-input-disabled"]]: _ && E
352
+ }),
353
+ onChange: J,
354
+ value: h,
355
+ disabled: m,
356
+ variant: j,
357
+ rightSlotClassName: e["right-slot"],
358
+ requiredMarkClassName: e["required-mark"],
359
+ "data-testid": "select-search-input",
360
+ onFocus: Q,
361
+ rightAddon: {
362
+ addonType: "icon",
363
+ addonContent: Le(t, o)
364
+ },
365
+ autocomplete: H,
366
+ ...F
367
+ }
368
+ )
124
369
  }
125
- ) }),
126
- v && d && /* @__PURE__ */ n(
127
- Q,
370
+ ),
371
+ E && h && /* @__PURE__ */ s(
372
+ Oe,
128
373
  {
129
374
  tabIndex: -1,
130
- className: i(e.clear, {
131
- [e.disabled]: r
375
+ className: a(e.clear, {
376
+ [e.disabled]: m
132
377
  }),
133
378
  iconButtonClassName: e["icon-button"],
134
379
  isIconButton: !0,
135
380
  iconName: "Close16px",
136
381
  size: "m-s",
137
382
  clear: !0,
138
- disabled: r,
383
+ disabled: m,
139
384
  variant: "secondary-gray",
140
- onClick: (o) => {
141
- o.stopPropagation(), H();
385
+ onClick: (n) => {
386
+ n.stopPropagation(), be();
142
387
  },
143
388
  "data-testid": "clear-button"
144
389
  }
145
390
  )
146
391
  ] }),
147
- !c && /* @__PURE__ */ n(
148
- j,
392
+ !_ && /* @__PURE__ */ s(
393
+ re,
149
394
  {
150
- as: B,
151
- label: w,
152
- size: A(a),
153
- className: e["select-input"],
154
- onChange: z,
155
- value: d,
156
- disabled: r,
157
- variant: I,
158
- withClearButton: v,
395
+ as: oe,
396
+ label: M,
397
+ size: ne(o),
398
+ className: e["select-search-input"],
159
399
  rightSlotClassName: e["right-slot"],
160
400
  requiredMarkClassName: e["required-mark"],
401
+ value: h,
402
+ disabled: m,
403
+ variant: j,
404
+ withClearButton: E && !!h,
405
+ onChange: J,
406
+ rightAddon: ye(t),
161
407
  "data-testid": "select-search-input",
162
- rightAddon: S ? {
163
- addonType: "react-node",
164
- addonContent: S && /* @__PURE__ */ n(
165
- M,
166
- {
167
- className: i(e.button, {
168
- [e.disabled]: r
169
- }),
170
- disabled: r,
171
- children: /* @__PURE__ */ n(
172
- O,
173
- {
174
- iconName: a == b.M || a == b.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
175
- className: i(e["selector-icon"], {
176
- [e["selector-icon-open"]]: t
177
- })
178
- }
179
- )
180
- }
181
- )
182
- } : void 0,
183
- onFocus: (o) => {
184
- c && o.target.blur();
185
- },
186
- autocomplete: k,
187
- ...y
408
+ onFocus: Q,
409
+ autocomplete: H,
410
+ ...F
188
411
  }
189
412
  )
190
413
  ]
191
414
  }
192
415
  ),
193
- t && /* @__PURE__ */ n(D, { children: u.length ? x.length ? /* @__PURE__ */ n(
194
- Z,
195
- {
196
- "data-testid": "select-search-options",
197
- className: i(
198
- e.options,
199
- e[a],
200
- e[N]
201
- ),
202
- children: ({ option: o }) => /* @__PURE__ */ h(
203
- ee,
204
- {
205
- value: o,
206
- className: ({ focus: K }) => i(
207
- e.option,
208
- F,
209
- a && e[a],
210
- {
211
- [e["option-active"]]: K
212
- }
213
- ),
214
- "data-testid": `select-search-option-${o.id}`,
215
- children: [
216
- /* @__PURE__ */ h("div", { className: e["option-inner"], children: [
217
- o.name,
218
- o.bottom && /* @__PURE__ */ n("div", { children: o.bottom })
219
- ] }),
220
- p && p.id === o.id && /* @__PURE__ */ n(
221
- O,
222
- {
223
- iconName: a === b.M || a === b.S ? "Done16px" : "Done24px",
224
- className: e["selected-icon"]
225
- }
226
- )
227
- ]
228
- },
229
- o.id
230
- )
231
- }
232
- ) : /* @__PURE__ */ n(
233
- "div",
234
- {
235
- className: i(
236
- e.options,
237
- e[a],
238
- e["no-options"],
239
- e[N]
240
- ),
241
- "data-headlessui-state": t ? "open" : "closed",
242
- children: "Ничего не найдено"
243
- }
244
- ) : /* @__PURE__ */ n(
245
- "div",
246
- {
247
- className: i(
248
- e.options,
249
- e[a],
250
- e["no-options"],
251
- e[N]
252
- ),
253
- "data-headlessui-state": t ? "open" : "closed",
254
- children: "Нет данных"
255
- }
256
- ) })
416
+ t && xe(t)
257
417
  ] })
258
418
  }
259
419
  );
260
420
  }
261
421
  );
422
+ We.displayName = "SelectSearch";
262
423
  export {
263
- Ce as SelectSearch
424
+ We as SelectSearch
264
425
  };
@@ -3,3 +3,9 @@ export declare enum ESelectSearchSize {
3
3
  M = "m",
4
4
  L = "l"
5
5
  }
6
+ export declare enum ELoadingIndicatorPlacement {
7
+ Input = "input",
8
+ Dropdown = "dropdown",
9
+ Both = "both",
10
+ None = "none"
11
+ }
@@ -1,4 +1,5 @@
1
- var m = /* @__PURE__ */ ((r) => (r.S = "s", r.M = "m", r.L = "l", r))(m || {});
1
+ var r = /* @__PURE__ */ ((p) => (p.S = "s", p.M = "m", p.L = "l", p))(r || {}), u = /* @__PURE__ */ ((p) => (p.Input = "input", p.Dropdown = "dropdown", p.Both = "both", p.None = "none", p))(u || {});
2
2
  export {
3
- m as ESelectSearchSize
3
+ u as ELoadingIndicatorPlacement,
4
+ r as ESelectSearchSize
4
5
  };