mimir-ui-kit 1.39.3 → 1.40.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.
@@ -1,83 +1,84 @@
1
- import { jsx as s, jsxs as h, Fragment as D } from "react/jsx-runtime";
2
- import { c as l } from "../../index-DIxK0V-G.js";
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
3
  import { forwardRef as U, useState as q, useMemo as W, useCallback as R, useEffect as $ } from "react";
4
- import { ESelectSearchSize as g } from "./constants.js";
4
+ import { ESelectSearchSize as b } from "./constants.js";
5
5
  import { mapSizeToInputSize as A, getDropdownArrowIcon as J } from "./utils.js";
6
6
  import { Icon as O } from "../../icons/Icon.js";
7
7
  import { Button as Q } from "../Button/Button.js";
8
8
  import { I as B } from "../../Input-DAmc_HxO.js";
9
9
  import { EInputVariant as X } from "../Input/constants.js";
10
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_1bph7_6", oe = "_container_1bph7_13", ne = "_full_1bph7_28", se = "_button_1bph7_40", ae = "_options_1bph7_54", ie = "_top_1bph7_65", le = "_bottom_1bph7_71", re = "_m_1bph7_98", ce = "_l_1bph7_113", de = "_option_1bph7_54", pe = "_clear_1bph7_167", e = {
12
- "select-search": "_select-search_1bph7_2",
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
13
  disabled: te,
14
14
  container: oe,
15
- "container-open": "_container-open_1bph7_24",
16
- full: ne,
17
- "selected-icon": "_selected-icon_1bph7_32",
18
- "selector-icon-open": "_selector-icon-open_1bph7_36",
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
19
  button: se,
20
- "selector-icon": "_selector-icon_1bph7_36",
21
- options: ae,
22
- top: ie,
23
- bottom: le,
24
- "no-options": "_no-options_1bph7_77",
25
- m: re,
26
- l: ce,
27
- "select-input": "_select-input_1bph7_128",
28
- "select-input-disabled": "_select-input-disabled_1bph7_131",
29
- option: de,
30
- "option-active": "_option-active_1bph7_147",
31
- "option-inner": "_option-inner_1bph7_150",
32
- "right-slot": "_right-slot_1bph7_157",
33
- "required-mark": "_required-mark_1bph7_162",
34
- clear: pe,
35
- "icon-button": "_icon-button_1bph7_176"
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"
36
37
  }, Ce = U(
37
38
  (E, L) => {
38
39
  const {
39
40
  placeholder: w,
40
- size: a = g.L,
41
- value: i,
42
- onChange: n,
41
+ size: a = b.L,
42
+ value: l,
43
+ onChange: s,
43
44
  full: V,
44
- showArrow: C = !0,
45
+ showArrow: S = !0,
45
46
  items: u = [],
46
47
  classNameOption: F,
47
48
  displayValue: G = "name",
48
- filterOnSearch: I = !0,
49
- onSearch: b,
50
- variant: S = X.DefaultGray,
51
- menuPlacement: f = "bottom",
49
+ filterOnSearch: C = !0,
50
+ onSearch: f,
51
+ variant: I = X.DefaultGray,
52
+ menuPlacement: N = "bottom",
52
53
  disabled: r = !1,
53
54
  searchProps: y,
54
- withClearButton: N = !1,
55
+ withClearButton: v = !1,
55
56
  disableInput: c = !1,
56
57
  autocomplete: k = "on",
57
58
  immediate: P = !1
58
- } = E, v = String((i == null ? void 0 : i[G]) || ""), [d, m] = q(v), [p, _] = q(i), x = W(() => I && d.trim().toLowerCase() ? u.filter(
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(
59
60
  (t) => t.name.toLowerCase().includes(d.toLowerCase())
60
- ) : u, [d, u, I]), T = (t) => {
61
- t ? (m(t.name), _(t), n == null || n(t)) : (m(""), _(null), n == null || n({ id: "", name: "" }));
61
+ ) : u, [d, u, C]), T = (t) => {
62
+ t ? (_(t.name), m(t), s == null || s(t)) : (_(""), m(null), s == null || s({ id: "", name: "" }));
62
63
  }, z = R(
63
64
  (t) => {
64
65
  if (c) return;
65
66
  const o = t.target.value;
66
- m(o), b == null || b(o), p && o !== p.name && _(null), !o && i && (n == null || n({ id: "", name: "" }));
67
+ _(o), f == null || f(o), p && o !== p.name && m(null), !o && l && (s == null || s({ id: "", name: "" }));
67
68
  },
68
- [c, n, b, i, p]
69
+ [c, s, f, l, p]
69
70
  ), H = () => {
70
- m(""), _(null), n == null || n({ id: "", name: "" });
71
+ _(""), m(null), s == null || s({ id: "", name: "" });
71
72
  };
72
73
  return $(() => {
73
- const t = !i || typeof i == "object" && !Object.keys(i).length;
74
- m(t ? "" : v), _(t ? null : i);
75
- }, [i, v]), /* @__PURE__ */ s(
74
+ const t = !l || typeof l == "object" && !Object.keys(l).length;
75
+ _(t ? "" : g), m(t ? null : l);
76
+ }, [l, g]), /* @__PURE__ */ n(
76
77
  Y,
77
78
  {
78
79
  as: "div",
79
80
  value: p,
80
- className: l(e["select-search"], {
81
+ className: i(e["select-search"], {
81
82
  [e.full]: V,
82
83
  [e.disabled]: r
83
84
  }),
@@ -90,24 +91,24 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
90
91
  /* @__PURE__ */ h(
91
92
  "div",
92
93
  {
93
- className: l(e.container, e[a], {
94
+ className: i(e.container, e[a], {
94
95
  [e["container-open"]]: t
95
96
  }),
96
97
  children: [
97
98
  c && /* @__PURE__ */ h("div", { style: { position: "relative", width: "100%" }, children: [
98
- /* @__PURE__ */ s(M, { disabled: r, style: { width: "100%" }, children: /* @__PURE__ */ s(
99
+ /* @__PURE__ */ n(M, { disabled: r, style: { width: "100%" }, children: /* @__PURE__ */ n(
99
100
  j,
100
101
  {
101
102
  as: B,
102
103
  label: w,
103
104
  size: A(a),
104
- className: l(e["select-input"], {
105
- [e["select-input-disabled"]]: c && N
105
+ className: i(e["select-input"], {
106
+ [e["select-input-disabled"]]: c && v
106
107
  }),
107
108
  onChange: z,
108
109
  value: d,
109
110
  disabled: r,
110
- variant: S,
111
+ variant: I,
111
112
  rightSlotClassName: e["right-slot"],
112
113
  requiredMarkClassName: e["required-mark"],
113
114
  "data-testid": "select-search-input",
@@ -122,11 +123,11 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
122
123
  ...y
123
124
  }
124
125
  ) }),
125
- N && d && /* @__PURE__ */ s(
126
+ v && d && /* @__PURE__ */ n(
126
127
  Q,
127
128
  {
128
129
  tabIndex: -1,
129
- className: l(e.clear, {
130
+ className: i(e.clear, {
130
131
  [e.disabled]: r
131
132
  }),
132
133
  iconButtonClassName: e["icon-button"],
@@ -143,7 +144,7 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
143
144
  }
144
145
  )
145
146
  ] }),
146
- !c && /* @__PURE__ */ s(
147
+ !c && /* @__PURE__ */ n(
147
148
  j,
148
149
  {
149
150
  as: B,
@@ -153,25 +154,25 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
153
154
  onChange: z,
154
155
  value: d,
155
156
  disabled: r,
156
- variant: S,
157
- withClearButton: N,
157
+ variant: I,
158
+ withClearButton: v,
158
159
  rightSlotClassName: e["right-slot"],
159
160
  requiredMarkClassName: e["required-mark"],
160
161
  "data-testid": "select-search-input",
161
- rightAddon: C ? {
162
+ rightAddon: S ? {
162
163
  addonType: "react-node",
163
- addonContent: C && /* @__PURE__ */ s(
164
+ addonContent: S && /* @__PURE__ */ n(
164
165
  M,
165
166
  {
166
- className: l(e.button, {
167
+ className: i(e.button, {
167
168
  [e.disabled]: r
168
169
  }),
169
170
  disabled: r,
170
- children: /* @__PURE__ */ s(
171
+ children: /* @__PURE__ */ n(
171
172
  O,
172
173
  {
173
- iconName: a == g.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
174
- className: l(e["selector-icon"], {
174
+ iconName: a == b.M || a == b.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
175
+ className: i(e["selector-icon"], {
175
176
  [e["selector-icon-open"]]: t
176
177
  })
177
178
  }
@@ -189,20 +190,20 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
189
190
  ]
190
191
  }
191
192
  ),
192
- t && /* @__PURE__ */ s(D, { children: u.length ? x.length ? /* @__PURE__ */ s(
193
+ t && /* @__PURE__ */ n(D, { children: u.length ? x.length ? /* @__PURE__ */ n(
193
194
  Z,
194
195
  {
195
196
  "data-testid": "select-search-options",
196
- className: l(
197
+ className: i(
197
198
  e.options,
198
199
  e[a],
199
- e[f]
200
+ e[N]
200
201
  ),
201
202
  children: ({ option: o }) => /* @__PURE__ */ h(
202
203
  ee,
203
204
  {
204
205
  value: o,
205
- className: ({ focus: K }) => l(
206
+ className: ({ focus: K }) => i(
206
207
  e.option,
207
208
  F,
208
209
  a && e[a],
@@ -214,12 +215,12 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
214
215
  children: [
215
216
  /* @__PURE__ */ h("div", { className: e["option-inner"], children: [
216
217
  o.name,
217
- o.bottom && /* @__PURE__ */ s("div", { children: o.bottom })
218
+ o.bottom && /* @__PURE__ */ n("div", { children: o.bottom })
218
219
  ] }),
219
- p && p.id === o.id && /* @__PURE__ */ s(
220
+ p && p.id === o.id && /* @__PURE__ */ n(
220
221
  O,
221
222
  {
222
- iconName: a === g.M ? "Done16px" : "Done24px",
223
+ iconName: a === b.M || a === b.S ? "Done16px" : "Done24px",
223
224
  className: e["selected-icon"]
224
225
  }
225
226
  )
@@ -228,26 +229,26 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
228
229
  o.id
229
230
  )
230
231
  }
231
- ) : /* @__PURE__ */ s(
232
+ ) : /* @__PURE__ */ n(
232
233
  "div",
233
234
  {
234
- className: l(
235
+ className: i(
235
236
  e.options,
236
237
  e[a],
237
238
  e["no-options"],
238
- e[f]
239
+ e[N]
239
240
  ),
240
241
  "data-headlessui-state": t ? "open" : "closed",
241
242
  children: "Ничего не найдено"
242
243
  }
243
- ) : /* @__PURE__ */ s(
244
+ ) : /* @__PURE__ */ n(
244
245
  "div",
245
246
  {
246
- className: l(
247
+ className: i(
247
248
  e.options,
248
249
  e[a],
249
250
  e["no-options"],
250
- e[f]
251
+ e[N]
251
252
  ),
252
253
  "data-headlessui-state": t ? "open" : "closed",
253
254
  children: "Нет данных"
@@ -1,4 +1,5 @@
1
1
  export declare enum ESelectSearchSize {
2
+ S = "s",
2
3
  M = "m",
3
4
  L = "l"
4
5
  }
@@ -1,4 +1,4 @@
1
- var m = /* @__PURE__ */ ((r) => (r.M = "m", r.L = "l", r))(m || {});
1
+ var m = /* @__PURE__ */ ((r) => (r.S = "s", r.M = "m", r.L = "l", r))(m || {});
2
2
  export {
3
3
  m as ESelectSearchSize
4
4
  };
@@ -1,17 +1,19 @@
1
1
  import { ESelectSearchSize as r } from "./constants.js";
2
2
  import "../../Input-DAmc_HxO.js";
3
- import { EInputSize as t } from "../Input/constants.js";
4
- const c = (o) => {
5
- switch (o) {
3
+ import { EInputSize as o } from "../Input/constants.js";
4
+ const c = (t) => {
5
+ switch (t) {
6
+ case r.S:
7
+ return o.S;
6
8
  case r.M:
7
- return t.M;
9
+ return o.M;
8
10
  case r.L:
9
- return t.L;
11
+ return o.L;
10
12
  default:
11
- return t.M;
13
+ return o.M;
12
14
  }
13
- }, i = (o, p) => o ? p === r.L ? "DropdownArrowUp24px" : "DropdownArrowUp16px" : p === r.L ? "DropdownArrowDown24px" : "DropdownArrowBottom16px";
15
+ }, u = (t, e) => t ? e === r.L ? "DropdownArrowUp24px" : "DropdownArrowUp16px" : e === r.L ? "DropdownArrowDown24px" : "DropdownArrowBottom16px";
14
16
  export {
15
- i as getDropdownArrowIcon,
17
+ u as getDropdownArrowIcon,
16
18
  c as mapSizeToInputSize
17
19
  };