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.
- package/dist/{ProgressBar-C0dC7o7N.js → ProgressBar-DEFs1tWq.js} +3 -3
- package/dist/assets/ListPhotos.css +1 -1
- package/dist/components/Drawer/Drawer.js +15 -15
- package/dist/components/InputPassword/InputPassword.js +28 -26
- package/dist/components/ListPhotos/ListPhotos.js +12 -12
- package/dist/components/OtpInput/OtpInput.js +21 -15
- package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/components/SelectSearch/SelectSearch.js +531 -503
- package/dist/components/SelectSearch/types.d.ts +2 -0
- package/dist/components/Skeleton/SkeletonBrick/SkeletonBrick.js +14 -13
- package/dist/components/Skeleton/SkeletonCircle/SkeletonCircle.js +2 -1
- package/dist/components/Skeleton/SkeletonText/SkeletonText.js +26 -17
- package/dist/components/Slider/Slider.js +8 -1
- package/dist/components/Steps/Steps.js +10 -9
- package/dist/components/TextArea/TextArea.js +23 -23
- package/dist/components/Toasts/ProgressBar.js +1 -1
- package/dist/components/Toasts/Toast.js +1 -1
- package/dist/components/Toasts/ToastList.js +20 -19
- package/dist/components/Toasts/ToastsProvider.js +1 -1
- package/dist/components/UniversalUploader/UniversalUploader.d.ts +7 -2
- package/dist/components/UniversalUploader/UniversalUploader.js +65 -43
- package/dist/components/UniversalUploader/types.d.ts +2 -9
- package/dist/components/Uploader/Uploader.d.ts +13 -0
- package/dist/components/Uploader/Uploader.js +45 -39
- 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,7 +1,8 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { forwardRef as
|
3
|
-
import { Icon as
|
4
|
-
import { Button as
|
1
|
+
import { jsxs as n, jsx as a, Fragment as U } from "react/jsx-runtime";
|
2
|
+
import { forwardRef as V, useRef as m, useId as z } from "react";
|
3
|
+
import { Icon as A } from "../../icons/Icon.js";
|
4
|
+
import { Button as B } from "../Button/Button.js";
|
5
|
+
import { EButtonVariantDefault as C } from "../Button/constants.js";
|
5
6
|
import '../../assets/Uploader.css';const p = {
|
6
7
|
"upload-file-wrapper": "_upload-file-wrapper_bplvw_2",
|
7
8
|
"upload-text": "_upload-text_bplvw_25",
|
@@ -20,42 +21,45 @@ import '../../assets/Uploader.css';const p = {
|
|
20
21
|
xls: "application/excel",
|
21
22
|
txt: "text/plain",
|
22
23
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
23
|
-
},
|
24
|
+
}, S = [
|
24
25
|
"jpeg",
|
25
26
|
"jpg",
|
26
27
|
"png",
|
27
28
|
"tiff",
|
28
29
|
"gif",
|
29
30
|
"heic"
|
30
|
-
],
|
31
|
-
let
|
32
|
-
return () => (
|
33
|
-
},
|
34
|
-
(
|
31
|
+
], M = () => {
|
32
|
+
let i = 0;
|
33
|
+
return () => (i = (i + 1) % Number.MAX_SAFE_INTEGER, i);
|
34
|
+
}, k = M(), q = V(
|
35
|
+
(i, g) => {
|
35
36
|
const {
|
36
|
-
filesType:
|
37
|
+
filesType: o = S,
|
37
38
|
onChangeValue: x,
|
38
39
|
arrayName: h,
|
39
40
|
maxSize: r = 15,
|
40
41
|
maxFiles: b,
|
41
42
|
isDisabled: s,
|
42
|
-
titleUploader: w = "Или перетащите сюда"
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
},
|
43
|
+
titleUploader: w = "Или перетащите сюда",
|
44
|
+
buttonText: y = "Выберите файлы",
|
45
|
+
showOnlyUploadButton: _ = !1,
|
46
|
+
uploadButtonVariant: j = C.SecondaryAsphalt
|
47
|
+
} = i, c = m(null), l = m(null), d = z(), v = (e) => {
|
48
|
+
var t;
|
49
|
+
return e.type ? e.type : ((t = e.name.split(".").pop()) == null ? void 0 : t.toLowerCase()) === "heic" ? "image/heic" : "";
|
50
|
+
}, I = (e) => {
|
47
51
|
if (e.target.files && e.target.files[0]) {
|
48
|
-
const f = Array.from(e.target.files).filter((
|
49
|
-
const
|
50
|
-
return
|
51
|
-
}).slice(0, b).map((
|
52
|
+
const f = Array.from(e.target.files).filter((t) => {
|
53
|
+
const T = v(t), E = o.map((R) => u[R]).includes(T), F = t.size / 1024 ** 2 <= r;
|
54
|
+
return E && F;
|
55
|
+
}).slice(0, b).map((t) => ({ file: t, id: k() }));
|
52
56
|
x({ arrayName: h, value: f }), l.current && (l.current.value = "");
|
53
57
|
}
|
54
|
-
},
|
58
|
+
}, N = () => {
|
55
59
|
var e;
|
56
60
|
(e = c.current) == null || e.click();
|
57
61
|
};
|
58
|
-
return /* @__PURE__ */
|
62
|
+
return /* @__PURE__ */ n("div", { className: p["upload-file-wrapper"], ref: g, children: [
|
59
63
|
/* @__PURE__ */ a(
|
60
64
|
"input",
|
61
65
|
{
|
@@ -65,38 +69,40 @@ import '../../assets/Uploader.css';const p = {
|
|
65
69
|
"aria-label": "Upload",
|
66
70
|
name: "image[]",
|
67
71
|
multiple: !0,
|
68
|
-
onChange:
|
72
|
+
onChange: I,
|
69
73
|
title: "",
|
70
74
|
id: d,
|
71
|
-
accept:
|
75
|
+
accept: o.map((e) => u[e]).join(),
|
72
76
|
disabled: s
|
73
77
|
}
|
74
78
|
),
|
75
|
-
/* @__PURE__ */
|
79
|
+
/* @__PURE__ */ n("label", { htmlFor: d, ref: c, children: [
|
76
80
|
/* @__PURE__ */ a(
|
77
|
-
|
81
|
+
B,
|
78
82
|
{
|
79
83
|
size: "m",
|
80
|
-
variant:
|
81
|
-
leftIcon: /* @__PURE__ */ a(
|
82
|
-
onClick:
|
84
|
+
variant: j,
|
85
|
+
leftIcon: /* @__PURE__ */ a(A, { iconName: "UnionIcon16px" }),
|
86
|
+
onClick: N,
|
83
87
|
disabled: s,
|
84
|
-
children:
|
88
|
+
children: y
|
85
89
|
}
|
86
90
|
),
|
87
|
-
/* @__PURE__ */
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
91
|
+
!_ && /* @__PURE__ */ n(U, { children: [
|
92
|
+
/* @__PURE__ */ a("b", { children: w }),
|
93
|
+
/* @__PURE__ */ n("span", { className: p["upload-text"], children: [
|
94
|
+
"Максимальный размер одного файла – ",
|
95
|
+
r,
|
96
|
+
" Мб",
|
97
|
+
/* @__PURE__ */ a("br", {}),
|
98
|
+
"Загрузить можно файлы следующих форматов: ",
|
99
|
+
o.join(", ")
|
100
|
+
] })
|
95
101
|
] })
|
96
102
|
] })
|
97
103
|
] });
|
98
104
|
}
|
99
105
|
);
|
100
106
|
export {
|
101
|
-
|
107
|
+
q as Uploader
|
102
108
|
};
|
@@ -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
|
);
|