mimir-ui-kit 1.34.6 → 1.34.8

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/{ProgressBar-C0dC7o7N.js → ProgressBar-DEFs1tWq.js} +3 -3
  2. package/dist/assets/ListPhotos.css +1 -1
  3. package/dist/components/Drawer/Drawer.js +15 -15
  4. package/dist/components/InputPassword/InputPassword.js +28 -26
  5. package/dist/components/ListPhotos/ListPhotos.js +12 -12
  6. package/dist/components/OtpInput/OtpInput.js +21 -15
  7. package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
  8. package/dist/components/SelectSearch/SelectSearch.js +531 -503
  9. package/dist/components/SelectSearch/types.d.ts +2 -0
  10. package/dist/components/Skeleton/SkeletonBrick/SkeletonBrick.js +14 -13
  11. package/dist/components/Skeleton/SkeletonCircle/SkeletonCircle.js +2 -1
  12. package/dist/components/Skeleton/SkeletonText/SkeletonText.js +26 -17
  13. package/dist/components/Slider/Slider.js +8 -1
  14. package/dist/components/Steps/Steps.js +10 -9
  15. package/dist/components/TextArea/TextArea.js +23 -23
  16. package/dist/components/Toasts/ProgressBar.js +1 -1
  17. package/dist/components/Toasts/Toast.js +1 -1
  18. package/dist/components/Toasts/ToastList.js +20 -19
  19. package/dist/components/Toasts/ToastsProvider.js +1 -1
  20. package/dist/components/UniversalUploader/UniversalUploader.d.ts +7 -2
  21. package/dist/components/UniversalUploader/UniversalUploader.js +65 -43
  22. package/dist/components/UniversalUploader/types.d.ts +2 -9
  23. package/dist/components/Uploader/Uploader.d.ts +13 -0
  24. package/dist/components/Uploader/Uploader.js +45 -39
  25. package/dist/components/UploaderFiles/UploaderFiles.d.ts +4 -0
  26. package/dist/components/UploaderFiles/UploaderFiles.js +17 -16
  27. package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +1 -0
  28. package/dist/components/UploaderPhotos/UploaderPhotos.js +17 -15
  29. package/package.json +1 -1
@@ -50,4 +50,6 @@ export type TSelectSearchProps = Pick<TInputProps, 'withClearButton' | 'variant'
50
50
  disabled?: boolean;
51
51
  /** Пропсы для инпута поиска опций */
52
52
  searchProps?: Pick<TInputProps, 'numbersOnly' | 'maxLength'>;
53
+ /** Отключает инпут, но позволяет открывать меню*/
54
+ disableInput?: boolean;
53
55
  };
@@ -2,31 +2,32 @@ import { jsx as l } from "react/jsx-runtime";
2
2
  import { c as n } from "../../../index-DIxK0V-G.js";
3
3
  import { ESkeletonVariant as c } from "../constants.js";
4
4
  import { v as r } from "../../../variant.module-BXn4N1h0.js";
5
- const d = ({
6
- className: o,
7
- width: t = "100%",
5
+ const v = ({
6
+ className: t,
7
+ width: o = "100%",
8
8
  height: s,
9
9
  borderRadius: a = "var(--mimir-control-radius)",
10
- style: m,
11
- variant: e = c.WHITE,
12
- ...i
10
+ style: e,
11
+ variant: i = c.WHITE,
12
+ ...m
13
13
  }) => /* @__PURE__ */ l(
14
14
  "div",
15
15
  {
16
- ...i,
16
+ ...m,
17
17
  className: n(
18
18
  r.skeleton,
19
- r[e],
20
- o
19
+ r[i],
20
+ t
21
21
  ),
22
22
  style: {
23
- ...m,
24
- width: t,
23
+ ...e,
24
+ width: o,
25
25
  height: s,
26
26
  borderRadius: a
27
- }
27
+ },
28
+ "data-testid": "skeleton-brick"
28
29
  }
29
30
  );
30
31
  export {
31
- d as SkeletonBrick
32
+ v as SkeletonBrick
32
33
  };
@@ -20,7 +20,8 @@ import '../../../assets/SkeletonCircle.css';const i = {
20
20
  style: {
21
21
  width: e,
22
22
  height: e
23
- }
23
+ },
24
+ "data-testid": "skeleton-circle"
24
25
  }
25
26
  );
26
27
  export {
@@ -1,12 +1,12 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as s } from "react/jsx-runtime";
2
2
  import { c } from "../../../index-DIxK0V-G.js";
3
- import { memo as m } from "react";
4
- import { ESkeletonVariant as i } from "../constants.js";
5
- import { SkeletonBrick as f } from "../SkeletonBrick/SkeletonBrick.js";
6
- import '../../../assets/SkeletonText.css';const k = "_row_1ks6f_9", s = {
3
+ import { memo as i } from "react";
4
+ import { ESkeletonVariant as m } from "../constants.js";
5
+ import { SkeletonBrick as k } from "../SkeletonBrick/SkeletonBrick.js";
6
+ import '../../../assets/SkeletonText.css';const d = "_row_1ks6f_9", o = {
7
7
  "skeleton-text": "_skeleton-text_1ks6f_2",
8
- row: k
9
- }, u = (t, e) => {
8
+ row: d
9
+ }, f = (t, e) => {
10
10
  if (t === e - 1)
11
11
  return "50%";
12
12
  switch (t % 3) {
@@ -19,23 +19,32 @@ import '../../../assets/SkeletonText.css';const k = "_row_1ks6f_9", s = {
19
19
  default:
20
20
  return "100%";
21
21
  }
22
- }, N = m(
22
+ }, N = i(
23
23
  ({
24
24
  rows: t = 1,
25
25
  height: e = 20,
26
- variant: n = i.WHITE,
26
+ variant: n = m.WHITE,
27
27
  ...a
28
28
  }) => {
29
29
  const { className: l } = a;
30
- return /* @__PURE__ */ o("div", { className: c(s["skeleton-text"], l), children: new Array(t).fill(null).map((p, r) => /* @__PURE__ */ o("div", { className: s.row, children: /* @__PURE__ */ o(
31
- f,
30
+ return /* @__PURE__ */ s(
31
+ "div",
32
32
  {
33
- variant: n,
34
- height: e,
35
- width: u(r, t),
36
- style: { animationDelay: `${r * 0.125}s` }
37
- }
38
- ) }, r)) }, t);
33
+ className: c(o["skeleton-text"], l),
34
+ "data-testid": "skeleton-text",
35
+ children: new Array(t).fill(null).map((u, r) => /* @__PURE__ */ s("div", { className: o.row, children: /* @__PURE__ */ s(
36
+ k,
37
+ {
38
+ variant: n,
39
+ height: e,
40
+ width: f(r, t),
41
+ style: { animationDelay: `${r * 0.125}s` },
42
+ "data-testid": "skeleton-brick"
43
+ }
44
+ ) }, r))
45
+ },
46
+ t
47
+ );
39
48
  }
40
49
  );
41
50
  export {
@@ -2919,7 +2919,14 @@ const Li = "_swiper_1ji90_3", Oi = "_slide_1ji90_9", _i = "_link_1ji90_16", zi =
2919
2919
  );
2920
2920
  return /* @__PURE__ */ R(Qe, { buttons: s });
2921
2921
  }), $i = Ae(
2922
- Te((t, e) => /* @__PURE__ */ R("div", { className: $.progress, children: /* @__PURE__ */ R("div", { ref: e, className: $["progress-bar"] }) }))
2922
+ Te((t, e) => /* @__PURE__ */ R("div", { className: $.progress, children: /* @__PURE__ */ R(
2923
+ "div",
2924
+ {
2925
+ ref: e,
2926
+ className: $["progress-bar"],
2927
+ "data-testid": "progress-bar"
2928
+ }
2929
+ ) }))
2923
2930
  );
2924
2931
  function qi({
2925
2932
  images: t,
@@ -21,9 +21,9 @@ import '../../assets/Steps.css';const ee = "_container_1cq8d_2", oe = "_step_1cq
21
21
  stepClassName: Z,
22
22
  quantity: z,
23
23
  needZeroValue: O = !0,
24
- current: _ = A,
24
+ current: d = A,
25
25
  editable: q = !1,
26
- size: d = K.M,
26
+ size: _ = K.M,
27
27
  onClick: f,
28
28
  customSize: p,
29
29
  resizable: i,
@@ -36,10 +36,10 @@ import '../../assets/Steps.css';const ee = "_container_1cq8d_2", oe = "_step_1cq
36
36
  setParentColor: u,
37
37
  classNameIconStep: $,
38
38
  ...w
39
- } = T, B = G(), [t, m] = N(_), [a, L] = N(null), b = J(null), [I, h] = N(null);
39
+ } = T, B = G(), [t, m] = N(d), [a, L] = N(null), b = J(null), [I, h] = N(null);
40
40
  C(() => {
41
- m(_);
42
- }, [_]), C(() => {
41
+ m(d);
42
+ }, [d]), C(() => {
43
43
  if (c) {
44
44
  const o = r.find((e) => e.to >= (t || 0));
45
45
  o && h(o.color);
@@ -79,7 +79,7 @@ import '../../assets/Steps.css';const ee = "_container_1cq8d_2", oe = "_step_1cq
79
79
  height: p == null ? void 0 : p.height
80
80
  },
81
81
  id: `${B}${R}${e}`,
82
- className: y(l.step, l[d], Z, {
82
+ className: y(l.step, l[_], Z, {
83
83
  [l.editable]: q && !M,
84
84
  [l.resizable]: i,
85
85
  [l.disabled]: M || !q && e + 1 > t
@@ -90,9 +90,10 @@ import '../../assets/Steps.css';const ee = "_container_1cq8d_2", oe = "_step_1cq
90
90
  children: !i && /* @__PURE__ */ E(
91
91
  x,
92
92
  {
93
- iconName: Q[d].icon,
94
- ...U[d],
95
- className: $
93
+ iconName: Q[_].icon,
94
+ ...U[_],
95
+ className: $,
96
+ "data-testid": "step-icon"
96
97
  }
97
98
  )
98
99
  },
@@ -1,5 +1,5 @@
1
1
  import { jsxs as V, jsx as n } from "react/jsx-runtime";
2
- import { c as d } from "../../index-DIxK0V-G.js";
2
+ import { c as i } from "../../index-DIxK0V-G.js";
3
3
  import { memo as K, forwardRef as Q, useState as B, useRef as U, useEffect as X } from "react";
4
4
  import { useAutoResizeTextArea as Y } from "./hooks.js";
5
5
  import { useMergeRefs as Z } from "../../hooks/useMergeRefs/useMergeRefs.js";
@@ -29,7 +29,7 @@ import '../../assets/TextArea.css';const te = "_textarea_1n8kz_2", se = "_label_
29
29
  $,
30
30
  {
31
31
  style: {
32
- "--icon-size": d({
32
+ "--icon-size": i({
33
33
  "16px": _,
34
34
  "24px": b
35
35
  })
@@ -54,11 +54,11 @@ import '../../assets/TextArea.css';const te = "_textarea_1n8kz_2", se = "_label_
54
54
  variant: q = ae.DefaultGray,
55
55
  autofocus: k,
56
56
  readonly: s,
57
- status: I,
58
- id: R,
57
+ status: R,
58
+ id: T,
59
59
  onFocus: N,
60
60
  onBlur: z,
61
- label: i,
61
+ label: d,
62
62
  onChange: c,
63
63
  withClearButton: j,
64
64
  disabled: u,
@@ -71,26 +71,26 @@ import '../../assets/TextArea.css';const te = "_textarea_1n8kz_2", se = "_label_
71
71
  X(() => {
72
72
  k && C(!0);
73
73
  }, [k]);
74
- const T = Y(r.current), M = (l) => {
74
+ const I = Y(r.current), M = (l) => {
75
75
  const y = l.currentTarget.value;
76
76
  z == null || z(l), C(!1), v(!!y);
77
77
  }, O = (l) => {
78
78
  s || (C(!0), N == null || N(l));
79
79
  }, P = () => {
80
- r != null && r.current && (r.current.value = "", r.current.focus(), v(!1), T(), c == null || c({
80
+ r != null && r.current && (r.current.value = "", r.current.focus(), v(!1), I(), c == null || c({
81
81
  target: { value: "" }
82
82
  }));
83
83
  }, S = (l) => {
84
84
  const y = l.target.value;
85
- v(!!y), T(), c == null || c(l);
85
+ v(!!y), I(), c == null || c(l);
86
86
  }, x = F(L), A = F(E), W = {
87
87
  [e.readonly]: u || s,
88
88
  [e.focused]: f,
89
89
  [e.disabled]: u || s,
90
90
  [e["has-left-slot"]]: !!x,
91
91
  [e["has-right-slot"]]: !!A,
92
- [a["has-label"]]: !!i
93
- }, w = f || h || !!o, H = d(
92
+ [a["has-label"]]: !!d
93
+ }, w = f || h || !!o, H = i(
94
94
  e.label,
95
95
  a.label,
96
96
  {
@@ -100,21 +100,21 @@ import '../../assets/TextArea.css';const te = "_textarea_1n8kz_2", se = "_label_
100
100
  },
101
101
  _,
102
102
  e[m]
103
- ), J = d(
103
+ ), J = i(
104
104
  a.textarea,
105
105
  e.input,
106
106
  W,
107
107
  _,
108
- [e[q], a[m], e[m], e[I ?? ""]]
108
+ [e[q], a[m], e[m], e[R ?? ""]]
109
109
  );
110
110
  return /* @__PURE__ */ V(
111
111
  "div",
112
112
  {
113
- className: d(
113
+ className: i(
114
114
  e["input-wrapper"],
115
115
  a["textarea-wrapper"],
116
116
  e[q],
117
- e[I ?? ""],
117
+ e[R ?? ""],
118
118
  a[m],
119
119
  e[m],
120
120
  {
@@ -124,8 +124,8 @@ import '../../assets/TextArea.css';const te = "_textarea_1n8kz_2", se = "_label_
124
124
  b
125
125
  ),
126
126
  children: [
127
- i && /* @__PURE__ */ V("label", { htmlFor: R, className: H, children: [
128
- i,
127
+ d && /* @__PURE__ */ V("label", { htmlFor: T, className: H, children: [
128
+ d,
129
129
  g && (h || f) && /* @__PURE__ */ n(
130
130
  "span",
131
131
  {
@@ -137,11 +137,11 @@ import '../../assets/TextArea.css';const te = "_textarea_1n8kz_2", se = "_label_
137
137
  x && /* @__PURE__ */ n(
138
138
  "span",
139
139
  {
140
- className: d(e["left-slot"], {
140
+ className: i(e["left-slot"], {
141
141
  [e.focused]: w,
142
- [e["has-label"]]: !!i
142
+ [e["has-label"]]: !!d
143
143
  }),
144
- "data-testId": "left-addon",
144
+ "data-testid": "left-addon",
145
145
  children: x
146
146
  }
147
147
  ),
@@ -149,7 +149,7 @@ import '../../assets/TextArea.css';const te = "_textarea_1n8kz_2", se = "_label_
149
149
  "textarea",
150
150
  {
151
151
  ref: G,
152
- id: R,
152
+ id: T,
153
153
  className: J,
154
154
  onFocus: O,
155
155
  onBlur: M,
@@ -163,11 +163,11 @@ import '../../assets/TextArea.css';const te = "_textarea_1n8kz_2", se = "_label_
163
163
  A && /* @__PURE__ */ n(
164
164
  "span",
165
165
  {
166
- className: d(e["right-slot"], {
166
+ className: i(e["right-slot"], {
167
167
  [e.focused]: w,
168
- [e["has-label"]]: !!i
168
+ [e["has-label"]]: !!d
169
169
  }),
170
- "data-testId": "right-addon",
170
+ "data-testid": "right-addon",
171
171
  children: A
172
172
  }
173
173
  ),
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "../../index-DIxK0V-G.js";
3
3
  import "react";
4
4
  import "./constants.js";
5
- import { P as s } from "../../ProgressBar-C0dC7o7N.js";
5
+ import { P as s } from "../../ProgressBar-DEFs1tWq.js";
6
6
  export {
7
7
  s as ProgressBar
8
8
  };
@@ -2,7 +2,7 @@ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
2
  import { c as A } from "../../index-DIxK0V-G.js";
3
3
  import { memo as x, useRef as E } from "react";
4
4
  import { ANIMATION_VARIABLES_MAP as I, EToastPosition as _, EToastVariant as B, DEFAULT_TOAST_DURATION as D } from "./constants.js";
5
- import { c as r, P as O } from "../../ProgressBar-C0dC7o7N.js";
5
+ import { c as r, P as O } from "../../ProgressBar-DEFs1tWq.js";
6
6
  import { useTimer as P } from "../../hooks/useTimer/index.js";
7
7
  import { Button as w } from "../Button/Button.js";
8
8
  const M = x(
@@ -1,32 +1,33 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
- import { c as f } from "../../index-DIxK0V-G.js";
3
- import { memo as T, useRef as e, useCallback as a, useEffect as u } from "react";
4
- import { EToastPosition as c } from "./constants.js";
5
- import { c as n } from "../../ProgressBar-C0dC7o7N.js";
6
- import { Toast as p } from "./Toast.js";
7
- const O = T(
8
- ({ toasts: s, position: r = c.TOP_RIGHT, onToastRemove: l }) => {
9
- const t = e(null), i = a(
2
+ import { c as a } from "../../index-DIxK0V-G.js";
3
+ import { memo as e, useRef as f, useCallback as T, useEffect as u } from "react";
4
+ import { EToastPosition as i } from "./constants.js";
5
+ import { c as l } from "../../ProgressBar-DEFs1tWq.js";
6
+ import { Toast as d } from "./Toast.js";
7
+ const O = e(
8
+ ({ toasts: r, position: s = i.TOP_RIGHT, onToastRemove: n }) => {
9
+ const t = f(null), c = T(
10
10
  (o) => {
11
11
  [
12
- c.TOP_LEFT,
13
- c.TOP_RIGHT
14
- ].includes(r) ? o == null || o.scrollTo(0, o.scrollHeight) : o == null || o.scrollTo(0, 0);
12
+ i.TOP_LEFT,
13
+ i.TOP_RIGHT
14
+ ].includes(s) ? o == null || o.scrollTo(0, o.scrollHeight) : o == null || o.scrollTo(0, 0);
15
15
  },
16
- [r]
16
+ [s]
17
17
  );
18
18
  return u(() => {
19
- t.current && i(t.current);
20
- }, [i, s]), s.length ? /* @__PURE__ */ m(
19
+ t.current && c(t.current);
20
+ }, [c, r]), r.length ? /* @__PURE__ */ m(
21
21
  "div",
22
22
  {
23
23
  ref: t,
24
- className: f(n["toast-list"], n[r]),
25
- children: s.map((o) => /* @__PURE__ */ m(
26
- p,
24
+ className: a(l["toast-list"], l[s]),
25
+ "data-testid": "toast-list",
26
+ children: r.map((o) => /* @__PURE__ */ m(
27
+ d,
27
28
  {
28
- position: r,
29
- onToastRemove: l,
29
+ position: s,
30
+ onToastRemove: n,
30
31
  ...o
31
32
  },
32
33
  o.id
@@ -3,7 +3,7 @@ import { useReducer as u, useCallback as m, useMemo as l } from "react";
3
3
  import { EToastVariant as o } from "./constants.js";
4
4
  import { ToastContext as E } from "./hooks.js";
5
5
  import { reducer as A, initialState as C, actionCreators as c } from "./store.js";
6
- import { c as L } from "../../ProgressBar-C0dC7o7N.js";
6
+ import { c as L } from "../../ProgressBar-DEFs1tWq.js";
7
7
  import { ToastList as S } from "./ToastList.js";
8
8
  const O = ({ children: d }) => {
9
9
  const [i, r] = u(A, C), a = m((t) => {
@@ -1,3 +1,8 @@
1
- import { TUniversalUploader } from './types';
1
+ import { TFilesDetail } from '../ListFiles/ListFiles';
2
+ import { TPhotosDetail } from '../ListPhotos/ListPhotos';
2
3
 
3
- export declare const UniversalUploader: import('react').ForwardRefExoticComponent<TUniversalUploader & import('react').RefAttributes<HTMLDivElement>>;
4
+ export declare const UniversalUploader: import('react').ForwardRefExoticComponent<Omit<import('../Uploader/Uploader').TUploader, "onChangeValue"> & {
5
+ type: "files" | "photos" | "all";
6
+ onChange: (j: import('./types').TOnChangeUpdate) => void;
7
+ value?: TFilesDetail[] | TPhotosDetail[];
8
+ } & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,31 +1,36 @@
1
- import { jsxs as I, jsx as f } from "react/jsx-runtime";
2
- import { c as L } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as R, useState as b, useEffect as j, useMemo as N } from "react";
4
- import { imageTypes as c } from "./constants.js";
1
+ import { jsxs as y, jsx as p, Fragment as j } from "react/jsx-runtime";
2
+ import { c as B } from "../../index-DIxK0V-G.js";
3
+ import { forwardRef as D, useState as N, useEffect as S, useMemo as T } from "react";
4
+ import { imageTypes as h } from "./constants.js";
5
+ import "../Button/Button.js";
6
+ import { EButtonVariantDefault as V } from "../Button/constants.js";
5
7
  import { ListFiles as _ } from "../ListFiles/ListFiles.js";
6
- import { ListPhotos as D } from "../ListPhotos/ListPhotos.js";
8
+ import { ListPhotos as E } from "../ListPhotos/ListPhotos.js";
7
9
  import { Uploader as M } from "../Uploader/Uploader.js";
8
- import '../../assets/UploaderPhotos.css';const y = {
10
+ import '../../assets/UploaderPhotos.css';const g = {
9
11
  "upload-file-wrapper": "_upload-file-wrapper_1a115_2"
10
- }, n = (i) => "file" in i && i.file instanceof File ? c.includes(i.file.type) : "type" in i && typeof i.type == "string" ? c.includes(i.type) : !1, q = R(
11
- (i, h) => {
12
+ }, f = (i) => "file" in i && i.file instanceof File ? h.includes(i.file.type) : "type" in i && typeof i.type == "string" ? h.includes(i.type) : !1, K = D(
13
+ (i, v) => {
12
14
  const {
13
15
  type: s,
14
- filesType: v,
15
- arrayName: g,
16
- maxSize: x,
17
- onChange: r,
18
- value: l,
16
+ filesType: x,
17
+ arrayName: F,
18
+ maxSize: U,
19
+ onChange: o,
20
+ value: a,
19
21
  maxFiles: m,
20
- titleUploader: F
21
- } = i, [a, p] = b(
22
- l || []
23
- ), d = a.length >= m;
24
- j(() => {
25
- l && p(l);
26
- }, [l]);
27
- const U = (t) => {
28
- const o = t.value.map((e) => n(e.file) ? {
22
+ titleUploader: w,
23
+ buttonText: z = "Выберите файлы",
24
+ showOnlyUploadButton: u = !1,
25
+ uploadButtonVariant: b = V.SecondaryAsphalt
26
+ } = i, [l, n] = N(
27
+ a || []
28
+ ), d = l.length >= m;
29
+ S(() => {
30
+ a && n(a);
31
+ }, [a]);
32
+ const I = (t) => {
33
+ const r = t.value.map((e) => f(e.file) ? {
29
34
  id: e.id,
30
35
  url: URL.createObjectURL(e.file),
31
36
  type: e.file.type,
@@ -38,41 +43,58 @@ import '../../assets/UploaderPhotos.css';const y = {
38
43
  name: e.file.name,
39
44
  type: e.file.type
40
45
  });
41
- p((e) => [...e, ...o]), r == null || r({ type: "add", data: t.value });
42
- }, u = (t) => {
43
- p((o) => o.filter((e) => e.id !== t)), r == null || r({ type: "delete", data: t });
44
- }, { photos: w, files: z } = N(() => {
45
- const t = () => a.filter((e) => !n(e)), o = () => a.filter(n);
46
- return s === "all" ? { files: t(), photos: o() } : s === "files" ? { photos: [], files: t() } : s === "photos" ? { files: [], photos: o() } : { files: [], photos: [] };
47
- }, [a, s]);
48
- return /* @__PURE__ */ I(
46
+ n((e) => [...e, ...r]), o == null || o({ type: "add", data: t.value });
47
+ }, c = (t) => {
48
+ n((r) => r.filter((e) => e.id !== t)), o == null || o({ type: "delete", data: t });
49
+ }, { photos: L, files: R } = T(() => {
50
+ const t = () => l.filter((e) => !f(e)), r = () => l.filter(f);
51
+ return s === "all" ? { files: t(), photos: r() } : s === "files" ? { photos: [], files: t() } : s === "photos" ? { files: [], photos: r() } : { files: [], photos: [] };
52
+ }, [l, s]);
53
+ return /* @__PURE__ */ y(
49
54
  "div",
50
55
  {
51
- className: L(
52
- y["upload-file-wrapper"],
53
- d && y.disabled
56
+ className: B(
57
+ g["upload-file-wrapper"],
58
+ d && g.disabled
54
59
  ),
55
60
  children: [
56
- /* @__PURE__ */ f(
61
+ /* @__PURE__ */ p(
57
62
  M,
58
63
  {
59
- filesType: v,
60
- arrayName: g,
61
- maxSize: x,
62
- onChangeValue: U,
63
- ref: h,
64
+ filesType: x,
65
+ arrayName: F,
66
+ maxSize: U,
67
+ onChangeValue: I,
68
+ ref: v,
64
69
  maxFiles: m,
65
70
  isDisabled: d,
66
- titleUploader: F
71
+ titleUploader: w,
72
+ showOnlyUploadButton: u,
73
+ buttonText: z,
74
+ uploadButtonVariant: b
67
75
  }
68
76
  ),
69
- (s === "files" || s === "all") && /* @__PURE__ */ f(_, { value: z, onChange: (t) => u(t.deleteId) }),
70
- (s === "photos" || s === "all") && /* @__PURE__ */ f(D, { value: w, onChange: (t) => u(t.deleteId) })
77
+ !u && /* @__PURE__ */ y(j, { children: [
78
+ (s === "files" || s === "all") && /* @__PURE__ */ p(
79
+ _,
80
+ {
81
+ value: R,
82
+ onChange: (t) => c(t.deleteId)
83
+ }
84
+ ),
85
+ (s === "photos" || s === "all") && /* @__PURE__ */ p(
86
+ E,
87
+ {
88
+ value: L,
89
+ onChange: (t) => c(t.deleteId)
90
+ }
91
+ )
92
+ ] })
71
93
  ]
72
94
  }
73
95
  );
74
96
  }
75
97
  );
76
98
  export {
77
- q as UniversalUploader
99
+ K as UniversalUploader
78
100
  };
@@ -1,18 +1,11 @@
1
1
  import { TFilesDetail } from '../ListFiles/ListFiles';
2
2
  import { TPhotosDetail } from '../ListPhotos/ListPhotos';
3
- import { TFileItem } from '../Uploader';
4
- import { imageTypesArr } from '../Uploader/constants';
3
+ import { TFileItem, TUploader } from '../Uploader';
5
4
 
6
- export type TUniversalUploader = {
5
+ export type TUniversalUploader = Omit<TUploader, 'onChangeValue'> & {
7
6
  type: 'files' | 'photos' | 'all';
8
- filesType: imageTypesArr[];
9
- arrayName: string;
10
- maxSize: number;
11
7
  onChange: (j: TOnChangeUpdate) => void;
12
8
  value?: TFilesDetail[] | TPhotosDetail[];
13
- maxFiles: number;
14
- titleUploader?: string;
15
- disabled?: boolean;
16
9
  };
17
10
  export type TOnChangeUpdate = {
18
11
  type: string;
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { imageTypesArr } from './constants';
3
+ import { TButtonDefaultFormProps } from '../Button/types';
3
4
 
4
5
  export type TUploader = {
5
6
  /**
@@ -31,6 +32,18 @@ export type TUploader = {
31
32
  * Тайтл загрузки файлов
32
33
  */
33
34
  titleUploader?: string;
35
+ /**
36
+ * Отображать ли только кнопку загрузки файла
37
+ */
38
+ showOnlyUploadButton?: boolean;
39
+ /**
40
+ * Текст внутри кнопки загрузки файла
41
+ */
42
+ buttonText?: string;
43
+ /**
44
+ * Вариант кнопки загрузки файла
45
+ */
46
+ uploadButtonVariant?: TButtonDefaultFormProps['variant'];
34
47
  };
35
48
  export type TUploadValue = {
36
49
  value: TFileItem[];