mimir-ui-kit 1.36.8 → 1.36.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/dist/{Input-WnjLXNpw.js → Input-CbgqYgLo.js} +65 -63
  2. package/dist/{combobox-CDU06zJj.js → combobox-BpYucpxz.js} +1121 -1080
  3. package/dist/components/Accordion/Accordion.js +15 -15
  4. package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
  5. package/dist/components/DatePicker/DatePicker.js +1 -1
  6. package/dist/components/Drawer/Drawer.d.ts +9 -1
  7. package/dist/components/Drawer/Drawer.js +76 -72
  8. package/dist/components/Input/Input.d.ts +4 -0
  9. package/dist/components/Input/Input.js +1 -1
  10. package/dist/components/Input/index.js +1 -1
  11. package/dist/components/InputPassword/InputPassword.js +1 -1
  12. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
  13. package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +1 -0
  14. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +108 -105
  15. package/dist/components/MultiSelectSearch/types.d.ts +2 -0
  16. package/dist/components/MultiSelectSearch/utils.js +1 -1
  17. package/dist/components/OtpInput/OtpInput.js +1 -1
  18. package/dist/components/RadioGroup/RadioGroup.js +3 -3
  19. package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
  20. package/dist/components/SelectSearch/SelectSearch.js +96 -92
  21. package/dist/components/SelectSearch/types.d.ts +2 -0
  22. package/dist/components/SelectSearch/utils.js +1 -1
  23. package/dist/components/Switcher/Switcher.js +4 -4
  24. package/dist/components/TabTrail/TabTrail.js +4 -4
  25. package/dist/components/TextArea/TextArea.js +1 -1
  26. package/dist/components/index.js +1 -1
  27. package/dist/{field-FJ34aSs4.js → field-C1kt7aNM.js} +2 -2
  28. package/dist/{focus-management-XwV-9qkO.js → focus-management-DOYCPyGg.js} +1 -1
  29. package/dist/{hidden-DbgtYPOH.js → hidden-PvGXrYUY.js} +1 -1
  30. package/dist/index.js +1 -1
  31. package/dist/{keyboard-B0lm_zyn.js → keyboard-mgWkd2Vh.js} +114 -111
  32. package/dist/{label-y3ANLTNC.js → label-D4GFpe5F.js} +2 -2
  33. package/dist/open-closed-D2VjDhAN.js +86 -0
  34. package/dist/{use-active-press-86hajhdd.js → use-active-press-CqLGIFz7.js} +1 -1
  35. package/package.json +1 -1
  36. package/dist/open-closed-CdldUPoq.js +0 -86
@@ -1,138 +1,139 @@
1
- import { jsxs as g, jsx as o, Fragment as V } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as n, Fragment as B } from "react/jsx-runtime";
2
2
  import { c as l } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as se, useRef as B, useState as S, useEffect as R, useMemo as ie } from "react";
3
+ import { forwardRef as ie, useRef as R, useState as S, useEffect as j, useMemo as le } from "react";
4
4
  import { EMultiSelectSearchSize as M } from "./constants.js";
5
- import { getInitialInputValue as E, mapSizeToInputSize as F, getDropdownArrowIcon as le, joinSelectedItems as P } from "./utils.js";
6
- import { Icon as re } from "../../icons/Icon.js";
7
- import { Button as ce } from "../Button/Button.js";
8
- import { CheckboxMimir as ae } from "../CheckboxMimir/CheckboxMimir.js";
9
- import { Chip as ue } from "../Chip/Chip.js";
10
- import { I as j } from "../../Input-WnjLXNpw.js";
11
- import { EInputVariant as de } from "../Input/constants.js";
12
- import { H as pe, U as G, G as W, K as me, W as _e } from "../../combobox-CDU06zJj.js";
13
- import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe = "_container_17kql_9", ke = "_full_17kql_27", qe = "_button_17kql_39", ge = "_options_17kql_53", be = "_top_17kql_64", ve = "_bottom_17kql_69", Ne = "_m_17kql_2", Ie = "_l_17kql_111", we = "_focused_17kql_129", Ce = "_option_17kql_53", Se = "_chip_17kql_158", Me = "_clear_17kql_183", e = {
5
+ import { getInitialInputValue as E, mapSizeToInputSize as F, getDropdownArrowIcon as re, joinSelectedItems as P } from "./utils.js";
6
+ import { Icon as ce } from "../../icons/Icon.js";
7
+ import { Button as ae } from "../Button/Button.js";
8
+ import { CheckboxMimir as ue } from "../CheckboxMimir/CheckboxMimir.js";
9
+ import { Chip as de } from "../Chip/Chip.js";
10
+ import { I as G } from "../../Input-CbgqYgLo.js";
11
+ import { EInputVariant as pe } from "../Input/constants.js";
12
+ import { H as me, U as H, G as J, K as _e, j as he } from "../../combobox-BpYucpxz.js";
13
+ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke = "_container_17kql_9", qe = "_full_17kql_27", ge = "_button_17kql_39", be = "_options_17kql_53", ve = "_top_17kql_64", Ne = "_bottom_17kql_69", Ie = "_m_17kql_2", we = "_l_17kql_111", Ce = "_focused_17kql_129", Se = "_option_17kql_53", Me = "_chip_17kql_158", xe = "_clear_17kql_183", e = {
14
14
  "multi-select-search": "_multi-select-search_17kql_2",
15
- disabled: he,
16
- container: fe,
15
+ disabled: fe,
16
+ container: ke,
17
17
  "container-open": "_container-open_17kql_18",
18
18
  "input-container": "_input-container_17kql_22",
19
- full: ke,
19
+ full: qe,
20
20
  "selected-icon": "_selected-icon_17kql_31",
21
21
  "selector-icon-open": "_selector-icon-open_17kql_35",
22
- button: qe,
22
+ button: ge,
23
23
  "selector-icon": "_selector-icon_17kql_35",
24
- options: ge,
25
- top: be,
26
- bottom: ve,
24
+ options: be,
25
+ top: ve,
26
+ bottom: Ne,
27
27
  "no-options": "_no-options_17kql_90",
28
- m: Ne,
29
- l: Ie,
28
+ m: Ie,
29
+ l: we,
30
30
  "multi-select-input-disabled": "_multi-select-input-disabled_17kql_126",
31
31
  "multi-select-input": "_multi-select-input_17kql_126",
32
- focused: we,
33
- option: Ce,
32
+ focused: Ce,
33
+ option: Se,
34
34
  "option-active": "_option-active_17kql_148",
35
35
  "option-inner": "_option-inner_17kql_151",
36
- chip: Se,
36
+ chip: Me,
37
37
  "chip-container": "_chip-container_17kql_163",
38
38
  "chip-root": "_chip-root_17kql_169",
39
39
  "right-slot": "_right-slot_17kql_173",
40
40
  "required-mark": "_required-mark_17kql_178",
41
- clear: Me,
41
+ clear: xe,
42
42
  "icon-button": "_icon-button_17kql_192"
43
- }, Fe = se(
44
- (H, J) => {
43
+ }, Fe = ie(
44
+ (K, U) => {
45
45
  const {
46
46
  placeholder: x,
47
47
  size: i = M.L,
48
48
  value: a,
49
49
  onChange: s,
50
- full: K,
51
- showArrow: U = !0,
50
+ full: W,
51
+ showArrow: Q = !0,
52
52
  items: m = [],
53
- classNameOption: Q,
53
+ classNameOption: X,
54
54
  displayValue: d = "name",
55
55
  filterOnSearch: y = !0,
56
56
  onSearch: v,
57
- variant: D = de.DefaultGray,
57
+ variant: D = pe.DefaultGray,
58
58
  menuPlacement: N = "bottom",
59
59
  disabled: r = !1,
60
60
  searchProps: z,
61
61
  withClearButton: I = !1,
62
- withChip: X = !1,
63
- chipVariant: Y = "sapphire",
64
- disableInput: _ = !1
65
- } = H, w = B(null), p = B(null), [b, h] = S(!1), [f, k] = S(
62
+ withChip: Y = !1,
63
+ chipVariant: Z = "sapphire",
64
+ disableInput: _ = !1,
65
+ autocomplete: O = "on"
66
+ } = K, w = R(null), p = R(null), [b, h] = S(!1), [f, k] = S(
66
67
  () => E(a, d)
67
68
  ), [u, q] = S(
68
69
  a || []
69
70
  );
70
- R(() => {
71
+ j(() => {
71
72
  a && (q(a), JSON.stringify(a) !== JSON.stringify(u) && k(E(a, d)));
72
73
  }, [a, d, u]);
73
- const O = ie(() => {
74
- var n;
74
+ const A = le(() => {
75
+ var o;
75
76
  if (!y) return m;
76
- const t = ((n = f.split(",").pop()) == null ? void 0 : n.trim().toLowerCase()) ?? "";
77
+ const t = ((o = f.split(",").pop()) == null ? void 0 : o.trim().toLowerCase()) ?? "";
77
78
  return m.filter(
78
79
  (c) => c.name.toLowerCase().includes(t)
79
80
  );
80
- }, [y, m, f]), Z = (t) => {
81
+ }, [y, m, f]), $ = (t) => {
81
82
  q(t), s == null || s(t);
82
- const n = P(t, d);
83
- k(n), h(!0), setTimeout(() => {
83
+ const o = P(t, d);
84
+ k(o), h(!0), setTimeout(() => {
84
85
  if (p.current) {
85
86
  p.current.focus(), p.current.scrollLeft = p.current.scrollWidth;
86
- const c = n.length;
87
+ const c = o.length;
87
88
  p.current.setSelectionRange(c, c);
88
89
  }
89
90
  }, 0);
90
- }, A = (t) => {
91
+ }, L = (t) => {
91
92
  if (_) return;
92
- const n = t.target.value;
93
- k(n), v == null || v(n);
94
- const c = n.split(",").map((C) => C.trim()).filter(Boolean), T = m.filter(
93
+ const o = t.target.value;
94
+ k(o), v == null || v(o);
95
+ const c = o.split(",").map((C) => C.trim()).filter(Boolean), V = m.filter(
95
96
  (C) => c.includes(C[d])
96
97
  );
97
- q(T), s == null || s(T), h(!0);
98
- }, $ = (t) => {
99
- const n = u.filter(
98
+ q(V), s == null || s(V), h(!0);
99
+ }, ee = (t) => {
100
+ const o = u.filter(
100
101
  (c) => c.id !== t.id
101
102
  );
102
- q(n), s == null || s(n), k(P(n, d));
103
- }, L = () => h((t) => !t), ee = (t) => {
103
+ q(o), s == null || s(o), k(P(o, d));
104
+ }, T = () => h((t) => !t), te = (t) => {
104
105
  t.preventDefault(), t.currentTarget.focus();
105
- const n = t.currentTarget.value.length;
106
- t.currentTarget.setSelectionRange(n, n);
107
- }, te = () => {
106
+ const o = t.currentTarget.value.length;
107
+ t.currentTarget.setSelectionRange(o, o);
108
+ }, oe = () => {
108
109
  k(""), q([]), s == null || s([]);
109
110
  }, ne = (t) => {
110
- t.stopPropagation(), te();
111
- }, oe = (t) => {
111
+ t.stopPropagation(), oe();
112
+ }, se = (t) => {
112
113
  _ && t.target.blur();
113
114
  };
114
- return R(() => {
115
- const t = (n) => {
116
- w.current && !w.current.contains(n.target) && !n.defaultPrevented && h(!1);
115
+ return j(() => {
116
+ const t = (o) => {
117
+ w.current && !w.current.contains(o.target) && !o.defaultPrevented && h(!1);
117
118
  };
118
119
  return document.addEventListener("mousedown", t), () => {
119
120
  document.removeEventListener("mousedown", t);
120
121
  };
121
122
  }, []), /* @__PURE__ */ g("div", { ref: w, children: [
122
- /* @__PURE__ */ o(
123
- pe,
123
+ /* @__PURE__ */ n(
124
+ me,
124
125
  {
125
126
  multiple: !0,
126
127
  as: "div",
127
128
  value: u,
128
129
  className: l(e["multi-select-search"], {
129
- [e.full]: K,
130
+ [e.full]: W,
130
131
  [e.disabled]: r
131
132
  }),
132
- onChange: Z,
133
- ref: J,
133
+ onChange: $,
134
+ ref: U,
134
135
  disabled: r,
135
- virtual: { options: O },
136
+ virtual: { options: A },
136
137
  children: /* @__PURE__ */ g(
137
138
  "div",
138
139
  {
@@ -141,40 +142,41 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
141
142
  }),
142
143
  children: [
143
144
  _ && /* @__PURE__ */ g("div", { className: e["input-container"], children: [
144
- /* @__PURE__ */ o(
145
- G,
145
+ /* @__PURE__ */ n(
146
+ H,
146
147
  {
147
148
  disabled: r,
148
149
  style: { width: "100%" },
149
- onClick: L,
150
- children: /* @__PURE__ */ o(
151
- W,
150
+ onClick: T,
151
+ children: /* @__PURE__ */ n(
152
+ J,
152
153
  {
153
- as: j,
154
+ as: G,
154
155
  label: x,
155
156
  size: F(i),
156
157
  className: l(e["multi-select-input"], {
157
158
  [e["multi-select-input-disabled"]]: _ && I
158
159
  }),
159
- onChange: A,
160
+ onChange: L,
160
161
  value: f,
161
162
  disabled: r,
162
163
  variant: D,
163
164
  rightSlotClassName: e["right-slot"],
164
165
  requiredMarkClassName: e["required-mark"],
165
166
  "data-testid": "select-search-input",
166
- onFocus: oe,
167
+ onFocus: se,
167
168
  rightAddon: {
168
169
  addonType: "icon",
169
- addonContent: le(b, i)
170
+ addonContent: re(b, i)
170
171
  },
172
+ autocomplete: O,
171
173
  ...z
172
174
  }
173
175
  )
174
176
  }
175
177
  ),
176
- I && f && /* @__PURE__ */ o(
177
- ce,
178
+ I && f && /* @__PURE__ */ n(
179
+ ae,
178
180
  {
179
181
  tabIndex: -1,
180
182
  className: l(e.clear, {
@@ -192,10 +194,10 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
192
194
  }
193
195
  )
194
196
  ] }),
195
- !_ && /* @__PURE__ */ o(
196
- W,
197
+ !_ && /* @__PURE__ */ n(
198
+ J,
197
199
  {
198
- as: j,
200
+ as: G,
199
201
  label: x,
200
202
  size: F(i),
201
203
  className: e["multi-select-input"],
@@ -206,21 +208,21 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
206
208
  variant: D,
207
209
  withClearButton: I,
208
210
  onFocus: () => h(!0),
209
- onMouseDown: ee,
210
- onChange: A,
211
+ onMouseDown: te,
212
+ onChange: L,
211
213
  ref: p,
212
214
  rightAddon: {
213
215
  addonType: "react-node",
214
- addonContent: U && /* @__PURE__ */ o(
215
- G,
216
+ addonContent: Q && /* @__PURE__ */ n(
217
+ H,
216
218
  {
217
219
  className: l(e.button, {
218
220
  [e.disabled]: r
219
221
  }),
220
222
  disabled: r,
221
- onMouseDown: L,
222
- children: /* @__PURE__ */ o(
223
- re,
223
+ onMouseDown: T,
224
+ children: /* @__PURE__ */ n(
225
+ ce,
224
226
  {
225
227
  iconName: i == M.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
226
228
  className: l(e["selector-icon"], {
@@ -232,11 +234,12 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
232
234
  )
233
235
  },
234
236
  "data-testid": "select-search-input",
237
+ autocomplete: O,
235
238
  ...z
236
239
  }
237
240
  ),
238
- b && /* @__PURE__ */ o(V, { children: m.length ? O.length ? /* @__PURE__ */ o(
239
- me,
241
+ b && /* @__PURE__ */ n(B, { children: m.length ? A.length ? /* @__PURE__ */ n(
242
+ _e,
240
243
  {
241
244
  className: l(
242
245
  e.options,
@@ -245,29 +248,29 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
245
248
  ),
246
249
  modal: !1,
247
250
  static: !0,
248
- children: ({ option: t }) => /* @__PURE__ */ o(
249
- _e,
251
+ children: ({ option: t }) => /* @__PURE__ */ n(
252
+ he,
250
253
  {
251
254
  value: t,
252
- className: ({ focus: n }) => l(
255
+ className: ({ focus: o }) => l(
253
256
  e.option,
254
- Q,
257
+ X,
255
258
  i && e[i],
256
259
  {
257
- [e["option-active"]]: n
260
+ [e["option-active"]]: o
258
261
  }
259
262
  ),
260
- children: /* @__PURE__ */ g(V, { children: [
263
+ children: /* @__PURE__ */ g(B, { children: [
261
264
  /* @__PURE__ */ g("div", { className: e["option-inner"], children: [
262
265
  t.name,
263
- t.bottom && /* @__PURE__ */ o("div", { children: t.bottom })
266
+ t.bottom && /* @__PURE__ */ n("div", { children: t.bottom })
264
267
  ] }),
265
- /* @__PURE__ */ o(
266
- ae,
268
+ /* @__PURE__ */ n(
269
+ ue,
267
270
  {
268
271
  isInteractive: !1,
269
272
  checked: u.some(
270
- (n) => n.id === t.id
273
+ (o) => o.id === t.id
271
274
  )
272
275
  }
273
276
  )
@@ -276,7 +279,7 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
276
279
  t.id
277
280
  )
278
281
  }
279
- ) : /* @__PURE__ */ o(
282
+ ) : /* @__PURE__ */ n(
280
283
  "div",
281
284
  {
282
285
  className: l(
@@ -287,7 +290,7 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
287
290
  ),
288
291
  children: "Ничего не найдено"
289
292
  }
290
- ) : /* @__PURE__ */ o(
293
+ ) : /* @__PURE__ */ n(
291
294
  "div",
292
295
  {
293
296
  className: l(
@@ -304,15 +307,15 @@ import '../../assets/MultiSelectSearch.css';const he = "_disabled_17kql_5", fe =
304
307
  )
305
308
  }
306
309
  ),
307
- X && u.length > 0 && /* @__PURE__ */ o("div", { className: e["chip-container"], children: u.map((t) => /* @__PURE__ */ o(
308
- ue,
310
+ Y && u.length > 0 && /* @__PURE__ */ n("div", { className: e["chip-container"], children: u.map((t) => /* @__PURE__ */ n(
311
+ de,
309
312
  {
310
313
  size: i === M.L ? "s" : "xs",
311
- variant: Y,
314
+ variant: Z,
312
315
  className: e["chip-root"],
313
316
  withAction: !0,
314
- onClose: () => $(t),
315
- children: /* @__PURE__ */ o("span", { className: e.chip, children: t.name })
317
+ onClose: () => ee(t),
318
+ children: /* @__PURE__ */ n("span", { className: e.chip, children: t.name })
316
319
  },
317
320
  t.id
318
321
  )) })
@@ -57,4 +57,6 @@ export type TMultiSelectSearchProps = Pick<TInputProps, 'withClearButton' | 'var
57
57
  chipVariant?: EChipVariant | `${EChipVariant}`;
58
58
  /** Отключает инпут, но позволяет открывать меню*/
59
59
  disableInput?: boolean;
60
+ /** Управляет поведением автозаполнения браузера */
61
+ autocomplete?: 'on' | 'off';
60
62
  };
@@ -1,5 +1,5 @@
1
1
  import { EMultiSelectSearchSize as t } from "./constants.js";
2
- import "../../Input-WnjLXNpw.js";
2
+ import "../../Input-CbgqYgLo.js";
3
3
  import { EInputSize as e } from "../Input/constants.js";
4
4
  const w = (r) => {
5
5
  switch (r) {
@@ -3,7 +3,7 @@ import { c as u } from "../../index-DIxK0V-G.js";
3
3
  import { forwardRef as P, useImperativeHandle as R, Fragment as T } from "react";
4
4
  import { ITEMS_PER_SEPARATOR as q, DEFAULT_VALUE_LENGTH as v } from "./constants.js";
5
5
  import { useOTPInput as y } from "./hooks.js";
6
- import { I as A } from "../../Input-WnjLXNpw.js";
6
+ import { I as A } from "../../Input-CbgqYgLo.js";
7
7
  import '../../assets/OtpInput.css';const C = "_otp_1shq3_3", F = "_input_1shq3_14", L = "_separator_1shq3_28", r = {
8
8
  otp: C,
9
9
  "input-wrapper": "_input-wrapper_1shq3_14",
@@ -1,10 +1,10 @@
1
1
  import { jsxs as ee, jsx as L, Fragment as _e } from "react/jsx-runtime";
2
- import { K as V, w as ye, a as oe, z as te, U as ie, b as ke, T as Oe, j as we, u as Pe, I as Ee, G as Te, p as De } from "../../label-y3ANLTNC.js";
3
- import { W, y as z, o as U, H as K, s as se, n as ne, $ as le, b as de, D as ue, a as Ce, u as Ge, c as N } from "../../keyboard-B0lm_zyn.js";
2
+ import { K as V, w as ye, a as oe, z as te, U as ie, b as ke, T as Oe, j as we, u as Pe, I as Ee, G as Te, p as De } from "../../label-D4GFpe5F.js";
3
+ import { W, y as z, o as U, H as K, s as se, n as ne, $ as le, b as de, D as ue, a as Ce, u as Ge, c as N } from "../../keyboard-mgWkd2Vh.js";
4
4
  import E, { createContext as ce, useId as q, useReducer as xe, useRef as B, useMemo as T, useCallback as Fe, useContext as pe, forwardRef as Ne } from "react";
5
5
  import { u as Ae } from "../../use-by-comparator-CVuf9KBq.js";
6
6
  import { r as fe } from "../../bugs-diTMAGNw.js";
7
- import { P as re, F as H, T as ae, _ as Ie } from "../../focus-management-XwV-9qkO.js";
7
+ import { P as re, F as H, T as ae, _ as Ie } from "../../focus-management-DOYCPyGg.js";
8
8
  import { c as M } from "../../index-DIxK0V-G.js";
9
9
  import '../../assets/RadioGroup.css';var Se = ((e) => (e[e.RegisterOption = 0] = "RegisterOption", e[e.UnregisterOption = 1] = "UnregisterOption", e))(Se || {});
10
10
  let Le = { 0(e, r) {
@@ -17,4 +17,5 @@ export declare const SelectSearch: import('react').ForwardRefExoticComponent<Pic
17
17
  disabled?: boolean;
18
18
  searchProps?: Pick<import('../Input').TInputProps, "numbersOnly" | "maxLength" | "required">;
19
19
  disableInput?: boolean;
20
+ autocomplete?: "on" | "off";
20
21
  } & import('react').RefAttributes<HTMLElement>>;