mimir-ui-kit 1.34.7 → 1.34.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/ListPhotos.css +1 -1
- package/dist/components/ListPhotos/ListPhotos.js +12 -12
- package/dist/components/UploaderFiles/UploaderFiles.d.ts +4 -0
- package/dist/components/UploaderFiles/UploaderFiles.js +17 -16
- package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +1 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.js +17 -15
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
._list-
|
1
|
+
._list-photos_167sp_2{display:flex;gap:var(--mimir-space-m);overflow-x:auto;padding-top:var(--mimir-space-m)}._list-photos_167sp_2::-webkit-scrollbar{display:none}._list-photos_167sp_2 ._list-photos-item_167sp_11{position:relative;flex-shrink:0;width:var(--mimir-space-4xxl);height:var(--mimir-space-4xxl);overflow:hidden;border-radius:var(--mimir-control-radius);box-shadow:0 0 #16172705,0 2px 4px #16172705,0 6px 6px #16172705,0 15px 9px #16172703}._list-photos_167sp_2 ._list-photos-image_167sp_20{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}._list-photos_167sp_2 ._delete-button_167sp_25{position:absolute;top:var(--mimir-space-2xs);right:var(--mimir-space-2xs)}
|
@@ -1,32 +1,32 @@
|
|
1
1
|
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
2
2
|
import { useState as n, useEffect as _ } from "react";
|
3
|
-
import { Button as
|
3
|
+
import { Button as d } from "../Button/Button.js";
|
4
4
|
import '../../assets/ListPhotos.css';const o = {
|
5
|
-
"list-photos": "_list-
|
6
|
-
"list-photos-item": "_list-photos-
|
7
|
-
"list-photos-image": "_list-photos-
|
8
|
-
"delete-button": "_delete-
|
5
|
+
"list-photos": "_list-photos_167sp_2",
|
6
|
+
"list-photos-item": "_list-photos-item_167sp_11",
|
7
|
+
"list-photos-image": "_list-photos-image_167sp_20",
|
8
|
+
"delete-button": "_delete-button_167sp_25"
|
9
9
|
};
|
10
10
|
function N({ value: i, onChange: s }) {
|
11
|
-
const [l,
|
11
|
+
const [l, m] = n(i);
|
12
12
|
_(() => {
|
13
|
-
|
13
|
+
m(i);
|
14
14
|
}, [i]);
|
15
|
-
const
|
16
|
-
const
|
17
|
-
|
15
|
+
const p = async (t) => {
|
16
|
+
const c = [...l.filter((r) => r.id !== t)];
|
17
|
+
m(c), s == null || s({ deleteId: t, list: c });
|
18
18
|
};
|
19
19
|
return /* @__PURE__ */ e("ul", { className: o["list-photos"], children: l.map((t) => /* @__PURE__ */ a("li", { className: o["list-photos-item"], children: [
|
20
20
|
/* @__PURE__ */ e("img", { className: o["list-photos-image"], src: t.url, alt: "" }),
|
21
21
|
s && /* @__PURE__ */ e(
|
22
|
-
|
22
|
+
d,
|
23
23
|
{
|
24
24
|
isIconButton: !0,
|
25
25
|
iconName: "Close12px",
|
26
26
|
size: "m-s",
|
27
27
|
variant: "secondary-gray",
|
28
28
|
className: o["delete-button"],
|
29
|
-
onClick: () =>
|
29
|
+
onClick: () => p(t.id)
|
30
30
|
}
|
31
31
|
)
|
32
32
|
] }, t.id)) });
|
@@ -1,19 +1,19 @@
|
|
1
1
|
import { jsxs as N, jsx as m } from "react/jsx-runtime";
|
2
2
|
import { c as _ } from "../../index-DIxK0V-G.js";
|
3
|
-
import { forwardRef as
|
4
|
-
import { ListFiles as
|
5
|
-
import { Uploader as
|
3
|
+
import { forwardRef as h, useState as D, useEffect as I } from "react";
|
4
|
+
import { ListFiles as R } from "../ListFiles/ListFiles.js";
|
5
|
+
import { Uploader as S } from "../Uploader/Uploader.js";
|
6
6
|
import '../../assets/UploaderPhotos.css';const c = {
|
7
7
|
"upload-file-wrapper": "_upload-file-wrapper_1a115_2"
|
8
|
-
},
|
8
|
+
}, V = h(
|
9
9
|
(n, u) => {
|
10
|
-
const { filesType: x, arrayName: y, maxSize: F, onChange: a, value:
|
11
|
-
|
12
|
-
|
13
|
-
}, [
|
14
|
-
const
|
10
|
+
const { filesType: x, arrayName: y, maxSize: F, onChange: a, value: t, maxFiles: o, buttonText: v } = n, [i, r] = D(t || []), d = i.length >= o;
|
11
|
+
I(() => {
|
12
|
+
t && r(t);
|
13
|
+
}, [t]);
|
14
|
+
const w = (s) => {
|
15
15
|
const z = [
|
16
|
-
...
|
16
|
+
...i,
|
17
17
|
...s.value.map((e) => {
|
18
18
|
var p, l, f;
|
19
19
|
return {
|
@@ -26,7 +26,7 @@ import '../../assets/UploaderPhotos.css';const c = {
|
|
26
26
|
})
|
27
27
|
];
|
28
28
|
r(z), a == null || a({ type: "add", data: s.value });
|
29
|
-
},
|
29
|
+
}, b = (s) => {
|
30
30
|
r(s.list), s.deleteId && (a == null || a({ type: "delete", data: s.deleteId }));
|
31
31
|
};
|
32
32
|
return /* @__PURE__ */ N(
|
@@ -38,23 +38,24 @@ import '../../assets/UploaderPhotos.css';const c = {
|
|
38
38
|
),
|
39
39
|
children: [
|
40
40
|
/* @__PURE__ */ m(
|
41
|
-
|
41
|
+
S,
|
42
42
|
{
|
43
43
|
filesType: x,
|
44
44
|
arrayName: y,
|
45
45
|
maxSize: F,
|
46
|
-
onChangeValue:
|
46
|
+
onChangeValue: w,
|
47
47
|
ref: u,
|
48
48
|
maxFiles: o,
|
49
|
-
isDisabled: d
|
49
|
+
isDisabled: d,
|
50
|
+
buttonText: v
|
50
51
|
}
|
51
52
|
),
|
52
|
-
/* @__PURE__ */ m(
|
53
|
+
/* @__PURE__ */ m(R, { value: i, onChange: b })
|
53
54
|
]
|
54
55
|
}
|
55
56
|
);
|
56
57
|
}
|
57
58
|
);
|
58
59
|
export {
|
59
|
-
|
60
|
+
V as UploaderFiles
|
60
61
|
};
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as b, jsx as d } from "react/jsx-runtime";
|
2
2
|
import { c as y } from "../../index-DIxK0V-G.js";
|
3
|
-
import { forwardRef as P, useState as R, useEffect as
|
4
|
-
import { ListPhotos as
|
5
|
-
import { Uploader as
|
3
|
+
import { forwardRef as P, useState as R, useEffect as L } from "react";
|
4
|
+
import { ListPhotos as N } from "../ListPhotos/ListPhotos.js";
|
5
|
+
import { Uploader as _ } from "../Uploader/Uploader.js";
|
6
6
|
import '../../assets/UploaderPhotos.css';const p = {
|
7
7
|
"upload-file-wrapper": "_upload-file-wrapper_1a115_2"
|
8
8
|
}, g = P(
|
@@ -14,24 +14,25 @@ import '../../assets/UploaderPhotos.css';const p = {
|
|
14
14
|
onChange: e,
|
15
15
|
value: a,
|
16
16
|
maxFiles: l,
|
17
|
-
titleUploader: h
|
17
|
+
titleUploader: h,
|
18
|
+
buttonText: x = "Выберите файлы"
|
18
19
|
} = c, [o, s] = R(a || []), r = o.length >= l;
|
19
|
-
|
20
|
+
L(() => {
|
20
21
|
a && s(a);
|
21
22
|
}, [a]);
|
22
|
-
const
|
23
|
-
const
|
23
|
+
const v = (t) => {
|
24
|
+
const U = [
|
24
25
|
...o,
|
25
26
|
...t.value.map((i) => ({
|
26
27
|
url: URL.createObjectURL(i.file),
|
27
28
|
id: i.id
|
28
29
|
}))
|
29
30
|
];
|
30
|
-
s(
|
31
|
-
},
|
31
|
+
s(U), e == null || e({ type: "add", data: t.value });
|
32
|
+
}, w = (t) => {
|
32
33
|
s(t.list), t.deleteId && (e == null || e({ type: "delete", data: t.deleteId }));
|
33
34
|
};
|
34
|
-
return /* @__PURE__ */
|
35
|
+
return /* @__PURE__ */ b(
|
35
36
|
"div",
|
36
37
|
{
|
37
38
|
className: y(
|
@@ -40,19 +41,20 @@ import '../../assets/UploaderPhotos.css';const p = {
|
|
40
41
|
),
|
41
42
|
children: [
|
42
43
|
/* @__PURE__ */ d(
|
43
|
-
|
44
|
+
_,
|
44
45
|
{
|
45
46
|
filesType: m,
|
46
47
|
arrayName: n,
|
47
48
|
maxSize: u,
|
48
|
-
onChangeValue:
|
49
|
+
onChangeValue: v,
|
49
50
|
ref: f,
|
50
51
|
maxFiles: l,
|
51
52
|
isDisabled: r,
|
52
|
-
titleUploader: h
|
53
|
+
titleUploader: h,
|
54
|
+
buttonText: x
|
53
55
|
}
|
54
56
|
),
|
55
|
-
!!o.length && /* @__PURE__ */ d(
|
57
|
+
!!o.length && /* @__PURE__ */ d(N, { value: o, onChange: w })
|
56
58
|
]
|
57
59
|
}
|
58
60
|
);
|