mimir-ui-kit 1.38.1 → 1.38.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. package/dist/assets/SelectSearch.css +1 -1
  2. package/dist/{combobox-CVtJDVoZ.js → combobox-DgSZTriw.js} +254 -251
  3. package/dist/components/Accordion/Accordion.js +3 -3
  4. package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
  5. package/dist/components/DatePicker/hooks.js +12 -12
  6. package/dist/components/Dropdown/Dropdown.js +32 -32
  7. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +18 -18
  8. package/dist/components/RadioGroup/RadioGroup.js +3 -3
  9. package/dist/components/SelectSearch/SelectSearch.js +116 -116
  10. package/dist/components/Switcher/Switcher.js +4 -4
  11. package/dist/components/TabTrail/TabTrail.js +4 -4
  12. package/dist/components/UniversalUploader/UniversalUploader.js +56 -50
  13. package/dist/components/Uploader/Uploader.d.ts +12 -0
  14. package/dist/components/Uploader/Uploader.js +64 -59
  15. package/dist/components/UploaderFiles/UploaderFiles.d.ts +12 -0
  16. package/dist/components/UploaderFiles/UploaderFiles.js +45 -39
  17. package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +12 -0
  18. package/dist/components/UploaderPhotos/UploaderPhotos.js +40 -34
  19. package/dist/{field-FJ34aSs4.js → field-C1kt7aNM.js} +2 -2
  20. package/dist/{focus-management-DE4t_lW3.js → focus-management-BtPpk3D1.js} +1 -1
  21. package/dist/{hidden-DbgtYPOH.js → hidden-PvGXrYUY.js} +1 -1
  22. package/dist/{keyboard-B0lm_zyn.js → keyboard-mgWkd2Vh.js} +114 -111
  23. package/dist/{label-y3ANLTNC.js → label-D4GFpe5F.js} +2 -2
  24. package/dist/open-closed-D2VjDhAN.js +86 -0
  25. package/dist/portal-DPqg52FR.js +1946 -0
  26. package/dist/{use-active-press-86hajhdd.js → use-active-press-CqLGIFz7.js} +1 -1
  27. package/package.json +1 -1
  28. package/dist/open-closed-CdldUPoq.js +0 -86
  29. package/dist/portal-WDFNoIMz.js +0 -1908
@@ -1,140 +1,140 @@
1
- import { jsx as a, jsxs as u, Fragment as z } from "react/jsx-runtime";
2
- import { c } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as U, useState as D, useMemo as W, useCallback as R, useEffect as $ } from "react";
4
- import { ESelectSearchSize as v } from "./constants.js";
5
- import { mapSizeToInputSize as A, getDropdownArrowIcon as J } from "./utils.js";
6
- import { Icon as O } from "../../icons/Icon.js";
7
- import { Button as Q } from "../Button/Button.js";
8
- import { I as B } from "../../Input-BYrIS5GU.js";
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";
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";
5
+ import { mapSizeToInputSize as q, getDropdownArrowIcon as Q } from "./utils.js";
6
+ import { Icon as A } from "../../icons/Icon.js";
7
+ import { Button as W } from "../Button/Button.js";
8
+ import { I as O } from "../../Input-BYrIS5GU.js";
9
9
  import { EInputVariant as X } from "../Input/constants.js";
10
- import { H as Y, U as M, G as j, K as Z, W as ee } from "../../combobox-CVtJDVoZ.js";
11
- import '../../assets/SelectSearch.css';const te = "_disabled_5nqc2_6", oe = "_container_5nqc2_13", ne = "_full_5nqc2_28", se = "_button_5nqc2_40", ae = "_options_5nqc2_54", ie = "_top_5nqc2_65", ce = "_bottom_5nqc2_71", le = "_m_5nqc2_98", re = "_l_5nqc2_113", de = "_option_5nqc2_54", pe = "_clear_5nqc2_167", e = {
12
- "select-search": "_select-search_5nqc2_2",
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",
13
13
  disabled: te,
14
14
  container: oe,
15
- "container-open": "_container-open_5nqc2_24",
15
+ "container-open": "_container-open_7klny_24",
16
16
  full: ne,
17
- "selected-icon": "_selected-icon_5nqc2_32",
18
- "selector-icon-open": "_selector-icon-open_5nqc2_36",
17
+ "selected-icon": "_selected-icon_7klny_32",
18
+ "selector-icon-open": "_selector-icon-open_7klny_36",
19
19
  button: se,
20
- "selector-icon": "_selector-icon_5nqc2_36",
21
- options: ae,
22
- top: ie,
23
- bottom: ce,
24
- "no-options": "_no-options_5nqc2_77",
25
- m: le,
26
- l: re,
27
- "select-input": "_select-input_5nqc2_128",
28
- "select-input-disabled": "_select-input-disabled_5nqc2_131",
20
+ "selector-icon": "_selector-icon_7klny_36",
21
+ options: le,
22
+ top: ae,
23
+ bottom: ie,
24
+ "no-options": "_no-options_7klny_77",
25
+ m: re,
26
+ l: ce,
27
+ "select-input": "_select-input_7klny_128",
28
+ "select-input-disabled": "_select-input-disabled_7klny_131",
29
29
  option: de,
30
- "option-active": "_option-active_5nqc2_147",
31
- "option-inner": "_option-inner_5nqc2_150",
32
- "right-slot": "_right-slot_5nqc2_157",
33
- "required-mark": "_required-mark_5nqc2_162",
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
34
  clear: pe,
35
- "icon-button": "_icon-button_5nqc2_176"
36
- }, we = U(
35
+ "icon-button": "_icon-button_7klny_176"
36
+ }, ge = U(
37
37
  (E, L) => {
38
38
  const {
39
- placeholder: g,
40
- size: i = v.L,
39
+ placeholder: v,
40
+ size: a = N.L,
41
41
  value: n,
42
42
  onChange: s,
43
43
  full: V,
44
- showArrow: w = !0,
44
+ showArrow: g = !0,
45
45
  items: p = [],
46
46
  classNameOption: F,
47
47
  displayValue: G = "name",
48
- filterOnSearch: C = !0,
48
+ filterOnSearch: w = !0,
49
49
  onSearch: _,
50
- variant: I = X.DefaultGray,
51
- menuPlacement: f = "bottom",
52
- disabled: l = !1,
53
- searchProps: S,
54
- withClearButton: b = !1,
55
- disableInput: r = !1,
56
- autocomplete: y = "on",
50
+ variant: C = X.DefaultGray,
51
+ menuPlacement: y = "bottom",
52
+ disabled: r = !1,
53
+ searchProps: I,
54
+ withClearButton: f = !1,
55
+ disableInput: c = !1,
56
+ autocomplete: S = "on",
57
57
  immediate: P = !1
58
- } = E, q = String((n == null ? void 0 : n[G]) || ""), [d, m] = D(q), [N, h] = D(n), k = W(() => !C || n && (n.id || n.name) ? p : d.trim().toLowerCase() ? p.filter(
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
59
  (o) => o.name.toLowerCase().includes(d.toLowerCase())
60
- ) : p, [d, p, n, C]), T = (o) => {
60
+ ) : p, [d, p, n, w]), T = (o) => {
61
61
  o ? (m(o.name), h(o), s == null || s(o)) : (m(""), h(null), s == null || s({ id: "", name: "" }));
62
- }, x = R(
62
+ }, z = $(
63
63
  (o) => {
64
- if (r) return;
64
+ if (c) return;
65
65
  const t = o.target.value;
66
66
  m(t), _ == null || _(t), !t && n && (s == null || s({ id: "", name: "" }));
67
67
  },
68
- [r, s, _, n]
68
+ [c, s, _, n]
69
69
  ), H = () => {
70
70
  m(""), h(null), s == null || s({ id: "", name: "" });
71
71
  };
72
- return $(() => {
72
+ return J(() => {
73
73
  const o = !n || typeof n == "object" && !Object.keys(n).length;
74
- m(o ? "" : q), h(o ? null : n);
75
- }, [n, q]), /* @__PURE__ */ a(
74
+ m(o ? "" : b), h(o ? null : n);
75
+ }, [n, b]), /* @__PURE__ */ l(
76
76
  Y,
77
77
  {
78
78
  as: "div",
79
- value: N,
80
- className: c(e["select-search"], {
79
+ value: k,
80
+ className: i(e["select-search"], {
81
81
  [e.full]: V,
82
- [e.disabled]: l
82
+ [e.disabled]: r
83
83
  }),
84
84
  onChange: T,
85
85
  ref: L,
86
- disabled: l,
87
- virtual: { options: k },
86
+ disabled: r,
87
+ virtual: { options: x },
88
88
  immediate: P,
89
- children: ({ open: o }) => /* @__PURE__ */ u(z, { children: [
89
+ children: ({ open: o }) => /* @__PURE__ */ u(D, { children: [
90
90
  /* @__PURE__ */ u(
91
91
  "div",
92
92
  {
93
- className: c(e.container, e[i], {
93
+ className: i(e.container, e[a], {
94
94
  [e["container-open"]]: o
95
95
  }),
96
96
  children: [
97
- r && /* @__PURE__ */ u("div", { style: { position: "relative", width: "100%" }, children: [
98
- /* @__PURE__ */ a(M, { disabled: l, style: { width: "100%" }, children: /* @__PURE__ */ a(
99
- j,
97
+ c && /* @__PURE__ */ u("div", { style: { position: "relative", width: "100%" }, children: [
98
+ /* @__PURE__ */ l(B, { disabled: r, style: { width: "100%" }, children: /* @__PURE__ */ l(
99
+ M,
100
100
  {
101
- as: B,
102
- label: g,
103
- size: A(i),
104
- className: c(e["select-input"], {
105
- [e["select-input-disabled"]]: r && b
101
+ as: O,
102
+ label: v,
103
+ size: q(a),
104
+ className: i(e["select-input"], {
105
+ [e["select-input-disabled"]]: c && f
106
106
  }),
107
- onChange: x,
107
+ onChange: z,
108
108
  value: d,
109
- disabled: l,
110
- variant: I,
109
+ disabled: r,
110
+ variant: C,
111
111
  rightSlotClassName: e["right-slot"],
112
112
  requiredMarkClassName: e["required-mark"],
113
113
  "data-testid": "select-search-input",
114
114
  onFocus: (t) => {
115
- r && t.target.blur();
115
+ c && t.target.blur();
116
116
  },
117
117
  rightAddon: {
118
118
  addonType: "icon",
119
- addonContent: J(o, i)
119
+ addonContent: Q(o, a)
120
120
  },
121
- autocomplete: y,
122
- ...S
121
+ autocomplete: S,
122
+ ...I
123
123
  }
124
124
  ) }),
125
- b && d && /* @__PURE__ */ a(
126
- Q,
125
+ f && d && /* @__PURE__ */ l(
126
+ W,
127
127
  {
128
128
  tabIndex: -1,
129
- className: c(e.clear, {
130
- [e.disabled]: l
129
+ className: i(e.clear, {
130
+ [e.disabled]: r
131
131
  }),
132
132
  iconButtonClassName: e["icon-button"],
133
133
  isIconButton: !0,
134
134
  iconName: "Close16px",
135
135
  size: "m-s",
136
136
  clear: !0,
137
- disabled: l,
137
+ disabled: r,
138
138
  variant: "secondary-gray",
139
139
  onClick: (t) => {
140
140
  t.stopPropagation(), H();
@@ -143,35 +143,35 @@ import '../../assets/SelectSearch.css';const te = "_disabled_5nqc2_6", oe = "_co
143
143
  }
144
144
  )
145
145
  ] }),
146
- !r && /* @__PURE__ */ a(
147
- j,
146
+ !c && /* @__PURE__ */ l(
147
+ M,
148
148
  {
149
- as: B,
150
- label: g,
151
- size: A(i),
149
+ as: O,
150
+ label: v,
151
+ size: q(a),
152
152
  className: e["select-input"],
153
- onChange: x,
153
+ onChange: z,
154
154
  value: d,
155
- disabled: l,
156
- variant: I,
157
- withClearButton: b,
155
+ disabled: r,
156
+ variant: C,
157
+ withClearButton: f,
158
158
  rightSlotClassName: e["right-slot"],
159
159
  requiredMarkClassName: e["required-mark"],
160
160
  "data-testid": "select-search-input",
161
- rightAddon: w ? {
161
+ rightAddon: g ? {
162
162
  addonType: "react-node",
163
- addonContent: w && /* @__PURE__ */ a(
164
- M,
163
+ addonContent: g && /* @__PURE__ */ l(
164
+ B,
165
165
  {
166
- className: c(e.button, {
167
- [e.disabled]: l
166
+ className: i(e.button, {
167
+ [e.disabled]: r
168
168
  }),
169
- disabled: l,
170
- children: /* @__PURE__ */ a(
171
- O,
169
+ disabled: r,
170
+ children: /* @__PURE__ */ l(
171
+ A,
172
172
  {
173
- iconName: i == v.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
174
- className: c(e["selector-icon"], {
173
+ iconName: a == N.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
174
+ className: i(e["selector-icon"], {
175
175
  [e["selector-icon-open"]]: o
176
176
  })
177
177
  }
@@ -180,32 +180,32 @@ import '../../assets/SelectSearch.css';const te = "_disabled_5nqc2_6", oe = "_co
180
180
  )
181
181
  } : void 0,
182
182
  onFocus: (t) => {
183
- r && t.target.blur();
183
+ c && t.target.blur();
184
184
  },
185
- autocomplete: y,
186
- ...S
185
+ autocomplete: S,
186
+ ...I
187
187
  }
188
188
  )
189
189
  ]
190
190
  }
191
191
  ),
192
- o && /* @__PURE__ */ a(z, { children: p.length ? k.length ? /* @__PURE__ */ a(
192
+ o && /* @__PURE__ */ l(D, { children: p.length ? x.length ? /* @__PURE__ */ l(
193
193
  Z,
194
194
  {
195
195
  "data-testid": "select-search-options",
196
- className: c(
196
+ className: i(
197
197
  e.options,
198
- e[i],
199
- e[f]
198
+ e[a],
199
+ e[y]
200
200
  ),
201
201
  children: ({ option: t }) => /* @__PURE__ */ u(
202
202
  ee,
203
203
  {
204
204
  value: t,
205
- className: ({ focus: K }) => c(
205
+ className: ({ focus: K }) => i(
206
206
  e.option,
207
207
  F,
208
- i && e[i],
208
+ a && e[a],
209
209
  {
210
210
  [e["option-active"]]: K
211
211
  }
@@ -214,12 +214,12 @@ import '../../assets/SelectSearch.css';const te = "_disabled_5nqc2_6", oe = "_co
214
214
  children: [
215
215
  /* @__PURE__ */ u("div", { className: e["option-inner"], children: [
216
216
  t.name,
217
- t.bottom && /* @__PURE__ */ a("div", { children: t.bottom })
217
+ t.bottom && /* @__PURE__ */ l("div", { children: t.bottom })
218
218
  ] }),
219
- N && N.id === t.id && /* @__PURE__ */ a(
220
- O,
219
+ k && k.id === t.id && /* @__PURE__ */ l(
220
+ A,
221
221
  {
222
- iconName: i === v.M ? "Done16px" : "Done24px",
222
+ iconName: a === N.M ? "Done16px" : "Done24px",
223
223
  className: e["selected-icon"]
224
224
  }
225
225
  )
@@ -228,25 +228,25 @@ import '../../assets/SelectSearch.css';const te = "_disabled_5nqc2_6", oe = "_co
228
228
  t.id
229
229
  )
230
230
  }
231
- ) : /* @__PURE__ */ a(
231
+ ) : /* @__PURE__ */ l(
232
232
  "div",
233
233
  {
234
- className: c(
234
+ className: i(
235
235
  e.options,
236
- e[i],
236
+ e[a],
237
237
  e["no-options"],
238
- e[f]
238
+ e[y]
239
239
  ),
240
240
  children: "Ничего не найдено"
241
241
  }
242
- ) : /* @__PURE__ */ a(
242
+ ) : /* @__PURE__ */ l(
243
243
  "div",
244
244
  {
245
- className: c(
245
+ className: i(
246
246
  e.options,
247
- e[i],
247
+ e[a],
248
248
  e["no-options"],
249
- e[f]
249
+ e[y]
250
250
  ),
251
251
  children: "Нет данных"
252
252
  }
@@ -257,5 +257,5 @@ import '../../assets/SelectSearch.css';const te = "_disabled_5nqc2_6", oe = "_co
257
257
  }
258
258
  );
259
259
  export {
260
- we as SelectSearch
260
+ ge as SelectSearch
261
261
  };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as L, jsx as N } from "react/jsx-runtime";
2
- import { H as te } from "../../field-FJ34aSs4.js";
3
- import { K as I, w as re, z as se, U as ae, u as ce, a as le, b as oe, T as ie, I as ne, G as ue, j as he, p as me } from "../../label-y3ANLTNC.js";
4
- import { W as de, H as j, y as pe, p as fe, o as $, $ as be, b as we, D as _e, c as H } from "../../keyboard-B0lm_zyn.js";
2
+ import { H as te } from "../../field-C1kt7aNM.js";
3
+ import { K as I, w as re, z as se, U as ae, u as ce, a as le, b as oe, T as ie, I as ne, G as ue, j as he, p as me } from "../../label-D4GFpe5F.js";
4
+ import { W as de, H as j, y as pe, p as fe, o as $, $ as be, b as we, D as _e, c as H } from "../../keyboard-mgWkd2Vh.js";
5
5
  import u, { createContext as $e, useState as x, useMemo as G, useId as ge, useContext as ve, useRef as ke, useCallback as xe, Fragment as ye, forwardRef as Pe } from "react";
6
- import { w as Ce } from "../../use-active-press-86hajhdd.js";
6
+ import { w as Ce } from "../../use-active-press-CqLGIFz7.js";
7
7
  import { e as De } from "../../use-resolve-button-type-DhFdPxnv.js";
8
8
  import { r as Fe } from "../../bugs-diTMAGNw.js";
9
9
  import { c as g } from "../../index-DIxK0V-G.js";
@@ -6,11 +6,11 @@ import { ETabTrailSize as Ae } from "./constants.js";
6
6
  import { TabButtons as Se } from "./TabButtons/TabButtons.js";
7
7
  import { ETabTrailButtonVariant as Fe } from "./TabButtons/constants.js";
8
8
  import { NotificationBadge as De } from "../NotificationBadge/NotificationBadge.js";
9
- import { n as W, M as se, W as V, s as j, y as q, o as A, H as z, $ as ce, b as Ne, D as de, a as G, u as Re, c as T, t as Me } from "../../keyboard-B0lm_zyn.js";
10
- import { w as Ce } from "../../use-active-press-86hajhdd.js";
9
+ import { n as W, M as se, W as V, s as j, y as q, o as A, H as z, $ as ce, b as Ne, D as de, a as G, u as Re, c as T, t as Me } from "../../keyboard-mgWkd2Vh.js";
10
+ import { w as Ce } from "../../use-active-press-CqLGIFz7.js";
11
11
  import { e as Le } from "../../use-resolve-button-type-DhFdPxnv.js";
12
- import { T as pe, s as Oe } from "../../hidden-DbgtYPOH.js";
13
- import { _ as B, T as J, P as N, F as I } from "../../focus-management-DE4t_lW3.js";
12
+ import { T as pe, s as Oe } from "../../hidden-PvGXrYUY.js";
13
+ import { _ as B, T as J, P as N, F as I } from "../../focus-management-BtPpk3D1.js";
14
14
  import '../../assets/TabTrail.css';function Be() {
15
15
  let e = U(!1);
16
16
  return W(() => (e.current = !0, () => {
@@ -1,40 +1,43 @@
1
1
  import { jsxs as h, jsx as p, Fragment as j } from "react/jsx-runtime";
2
2
  import { c as B } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as D, useState as E, useEffect as T, useMemo as _ } from "react";
3
+ import { forwardRef as D, useState as _, useEffect as C, useMemo as O } from "react";
4
4
  import { imageTypes as y } from "./constants.js";
5
5
  import "../Button/Button.js";
6
- import { EButtonVariantDefault as C } from "../Button/constants.js";
7
- import { ListFiles as M } from "../ListFiles/ListFiles.js";
8
- import { EFileItemVariant as O } from "../ListFiles/constants.js";
9
- import { ListPhotos as P } from "../ListPhotos/ListPhotos.js";
10
- import { Uploader as A } from "../Uploader/Uploader.js";
6
+ import { EButtonVariantDefault as P } from "../Button/constants.js";
7
+ import { ListFiles as A } from "../ListFiles/ListFiles.js";
8
+ import { EFileItemVariant as k } from "../ListFiles/constants.js";
9
+ import { ListPhotos as q } from "../ListPhotos/ListPhotos.js";
10
+ import { Uploader as G } from "../Uploader/Uploader.js";
11
11
  import '../../assets/UploaderPhotos.css';const v = {
12
12
  "upload-file-wrapper": "_upload-file-wrapper_1a115_2"
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, Z = D(
14
- (i, F) => {
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) => {
15
15
  const {
16
16
  type: a,
17
- filesType: g,
18
- arrayName: w,
19
- maxSize: x,
17
+ filesType: F,
18
+ arrayName: g,
19
+ maxSize: w,
20
20
  onChange: s,
21
- value: o,
22
- maxFiles: m,
23
- titleUploader: U,
24
- buttonText: b = "Выберите файлы",
25
- showOnlyUploadButton: u = !1,
26
- uploadButtonVariant: z = C.SecondaryAsphalt,
21
+ value: r,
22
+ maxFiles: d,
23
+ titleUploader: z,
24
+ buttonText: U = "Выберите файлы",
25
+ showOnlyUploadButton: m = !1,
26
+ uploadButtonVariant: b = P.SecondaryAsphalt,
27
27
  buttonSize: I = "m",
28
- buttonClassName: L,
29
- variantListFiles: V = O.white
30
- } = i, [l, n] = E(
31
- o || []
32
- ), d = l.length >= m;
33
- T(() => {
34
- o && n(o);
35
- }, [o]);
28
+ buttonClassName: E,
29
+ variantListFiles: L = k.white,
30
+ onMaxFilesExceeded: S,
31
+ onMaxSizeExceeded: V,
32
+ onInvalidFileType: M
33
+ } = i, [l, n] = _(
34
+ r || []
35
+ ), u = l.length >= d;
36
+ C(() => {
37
+ r && n(r);
38
+ }, [r]);
36
39
  const N = (t) => {
37
- const r = t.value.map((e) => f(e.file) ? {
40
+ const o = t.value.map((e) => f(e.file) ? {
38
41
  id: e.id,
39
42
  url: URL.createObjectURL(e.file),
40
43
  type: e.file.type,
@@ -47,12 +50,12 @@ import '../../assets/UploaderPhotos.css';const v = {
47
50
  name: e.file.name,
48
51
  type: e.file.type
49
52
  });
50
- n((e) => [...e, ...r]), s == null || s({ type: "add", data: t.value });
53
+ n((e) => [...e, ...o]), s == null || s({ type: "add", data: t.value });
51
54
  }, c = (t) => {
52
- n((r) => r.filter((e) => e.id !== t)), s == null || s({ type: "delete", data: t });
53
- }, { photos: R, files: S } = _(() => {
54
- const t = () => l.filter((e) => !f(e)), r = () => l.filter(f);
55
- return a === "all" ? { files: t(), photos: r() } : a === "files" ? { photos: [], files: t() } : a === "photos" ? { files: [], photos: r() } : { files: [], photos: [] };
55
+ n((o) => o.filter((e) => e.id !== t)), s == null || s({ type: "delete", data: t });
56
+ }, { photos: R, files: T } = O(() => {
57
+ const t = () => l.filter((e) => !f(e)), o = () => l.filter(f);
58
+ return a === "all" ? { files: t(), photos: o() } : a === "files" ? { photos: [], files: t() } : a === "photos" ? { files: [], photos: o() } : { files: [], photos: [] };
56
59
  }, [l, a]);
57
60
  return /* @__PURE__ */ h(
58
61
  "div",
@@ -60,38 +63,41 @@ import '../../assets/UploaderPhotos.css';const v = {
60
63
  "data-testid": "universal-uploader",
61
64
  className: B(
62
65
  v["upload-file-wrapper"],
63
- d && v.disabled
66
+ u && v.disabled
64
67
  ),
65
68
  children: [
66
69
  /* @__PURE__ */ p(
67
- A,
70
+ G,
68
71
  {
69
- filesType: g,
70
- arrayName: w,
71
- maxSize: x,
72
+ filesType: F,
73
+ arrayName: g,
74
+ maxSize: w,
72
75
  onChangeValue: N,
73
- ref: F,
74
- maxFiles: m,
75
- isDisabled: d,
76
- titleUploader: U,
77
- showOnlyUploadButton: u,
78
- buttonText: b,
79
- uploadButtonVariant: z,
76
+ ref: x,
77
+ maxFiles: d,
78
+ isDisabled: u,
79
+ titleUploader: z,
80
+ showOnlyUploadButton: m,
81
+ buttonText: U,
82
+ uploadButtonVariant: b,
80
83
  buttonSize: I,
81
- buttonClassName: L
84
+ buttonClassName: E,
85
+ onMaxFilesExceeded: S,
86
+ onMaxSizeExceeded: V,
87
+ onInvalidFileType: M
82
88
  }
83
89
  ),
84
- !u && /* @__PURE__ */ h(j, { children: [
90
+ !m && /* @__PURE__ */ h(j, { children: [
85
91
  (a === "files" || a === "all") && /* @__PURE__ */ p(
86
- M,
92
+ A,
87
93
  {
88
- value: S,
94
+ value: T,
89
95
  onChange: (t) => c(t.deleteId),
90
- variant: V
96
+ variant: L
91
97
  }
92
98
  ),
93
99
  (a === "photos" || a === "all") && /* @__PURE__ */ p(
94
- P,
100
+ q,
95
101
  {
96
102
  value: R,
97
103
  onChange: (t) => c(t.deleteId)
@@ -104,5 +110,5 @@ import '../../assets/UploaderPhotos.css';const v = {
104
110
  }
105
111
  );
106
112
  export {
107
- Z as UniversalUploader
113
+ te as UniversalUploader
108
114
  };
@@ -53,6 +53,18 @@ export type TUploader = {
53
53
  * Класс для кнопки
54
54
  */
55
55
  buttonClassName?: string;
56
+ /**
57
+ * Проп для обработки ошибки при превышении максимального количества файлов
58
+ */
59
+ onMaxFilesExceeded?: () => void;
60
+ /**
61
+ * Проп для обработки ошибки при превышении максимального размера файла
62
+ */
63
+ onMaxSizeExceeded?: (fileName: string) => void;
64
+ /**
65
+ * Проп для обработки ошибки при загрузке файла неразрешенного типа
66
+ */
67
+ onInvalidFileType?: (fileName: string) => void;
56
68
  };
57
69
  export type TUploadValue = {
58
70
  value: TFileItem[];