mimir-ui-kit 1.38.3 → 1.38.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- ._select-search_7klny_2{position:relative;isolation:isolate}._select-search_7klny_2._disabled_7klny_6{cursor:not-allowed}._select-search_7klny_2:focus-within{z-index:100}._container_7klny_13{position:relative;z-index:10;display:block;gap:var(--mimir-select-search-gap);align-items:center;justify-content:space-between;height:var(--mimir-select-search-height);background-color:var(--black-5);border-radius:var(--mimir-select-search-radius)}._container-open_7klny_24{border-bottom:1px solid var(--citrine-100)}._full_7klny_28{width:100%}._selected-icon_7klny_32 path{fill:var(--sapphire-100)}._selector-icon-open_7klny_36{transform:rotate(180deg)}._button_7klny_40{display:flex;align-items:center;background:none;border:none;cursor:pointer}._button_7klny_40._disabled_7klny_6{cursor:not-allowed}._button_7klny_40._disabled_7klny_6 ._selector-icon_7klny_36 path{fill:var(--white)}._options_7klny_54{position:absolute;z-index:5;width:100%;min-height:100%;max-height:var(--mimir-select-search-options-height);overflow-y:auto;font-size:var(--mimir-size-text-l);background:var(--white);box-shadow:var(--mimir-box-shadow-select-search)}._options_7klny_54._top_7klny_65{bottom:90%;margin-bottom:1px;padding-bottom:5px;border-radius:var(--mimir-select-search-radius) var(--mimir-select-search-radius) 0 0}._options_7klny_54._bottom_7klny_71{top:90%;margin-top:1px;padding-top:5px;border-radius:0 0 var(--mimir-select-search-radius) var(--mimir-select-search-radius)}._options_7klny_54._no-options_7klny_77{height:100%;padding:var(--mimir-select-search-option-space);color:var(--black-80)}._options_7klny_54::-webkit-scrollbar{width:3px}._options_7klny_54::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:var(--mimir-control-radius-xs2)}._options_7klny_54::-webkit-scrollbar-track{background-color:var(--white)}@media (max-width: 600px){._options_7klny_54{max-height:var(--mimir-select-search-options-height-mobile)}}._m_7klny_98{--mimir-select-search-height: var(--mimir-select-search-height-l);--mimir-select-search-space: var(--mimir-space-xss) var(--mimir-space-m);--mimir-select-search-radius: var(--mimir-control-radius);--mimir-select-search-gap: var(--mimir-space-2xs);--mimir-select-search-btn-space: var(--mimir-space-m) var(--mimir-space-m) var(--mimir-space-m) var(--mimir-space-xs);--mimir-select-search-option-space: var(--mimir-space-2s) var(--mimir-space-m);--mimir-select-search-options-height: var( --mimir-select-search-options-height-mobile );--clear-right: var(--mimir-space-2xxl);--select-input-disabled-margin-right: var(--mimir-space-l)}._l_7klny_113{--mimir-select-search-height: var(--mimir-select-search-height-xxl);--mimir-select-search-space: var(--mimir-space-xss) var(--mimir-space-m);--mimir-select-search-radius: var(--mimir-control-radius-s);--mimir-select-search-gap: var(--mimir-space-xs);--mimir-select-search-btn-space: var(--mimir-space-l) var(--mimir-space-m) var(--mimir-space-l) var(--mimir-space-xs);--mimir-select-search-option-space: var(--mimir-space-2l) var(--mimir-space-m);--mimir-select-search-options-height: var( --mimir-select-search-options-height-desktop );--clear-right: var(--mimir-space-4xl);--select-input-disabled-margin-right: var(--mimir-space-1xl)}._select-input_7klny_128{width:100%!important}._select-input-disabled_7klny_131{margin-right:var(--select-input-disabled-margin-right)}._select-input_7klny_128:last-child{padding-right:var(--mimir-space-4xl)}._option_7klny_54{display:flex;gap:var(--mimir-space-m);align-items:center;width:100%;padding:var(--mimir-select-search-option-space);cursor:pointer;transition:background-color .2s ease-in-out}._option-active_7klny_147{background-color:var(--black-5)}._option-inner_7klny_150{display:flex;flex-direction:column;gap:var(--mimir-space-xs);width:100%}._right-slot_7klny_157{order:2;padding-top:0!important}._required-mark_7klny_162{order:1;margin-right:var(--mimir-space-xs)}._clear_7klny_167{position:absolute;top:50%;right:var(--clear-right);transform:translateY(-50%)}._clear_7klny_167._disabled_7klny_6{cursor:not-allowed}._clear_7klny_167._disabled_7klny_6 ._icon-button_7klny_176 path{fill:var(--white)}
1
+ ._select-search_1bph7_2{position:relative;isolation:isolate}._select-search_1bph7_2._disabled_1bph7_6{cursor:not-allowed}._select-search_1bph7_2:has([data-headlessui-state=open]){z-index:100}._container_1bph7_13{position:relative;z-index:10;display:block;gap:var(--mimir-select-search-gap);align-items:center;justify-content:space-between;height:var(--mimir-select-search-height);background-color:var(--black-5);border-radius:var(--mimir-select-search-radius)}._container-open_1bph7_24{border-bottom:1px solid var(--citrine-100)}._full_1bph7_28{width:100%}._selected-icon_1bph7_32 path{fill:var(--sapphire-100)}._selector-icon-open_1bph7_36{transform:rotate(180deg)}._button_1bph7_40{display:flex;align-items:center;background:none;border:none;cursor:pointer}._button_1bph7_40._disabled_1bph7_6{cursor:not-allowed}._button_1bph7_40._disabled_1bph7_6 ._selector-icon_1bph7_36 path{fill:var(--white)}._options_1bph7_54{position:absolute;z-index:5;width:100%;min-height:100%;max-height:var(--mimir-select-search-options-height);overflow-y:auto;font-size:var(--mimir-size-text-l);background:var(--white);box-shadow:var(--mimir-box-shadow-select-search)}._options_1bph7_54._top_1bph7_65{bottom:90%;margin-bottom:1px;padding-bottom:5px;border-radius:var(--mimir-select-search-radius) var(--mimir-select-search-radius) 0 0}._options_1bph7_54._bottom_1bph7_71{top:90%;margin-top:1px;padding-top:5px;border-radius:0 0 var(--mimir-select-search-radius) var(--mimir-select-search-radius)}._options_1bph7_54._no-options_1bph7_77{height:100%;padding:var(--mimir-select-search-option-space);color:var(--black-80)}._options_1bph7_54::-webkit-scrollbar{width:3px}._options_1bph7_54::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:var(--mimir-control-radius-xs2)}._options_1bph7_54::-webkit-scrollbar-track{background-color:var(--white)}@media (max-width: 600px){._options_1bph7_54{max-height:var(--mimir-select-search-options-height-mobile)}}._m_1bph7_98{--mimir-select-search-height: var(--mimir-select-search-height-l);--mimir-select-search-space: var(--mimir-space-xss) var(--mimir-space-m);--mimir-select-search-radius: var(--mimir-control-radius);--mimir-select-search-gap: var(--mimir-space-2xs);--mimir-select-search-btn-space: var(--mimir-space-m) var(--mimir-space-m) var(--mimir-space-m) var(--mimir-space-xs);--mimir-select-search-option-space: var(--mimir-space-2s) var(--mimir-space-m);--mimir-select-search-options-height: var( --mimir-select-search-options-height-mobile );--clear-right: var(--mimir-space-2xxl);--select-input-disabled-margin-right: var(--mimir-space-l)}._l_1bph7_113{--mimir-select-search-height: var(--mimir-select-search-height-xxl);--mimir-select-search-space: var(--mimir-space-xss) var(--mimir-space-m);--mimir-select-search-radius: var(--mimir-control-radius-s);--mimir-select-search-gap: var(--mimir-space-xs);--mimir-select-search-btn-space: var(--mimir-space-l) var(--mimir-space-m) var(--mimir-space-l) var(--mimir-space-xs);--mimir-select-search-option-space: var(--mimir-space-2l) var(--mimir-space-m);--mimir-select-search-options-height: var( --mimir-select-search-options-height-desktop );--clear-right: var(--mimir-space-4xl);--select-input-disabled-margin-right: var(--mimir-space-1xl)}._select-input_1bph7_128{width:100%!important}._select-input-disabled_1bph7_131{margin-right:var(--select-input-disabled-margin-right)}._select-input_1bph7_128:last-child{padding-right:var(--mimir-space-4xl)}._option_1bph7_54{display:flex;gap:var(--mimir-space-m);align-items:center;width:100%;padding:var(--mimir-select-search-option-space);cursor:pointer;transition:background-color .2s ease-in-out}._option-active_1bph7_147{background-color:var(--black-5)}._option-inner_1bph7_150{display:flex;flex-direction:column;gap:var(--mimir-space-xs);width:100%}._right-slot_1bph7_157{order:2;padding-top:0!important}._required-mark_1bph7_162{order:1;margin-right:var(--mimir-space-xs)}._clear_1bph7_167{position:absolute;top:50%;right:var(--clear-right);transform:translateY(-50%)}._clear_1bph7_167._disabled_1bph7_6{cursor:not-allowed}._clear_1bph7_167._disabled_1bph7_6 ._icon-button_1bph7_176 path{fill:var(--white)}
@@ -1,63 +1,63 @@
1
- import { jsx as l, jsxs as u, Fragment as D } from "react/jsx-runtime";
2
- import { c as i } from "../../index-DIxK0V-G.js";
1
+ import { jsx as a, jsxs as u, Fragment as D } from "react/jsx-runtime";
2
+ import { c as l } from "../../index-DIxK0V-G.js";
3
3
  import { forwardRef as U, useState as j, useMemo as R, useCallback as $, useEffect as J } from "react";
4
- import { ESelectSearchSize as N } from "./constants.js";
4
+ import { ESelectSearchSize as g } from "./constants.js";
5
5
  import { mapSizeToInputSize as q, getDropdownArrowIcon as Q } from "./utils.js";
6
6
  import { Icon as A } from "../../icons/Icon.js";
7
7
  import { Button as W } from "../Button/Button.js";
8
8
  import { I as O } from "../../Input-BYrIS5GU.js";
9
9
  import { EInputVariant as X } from "../Input/constants.js";
10
10
  import { H as Y, U as B, G as M, K as Z, j as ee } from "../../combobox-DgSZTriw.js";
11
- import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_container_7klny_13", ne = "_full_7klny_28", se = "_button_7klny_40", le = "_options_7klny_54", ae = "_top_7klny_65", ie = "_bottom_7klny_71", re = "_m_7klny_98", ce = "_l_7klny_113", de = "_option_7klny_54", pe = "_clear_7klny_167", e = {
12
- "select-search": "_select-search_7klny_2",
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", pe = "_option_1bph7_54", de = "_clear_1bph7_167", e = {
12
+ "select-search": "_select-search_1bph7_2",
13
13
  disabled: te,
14
14
  container: oe,
15
- "container-open": "_container-open_7klny_24",
15
+ "container-open": "_container-open_1bph7_24",
16
16
  full: ne,
17
- "selected-icon": "_selected-icon_7klny_32",
18
- "selector-icon-open": "_selector-icon-open_7klny_36",
17
+ "selected-icon": "_selected-icon_1bph7_32",
18
+ "selector-icon-open": "_selector-icon-open_1bph7_36",
19
19
  button: se,
20
- "selector-icon": "_selector-icon_7klny_36",
21
- options: le,
22
- top: ae,
23
- bottom: ie,
24
- "no-options": "_no-options_7klny_77",
20
+ "selector-icon": "_selector-icon_1bph7_36",
21
+ options: ae,
22
+ top: ie,
23
+ bottom: le,
24
+ "no-options": "_no-options_1bph7_77",
25
25
  m: re,
26
26
  l: ce,
27
- "select-input": "_select-input_7klny_128",
28
- "select-input-disabled": "_select-input-disabled_7klny_131",
29
- option: de,
30
- "option-active": "_option-active_7klny_147",
31
- "option-inner": "_option-inner_7klny_150",
32
- "right-slot": "_right-slot_7klny_157",
33
- "required-mark": "_required-mark_7klny_162",
34
- clear: pe,
35
- "icon-button": "_icon-button_7klny_176"
36
- }, ge = U(
27
+ "select-input": "_select-input_1bph7_128",
28
+ "select-input-disabled": "_select-input-disabled_1bph7_131",
29
+ option: pe,
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: de,
35
+ "icon-button": "_icon-button_1bph7_176"
36
+ }, Ce = U(
37
37
  (E, L) => {
38
38
  const {
39
- placeholder: v,
40
- size: a = N.L,
39
+ placeholder: w,
40
+ size: i = g.L,
41
41
  value: n,
42
42
  onChange: s,
43
43
  full: V,
44
- showArrow: g = !0,
45
- items: p = [],
44
+ showArrow: C = !0,
45
+ items: d = [],
46
46
  classNameOption: F,
47
47
  displayValue: G = "name",
48
- filterOnSearch: w = !0,
48
+ filterOnSearch: I = !0,
49
49
  onSearch: _,
50
- variant: C = X.DefaultGray,
51
- menuPlacement: y = "bottom",
50
+ variant: S = X.DefaultGray,
51
+ menuPlacement: b = "bottom",
52
52
  disabled: r = !1,
53
- searchProps: I,
53
+ searchProps: y,
54
54
  withClearButton: f = !1,
55
55
  disableInput: c = !1,
56
- autocomplete: S = "on",
56
+ autocomplete: k = "on",
57
57
  immediate: P = !1
58
- } = E, b = String((n == null ? void 0 : n[G]) || ""), [d, m] = j(b), [k, h] = j(n), x = R(() => !w || n && (n.id || n.name) ? p : d.trim().toLowerCase() ? p.filter(
59
- (o) => o.name.toLowerCase().includes(d.toLowerCase())
60
- ) : p, [d, p, n, w]), T = (o) => {
58
+ } = E, N = String((n == null ? void 0 : n[G]) || ""), [p, m] = j(N), [v, h] = j(n), x = R(() => !I || n && (n.id || n.name) ? d : p.trim().toLowerCase() ? d.filter(
59
+ (o) => o.name.toLowerCase().includes(p.toLowerCase())
60
+ ) : d, [p, d, n, I]), T = (o) => {
61
61
  o ? (m(o.name), h(o), s == null || s(o)) : (m(""), h(null), s == null || s({ id: "", name: "" }));
62
62
  }, z = $(
63
63
  (o) => {
@@ -71,13 +71,13 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
71
71
  };
72
72
  return J(() => {
73
73
  const o = !n || typeof n == "object" && !Object.keys(n).length;
74
- m(o ? "" : b), h(o ? null : n);
75
- }, [n, b]), /* @__PURE__ */ l(
74
+ m(o ? "" : N), h(o ? null : n);
75
+ }, [n, N]), /* @__PURE__ */ a(
76
76
  Y,
77
77
  {
78
78
  as: "div",
79
- value: k,
80
- className: i(e["select-search"], {
79
+ value: v,
80
+ className: l(e["select-search"], {
81
81
  [e.full]: V,
82
82
  [e.disabled]: r
83
83
  }),
@@ -90,24 +90,24 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
90
90
  /* @__PURE__ */ u(
91
91
  "div",
92
92
  {
93
- className: i(e.container, e[a], {
93
+ className: l(e.container, e[i], {
94
94
  [e["container-open"]]: o
95
95
  }),
96
96
  children: [
97
97
  c && /* @__PURE__ */ u("div", { style: { position: "relative", width: "100%" }, children: [
98
- /* @__PURE__ */ l(B, { disabled: r, style: { width: "100%" }, children: /* @__PURE__ */ l(
98
+ /* @__PURE__ */ a(B, { disabled: r, style: { width: "100%" }, children: /* @__PURE__ */ a(
99
99
  M,
100
100
  {
101
101
  as: O,
102
- label: v,
103
- size: q(a),
104
- className: i(e["select-input"], {
102
+ label: w,
103
+ size: q(i),
104
+ className: l(e["select-input"], {
105
105
  [e["select-input-disabled"]]: c && f
106
106
  }),
107
107
  onChange: z,
108
- value: d,
108
+ value: p,
109
109
  disabled: r,
110
- variant: C,
110
+ variant: S,
111
111
  rightSlotClassName: e["right-slot"],
112
112
  requiredMarkClassName: e["required-mark"],
113
113
  "data-testid": "select-search-input",
@@ -116,17 +116,17 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
116
116
  },
117
117
  rightAddon: {
118
118
  addonType: "icon",
119
- addonContent: Q(o, a)
119
+ addonContent: Q(o, i)
120
120
  },
121
- autocomplete: S,
122
- ...I
121
+ autocomplete: k,
122
+ ...y
123
123
  }
124
124
  ) }),
125
- f && d && /* @__PURE__ */ l(
125
+ f && p && /* @__PURE__ */ a(
126
126
  W,
127
127
  {
128
128
  tabIndex: -1,
129
- className: i(e.clear, {
129
+ className: l(e.clear, {
130
130
  [e.disabled]: r
131
131
  }),
132
132
  iconButtonClassName: e["icon-button"],
@@ -143,35 +143,35 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
143
143
  }
144
144
  )
145
145
  ] }),
146
- !c && /* @__PURE__ */ l(
146
+ !c && /* @__PURE__ */ a(
147
147
  M,
148
148
  {
149
149
  as: O,
150
- label: v,
151
- size: q(a),
150
+ label: w,
151
+ size: q(i),
152
152
  className: e["select-input"],
153
153
  onChange: z,
154
- value: d,
154
+ value: p,
155
155
  disabled: r,
156
- variant: C,
156
+ variant: S,
157
157
  withClearButton: f,
158
158
  rightSlotClassName: e["right-slot"],
159
159
  requiredMarkClassName: e["required-mark"],
160
160
  "data-testid": "select-search-input",
161
- rightAddon: g ? {
161
+ rightAddon: C ? {
162
162
  addonType: "react-node",
163
- addonContent: g && /* @__PURE__ */ l(
163
+ addonContent: C && /* @__PURE__ */ a(
164
164
  B,
165
165
  {
166
- className: i(e.button, {
166
+ className: l(e.button, {
167
167
  [e.disabled]: r
168
168
  }),
169
169
  disabled: r,
170
- children: /* @__PURE__ */ l(
170
+ children: /* @__PURE__ */ a(
171
171
  A,
172
172
  {
173
- iconName: a == N.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
174
- className: i(e["selector-icon"], {
173
+ iconName: i == g.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
174
+ className: l(e["selector-icon"], {
175
175
  [e["selector-icon-open"]]: o
176
176
  })
177
177
  }
@@ -182,30 +182,30 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
182
182
  onFocus: (t) => {
183
183
  c && t.target.blur();
184
184
  },
185
- autocomplete: S,
186
- ...I
185
+ autocomplete: k,
186
+ ...y
187
187
  }
188
188
  )
189
189
  ]
190
190
  }
191
191
  ),
192
- o && /* @__PURE__ */ l(D, { children: p.length ? x.length ? /* @__PURE__ */ l(
192
+ o && /* @__PURE__ */ a(D, { children: d.length ? x.length ? /* @__PURE__ */ a(
193
193
  Z,
194
194
  {
195
195
  "data-testid": "select-search-options",
196
- className: i(
196
+ className: l(
197
197
  e.options,
198
- e[a],
199
- e[y]
198
+ e[i],
199
+ e[b]
200
200
  ),
201
201
  children: ({ option: t }) => /* @__PURE__ */ u(
202
202
  ee,
203
203
  {
204
204
  value: t,
205
- className: ({ focus: K }) => i(
205
+ className: ({ focus: K }) => l(
206
206
  e.option,
207
207
  F,
208
- a && e[a],
208
+ i && e[i],
209
209
  {
210
210
  [e["option-active"]]: K
211
211
  }
@@ -214,12 +214,12 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
214
214
  children: [
215
215
  /* @__PURE__ */ u("div", { className: e["option-inner"], children: [
216
216
  t.name,
217
- t.bottom && /* @__PURE__ */ l("div", { children: t.bottom })
217
+ t.bottom && /* @__PURE__ */ a("div", { children: t.bottom })
218
218
  ] }),
219
- k && k.id === t.id && /* @__PURE__ */ l(
219
+ v && v.id === t.id && /* @__PURE__ */ a(
220
220
  A,
221
221
  {
222
- iconName: a === N.M ? "Done16px" : "Done24px",
222
+ iconName: i === g.M ? "Done16px" : "Done24px",
223
223
  className: e["selected-icon"]
224
224
  }
225
225
  )
@@ -228,25 +228,25 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
228
228
  t.id
229
229
  )
230
230
  }
231
- ) : /* @__PURE__ */ l(
231
+ ) : /* @__PURE__ */ a(
232
232
  "div",
233
233
  {
234
- className: i(
234
+ className: l(
235
235
  e.options,
236
- e[a],
236
+ e[i],
237
237
  e["no-options"],
238
- e[y]
238
+ e[b]
239
239
  ),
240
240
  children: "Ничего не найдено"
241
241
  }
242
- ) : /* @__PURE__ */ l(
242
+ ) : /* @__PURE__ */ a(
243
243
  "div",
244
244
  {
245
- className: i(
245
+ className: l(
246
246
  e.options,
247
- e[a],
247
+ e[i],
248
248
  e["no-options"],
249
- e[y]
249
+ e[b]
250
250
  ),
251
251
  children: "Нет данных"
252
252
  }
@@ -257,5 +257,5 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
257
257
  }
258
258
  );
259
259
  export {
260
- ge as SelectSearch
260
+ Ce as SelectSearch
261
261
  };
@@ -8,13 +8,13 @@ import { ListFiles as A } from "../ListFiles/ListFiles.js";
8
8
  import { EFileItemVariant as k } from "../ListFiles/constants.js";
9
9
  import { ListPhotos as q } from "../ListPhotos/ListPhotos.js";
10
10
  import { Uploader as G } from "../Uploader/Uploader.js";
11
- import '../../assets/UploaderPhotos.css';const v = {
11
+ import '../../assets/UploaderPhotos.css';const x = {
12
12
  "upload-file-wrapper": "_upload-file-wrapper_1a115_2"
13
13
  }, f = (i) => "file" in i && i.file instanceof File ? y.includes(i.file.type) : "type" in i && typeof i.type == "string" ? y.includes(i.type) : !1, te = D(
14
- (i, x) => {
14
+ (i, F) => {
15
15
  const {
16
16
  type: a,
17
- filesType: F,
17
+ filesType: v,
18
18
  arrayName: g,
19
19
  maxSize: w,
20
20
  onChange: s,
@@ -62,19 +62,19 @@ import '../../assets/UploaderPhotos.css';const v = {
62
62
  {
63
63
  "data-testid": "universal-uploader",
64
64
  className: B(
65
- v["upload-file-wrapper"],
66
- u && v.disabled
65
+ x["upload-file-wrapper"],
66
+ u && x.disabled
67
67
  ),
68
68
  children: [
69
69
  /* @__PURE__ */ p(
70
70
  G,
71
71
  {
72
- filesType: F,
72
+ filesType: v,
73
73
  arrayName: g,
74
74
  maxSize: w,
75
75
  onChangeValue: N,
76
- ref: x,
77
- maxFiles: d,
76
+ ref: F,
77
+ maxFiles: d - l.length,
78
78
  isDisabled: u,
79
79
  titleUploader: z,
80
80
  showOnlyUploadButton: m,
@@ -1,9 +1,9 @@
1
- import { jsxs as o, jsx as n, Fragment as A } from "react/jsx-runtime";
2
- import { forwardRef as B, useRef as _, useId as k } from "react";
1
+ import { jsxs as o, jsx as n, Fragment as B } from "react/jsx-runtime";
2
+ import { forwardRef as M, useRef as _, useId as k } from "react";
3
3
  import { Icon as D } from "../../icons/Icon.js";
4
4
  import { Button as G } from "../Button/Button.js";
5
5
  import { EButtonVariantDefault as O } from "../Button/constants.js";
6
- import '../../assets/Uploader.css';const s = {
6
+ import '../../assets/Uploader.css';const c = {
7
7
  "upload-file-wrapper": "_upload-file-wrapper_bplvw_2",
8
8
  "upload-text": "_upload-text_bplvw_25",
9
9
  "upload-file-input": "_upload-file-input_bplvw_35"
@@ -31,76 +31,76 @@ import '../../assets/Uploader.css';const s = {
31
31
  ], X = () => {
32
32
  let i = 0;
33
33
  return () => (i = (i + 1) % Number.MAX_SAFE_INTEGER, i);
34
- }, q = X(), W = B(
34
+ }, q = X(), W = M(
35
35
  (i, v) => {
36
36
  const {
37
37
  filesType: l = L,
38
38
  onChangeValue: I,
39
39
  arrayName: N,
40
- maxSize: c = 15,
40
+ maxSize: f = 15,
41
41
  maxFiles: d,
42
- isDisabled: f,
43
- titleUploader: m = "Или перетащите сюда",
42
+ isDisabled: m,
43
+ titleUploader: u = "Или перетащите сюда",
44
44
  buttonText: T = "Выберите файлы",
45
- showOnlyUploadButton: E = !1,
46
- uploadButtonVariant: F = O.SecondaryAsphalt,
47
- buttonSize: z = "m",
48
- buttonClassName: S,
49
- onMaxFilesExceeded: u,
45
+ showOnlyUploadButton: z = !1,
46
+ uploadButtonVariant: S = O.SecondaryAsphalt,
47
+ buttonSize: C = "m",
48
+ buttonClassName: E,
49
+ onMaxFilesExceeded: p,
50
50
  onMaxSizeExceeded: g,
51
51
  onInvalidFileType: x
52
- } = i, h = _(null), p = _(null), b = k(), C = (e) => {
52
+ } = i, h = _(null), r = _(null), b = k(), F = (e) => {
53
53
  var a;
54
54
  return e.type ? e.type : ((a = e.name.split(".").pop()) == null ? void 0 : a.toLowerCase()) === "heic" ? "image/heic" : "";
55
- }, M = (e) => {
55
+ }, R = (e) => {
56
56
  if (e.target.files && e.target.files[0]) {
57
- const r = Array.from(e.target.files);
58
- r.length > d && u && u();
59
- const a = r.filter((t) => {
60
- const U = C(t), w = l.map((V) => j[V]).includes(U), y = t.size / 1024 ** 2 <= c;
57
+ const s = Array.from(e.target.files);
58
+ s.length > d && (p == null || p());
59
+ const a = s.filter((t) => {
60
+ const V = F(t), w = l.map((A) => j[A]).includes(V), y = t.size / 1024 ** 2 <= f;
61
61
  return !w && x && x(t.name), !y && g && g(t.name), w && y;
62
62
  }).slice(0, d).map((t) => ({ file: t, id: q() }));
63
- I({ arrayName: N, value: a }), p.current && (p.current.value = "");
63
+ I({ arrayName: N, value: a }), r.current && (r.current.value = "");
64
64
  }
65
- }, R = () => {
65
+ }, U = () => {
66
66
  var e;
67
67
  (e = h.current) == null || e.click();
68
68
  };
69
- return /* @__PURE__ */ o("div", { className: s["upload-file-wrapper"], ref: v, children: [
69
+ return /* @__PURE__ */ o("div", { className: c["upload-file-wrapper"], ref: v, children: [
70
70
  /* @__PURE__ */ n(
71
71
  "input",
72
72
  {
73
- ref: p,
73
+ ref: r,
74
74
  type: "file",
75
- className: s["upload-file-input"],
75
+ className: c["upload-file-input"],
76
76
  "aria-label": "Upload",
77
77
  name: "image[]",
78
78
  multiple: !0,
79
- onChange: M,
79
+ onChange: R,
80
80
  title: "",
81
81
  id: b,
82
82
  accept: l.map((e) => j[e]).join(),
83
- disabled: f
83
+ disabled: m
84
84
  }
85
85
  ),
86
86
  /* @__PURE__ */ o("label", { htmlFor: b, ref: h, children: [
87
87
  /* @__PURE__ */ n(
88
88
  G,
89
89
  {
90
- size: z,
91
- variant: F,
90
+ size: C,
91
+ variant: S,
92
92
  leftIcon: /* @__PURE__ */ n(D, { iconName: "UnionIcon16px" }),
93
- onClick: R,
94
- disabled: f,
95
- className: S,
93
+ onClick: U,
94
+ disabled: m,
95
+ className: E,
96
96
  children: T
97
97
  }
98
98
  ),
99
- !E && /* @__PURE__ */ o(A, { children: [
100
- m && /* @__PURE__ */ n("b", { children: m }),
101
- /* @__PURE__ */ o("span", { className: s["upload-text"], children: [
99
+ !z && /* @__PURE__ */ o(B, { children: [
100
+ u && /* @__PURE__ */ n("b", { children: u }),
101
+ /* @__PURE__ */ o("span", { className: c["upload-text"], children: [
102
102
  "Максимальный размер одного файла – ",
103
- c,
103
+ f,
104
104
  " Мб",
105
105
  /* @__PURE__ */ n("br", {}),
106
106
  "Загрузить можно файлы следующих форматов: ",
@@ -1,11 +1,11 @@
1
- import { jsxs as S, jsx as n } from "react/jsx-runtime";
2
- import { c as T } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as _, useState as h, useEffect as D } from "react";
1
+ import { jsxs as N, jsx as f } from "react/jsx-runtime";
2
+ import { c as S } from "../../index-DIxK0V-G.js";
3
+ import { forwardRef as T, useState as _, useEffect as D } from "react";
4
4
  import { ListFiles as R } from "../ListFiles/ListFiles.js";
5
5
  import { Uploader as U } from "../Uploader/Uploader.js";
6
6
  import '../../assets/UploaderPhotos.css';const c = {
7
7
  "upload-file-wrapper": "_upload-file-wrapper_1a115_2"
8
- }, q = _(
8
+ }, q = T(
9
9
  (u, x) => {
10
10
  const {
11
11
  filesType: F,
@@ -14,58 +14,58 @@ import '../../assets/UploaderPhotos.css';const c = {
14
14
  onChange: a,
15
15
  value: s,
16
16
  name: d,
17
- maxFiles: r,
17
+ maxFiles: l,
18
18
  buttonText: w,
19
19
  onMaxFilesExceeded: z,
20
20
  onMaxSizeExceeded: b,
21
- onInvalidFileType: E
22
- } = u, [t, o] = h(s || []), l = t.length >= r;
21
+ onInvalidFileType: h
22
+ } = u, [t, o] = _(s || []), r = t.length >= l;
23
23
  D(() => {
24
24
  s && o(s);
25
25
  }, [s]);
26
- const I = (i) => {
27
- const N = [
26
+ const E = (i) => {
27
+ const M = [
28
28
  ...t,
29
29
  ...i.value.map((e) => {
30
- var p, f, m;
30
+ var p, m, n;
31
31
  return {
32
32
  id: e.id,
33
33
  url: "",
34
34
  size: (p = e == null ? void 0 : e.file) == null ? void 0 : p.size,
35
- name: (f = e == null ? void 0 : e.file) == null ? void 0 : f.name,
36
- type: (m = e == null ? void 0 : e.file) == null ? void 0 : m.type
35
+ name: (m = e == null ? void 0 : e.file) == null ? void 0 : m.name,
36
+ type: (n = e == null ? void 0 : e.file) == null ? void 0 : n.type
37
37
  };
38
38
  })
39
39
  ];
40
- o(N), a == null || a({ type: "add", data: i.value, name: d });
41
- }, M = (i) => {
40
+ o(M), a == null || a({ type: "add", data: i.value, name: d });
41
+ }, I = (i) => {
42
42
  o(i.list), i.deleteId && (a == null || a({ type: "delete", data: i.deleteId, name: d }));
43
43
  };
44
- return /* @__PURE__ */ S(
44
+ return /* @__PURE__ */ N(
45
45
  "div",
46
46
  {
47
- className: T(
47
+ className: S(
48
48
  c["upload-file-wrapper"],
49
- l && c.disabled
49
+ r && c.disabled
50
50
  ),
51
51
  children: [
52
- /* @__PURE__ */ n(
52
+ /* @__PURE__ */ f(
53
53
  U,
54
54
  {
55
55
  filesType: F,
56
56
  arrayName: y,
57
57
  maxSize: v,
58
- onChangeValue: I,
58
+ onChangeValue: E,
59
59
  ref: x,
60
- maxFiles: r,
61
- isDisabled: l,
60
+ maxFiles: l - t.length,
61
+ isDisabled: r,
62
62
  buttonText: w,
63
63
  onMaxFilesExceeded: z,
64
64
  onMaxSizeExceeded: b,
65
- onInvalidFileType: E
65
+ onInvalidFileType: h
66
66
  }
67
67
  ),
68
- /* @__PURE__ */ n(R, { value: t, onChange: M })
68
+ /* @__PURE__ */ f(R, { value: t, onChange: I })
69
69
  ]
70
70
  }
71
71
  );
@@ -12,29 +12,29 @@ import '../../assets/UploaderPhotos.css';const c = {
12
12
  arrayName: u,
13
13
  maxSize: x,
14
14
  onChange: e,
15
- value: a,
16
- maxFiles: l,
15
+ value: o,
16
+ maxFiles: s,
17
17
  titleUploader: h,
18
18
  name: i,
19
19
  buttonText: v = "Выберите файлы",
20
20
  onMaxFilesExceeded: w,
21
21
  onMaxSizeExceeded: y,
22
- onInvalidFileType: U
23
- } = n, [o, s] = L(a || []), d = o.length >= l;
22
+ onInvalidFileType: F
23
+ } = n, [a, l] = L(o || []), d = a.length >= s;
24
24
  M(() => {
25
- a && s(a);
26
- }, [a]);
27
- const b = (t) => {
25
+ o && l(o);
26
+ }, [o]);
27
+ const U = (t) => {
28
28
  const P = [
29
- ...o,
29
+ ...a,
30
30
  ...t.value.map((r) => ({
31
31
  url: URL.createObjectURL(r.file),
32
32
  id: r.id
33
33
  }))
34
34
  ];
35
- s(P), e == null || e({ type: "add", data: t.value, name: i });
36
- }, F = (t) => {
37
- s(t.list), t.deleteId && (e == null || e({ type: "delete", data: t.deleteId, name: i }));
35
+ l(P), e == null || e({ type: "add", data: t.value, name: i });
36
+ }, b = (t) => {
37
+ l(t.list), t.deleteId && (e == null || e({ type: "delete", data: t.deleteId, name: i }));
38
38
  };
39
39
  return /* @__PURE__ */ R(
40
40
  "div",
@@ -50,18 +50,18 @@ import '../../assets/UploaderPhotos.css';const c = {
50
50
  filesType: f,
51
51
  arrayName: u,
52
52
  maxSize: x,
53
- onChangeValue: b,
53
+ onChangeValue: U,
54
54
  ref: m,
55
- maxFiles: l,
55
+ maxFiles: s - a.length,
56
56
  isDisabled: d,
57
57
  titleUploader: h,
58
58
  buttonText: v,
59
59
  onMaxFilesExceeded: w,
60
60
  onMaxSizeExceeded: y,
61
- onInvalidFileType: U
61
+ onInvalidFileType: F
62
62
  }
63
63
  ),
64
- !!o.length && /* @__PURE__ */ p(N, { value: o, onChange: F })
64
+ !!a.length && /* @__PURE__ */ p(N, { value: a, onChange: b })
65
65
  ]
66
66
  }
67
67
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.38.3",
4
+ "version": "1.38.5",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {