mimir-ui-kit 1.38.22 → 1.38.24

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- ._gos-znak_dr109_2{display:inline-flex;align-items:center;width:var(--gos-znak-width);height:var(--gos-znak-height);overflow:hidden;background-color:var(--gos-znak-background-color);border-radius:var(--mimir-control-radius-xs1);outline:1px solid var(--gos-znak-outline-color)}._number_dr109_13{font-weight:var(--mimir-font-weight-text-medium);font-size:var(--gos-znak-number-font-size);font-family:var(--mimir-font-montserrat);line-height:var(--mimir-line-height-text-xss);letter-spacing:-.02em;text-align:center;text-transform:lowercase}._number-container_dr109_22{display:flex;align-items:center;justify-content:center;min-width:var(--gos-znak-number-container-width);height:100%;overflow:hidden;border-right:1px solid var(--number-border-right-color)}._region_dr109_32{font-weight:var(--mimir-font-weight-text-regular);font-size:var(--gos-znak-region-text-size);font-family:var(--mimir-font-inter);line-height:var(--mimir-line-height-text-l)}._region-container_dr109_38{display:flex;flex-direction:column;align-items:center;width:100%;overflow:hidden}._country_dr109_46{color:var(--gos-znak-country-color);font-size:var(--gos-znak-country-text-size);line-height:var(--mimir-line-height-text-s1);text-transform:uppercase}._l_dr109_53{--gos-znak-number-font-size: var(--mimir-size-text-xl3);--gos-znak-region-text-size: var(--mimir-size-text-xl);--gos-znak-country-text-size: var(--mimir-size-text-l);--gos-znak-number-container-width: 172px;--gos-znak-width: 242px;--gos-znak-height: 64px}._s_dr109_62{--gos-znak-number-font-size: var(--mimir-size-text-l);--gos-znak-region-text-size: var(--mimir-size-text-xs);--gos-znak-country-text-size: var(--mimir-size-text-xs2);--gos-znak-number-container-width: 86px;--gos-znak-width: 121px;--gos-znak-height: 32px}._normal_dr109_71{--gos-znak-background-color: var(--white);--gos-znak-outline-color: var(--black-20);--number-border-right-color: var(--black-20);--gos-znak-country-color: var(--black-60)}._traffic_dr109_78{--gos-znak-background-color: var(--gos-znak-traffic-background-color);--gos-znak-outline-color: var(--gos-znak-military-background-color);--number-border-right-color: var(--gos-znak-military-background-color);--gos-znak-country-color: var(--black-60)}._military_dr109_85{--gos-znak-background-color: var(--gos-znak-military-background-color);--gos-znak-outline-color: var(--black-5);--number-border-right-color: var(--black-5);--gos-znak-country-color: var(--black-30)}._police_dr109_92{--gos-znak-background-color: var(--gos-znak-police-background-color);--gos-znak-outline-color: var(--black-5);--number-border-right-color: var(--black-5);--gos-znak-country-color: var(--sapphire-30)}._diplomatic_dr109_99{--gos-znak-background-color: var(--gos-znak-diplomatic-background-color);--gos-znak-outline-color: var(--black-5);--number-border-right-color: var(--black-5);--gos-znak-country-color: var(--gos-znak-diplomatic-country-color)}._military_dr109_85,._police_dr109_92,._diplomatic_dr109_99{color:var(--white)}
1
+ ._gos-znak_dm2gm_2{display:inline-flex;align-items:center;width:var(--gos-znak-width);height:var(--gos-znak-height);overflow:hidden;background-color:var(--gos-znak-background-color);border-radius:var(--mimir-control-radius-xs1);outline:1px solid var(--gos-znak-outline-color)}._number_dm2gm_13{font-size:var(--gos-znak-number-font-size)}._number_dm2gm_13,._number-letter_dm2gm_16{font-weight:var(--mimir-font-weight-text-medium);font-family:var(--mimir-font-montserrat);line-height:var(--mimir-line-height-text-xss);letter-spacing:-.02em;text-align:center}._number-letter_dm2gm_16{font-size:var(--gos-znak-number-letter-font-size);text-transform:uppercase}._number-container_dm2gm_27{display:flex;align-items:center;justify-content:center;min-width:var(--gos-znak-number-container-width);height:100%;overflow:hidden;border-right:1px solid var(--number-border-right-color)}._region_dm2gm_37{font-weight:var(--mimir-font-weight-text-regular);font-size:var(--gos-znak-region-text-size);font-family:var(--mimir-font-inter);line-height:var(--mimir-line-height-text-l)}._region-container_dm2gm_43{display:flex;flex-direction:column;align-items:center;width:100%;overflow:hidden}._country_dm2gm_51{color:var(--gos-znak-country-color);font-size:var(--gos-znak-country-text-size);line-height:var(--mimir-line-height-text-s1);text-transform:uppercase}._l_dm2gm_58{--gos-znak-number-font-size: var(--mimir-size-text-xl3);--gos-znak-number-letter-font-size: var(--mimir-size-text-xl2);--gos-znak-region-text-size: var(--mimir-size-text-xl);--gos-znak-country-text-size: var(--mimir-size-text-l);--gos-znak-number-container-width: 172px;--gos-znak-width: 242px;--gos-znak-height: 64px}._s_dm2gm_68{--gos-znak-number-font-size: var(--mimir-size-text-l);--gos-znak-number-letter-font-size: var(--mimir-size-text-s);--gos-znak-region-text-size: var(--mimir-size-text-xs);--gos-znak-country-text-size: var(--mimir-size-text-xs2);--gos-znak-number-container-width: 86px;--gos-znak-width: 121px;--gos-znak-height: 32px}._normal_dm2gm_78{--gos-znak-background-color: var(--white);--gos-znak-outline-color: var(--black-20);--number-border-right-color: var(--black-20);--gos-znak-country-color: var(--black-60)}._traffic_dm2gm_85{--gos-znak-background-color: var(--gos-znak-traffic-background-color);--gos-znak-outline-color: var(--gos-znak-military-background-color);--number-border-right-color: var(--gos-znak-military-background-color);--gos-znak-country-color: var(--black-60)}._military_dm2gm_92{--gos-znak-background-color: var(--gos-znak-military-background-color);--gos-znak-outline-color: var(--black-5);--number-border-right-color: var(--black-5);--gos-znak-country-color: var(--black-30)}._police_dm2gm_99{--gos-znak-background-color: var(--gos-znak-police-background-color);--gos-znak-outline-color: var(--black-5);--number-border-right-color: var(--black-5);--gos-znak-country-color: var(--sapphire-30)}._diplomatic_dm2gm_106{--gos-znak-background-color: var(--gos-znak-diplomatic-background-color);--gos-znak-outline-color: var(--black-5);--number-border-right-color: var(--black-5);--gos-znak-country-color: var(--gos-znak-diplomatic-country-color)}._military_dm2gm_92,._police_dm2gm_99,._diplomatic_dm2gm_106{color:var(--white)}
@@ -1,63 +1,78 @@
1
- import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
- import { c as n } from "../../index-DIxK0V-G.js";
3
- import { EGosZnakSize as g, EGosZnakType as f } from "./constants.js";
4
- import '../../assets/GosZnak.css';const y = "_number_dr109_13", N = "_region_dr109_32", b = "_country_dr109_46", h = "_l_dr109_53", k = "_s_dr109_62", z = "_normal_dr109_71", v = "_traffic_dr109_78", x = "_military_dr109_85", G = "_police_dr109_92", Z = "_diplomatic_dr109_99", r = {
5
- "gos-znak": "_gos-znak_dr109_2",
6
- number: y,
7
- "number-container": "_number-container_dr109_22",
8
- region: N,
9
- "region-container": "_region-container_dr109_38",
10
- country: b,
11
- l: h,
12
- s: k,
13
- normal: z,
14
- traffic: v,
15
- military: x,
16
- police: G,
17
- diplomatic: Z
18
- }, S = ({
19
- number: i,
20
- region: s,
21
- country: a,
22
- size: e = g.L,
23
- type: _ = f.Normal,
24
- className: t,
25
- numberClassName: l,
26
- regionClassName: m,
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import { c as r } from "../../index-DIxK0V-G.js";
3
+ import { EGosZnakSize as h, EGosZnakType as N } from "./constants.js";
4
+ import { formatGosZnakNumber as y } from "./utils.js";
5
+ import '../../assets/GosZnak.css';const k = "_number_dm2gm_13", v = "_region_dm2gm_37", z = "_country_dm2gm_51", G = "_l_dm2gm_58", Z = "_s_dm2gm_68", x = "_normal_dm2gm_78", L = "_traffic_dm2gm_85", j = "_military_dm2gm_92", E = "_police_dm2gm_99", S = "_diplomatic_dm2gm_106", n = {
6
+ "gos-znak": "_gos-znak_dm2gm_2",
7
+ number: k,
8
+ "number-letter": "_number-letter_dm2gm_16",
9
+ "number-container": "_number-container_dm2gm_27",
10
+ region: v,
11
+ "region-container": "_region-container_dm2gm_43",
12
+ country: z,
13
+ l: G,
14
+ s: Z,
15
+ normal: x,
16
+ traffic: L,
17
+ military: j,
18
+ police: E,
19
+ diplomatic: S
20
+ }, B = ({
21
+ number: t = "",
22
+ region: c,
23
+ country: i,
24
+ size: s = h.L,
25
+ type: a = N.Normal,
26
+ className: _,
27
+ numberClassName: o,
28
+ regionClassName: l,
27
29
  countryClassName: d,
28
- numberContainerClassName: p,
29
- regionContainerClassName: u
30
- }) => /* @__PURE__ */ c(
31
- "div",
32
- {
33
- className: n(r["gos-znak"], r[e], r[_], t),
34
- children: [
35
- /* @__PURE__ */ o(
36
- "div",
37
- {
38
- className: n(
39
- r["number-container"],
40
- p
41
- ),
42
- children: /* @__PURE__ */ o("span", { className: n(r.number, l), children: i })
43
- }
44
- ),
45
- /* @__PURE__ */ c(
46
- "div",
47
- {
48
- className: n(
49
- r["region-container"],
50
- u
51
- ),
52
- children: [
53
- /* @__PURE__ */ o("span", { className: n(r.region, m), children: s }),
54
- /* @__PURE__ */ o("span", { className: n(r.country, d), children: a })
55
- ]
56
- }
57
- )
58
- ]
59
- }
60
- );
30
+ numberContainerClassName: g,
31
+ regionContainerClassName: p
32
+ }) => {
33
+ const [u, f, b] = y(t);
34
+ return /* @__PURE__ */ m(
35
+ "div",
36
+ {
37
+ className: r(n["gos-znak"], n[s], n[a], _),
38
+ children: [
39
+ /* @__PURE__ */ e(
40
+ "div",
41
+ {
42
+ className: r(
43
+ n["number-container"],
44
+ g
45
+ ),
46
+ children: /* @__PURE__ */ m("div", { children: [
47
+ /* @__PURE__ */ m("span", { className: r(n["number-letter"], o), children: [
48
+ u,
49
+ " "
50
+ ] }),
51
+ /* @__PURE__ */ m("span", { className: r(n.number, o), children: [
52
+ f,
53
+ " "
54
+ ] }),
55
+ /* @__PURE__ */ e("span", { className: r(n["number-letter"], o), children: b })
56
+ ] })
57
+ }
58
+ ),
59
+ /* @__PURE__ */ m(
60
+ "div",
61
+ {
62
+ className: r(
63
+ n["region-container"],
64
+ p
65
+ ),
66
+ children: [
67
+ /* @__PURE__ */ e("span", { className: r(n.region, l), children: c }),
68
+ /* @__PURE__ */ e("span", { className: r(n.country, d), children: i })
69
+ ]
70
+ }
71
+ )
72
+ ]
73
+ }
74
+ );
75
+ };
61
76
  export {
62
- S as GosZnak
77
+ B as GosZnak
63
78
  };
@@ -0,0 +1 @@
1
+ export declare const formatGosZnakNumber: (num: string) => string[];
@@ -0,0 +1,7 @@
1
+ const n = (s) => {
2
+ const t = s.replace(/\s/g, ""), e = t[0] || "", c = t.slice(1, 4) || "", r = t.slice(4, 6) || "";
3
+ return `${e} ${c} ${r}`.split(" ");
4
+ };
5
+ export {
6
+ n as formatGosZnakNumber
7
+ };
@@ -1,16 +1,16 @@
1
- import { jsxs as E, jsx as n, Fragment as Q } from "react/jsx-runtime";
2
- import { c as l } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as Ie, useId as Ne, useRef as X, useState as w, useEffect as T, useMemo as Se, useCallback as Ce } from "react";
4
- import { EMultiSelectSearchSize as D } from "./constants.js";
5
- import { getInitialInputValue as Y, shouldShowMenuOnTop as Me, MULTISELECT_OPEN_EVENT as Z, mapSizeToInputSize as ee, getDropdownArrowIcon as Ee, dispatchMultiselectOpen as L, joinSelectedItems as te } from "./utils.js";
6
- import { Icon as Le } from "../../icons/Icon.js";
7
- import { Button as Te } from "../Button/Button.js";
8
- import { CheckboxMimir as ke } from "../CheckboxMimir/CheckboxMimir.js";
9
- import { Chip as ye } from "../Chip/Chip.js";
10
- import { I as oe } from "../../Input-CQ7LgZWK.js";
1
+ import { jsxs as E, jsx as n, Fragment as Y } from "react/jsx-runtime";
2
+ import { c as u } from "../../index-DIxK0V-G.js";
3
+ import { forwardRef as Ne, useId as Se, useRef as P, useState as g, useEffect as y, useMemo as Ce, useCallback as Me } from "react";
4
+ import { EMultiSelectSearchSize as R } from "./constants.js";
5
+ import { getInitialInputValue as Z, shouldShowMenuOnTop as Ee, MULTISELECT_OPEN_EVENT as ee, mapSizeToInputSize as te, getDropdownArrowIcon as Le, dispatchMultiselectOpen as L, joinSelectedItems as oe } from "./utils.js";
6
+ import { Icon as ye } from "../../icons/Icon.js";
7
+ import { Button as ke } from "../Button/Button.js";
8
+ import { CheckboxMimir as Te } from "../CheckboxMimir/CheckboxMimir.js";
9
+ import { Chip as Oe } from "../Chip/Chip.js";
10
+ import { I as ne } from "../../Input-CQ7LgZWK.js";
11
11
  import { EInputVariant as ze } from "../Input/constants.js";
12
- import { H as Ae, U as ne, G as ie, K as Oe, W as Ve } from "../../combobox-CVtJDVoZ.js";
13
- import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De = "_container_io0c8_9", Pe = "_full_io0c8_27", qe = "_button_io0c8_39", Re = "_options_io0c8_53", Be = "_visible_io0c8_66", Fe = "_top_io0c8_69", je = "_bottom_io0c8_74", Ge = "_m_io0c8_2", Ue = "_l_io0c8_116", We = "_focused_io0c8_134", He = "_option_io0c8_53", Je = "_chip_io0c8_163", Ke = "_clear_io0c8_188", t = {
12
+ import { H as Ae, U as ie, G as se, K as Ve, W as qe } from "../../combobox-CVtJDVoZ.js";
13
+ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De = "_container_io0c8_9", Pe = "_full_io0c8_27", Re = "_button_io0c8_39", Be = "_options_io0c8_53", Fe = "_visible_io0c8_66", Je = "_top_io0c8_69", je = "_bottom_io0c8_74", Ge = "_m_io0c8_2", He = "_l_io0c8_116", Ue = "_focused_io0c8_134", We = "_option_io0c8_53", Ke = "_chip_io0c8_163", $e = "_clear_io0c8_188", e = {
14
14
  "multi-select-search": "_multi-select-search_io0c8_2",
15
15
  disabled: xe,
16
16
  container: De,
@@ -19,224 +19,218 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
19
19
  full: Pe,
20
20
  "selected-icon": "_selected-icon_io0c8_31",
21
21
  "selector-icon-open": "_selector-icon-open_io0c8_35",
22
- button: qe,
22
+ button: Re,
23
23
  "selector-icon": "_selector-icon_io0c8_35",
24
- options: Re,
25
- visible: Be,
26
- top: Fe,
24
+ options: Be,
25
+ visible: Fe,
26
+ top: Je,
27
27
  bottom: je,
28
28
  "no-options": "_no-options_io0c8_95",
29
29
  m: Ge,
30
- l: Ue,
30
+ l: He,
31
31
  "multi-select-input-disabled": "_multi-select-input-disabled_io0c8_131",
32
32
  "multi-select-input": "_multi-select-input_io0c8_131",
33
- focused: We,
34
- option: He,
33
+ focused: Ue,
34
+ option: We,
35
35
  "option-active": "_option-active_io0c8_153",
36
36
  "option-inner": "_option-inner_io0c8_156",
37
- chip: Je,
37
+ chip: Ke,
38
38
  "chip-container": "_chip-container_io0c8_168",
39
39
  "chip-root": "_chip-root_io0c8_174",
40
40
  "right-slot": "_right-slot_io0c8_178",
41
41
  "required-mark": "_required-mark_io0c8_183",
42
- clear: Ke,
42
+ clear: $e,
43
43
  "icon-button": "_icon-button_io0c8_197"
44
- }, lt = Ie(
45
- (se, ce) => {
44
+ }, at = Ne(
45
+ (ce, re) => {
46
46
  const {
47
- placeholder: P,
48
- size: i = D.L,
49
- value: p,
47
+ placeholder: B,
48
+ size: i = R.L,
49
+ value: m,
50
50
  onChange: s,
51
51
  full: le,
52
- showArrow: re = !0,
53
- items: h = [],
54
- classNameOption: ae,
55
- displayValue: f = "name",
56
- filterOnSearch: q = !0,
52
+ showArrow: ae = !0,
53
+ items: f = [],
54
+ classNameOption: ue,
55
+ displayValue: v = "name",
56
+ filterOnSearch: F = !0,
57
57
  onSearch: k,
58
- variant: R = ze.DefaultGray,
59
- menuPlacement: g = "bottom",
60
- disabled: r = !1,
61
- searchProps: B,
62
- withClearButton: y = !1,
63
- withChip: ue = !1,
64
- chipVariant: de = "sapphire",
58
+ variant: J = ze.DefaultGray,
59
+ menuPlacement: w = "bottom",
60
+ disabled: d = !1,
61
+ searchProps: j,
62
+ withClearButton: T = !1,
63
+ withChip: de = !1,
64
+ chipVariant: pe = "sapphire",
65
65
  disableInput: I = !1,
66
- autocomplete: F = "on",
67
- id: pe,
68
- autoPlacement: z = !1,
69
- onIsOpen: v
70
- } = se, me = Ne(), m = pe || `multiselect-${me}`, N = X(null), b = X(null), [a, _] = w(!1), [S, C] = w(
71
- () => Y(p, f)
72
- ), [c, M] = w(
73
- p || []
74
- ), [A, j] = w(g), [O, G] = w(!1), [_e, U] = w(!1);
75
- T(() => {
76
- p && (M(p), JSON.stringify(p) !== JSON.stringify(c) && C(Y(p, f)));
77
- }, [p, f, c]);
78
- const W = Se(() => {
66
+ autocomplete: G = "on",
67
+ id: me,
68
+ autoPlacement: O = !1,
69
+ onIsOpen: r
70
+ } = ce, _e = Se(), _ = me || `multiselect-${_e}`, N = P(null), b = P(null), z = P(!1), [l, h] = g(!1), [S, C] = g(
71
+ () => Z(m, v)
72
+ ), [c, M] = g(
73
+ m || []
74
+ ), [A, H] = g(w), [V, U] = g(!1), [he, W] = g(!1);
75
+ y(() => {
76
+ m && (M(m), JSON.stringify(m) !== JSON.stringify(c) && C(Z(m, v)));
77
+ }, [m, v, c]);
78
+ const K = Ce(() => {
79
79
  var o;
80
- if (!q) return h;
81
- const e = ((o = S.split(",").pop()) == null ? void 0 : o.trim().toLowerCase()) ?? "";
82
- return c.length > 0 && c[c.length - 1].name.toLowerCase() === e ? h : h.filter(
83
- (u) => u.name.toLowerCase().includes(e)
80
+ if (!F) return f;
81
+ const t = ((o = S.split(",").pop()) == null ? void 0 : o.trim().toLowerCase()) ?? "";
82
+ return c.length > 0 && c[c.length - 1].name.toLowerCase() === t ? f : f.filter(
83
+ (a) => a.name.toLowerCase().includes(t)
84
84
  );
85
- }, [q, h, S, c]), he = (e) => {
86
- M(e), s == null || s(e);
87
- const o = te(e, f);
88
- C(o), _(!0), L(m), setTimeout(() => {
85
+ }, [F, f, S, c]), fe = (t) => {
86
+ M(t), s == null || s(t);
87
+ const o = oe(t, v);
88
+ C(o), h(!0), L(_), setTimeout(() => {
89
89
  if (b.current) {
90
90
  b.current.focus(), b.current.scrollLeft = b.current.scrollWidth;
91
- const u = o.length;
92
- b.current.setSelectionRange(u, u);
91
+ const a = o.length;
92
+ b.current.setSelectionRange(a, a);
93
93
  }
94
94
  }, 0);
95
- }, H = (e) => {
96
- var $;
95
+ }, $ = (t) => {
96
+ var X;
97
97
  if (I) return;
98
- const o = e.target.value;
98
+ const o = t.target.value;
99
99
  C(o), k == null || k(o);
100
- const u = o.split(",").map((x) => x.trim()).filter(Boolean), K = h.filter(
101
- (x) => u.includes(x[f])
100
+ const a = o.split(",").map((D) => D.trim()).filter(Boolean), q = f.filter(
101
+ (D) => a.includes(D[v])
102
102
  );
103
- M(K), s == null || s(K), _(!0), L(m);
104
- const V = ($ = N.current) == null ? void 0 : $.querySelector(
105
- `.${t.options}`
103
+ JSON.stringify(q) !== JSON.stringify(c) && (M(q), s == null || s(q)), h(!0), L(_);
104
+ const x = (X = N.current) == null ? void 0 : X.querySelector(
105
+ `.${e.options}`
106
106
  );
107
- V && typeof V.scrollTo == "function" && V.scrollTo({ top: 0, behavior: "smooth" });
108
- }, fe = (e) => {
107
+ x && typeof x.scrollTo == "function" && x.scrollTo({ top: 0, behavior: "smooth" });
108
+ }, ve = (t) => {
109
109
  const o = c.filter(
110
- (u) => u.id !== e.id
110
+ (a) => a.id !== t.id
111
111
  );
112
- M(o), s == null || s(o), C(te(o, f));
113
- }, d = Ce(() => {
114
- if (!z) {
115
- j(g);
112
+ M(o), s == null || s(o), C(oe(o, v));
113
+ }, p = Me(() => {
114
+ if (!O) {
115
+ H(w);
116
116
  return;
117
117
  }
118
- const e = Me(N, i);
119
- j(e ? "top" : g);
120
- }, [z, g, i]), J = () => {
121
- const e = !a;
122
- e && (d(), L(m)), _(e), v == null || v(e);
123
- }, ve = (e) => {
124
- e.preventDefault(), e.currentTarget.focus();
125
- const o = e.currentTarget.value.length;
126
- e.currentTarget.setSelectionRange(o, o);
127
- }, be = () => {
118
+ const t = Ee(N, i);
119
+ H(t ? "top" : w);
120
+ }, [O, w, i]), Q = () => {
121
+ const t = !l;
122
+ t && (p(), L(_)), h(t), r == null || r(t);
123
+ }, be = (t) => {
124
+ t.preventDefault(), t.currentTarget.focus();
125
+ const o = t.currentTarget.value.length;
126
+ t.currentTarget.setSelectionRange(o, o);
127
+ }, ge = () => {
128
128
  C(""), M([]), s == null || s([]);
129
- }, we = (e) => {
130
- e.stopPropagation(), be();
131
- }, ge = (e) => {
129
+ }, we = (t) => {
130
+ t.stopPropagation(), ge();
131
+ }, Ie = (t) => {
132
132
  if (I) {
133
- e.target.blur();
133
+ t.target.blur();
134
134
  return;
135
135
  }
136
- d(), _(!0), L(m);
136
+ p(), h(!0), L(_);
137
137
  };
138
- return T(() => {
139
- if (a) {
140
- const e = (o) => {
141
- N.current && !N.current.contains(o.target) && !o.defaultPrevented && (_(!1), v == null || v(!1));
138
+ return y(() => {
139
+ if (l) {
140
+ const t = (o) => {
141
+ N.current && !N.current.contains(o.target) && !o.defaultPrevented && (h(!1), r == null || r(!1));
142
142
  };
143
- return document.addEventListener("mousedown", e), () => {
144
- document.removeEventListener("mousedown", e);
143
+ return document.addEventListener("mousedown", t), () => {
144
+ document.removeEventListener("mousedown", t);
145
145
  };
146
146
  }
147
- }, [a]), T(() => {
148
- const e = (o) => {
149
- o.detail !== m && _(!1);
147
+ }, [l, r]), y(() => {
148
+ const o = (a) => {
149
+ a.detail === _ || !l || z.current || (z.current = !0, h(!1), r == null || r(!1), queueMicrotask(() => {
150
+ z.current = !1;
151
+ }));
150
152
  };
151
- return window.addEventListener(
152
- Z,
153
- e
154
- ), () => {
155
- window.removeEventListener(
156
- Z,
157
- e
158
- );
159
- };
160
- }, [m]), T(() => {
161
- if (a) {
162
- d(), window.addEventListener("scroll", d), window.addEventListener("resize", d);
163
- const e = requestAnimationFrame(() => {
164
- U(!0), G(!0);
153
+ return window.addEventListener(ee, o), () => window.removeEventListener(ee, o);
154
+ }, [_, r, l]), y(() => {
155
+ if (l) {
156
+ p(), window.addEventListener("scroll", p), window.addEventListener("resize", p);
157
+ const t = requestAnimationFrame(() => {
158
+ W(!0), U(!0);
165
159
  });
166
160
  return () => {
167
- window.removeEventListener("scroll", d), window.removeEventListener("resize", d), cancelAnimationFrame(e);
161
+ window.removeEventListener("scroll", p), window.removeEventListener("resize", p), cancelAnimationFrame(t);
168
162
  };
169
163
  } else
170
- G(!1), U(!1);
171
- }, [a, g, z, i, d]), /* @__PURE__ */ E("div", { ref: N, children: [
164
+ U(!1), W(!1);
165
+ }, [l, w, O, i, p]), /* @__PURE__ */ E("div", { ref: N, children: [
172
166
  /* @__PURE__ */ n(
173
167
  Ae,
174
168
  {
175
169
  multiple: !0,
176
170
  as: "div",
177
171
  value: c,
178
- className: l(t["multi-select-search"], {
179
- [t.full]: le,
180
- [t.disabled]: r
172
+ className: u(e["multi-select-search"], {
173
+ [e.full]: le,
174
+ [e.disabled]: d
181
175
  }),
182
- onChange: he,
183
- ref: ce,
184
- disabled: r,
185
- virtual: { options: W },
176
+ onChange: fe,
177
+ ref: re,
178
+ disabled: d,
179
+ virtual: { options: K },
186
180
  children: /* @__PURE__ */ E(
187
181
  "div",
188
182
  {
189
- className: l(t.container, t[i], {
190
- [t["container-open"]]: a
183
+ className: u(e.container, e[i], {
184
+ [e["container-open"]]: l
191
185
  }),
192
186
  children: [
193
- I && /* @__PURE__ */ E("div", { className: t["input-container"], children: [
187
+ I && /* @__PURE__ */ E("div", { className: e["input-container"], children: [
194
188
  /* @__PURE__ */ n(
195
- ne,
189
+ ie,
196
190
  {
197
- disabled: r,
191
+ disabled: d,
198
192
  style: { width: "100%" },
199
- onClick: J,
193
+ onClick: Q,
200
194
  children: /* @__PURE__ */ n(
201
- ie,
195
+ se,
202
196
  {
203
- as: oe,
204
- label: P,
205
- size: ee(i),
206
- className: l(t["multi-select-input"], {
207
- [t["multi-select-input-disabled"]]: I && y
197
+ as: ne,
198
+ label: B,
199
+ size: te(i),
200
+ className: u(e["multi-select-input"], {
201
+ [e["multi-select-input-disabled"]]: I && T
208
202
  }),
209
- onChange: H,
203
+ onChange: $,
210
204
  value: S,
211
- disabled: r,
212
- variant: R,
213
- rightSlotClassName: t["right-slot"],
214
- requiredMarkClassName: t["required-mark"],
205
+ disabled: d,
206
+ variant: J,
207
+ rightSlotClassName: e["right-slot"],
208
+ requiredMarkClassName: e["required-mark"],
215
209
  "data-testid": "select-search-input",
216
- onFocus: ge,
210
+ onFocus: Ie,
217
211
  rightAddon: {
218
212
  addonType: "icon",
219
- addonContent: Ee(a, i)
213
+ addonContent: Le(l, i)
220
214
  },
221
- autocomplete: F,
222
- ...B
215
+ autocomplete: G,
216
+ ...j
223
217
  }
224
218
  )
225
219
  }
226
220
  ),
227
- y && S && /* @__PURE__ */ n(
228
- Te,
221
+ T && S && /* @__PURE__ */ n(
222
+ ke,
229
223
  {
230
224
  tabIndex: -1,
231
- className: l(t.clear, {
232
- [t.disabled]: r
225
+ className: u(e.clear, {
226
+ [e.disabled]: d
233
227
  }),
234
- iconButtonClassName: t["icon-button"],
228
+ iconButtonClassName: e["icon-button"],
235
229
  isIconButton: !0,
236
230
  iconName: "Close16px",
237
231
  size: "m-s",
238
232
  clear: !0,
239
- disabled: r,
233
+ disabled: d,
240
234
  variant: "secondary-gray",
241
235
  onClick: we,
242
236
  "data-testid": "clear-button"
@@ -244,40 +238,40 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
244
238
  )
245
239
  ] }),
246
240
  !I && /* @__PURE__ */ n(
247
- ie,
241
+ se,
248
242
  {
249
- as: oe,
250
- label: P,
251
- size: ee(i),
252
- className: t["multi-select-input"],
253
- rightSlotClassName: t["right-slot"],
254
- requiredMarkClassName: t["required-mark"],
243
+ as: ne,
244
+ label: B,
245
+ size: te(i),
246
+ className: e["multi-select-input"],
247
+ rightSlotClassName: e["right-slot"],
248
+ requiredMarkClassName: e["required-mark"],
255
249
  value: S,
256
- disabled: r,
257
- variant: R,
258
- withClearButton: y,
250
+ disabled: d,
251
+ variant: J,
252
+ withClearButton: T,
259
253
  onFocus: () => {
260
- _(!0), L(m);
254
+ h(!0), L(_);
261
255
  },
262
- onMouseDown: ve,
263
- onChange: H,
256
+ onMouseDown: be,
257
+ onChange: $,
264
258
  ref: b,
265
259
  rightAddon: {
266
260
  addonType: "react-node",
267
- addonContent: re && /* @__PURE__ */ n(
268
- ne,
261
+ addonContent: ae && /* @__PURE__ */ n(
262
+ ie,
269
263
  {
270
- className: l(t.button, {
271
- [t.disabled]: r
264
+ className: u(e.button, {
265
+ [e.disabled]: d
272
266
  }),
273
- disabled: r,
274
- onMouseDown: J,
267
+ disabled: d,
268
+ onMouseDown: Q,
275
269
  children: /* @__PURE__ */ n(
276
- Le,
270
+ ye,
277
271
  {
278
- iconName: i == D.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
279
- className: l(t["selector-icon"], {
280
- [t["selector-icon-open"]]: a
272
+ iconName: i == R.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
273
+ className: u(e["selector-icon"], {
274
+ [e["selector-icon-open"]]: l
281
275
  })
282
276
  }
283
277
  )
@@ -285,73 +279,73 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
285
279
  )
286
280
  },
287
281
  "data-testid": "select-search-input",
288
- autocomplete: F,
289
- ...B
282
+ autocomplete: G,
283
+ ...j
290
284
  }
291
285
  ),
292
- a && _e && /* @__PURE__ */ n(Q, { children: h.length ? W.length ? /* @__PURE__ */ n(
293
- Oe,
286
+ l && he && /* @__PURE__ */ n(Y, { children: f.length ? K.length ? /* @__PURE__ */ n(
287
+ Ve,
294
288
  {
295
- className: l(
296
- t.options,
297
- t[i],
298
- t[A],
299
- { [t.visible]: O }
289
+ className: u(
290
+ e.options,
291
+ e[i],
292
+ e[A],
293
+ { [e.visible]: V }
300
294
  ),
301
295
  modal: !1,
302
296
  static: !0,
303
- children: ({ option: e }) => /* @__PURE__ */ n(
304
- Ve,
297
+ children: ({ option: t }) => /* @__PURE__ */ n(
298
+ qe,
305
299
  {
306
- value: e,
307
- className: ({ focus: o }) => l(
308
- t.option,
309
- ae,
310
- i && t[i],
300
+ value: t,
301
+ className: ({ focus: o }) => u(
302
+ e.option,
303
+ ue,
304
+ i && e[i],
311
305
  {
312
- [t["option-active"]]: o
306
+ [e["option-active"]]: o
313
307
  }
314
308
  ),
315
- children: /* @__PURE__ */ E(Q, { children: [
316
- /* @__PURE__ */ E("div", { className: t["option-inner"], children: [
317
- e.name,
318
- e.bottom && /* @__PURE__ */ n("div", { children: e.bottom })
309
+ children: /* @__PURE__ */ E(Y, { children: [
310
+ /* @__PURE__ */ E("div", { className: e["option-inner"], children: [
311
+ t.name,
312
+ t.bottom && /* @__PURE__ */ n("div", { children: t.bottom })
319
313
  ] }),
320
314
  /* @__PURE__ */ n(
321
- ke,
315
+ Te,
322
316
  {
323
317
  isInteractive: !1,
324
318
  checked: c.some(
325
- (o) => o.id === e.id
319
+ (o) => o.id === t.id
326
320
  )
327
321
  }
328
322
  )
329
323
  ] })
330
324
  },
331
- e.id
325
+ t.id
332
326
  )
333
327
  }
334
328
  ) : /* @__PURE__ */ n(
335
329
  "div",
336
330
  {
337
- className: l(
338
- t.options,
339
- t[i],
340
- t["no-options"],
341
- t[A],
342
- { [t.visible]: O }
331
+ className: u(
332
+ e.options,
333
+ e[i],
334
+ e["no-options"],
335
+ e[A],
336
+ { [e.visible]: V }
343
337
  ),
344
338
  children: "Ничего не найдено"
345
339
  }
346
340
  ) : /* @__PURE__ */ n(
347
341
  "div",
348
342
  {
349
- className: l(
350
- t.options,
351
- t[i],
352
- t["no-options"],
353
- t[A],
354
- { [t.visible]: O }
343
+ className: u(
344
+ e.options,
345
+ e[i],
346
+ e["no-options"],
347
+ e[A],
348
+ { [e.visible]: V }
355
349
  ),
356
350
  children: "Нет данных"
357
351
  }
@@ -361,21 +355,21 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
361
355
  )
362
356
  }
363
357
  ),
364
- ue && c.length > 0 && /* @__PURE__ */ n("div", { className: t["chip-container"], children: c.map((e) => /* @__PURE__ */ n(
365
- ye,
358
+ de && c.length > 0 && /* @__PURE__ */ n("div", { className: e["chip-container"], children: c.map((t) => /* @__PURE__ */ n(
359
+ Oe,
366
360
  {
367
- size: i === D.L ? "s" : "xs",
368
- variant: de,
369
- className: t["chip-root"],
361
+ size: i === R.L ? "s" : "xs",
362
+ variant: pe,
363
+ className: e["chip-root"],
370
364
  withAction: !0,
371
- onClose: () => fe(e),
372
- children: /* @__PURE__ */ n("span", { className: t.chip, children: e.name })
365
+ onClose: () => ve(t),
366
+ children: /* @__PURE__ */ n("span", { className: e.chip, children: t.name })
373
367
  },
374
- e.id
368
+ t.id
375
369
  )) })
376
370
  ] });
377
371
  }
378
372
  );
379
373
  export {
380
- lt as MultiSelectSearch
374
+ at as MultiSelectSearch
381
375
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.38.22",
4
+ "version": "1.38.24",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {