mimir-ui-kit 1.43.8 → 1.43.10

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.
@@ -13,6 +13,7 @@ export declare const SelectSearch: import('react').ForwardRefExoticComponent<Pic
13
13
  filterOnSearch?: boolean;
14
14
  items: TSelectOption[];
15
15
  classNameOption?: string;
16
+ classNameOptionInner?: string;
16
17
  menuPlacement?: import('./types').TMenuPlacement;
17
18
  disabled?: boolean;
18
19
  searchProps?: Pick<import('../Input').TInputProps, "numbersOnly" | "maxLength" | "required">;
@@ -26,4 +27,5 @@ export declare const SelectSearch: import('react').ForwardRefExoticComponent<Pic
26
27
  loadingIndicatorPlacement?: ELoadingIndicatorPlacement | `${ELoadingIndicatorPlacement}`;
27
28
  groupBy?: string;
28
29
  getGroupTitle?: (groupValue: string) => string;
30
+ optionLayout?: import('./types').TOptionLayout;
29
31
  } & import('react').RefAttributes<HTMLElement>>;
@@ -1,159 +1,175 @@
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 = {
1
+ import { jsx as r, jsxs as c, Fragment as V } from "react/jsx-runtime";
2
+ import { u as zt } from "../../index-D5H8gPPn.js";
3
+ import { c as i } from "../../index-DIxK0V-G.js";
4
+ import { forwardRef as Lt, useRef as Dt, useState as E, useMemo as q, useEffect as st, useCallback as Vt } from "react";
5
+ import { ESelectSearchSize as l, ELoadingIndicatorPlacement as x } from "./constants.js";
6
+ import { prepareGroupedItems as Et, mapSizeToInputSize as it, getDropdownArrowIcon as Tt } from "./utils.js";
7
+ import { Icon as P } from "../../icons/Icon.js";
8
+ import { Button as Bt } from "../Button/Button.js";
9
+ import { I as at } from "../../Input-BU_6U1CW.js";
10
+ import { EInputVariant as At } from "../Input/constants.js";
11
+ import { Loader as ct } from "../Loader/Loader.js";
12
+ import { H as Gt, U as lt, G as dt, W as ut, K as Mt } from "../../combobox-fIVOzEhl.js";
13
+ import '../../assets/SelectSearch.css';const qt = "_disabled_1rthm_6", Pt = "_container_1rthm_13", jt = "_full_1rthm_26", Ft = "_button_1rthm_38", Ht = "_options_1rthm_52", $t = "_top_1rthm_63", Kt = "_bottom_1rthm_69", Ut = "_s_1rthm_2", Wt = "_m_1rthm_110", Qt = "_l_1rthm_123", Yt = "_loader_1rthm_161", Jt = "_option_1rthm_52", Rt = "_clear_1rthm_200", t = {
14
14
  "select-search": "_select-search_1rthm_2",
15
- disabled: Be,
16
- container: Ve,
15
+ disabled: qt,
16
+ container: Pt,
17
17
  "container-open": "_container-open_1rthm_22",
18
- full: Ae,
18
+ full: jt,
19
19
  "selected-icon": "_selected-icon_1rthm_30",
20
20
  "selector-icon-open": "_selector-icon-open_1rthm_34",
21
- button: Ge,
21
+ button: Ft,
22
22
  "selector-icon": "_selector-icon_1rthm_34",
23
- options: Me,
24
- top: qe,
25
- bottom: Pe,
23
+ options: Ht,
24
+ top: $t,
25
+ bottom: Kt,
26
26
  "no-options": "_no-options_1rthm_75",
27
- s: je,
28
- m: Fe,
29
- l: He,
27
+ s: Ut,
28
+ m: Wt,
29
+ l: Qt,
30
30
  "select-search-input": "_select-search-input_1rthm_136",
31
31
  "select-search-input-disabled": "_select-search-input-disabled_1rthm_139",
32
32
  "group-header": "_group-header_1rthm_146",
33
33
  "sticky-active": "_sticky-active_1rthm_157",
34
- loader: $e,
34
+ loader: Yt,
35
35
  "input-container": "_input-container_1rthm_166",
36
- option: Ke,
36
+ option: Jt,
37
37
  "option-active": "_option-active_1rthm_180",
38
38
  "option-inner": "_option-inner_1rthm_183",
39
39
  "right-slot": "_right-slot_1rthm_190",
40
40
  "required-mark": "_required-mark_1rthm_195",
41
- clear: Ue,
41
+ clear: Rt,
42
42
  "icon-button": "_icon-button_1rthm_209"
43
- }, We = ke(
44
- (ce, le) => {
43
+ }, Xt = Lt(
44
+ (mt, pt) => {
45
45
  const {
46
- placeholder: M,
47
- size: o = d.L,
48
- value: c,
49
- onChange: r,
50
- full: de,
51
- showArrow: me = !0,
46
+ placeholder: j,
47
+ size: o = l.L,
48
+ value: d,
49
+ onChange: a,
50
+ full: ht,
51
+ showArrow: _t = !0,
52
52
  items: g = [],
53
- classNameOption: q,
54
- displayValue: ue = "name",
55
- filterOnSearch: P = !0,
53
+ classNameOption: F,
54
+ classNameOptionInner: H,
55
+ displayValue: S = "name",
56
+ filterOnSearch: $ = !0,
56
57
  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,
58
+ variant: K = At.DefaultGray,
59
+ menuPlacement: k = "bottom",
60
+ disabled: u = !1,
61
+ searchProps: U,
62
+ withClearButton: T = !1,
63
+ disableInput: h = !1,
64
+ autocomplete: W = "on",
65
+ immediate: ft = !1,
66
+ noOptionsText: gt = "Нет данных",
67
+ noMatchText: vt = "Ничего не найдено",
68
+ loadOnOpen: B,
69
+ loading: Q,
70
+ loadingIndicatorPlacement: w = x.Dropdown,
70
71
  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,
72
+ getGroupTitle: Y = (e) => e,
73
+ optionLayout: bt = "name-bottom"
74
+ } = mt, A = (e) => {
75
+ if (!e) return "";
76
+ const n = e[S];
77
+ return typeof n == "string" ? n : String(n || "");
78
+ }, yt = (e) => {
79
+ const n = e[S];
80
+ return typeof n == "string" ? n : String(n || "");
81
+ }, G = A(d), C = Dt(null), [_, v] = E(G), [m, b] = E(d), [Nt, J] = E(!1), [M, xt] = E(null), R = Q !== void 0 ? Q : Nt, y = q(() => {
82
+ if (!$)
83
+ return g;
84
+ const e = String(_ || "").trim().toLowerCase();
85
+ return e ? g.filter((n) => yt(n).toLowerCase().includes(e)) : g;
86
+ }, [_, g, $, S]), N = q(() => p ? Et(
87
+ y,
76
88
  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,
89
+ Y || ((e) => e)
90
+ ) : y, [y, p, Y]), O = q(() => {
91
+ const e = [];
92
+ return N.forEach((n, s) => {
93
+ n.isGroupHeader && e.push(s);
94
+ }), e;
95
+ }, [N]), f = zt({
96
+ count: N.length,
97
+ getScrollElement: () => C.current,
98
+ estimateSize: () => o === l.L ? 65 : 49,
87
99
  overscan: 10
88
100
  });
89
- te(() => {
90
- const t = w.current;
91
- if (!t || !p) return;
101
+ st(() => {
102
+ const e = C.current;
103
+ if (!e || !p) return;
92
104
  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)
105
+ var nt, ot;
106
+ const s = e.scrollTop;
107
+ let z = null;
108
+ for (let L = 0; L < O.length; L++) {
109
+ const rt = O[L];
110
+ if ((((nt = f.getVirtualItems().find((D) => D.index === rt)) == null ? void 0 : nt.start) || 0) <= s) {
111
+ z = rt;
112
+ const D = O[L + 1];
113
+ if (D !== void 0 && (((ot = f.getVirtualItems().find((Ot) => Ot.index === D)) == null ? void 0 : ot.start) || 0) <= s)
102
114
  continue;
103
115
  } else
104
116
  break;
105
117
  }
106
- ge(C);
118
+ xt(z);
107
119
  };
108
- return t.addEventListener("scroll", n), () => t.removeEventListener("scroll", n);
109
- }, [f, z, p, w.current]);
110
- const Y = async () => {
111
- if (T)
120
+ return e.addEventListener("scroll", n), () => e.removeEventListener("scroll", n);
121
+ }, [f, O, p, C.current]);
122
+ const X = async () => {
123
+ if (B)
112
124
  try {
113
- U(!0), await T();
125
+ J(!0), await B();
114
126
  } finally {
115
- U(!1);
127
+ J(!1);
116
128
  }
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(
120
- (t) => {
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: "" }));
129
+ }, St = (e) => {
130
+ if (e) {
131
+ const n = A(e);
132
+ v(n), b(e), a == null || a(e);
133
+ } else
134
+ v(""), b(null), a == null || a({ id: "", name: "" });
135
+ }, Z = Vt(
136
+ (e) => {
137
+ if (h) return;
138
+ const n = e.target.value;
139
+ v(n), I == null || I(n), m && n !== A(m) && b(null), !n && d && (a == null || a({ id: "", name: "" }));
124
140
  },
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();
141
+ [h, a, I, d, m, S]
142
+ ), It = () => {
143
+ v(""), b(null), a == null || a({ id: "", name: "" });
144
+ }, tt = async (e) => {
145
+ h && e.target.blur(), B && await X();
130
146
  };
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" }),
147
+ st(() => {
148
+ const e = !d || typeof d == "object" && !Object.keys(d).length;
149
+ v(e ? "" : G), b(e ? null : d);
150
+ }, [d, G]);
151
+ const kt = () => R && (w === x.Dropdown || w === x.Both) ? /* @__PURE__ */ c("div", { className: t.loader, children: [
152
+ /* @__PURE__ */ r(ct, { size: "s" }),
137
153
  "Загрузка..."
138
- ] }) : he, ye = (t) => {
139
- if (me)
154
+ ] }) : gt, wt = (e) => {
155
+ if (_t)
140
156
  return {
141
157
  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,
158
+ addonContent: /* @__PURE__ */ c(V, { children: [
159
+ R && (w === x.Input || w === x.Both) && /* @__PURE__ */ r(ct, { size: "s" }),
160
+ /* @__PURE__ */ r(
161
+ lt,
146
162
  {
147
- className: a(e.button, {
148
- [e.disabled]: m
163
+ className: i(t.button, {
164
+ [t.disabled]: u
149
165
  }),
150
- disabled: m,
151
- children: /* @__PURE__ */ s(
152
- G,
166
+ disabled: u,
167
+ children: /* @__PURE__ */ r(
168
+ P,
153
169
  {
154
- iconName: o == d.M || o == d.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
155
- className: a(e["selector-icon"], {
156
- [e["selector-icon-open"]]: t
170
+ iconName: o == l.M || o == l.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
171
+ className: i(t["selector-icon"], {
172
+ [t["selector-icon-open"]]: e
157
173
  })
158
174
  }
159
175
  )
@@ -161,30 +177,39 @@ import '../../assets/SelectSearch.css';const Be = "_disabled_1rthm_6", Ve = "_co
161
177
  )
162
178
  ] })
163
179
  };
164
- }, xe = (t) => g.length ? N.length ? p ? /* @__PURE__ */ l(
180
+ }, et = (e) => {
181
+ const n = e.name, s = e.bottom && /* @__PURE__ */ r("div", { children: e.bottom });
182
+ return bt === "bottom-name" ? /* @__PURE__ */ c(V, { children: [
183
+ s,
184
+ n
185
+ ] }) : /* @__PURE__ */ c(V, { children: [
186
+ n,
187
+ s
188
+ ] });
189
+ }, Ct = (e) => g.length ? y.length ? p ? /* @__PURE__ */ c(
165
190
  "div",
166
191
  {
167
- ref: w,
192
+ ref: C,
168
193
  "data-testid": "select-search-options",
169
- className: a(e.options, e[o], e[S]),
194
+ className: i(t.options, t[o], t[k]),
170
195
  style: {
171
- height: o === d.M || o === d.S ? "240px" : "320px",
196
+ height: o === l.M || o === l.S ? "240px" : "320px",
172
197
  overflow: "auto"
173
198
  },
174
199
  children: [
175
- V !== null && /* @__PURE__ */ s(
200
+ M !== null && /* @__PURE__ */ r(
176
201
  "div",
177
202
  {
178
- className: e["group-header"],
203
+ className: t["group-header"],
179
204
  style: {
180
205
  position: "sticky",
181
206
  top: 0,
182
207
  zIndex: 3
183
208
  },
184
- children: y[V].name
209
+ children: N[M].name
185
210
  }
186
211
  ),
187
- /* @__PURE__ */ s(
212
+ /* @__PURE__ */ r(
188
213
  "div",
189
214
  {
190
215
  style: {
@@ -192,8 +217,8 @@ import '../../assets/SelectSearch.css';const Be = "_disabled_1rthm_6", Ve = "_co
192
217
  width: "100%"
193
218
  },
194
219
  children: f.getVirtualItems().map((n) => {
195
- const i = y[n.index];
196
- return /* @__PURE__ */ s(
220
+ const s = N[n.index];
221
+ return /* @__PURE__ */ r(
197
222
  "div",
198
223
  {
199
224
  "data-index": n.index,
@@ -205,43 +230,49 @@ import '../../assets/SelectSearch.css';const Be = "_disabled_1rthm_6", Ve = "_co
205
230
  width: "100%",
206
231
  transform: `translateY(${n.start}px)`
207
232
  },
208
- children: i.isGroupHeader ? /* @__PURE__ */ s(
233
+ children: s.isGroupHeader ? /* @__PURE__ */ r(
209
234
  "div",
210
235
  {
211
- className: e["group-header"],
236
+ className: t["group-header"],
212
237
  style: {
213
- visibility: V === n.index ? "hidden" : "visible"
238
+ visibility: M === n.index ? "hidden" : "visible"
214
239
  },
215
- children: i.name
240
+ children: s.name
216
241
  }
217
- ) : /* @__PURE__ */ l(
218
- ae,
242
+ ) : /* @__PURE__ */ c(
243
+ ut,
219
244
  {
220
- value: i,
221
- className: ({ focus: C }) => a(
222
- e.option,
223
- q,
224
- o && e[o],
245
+ value: s,
246
+ className: ({ focus: z }) => i(
247
+ t.option,
248
+ F,
249
+ o && t[o],
225
250
  {
226
- [e["option-active"]]: C
251
+ [t["option-active"]]: z
227
252
  }
228
253
  ),
229
- "data-testid": `select-search-option-${i.id}`,
254
+ "data-testid": `select-search-option-${s.id}`,
230
255
  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,
256
+ /* @__PURE__ */ r(
257
+ "div",
237
258
  {
238
- iconName: o === d.M || o === d.S ? "Done16px" : "Done24px",
239
- className: e["selected-icon"]
259
+ className: i(
260
+ t["option-inner"],
261
+ H
262
+ ),
263
+ children: et(s)
264
+ }
265
+ ),
266
+ m && m.id === s.id && /* @__PURE__ */ r(
267
+ P,
268
+ {
269
+ iconName: o === l.M || o === l.S ? "Done16px" : "Done24px",
270
+ className: t["selected-icon"]
240
271
  }
241
272
  )
242
273
  ]
243
274
  },
244
- i.id
275
+ s.id
245
276
  )
246
277
  },
247
278
  n.key
@@ -251,35 +282,41 @@ import '../../assets/SelectSearch.css';const Be = "_disabled_1rthm_6", Ve = "_co
251
282
  )
252
283
  ]
253
284
  }
254
- ) : /* @__PURE__ */ s(
255
- Te,
285
+ ) : /* @__PURE__ */ r(
286
+ Mt,
256
287
  {
257
- className: a(e.options, e[o], e[S]),
288
+ className: i(t.options, t[o], t[k]),
258
289
  "data-testid": "select-search-options",
259
290
  style: { width: "100%" },
260
291
  static: !0,
261
- children: ({ option: n }) => /* @__PURE__ */ l(
262
- ae,
292
+ children: ({ option: n }) => /* @__PURE__ */ c(
293
+ ut,
263
294
  {
264
295
  value: n,
265
- className: ({ focus: i }) => a(
266
- e.option,
267
- q,
296
+ className: ({ focus: s }) => i(
297
+ t.option,
298
+ F,
268
299
  {
269
- [e["option-active"]]: i
300
+ [t["option-active"]]: s
270
301
  },
271
- o && e[o]
302
+ o && t[o]
272
303
  ),
273
304
  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,
305
+ /* @__PURE__ */ r(
306
+ "div",
307
+ {
308
+ className: i(
309
+ t["option-inner"],
310
+ H
311
+ ),
312
+ children: et(n)
313
+ }
314
+ ),
315
+ m && m.id === n.id && /* @__PURE__ */ r(
316
+ P,
280
317
  {
281
- iconName: o === d.M || o === d.S ? "Done16px" : "Done24px",
282
- className: e["selected-icon"]
318
+ iconName: o === l.M || o === l.S ? "Done16px" : "Done24px",
319
+ className: t["selected-icon"]
283
320
  }
284
321
  )
285
322
  ]
@@ -287,139 +324,139 @@ import '../../assets/SelectSearch.css';const Be = "_disabled_1rthm_6", Ve = "_co
287
324
  n.id
288
325
  )
289
326
  }
290
- ) : /* @__PURE__ */ s(
327
+ ) : /* @__PURE__ */ r(
291
328
  "div",
292
329
  {
293
- className: a(
294
- e.options,
295
- e[o],
296
- e["no-options"],
297
- e[S]
330
+ className: i(
331
+ t.options,
332
+ t[o],
333
+ t["no-options"],
334
+ t[k]
298
335
  ),
299
- "data-headlessui-state": t ? "open" : "closed",
300
- children: _e
336
+ "data-headlessui-state": e ? "open" : "closed",
337
+ children: vt
301
338
  }
302
- ) : /* @__PURE__ */ s(
339
+ ) : /* @__PURE__ */ r(
303
340
  "div",
304
341
  {
305
- className: a(
306
- e.options,
307
- e[o],
308
- e["no-options"],
309
- e[S]
342
+ className: i(
343
+ t.options,
344
+ t[o],
345
+ t["no-options"],
346
+ t[k]
310
347
  ),
311
- "data-headlessui-state": t ? "open" : "closed",
312
- children: Ne()
348
+ "data-headlessui-state": e ? "open" : "closed",
349
+ children: kt()
313
350
  }
314
351
  );
315
- return /* @__PURE__ */ s(
316
- Ee,
352
+ return /* @__PURE__ */ r(
353
+ Gt,
317
354
  {
318
355
  as: "div",
319
- value: u,
320
- className: a(e["select-search"], {
321
- [e.full]: de,
322
- [e.disabled]: m
356
+ value: m,
357
+ className: i(t["select-search"], {
358
+ [t.full]: ht,
359
+ [t.disabled]: u
323
360
  }),
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(
361
+ onChange: St,
362
+ ref: pt,
363
+ disabled: u,
364
+ virtual: p ? void 0 : { options: y },
365
+ immediate: ft,
366
+ children: ({ open: e }) => /* @__PURE__ */ c(V, { children: [
367
+ /* @__PURE__ */ c(
331
368
  "div",
332
369
  {
333
- className: a(e.container, e[o], {
334
- [e["container-open"]]: t
370
+ className: i(t.container, t[o], {
371
+ [t["container-open"]]: e
335
372
  }),
336
373
  children: [
337
- _ && /* @__PURE__ */ l("div", { className: e["input-container"], children: [
338
- /* @__PURE__ */ s(
339
- ie,
374
+ h && /* @__PURE__ */ c("div", { className: t["input-container"], children: [
375
+ /* @__PURE__ */ r(
376
+ lt,
340
377
  {
341
- disabled: m,
378
+ disabled: u,
342
379
  style: { width: "100%" },
343
- onClick: Y,
344
- children: /* @__PURE__ */ s(
345
- re,
380
+ onClick: X,
381
+ children: /* @__PURE__ */ r(
382
+ dt,
346
383
  {
347
- as: oe,
348
- label: M,
349
- size: ne(o),
350
- className: a(e["select-search-input"], {
351
- [e["select-search-input-disabled"]]: _ && E
384
+ as: at,
385
+ label: j,
386
+ size: it(o),
387
+ className: i(t["select-search-input"], {
388
+ [t["select-search-input-disabled"]]: h && T
352
389
  }),
353
- onChange: J,
354
- value: h,
355
- disabled: m,
356
- variant: j,
357
- rightSlotClassName: e["right-slot"],
358
- requiredMarkClassName: e["required-mark"],
390
+ onChange: Z,
391
+ value: _,
392
+ disabled: u,
393
+ variant: K,
394
+ rightSlotClassName: t["right-slot"],
395
+ requiredMarkClassName: t["required-mark"],
359
396
  "data-testid": "select-search-input",
360
- onFocus: Q,
397
+ onFocus: tt,
361
398
  rightAddon: {
362
399
  addonType: "icon",
363
- addonContent: Le(t, o)
400
+ addonContent: Tt(e, o)
364
401
  },
365
- autocomplete: H,
366
- ...F
402
+ autocomplete: W,
403
+ ...U
367
404
  }
368
405
  )
369
406
  }
370
407
  ),
371
- E && h && /* @__PURE__ */ s(
372
- Oe,
408
+ T && _ && /* @__PURE__ */ r(
409
+ Bt,
373
410
  {
374
411
  tabIndex: -1,
375
- className: a(e.clear, {
376
- [e.disabled]: m
412
+ className: i(t.clear, {
413
+ [t.disabled]: u
377
414
  }),
378
- iconButtonClassName: e["icon-button"],
415
+ iconButtonClassName: t["icon-button"],
379
416
  isIconButton: !0,
380
417
  iconName: "Close16px",
381
418
  size: "m-s",
382
419
  clear: !0,
383
- disabled: m,
420
+ disabled: u,
384
421
  variant: "secondary-gray",
385
422
  onClick: (n) => {
386
- n.stopPropagation(), be();
423
+ n.stopPropagation(), It();
387
424
  },
388
425
  "data-testid": "clear-button"
389
426
  }
390
427
  )
391
428
  ] }),
392
- !_ && /* @__PURE__ */ s(
393
- re,
429
+ !h && /* @__PURE__ */ r(
430
+ dt,
394
431
  {
395
- as: oe,
396
- label: M,
397
- size: ne(o),
398
- className: e["select-search-input"],
399
- rightSlotClassName: e["right-slot"],
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),
432
+ as: at,
433
+ label: j,
434
+ size: it(o),
435
+ className: t["select-search-input"],
436
+ rightSlotClassName: t["right-slot"],
437
+ requiredMarkClassName: t["required-mark"],
438
+ value: _,
439
+ disabled: u,
440
+ variant: K,
441
+ withClearButton: T && !!_,
442
+ onChange: Z,
443
+ rightAddon: wt(e),
407
444
  "data-testid": "select-search-input",
408
- onFocus: Q,
409
- autocomplete: H,
410
- ...F
445
+ onFocus: tt,
446
+ autocomplete: W,
447
+ ...U
411
448
  }
412
449
  )
413
450
  ]
414
451
  }
415
452
  ),
416
- t && xe(t)
453
+ e && Ct(e)
417
454
  ] })
418
455
  }
419
456
  );
420
457
  }
421
458
  );
422
- We.displayName = "SelectSearch";
459
+ Xt.displayName = "SelectSearch";
423
460
  export {
424
- We as SelectSearch
461
+ Xt as SelectSearch
425
462
  };
@@ -3,12 +3,13 @@ import { ELoadingIndicatorPlacement, ESelectSearchSize } from './constants';
3
3
  import { TInputProps } from '../Input';
4
4
 
5
5
  export type TSelectOption = {
6
- name: string;
6
+ name: string | ReactNode;
7
7
  id: number | string;
8
8
  bottom?: ReactNode;
9
9
  [index: string]: unknown;
10
10
  };
11
11
  export type TMenuPlacement = 'top' | 'bottom';
12
+ export type TOptionLayout = 'name-bottom' | 'bottom-name';
12
13
  export type TSelectSearchProps = Pick<TInputProps, 'withClearButton' | 'variant'> & {
13
14
  /**
14
15
  * Текущее выбранное значение.
@@ -44,6 +45,8 @@ export type TSelectSearchProps = Pick<TInputProps, 'withClearButton' | 'variant'
44
45
  items: TSelectOption[];
45
46
  /** Класснейм для значения */
46
47
  classNameOption?: string;
48
+ /** Класснейм для внутреннего контейнера опции */
49
+ classNameOptionInner?: string;
47
50
  /** Варианты отображения выпадающего меню */
48
51
  menuPlacement?: TMenuPlacement;
49
52
  /** Отключает компонент SelectSearch */
@@ -87,4 +90,9 @@ export type TSelectSearchProps = Pick<TInputProps, 'withClearButton' | 'variant'
87
90
  * @returns Строка для отображения в заголовке группы
88
91
  */
89
92
  getGroupTitle?: (groupValue: string) => string;
93
+ /**
94
+ * Порядок отображения элементов в опции
95
+ * @default 'name-bottom'
96
+ */
97
+ optionLayout?: TOptionLayout;
90
98
  };
@@ -27,6 +27,10 @@ type TProps = SwiperProps & {
27
27
  * Показывать стрелки навигации и количество слайдов.
28
28
  */
29
29
  needNavigation?: boolean;
30
+ /**
31
+ * Приостанавливать автопрокрутку при наведении на слайдер.
32
+ */
33
+ pauseOnMouseEnter?: boolean;
30
34
  /**
31
35
  * Функция, которая будет вызвана при клике на слайд.
32
36
  */
@@ -88,5 +92,5 @@ type TProps = SwiperProps & {
88
92
  */
89
93
  images?: TSlideImage[];
90
94
  };
91
- export default function Slider({ images, children, gap, onSlideClick, swiperClassName, slideClassName, imageClassName, navigationClassName, navigationContent, sliderBottomPanelClassName, descriptionsClassName, navigationContentClassName, buttonsVariant, progressBarPosition, isFullPaginationWidth, needNavigation, leftDescription, rightDescription, delay, ...props }: TProps): import("react/jsx-runtime").JSX.Element;
95
+ export default function Slider({ images, children, gap, onSlideClick, swiperClassName, slideClassName, imageClassName, navigationClassName, navigationContent, sliderBottomPanelClassName, descriptionsClassName, navigationContentClassName, buttonsVariant, progressBarPosition, isFullPaginationWidth, needNavigation, leftDescription, rightDescription, delay, pauseOnMouseEnter, ...props }: TProps): import("react/jsx-runtime").JSX.Element;
92
96
  export {};
@@ -1,35 +1,35 @@
1
1
  import { jsx as s, jsxs as o, Fragment as N } from "react/jsx-runtime";
2
2
  import { c as a } from "../../index-DIxK0V-G.js";
3
- import { memo as F, useCallback as u, useMemo as X, forwardRef as Z, useRef as B, useState as V, Children as I } from "react";
4
- import { u as W, S as ee, A as se, a as T } from "../../swiper-react-BvAw14a4.js";
3
+ import { memo as F, useCallback as u, useMemo as Z, forwardRef as V, useRef as B, useState as W, Children as I } from "react";
4
+ import { u as ee, S as se, A as re, a as T } from "../../swiper-react-BvAw14a4.js";
5
5
  import { EProgressBarPosition as S } from "./constants.js";
6
6
  import { formatSlideNumber as O } from "./utils.js";
7
7
  import { AppImage as P } from "../Image/Image.js";
8
- import { MergedButton as re } from "../MergedButton/MergedButton.js";
9
- import '../../assets/Slider.css';const te = "_swiper_zqjj3_2", ne = "_slide_zqjj3_8", ae = "_link_zqjj3_15", oe = "_image_zqjj3_21", ie = "_navigation_zqjj3_28", le = "_pagination_zqjj3_46", ce = "_slides_zqjj3_65", de = "_separator_zqjj3_71", pe = "_progress_zqjj3_78", ue = "_descriptions_zqjj3_95", e = {
10
- swiper: te,
11
- slide: ne,
12
- link: ae,
13
- image: oe,
14
- navigation: ie,
8
+ import { MergedButton as te } from "../MergedButton/MergedButton.js";
9
+ import '../../assets/Slider.css';const ne = "_swiper_zqjj3_2", ae = "_slide_zqjj3_8", oe = "_link_zqjj3_15", ie = "_image_zqjj3_21", le = "_navigation_zqjj3_28", ce = "_pagination_zqjj3_46", de = "_slides_zqjj3_65", pe = "_separator_zqjj3_71", ue = "_progress_zqjj3_78", me = "_descriptions_zqjj3_95", e = {
10
+ swiper: ne,
11
+ slide: ae,
12
+ link: oe,
13
+ image: ie,
14
+ navigation: le,
15
15
  "navigation-content": "_navigation-content_zqjj3_37",
16
- pagination: le,
16
+ pagination: ce,
17
17
  "is-full": "_is-full_zqjj3_60",
18
- slides: ce,
19
- separator: de,
20
- progress: pe,
18
+ slides: de,
19
+ separator: pe,
20
+ progress: ue,
21
21
  "progress-bar-bottom": "_progress-bar-bottom_zqjj3_85",
22
22
  "progress-bar": "_progress-bar_zqjj3_85",
23
- descriptions: ue
24
- }, me = 15e3, E = F(
23
+ descriptions: me
24
+ }, _e = 15e3, E = F(
25
25
  ({
26
26
  variant: t = "white"
27
27
  }) => {
28
- const n = W(), p = u(() => {
28
+ const n = ee(), p = u(() => {
29
29
  n.slideNext();
30
30
  }, [n]), c = u(() => {
31
31
  n.slidePrev();
32
- }, [n]), m = X(
32
+ }, [n]), m = Z(
33
33
  () => [
34
34
  {
35
35
  isIconButton: !0,
@@ -46,10 +46,10 @@ import '../../assets/Slider.css';const te = "_swiper_zqjj3_2", ne = "_slide_zqjj
46
46
  ],
47
47
  [c, t, p]
48
48
  );
49
- return /* @__PURE__ */ s(re, { buttons: m });
49
+ return /* @__PURE__ */ s(te, { buttons: m });
50
50
  }
51
51
  ), b = F(
52
- Z((t, n) => /* @__PURE__ */ s(
52
+ V((t, n) => /* @__PURE__ */ s(
53
53
  "div",
54
54
  {
55
55
  "data-testid": "progress-bar-wrapper",
@@ -65,7 +65,7 @@ import '../../assets/Slider.css';const te = "_swiper_zqjj3_2", ne = "_slide_zqjj
65
65
  }
66
66
  ))
67
67
  );
68
- function qe({
68
+ function ze({
69
69
  images: t,
70
70
  children: n,
71
71
  gap: p,
@@ -84,17 +84,18 @@ function qe({
84
84
  needNavigation: i = !0,
85
85
  leftDescription: C,
86
86
  rightDescription: y,
87
- delay: D = me,
88
- ...U
87
+ delay: D = _e,
88
+ pauseOnMouseEnter: U = !1,
89
+ ...Y
89
90
  }) {
90
- const d = B(null), h = B(null), [Y, G] = V(1), j = !(typeof n == "function") && !!n, H = j ? I.count(n) : 0, J = (t == null ? void 0 : t.length) ?? 0, A = O(Y), x = O(
91
- j ? H : J
92
- ), K = u(() => {
91
+ const d = B(null), h = B(null), [G, H] = W(1), j = !(typeof n == "function") && !!n, J = j ? I.count(n) : 0, K = (t == null ? void 0 : t.length) ?? 0, A = O(G), x = O(
92
+ j ? J : K
93
+ ), Q = u(() => {
93
94
  if (h.current && i) {
94
95
  const r = h.current.swiper;
95
- G(r.realIndex + 1);
96
+ H(r.realIndex + 1);
96
97
  }
97
- }, [i]), Q = u(
98
+ }, [i]), X = u(
98
99
  (r, l) => {
99
100
  if (d.current && i) {
100
101
  const g = r.params.autoplay.delay, w = l / g * 100;
@@ -104,23 +105,24 @@ function qe({
104
105
  [i]
105
106
  );
106
107
  return /* @__PURE__ */ o(
107
- ee,
108
+ se,
108
109
  {
109
- ...U,
110
+ ...Y,
110
111
  ref: h,
111
112
  className: a(e.swiper, m),
112
113
  loop: !0,
113
114
  spaceBetween: p,
114
115
  autoplay: {
115
116
  delay: D,
116
- disableOnInteraction: !1
117
+ disableOnInteraction: !1,
118
+ pauseOnMouseEnter: U
117
119
  },
118
120
  fadeEffect: {
119
121
  crossFade: !0
120
122
  },
121
- modules: [se],
122
- onAutoplayTimeLeft: Q,
123
- onSlideChange: K,
123
+ modules: [re],
124
+ onAutoplayTimeLeft: X,
125
+ onSlideChange: Q,
124
126
  children: [
125
127
  /* @__PURE__ */ s(
126
128
  "div",
@@ -246,5 +248,5 @@ function qe({
246
248
  );
247
249
  }
248
250
  export {
249
- qe as default
251
+ ze as default
250
252
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.43.8",
4
+ "version": "1.43.10",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {