mimir-ui-kit 1.62.0 → 1.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Input-CqNPT8os.js +243 -0
- package/dist/components/Accordion/Accordion.d.ts +5 -0
- package/dist/components/Accordion/Accordion.js +242 -220
- package/dist/components/Accordion/AccordionItem/AccordionItem.d.ts +6 -1
- package/dist/components/Accordion/AccordionItem/AccordionItem.js +19 -8
- package/dist/components/Button/Button.d.ts +37 -0
- package/dist/components/Button/Button.js +77 -61
- package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +9 -0
- package/dist/components/CheckboxMimir/CheckboxMimir.js +90 -59
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/Drawer/Drawer.d.ts +5 -0
- package/dist/components/Drawer/Drawer.js +141 -135
- package/dist/components/GosZnak/GosZnak.d.ts +1 -1
- package/dist/components/GosZnak/GosZnak.js +88 -67
- package/dist/components/GosZnak/types.d.ts +5 -0
- package/dist/components/Image/Image.d.ts +5 -0
- package/dist/components/Image/Image.js +55 -50
- package/dist/components/Input/Input.d.ts +5 -0
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputPassword/InputPassword.d.ts +5 -0
- package/dist/components/InputPassword/InputPassword.js +80 -69
- package/dist/components/InputPhoneNumber/InputPhoneNumber.d.ts +5 -1
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +39 -32
- package/dist/components/Loader/Loader.d.ts +6 -1
- package/dist/components/Loader/Loader.js +37 -14
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +1 -1
- package/dist/components/MultiSelectSearch/utils.js +1 -1
- package/dist/components/OtpInput/OtpInput.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +9 -0
- package/dist/components/RadioGroup/RadioGroup.js +142 -129
- package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/components/SelectSearch/SelectSearch.js +299 -277
- package/dist/components/SelectSearch/types.d.ts +5 -0
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/TextArea/TextArea.d.ts +1 -1
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/TextAreaV2/TextArea.js +155 -142
- package/dist/components/TextAreaV2/types.d.ts +5 -0
- package/dist/components/UniversalUploader/UniversalUploader.d.ts +1 -0
- package/dist/components/UniversalUploader/UniversalUploader.js +92 -88
- package/dist/components/UniversalUploader/types.d.ts +5 -0
- package/dist/components/Uploader/Uploader.d.ts +7 -2
- package/dist/components/Uploader/Uploader.js +121 -90
- package/dist/components/UploaderFiles/UploaderFiles.js +88 -79
- package/dist/components/UploaderFiles/types.d.ts +5 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +5 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.js +60 -57
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/dataTestId.d.ts +1 -0
- package/dist/types/dataTestId.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/Input-DPnH8pKc.js +0 -227
|
@@ -1,55 +1,56 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { imageTypes as g } from "./constants.js";
|
|
1
|
+
import { jsxs as x, jsx as p, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { c as q } from "../../index-DIxK0V-G.js";
|
|
3
|
+
import { forwardRef as G, useState as H, useEffect as J, useMemo as K } from "react";
|
|
5
4
|
import "../Button/Button.js";
|
|
6
|
-
import { EButtonVariantDefault as
|
|
7
|
-
import { ListFiles as
|
|
8
|
-
import { EFileItemVariant as
|
|
9
|
-
import { ListPhotos as
|
|
10
|
-
import { Uploader as
|
|
11
|
-
import '../../assets/UploaderPhotos.css';const
|
|
5
|
+
import { EButtonVariantDefault as Q } from "../Button/constants.js";
|
|
6
|
+
import { ListFiles as W } from "../ListFiles/ListFiles.js";
|
|
7
|
+
import { EFileItemVariant as X } from "../ListFiles/constants.js";
|
|
8
|
+
import { ListPhotos as Y } from "../ListPhotos/ListPhotos.js";
|
|
9
|
+
import { Uploader as Z } from "../Uploader/Uploader.js";
|
|
10
|
+
import '../../assets/UploaderPhotos.css';const g = {
|
|
12
11
|
"upload-file-wrapper": "_upload-file-wrapper_1a115_2"
|
|
13
|
-
},
|
|
14
|
-
(
|
|
12
|
+
}, y = (r, d) => "file" in r && r.file instanceof File ? d.includes(r.file.type) : "type" in r && typeof r.type == "string" ? d.includes(r.type) : !1, le = G(
|
|
13
|
+
(r, d) => {
|
|
15
14
|
const {
|
|
16
|
-
type:
|
|
17
|
-
filesType:
|
|
18
|
-
arrayName:
|
|
19
|
-
maxSize:
|
|
20
|
-
onChange:
|
|
21
|
-
value:
|
|
22
|
-
maxFiles:
|
|
23
|
-
titleUploader:
|
|
24
|
-
buttonText:
|
|
25
|
-
showOnlyUploadButton:
|
|
26
|
-
uploadButtonVariant:
|
|
27
|
-
buttonSize:
|
|
28
|
-
buttonClassName:
|
|
29
|
-
variantListFiles:
|
|
30
|
-
onMaxFilesExceeded:
|
|
31
|
-
onMaxSizeExceeded:
|
|
32
|
-
onInvalidFileType:
|
|
33
|
-
loadImage:
|
|
34
|
-
isDownloadingImage:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
15
|
+
type: s,
|
|
16
|
+
filesType: a,
|
|
17
|
+
arrayName: z,
|
|
18
|
+
maxSize: P,
|
|
19
|
+
onChange: l,
|
|
20
|
+
value: f,
|
|
21
|
+
maxFiles: m,
|
|
22
|
+
titleUploader: U,
|
|
23
|
+
buttonText: b = "Выберите файлы",
|
|
24
|
+
showOnlyUploadButton: v = !1,
|
|
25
|
+
uploadButtonVariant: D = Q.SecondaryAsphalt,
|
|
26
|
+
buttonSize: E = "m",
|
|
27
|
+
buttonClassName: S,
|
|
28
|
+
variantListFiles: V = X.white,
|
|
29
|
+
onMaxFilesExceeded: L,
|
|
30
|
+
onMaxSizeExceeded: N,
|
|
31
|
+
onInvalidFileType: B,
|
|
32
|
+
loadImage: _,
|
|
33
|
+
isDownloadingImage: j,
|
|
34
|
+
dataTestIdReactMap: t,
|
|
35
|
+
accept: A
|
|
36
|
+
} = r, [n, u] = H(
|
|
37
|
+
f || []
|
|
38
|
+
), F = !!m && n.length >= m;
|
|
39
|
+
J(() => {
|
|
40
|
+
f && u(f);
|
|
41
|
+
}, [f]);
|
|
42
|
+
const C = (i) => {
|
|
43
|
+
const o = i.value.map((e) => y(e.file, a) ? new Promise((c) => {
|
|
44
|
+
const h = new FileReader();
|
|
45
|
+
h.onload = () => {
|
|
46
|
+
c({
|
|
46
47
|
id: e.id,
|
|
47
|
-
url:
|
|
48
|
+
url: h.result,
|
|
48
49
|
type: e.file.type,
|
|
49
50
|
name: e.file.name,
|
|
50
51
|
size: e.file.size
|
|
51
52
|
});
|
|
52
|
-
},
|
|
53
|
+
}, h.readAsDataURL(e.file);
|
|
53
54
|
}) : Promise.resolve({
|
|
54
55
|
id: e.id,
|
|
55
56
|
url: "",
|
|
@@ -58,62 +59,65 @@ import '../../assets/UploaderPhotos.css';const v = {
|
|
|
58
59
|
type: e.file.type
|
|
59
60
|
}));
|
|
60
61
|
Promise.all(o).then((e) => {
|
|
61
|
-
|
|
62
|
+
u((c) => [...c, ...e]), l == null || l({ type: "add", data: i.value });
|
|
62
63
|
});
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
}, { photos:
|
|
66
|
-
const
|
|
67
|
-
return
|
|
68
|
-
}, [
|
|
69
|
-
return /* @__PURE__ */
|
|
64
|
+
}, w = (i) => {
|
|
65
|
+
u((o) => o.filter((e) => e.id !== i)), l == null || l({ type: "delete", data: i });
|
|
66
|
+
}, { photos: I, files: O } = K(() => {
|
|
67
|
+
const i = () => n.filter((e) => !y(e, a)), o = () => n.filter((e) => y(e, a));
|
|
68
|
+
return s === "all" ? { files: i(), photos: o() } : s === "files" ? { photos: [], files: i() } : s === "photos" ? { files: [], photos: o() } : { files: [], photos: [] };
|
|
69
|
+
}, [n, a, s]);
|
|
70
|
+
return /* @__PURE__ */ x(
|
|
70
71
|
"div",
|
|
71
72
|
{
|
|
72
73
|
"data-testid": "universal-uploader",
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
"data-testid-react": t == null ? void 0 : t.wrapper,
|
|
75
|
+
className: q(
|
|
76
|
+
g["upload-file-wrapper"],
|
|
77
|
+
F && g.disabled
|
|
76
78
|
),
|
|
77
79
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
80
|
+
/* @__PURE__ */ p(
|
|
81
|
+
Z,
|
|
80
82
|
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
83
|
+
dataTestIdReactMap: { wrapper: t == null ? void 0 : t.uploader },
|
|
84
|
+
filesType: a,
|
|
85
|
+
arrayName: z,
|
|
86
|
+
maxSize: P,
|
|
87
|
+
onChangeValue: C,
|
|
88
|
+
ref: d,
|
|
89
|
+
maxFiles: m && m - n.length,
|
|
90
|
+
isDisabled: F,
|
|
91
|
+
titleUploader: U,
|
|
92
|
+
showOnlyUploadButton: v,
|
|
93
|
+
buttonText: b,
|
|
94
|
+
uploadButtonVariant: D,
|
|
95
|
+
buttonSize: E,
|
|
96
|
+
buttonClassName: S,
|
|
97
|
+
onMaxFilesExceeded: L,
|
|
98
|
+
onMaxSizeExceeded: N,
|
|
99
|
+
onInvalidFileType: B,
|
|
100
|
+
accept: A
|
|
97
101
|
}
|
|
98
102
|
),
|
|
99
|
-
!
|
|
100
|
-
(
|
|
101
|
-
|
|
103
|
+
!v && /* @__PURE__ */ x(k, { children: [
|
|
104
|
+
(s === "files" || s === "all") && /* @__PURE__ */ p("div", { "data-testid-react": t == null ? void 0 : t.listFiles, children: /* @__PURE__ */ p(
|
|
105
|
+
W,
|
|
102
106
|
{
|
|
103
|
-
value:
|
|
104
|
-
onChange: (
|
|
105
|
-
variant:
|
|
107
|
+
value: O,
|
|
108
|
+
onChange: (i) => w(i.deleteId),
|
|
109
|
+
variant: V
|
|
106
110
|
}
|
|
107
|
-
),
|
|
108
|
-
(
|
|
109
|
-
|
|
111
|
+
) }),
|
|
112
|
+
(s === "photos" || s === "all") && /* @__PURE__ */ p("div", { "data-testid-react": t == null ? void 0 : t.listPhotos, children: /* @__PURE__ */ p(
|
|
113
|
+
Y,
|
|
110
114
|
{
|
|
111
|
-
value:
|
|
112
|
-
onChange: (
|
|
113
|
-
loadImage:
|
|
114
|
-
isDownloadingImage:
|
|
115
|
+
value: I,
|
|
116
|
+
onChange: (i) => w(i.deleteId),
|
|
117
|
+
loadImage: _,
|
|
118
|
+
isDownloadingImage: j
|
|
115
119
|
}
|
|
116
|
-
)
|
|
120
|
+
) })
|
|
117
121
|
] })
|
|
118
122
|
]
|
|
119
123
|
}
|
|
@@ -121,5 +125,5 @@ import '../../assets/UploaderPhotos.css';const v = {
|
|
|
121
125
|
}
|
|
122
126
|
);
|
|
123
127
|
export {
|
|
124
|
-
|
|
128
|
+
le as UniversalUploader
|
|
125
129
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TDataTestIdReactMap } from '../../types';
|
|
1
2
|
import { EFileItemVariant } from '../ListFiles';
|
|
2
3
|
import { TFilesDetail } from '../ListFiles/ListFiles';
|
|
3
4
|
import { TPhotosDetail } from '../ListPhotos/ListPhotos';
|
|
@@ -8,6 +9,10 @@ export type TUniversalUploader = Omit<TUploader, 'onChangeValue'> & {
|
|
|
8
9
|
onChange: (j: TOnChangeUpdate) => void;
|
|
9
10
|
value?: TFilesDetail[] | TPhotosDetail[];
|
|
10
11
|
variantListFiles?: EFileItemVariant | `${EFileItemVariant}`;
|
|
12
|
+
/**
|
|
13
|
+
* Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
|
|
14
|
+
*/
|
|
15
|
+
dataTestIdReactMap?: TDataTestIdReactMap<'wrapper' | 'uploader' | 'listFiles' | 'listPhotos'>;
|
|
11
16
|
/**
|
|
12
17
|
* Callback функция для загрузки изображения
|
|
13
18
|
* Принимает src в качестве аргумента и возвращает Promise с URL изображения
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TDataTestIdReactMap } from '../../types';
|
|
3
3
|
import { EButtonSize } from '../Button';
|
|
4
4
|
import { TButtonDefaultFormProps } from '../Button/types';
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ export type TUploader = {
|
|
|
8
8
|
* Массив разрешенных типов файлов для настройки валидации
|
|
9
9
|
* 'jpeg' | 'jpg' | 'png' | 'tiff' | 'gif' | 'heic' | 'doc' | 'xls' | 'pdf' | 'docx' | 'txt' | 'xlsx'
|
|
10
10
|
*/
|
|
11
|
-
filesType:
|
|
11
|
+
filesType: string[];
|
|
12
12
|
/**
|
|
13
13
|
* Наименование передаваемого массива файлов
|
|
14
14
|
*/
|
|
@@ -65,6 +65,11 @@ export type TUploader = {
|
|
|
65
65
|
* Проп для обработки ошибки при загрузке файла неразрешенного типа
|
|
66
66
|
*/
|
|
67
67
|
onInvalidFileType?: (fileName: string) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
|
|
70
|
+
*/
|
|
71
|
+
dataTestIdReactMap?: TDataTestIdReactMap<'wrapper' | 'input' | 'label' | 'button' | 'buttonIcon' | 'title' | 'description'>;
|
|
72
|
+
accept?: Record<string, string>;
|
|
68
73
|
};
|
|
69
74
|
export type TUploadValue = {
|
|
70
75
|
value: TFileItem[];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { EButtonVariantDefault as
|
|
6
|
-
import '../../assets/Uploader.css';const
|
|
1
|
+
import { jsxs as r, jsx as l, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as G, useRef as O, useId as I } from "react";
|
|
3
|
+
import { Icon as P } from "../../icons/Icon.js";
|
|
4
|
+
import { Button as X } from "../Button/Button.js";
|
|
5
|
+
import { EButtonVariantDefault as Y } from "../Button/constants.js";
|
|
6
|
+
import '../../assets/Uploader.css';const m = {
|
|
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"
|
|
10
|
-
},
|
|
10
|
+
}, $ = {
|
|
11
11
|
jpeg: "image/jpeg",
|
|
12
12
|
jpg: "image/jpg",
|
|
13
13
|
png: "image/png",
|
|
@@ -21,96 +21,127 @@ import '../../assets/Uploader.css';const c = {
|
|
|
21
21
|
xls: "application/excel",
|
|
22
22
|
txt: "text/plain",
|
|
23
23
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"gif",
|
|
30
|
-
"heic"
|
|
31
|
-
], X = () => {
|
|
32
|
-
let i = 0;
|
|
33
|
-
return () => (i = (i + 1) % Number.MAX_SAFE_INTEGER, i);
|
|
34
|
-
}, q = X(), W = R(
|
|
35
|
-
(i, v) => {
|
|
24
|
+
}, q = ["jpeg", "jpg", "png", "tiff", "gif", "heic"], H = () => {
|
|
25
|
+
let n = 0;
|
|
26
|
+
return () => (n = (n + 1) % Number.MAX_SAFE_INTEGER, n);
|
|
27
|
+
}, J = H(), R = G(
|
|
28
|
+
(n, v) => {
|
|
36
29
|
const {
|
|
37
|
-
filesType:
|
|
38
|
-
onChangeValue:
|
|
30
|
+
filesType: a = q,
|
|
31
|
+
onChangeValue: y,
|
|
39
32
|
arrayName: j,
|
|
40
|
-
maxSize:
|
|
33
|
+
maxSize: u = 15,
|
|
41
34
|
maxFiles: p,
|
|
42
35
|
isDisabled: f,
|
|
43
|
-
titleUploader:
|
|
44
|
-
buttonText:
|
|
45
|
-
showOnlyUploadButton:
|
|
46
|
-
uploadButtonVariant:
|
|
47
|
-
buttonSize:
|
|
48
|
-
buttonClassName:
|
|
49
|
-
onMaxFilesExceeded:
|
|
50
|
-
onMaxSizeExceeded:
|
|
51
|
-
onInvalidFileType:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
_({ arrayName: j, value: U }), (s = e.target) != null && s.value && (e.target.value = "");
|
|
36
|
+
titleUploader: d = "Или перетащите сюда",
|
|
37
|
+
buttonText: N = "Выберите файлы",
|
|
38
|
+
showOnlyUploadButton: E = !1,
|
|
39
|
+
uploadButtonVariant: S = Y.SecondaryAsphalt,
|
|
40
|
+
buttonSize: F = "m",
|
|
41
|
+
buttonClassName: z,
|
|
42
|
+
onMaxFilesExceeded: s,
|
|
43
|
+
onMaxSizeExceeded: g,
|
|
44
|
+
onInvalidFileType: x,
|
|
45
|
+
dataTestIdReactMap: e,
|
|
46
|
+
accept: U = $
|
|
47
|
+
} = n, b = O(null), h = I(), A = (i) => {
|
|
48
|
+
var o;
|
|
49
|
+
if (i.type) return i.type;
|
|
50
|
+
switch ((o = i.name.split(".").pop()) == null ? void 0 : o.toLowerCase()) {
|
|
51
|
+
case "heic":
|
|
52
|
+
return "image/heic";
|
|
53
|
+
case "msg":
|
|
54
|
+
return "application/vnd.ms-outlook";
|
|
55
|
+
default:
|
|
56
|
+
return "";
|
|
65
57
|
}
|
|
66
|
-
},
|
|
67
|
-
var
|
|
68
|
-
(
|
|
58
|
+
}, B = (i) => {
|
|
59
|
+
var c;
|
|
60
|
+
if (i.target.files && i.target.files[0]) {
|
|
61
|
+
const o = Array.from(i.target.files);
|
|
62
|
+
p && o.length > p && (s == null || s());
|
|
63
|
+
const V = o.filter((t) => {
|
|
64
|
+
const k = A(t), w = a.map((D) => U[D]).includes(k), _ = t.size / 1024 ** 2 <= u;
|
|
65
|
+
return !w && x && x(t.name), !_ && g && g(t.name), w && _;
|
|
66
|
+
}).slice(0, p).map((t) => ({ file: t, id: J() }));
|
|
67
|
+
y({ arrayName: j, value: V }), (c = i.target) != null && c.value && (i.target.value = "");
|
|
68
|
+
}
|
|
69
|
+
}, C = () => {
|
|
70
|
+
var i;
|
|
71
|
+
(i = b.current) == null || i.click();
|
|
69
72
|
};
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
73
|
+
return /* @__PURE__ */ r(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
"data-testid-react": e == null ? void 0 : e.wrapper,
|
|
77
|
+
className: m["upload-file-wrapper"],
|
|
78
|
+
ref: v,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ l(
|
|
81
|
+
"input",
|
|
82
|
+
{
|
|
83
|
+
"data-testid-react": e == null ? void 0 : e.input,
|
|
84
|
+
type: "file",
|
|
85
|
+
className: m["upload-file-input"],
|
|
86
|
+
"aria-label": "Upload",
|
|
87
|
+
name: "image[]",
|
|
88
|
+
multiple: !0,
|
|
89
|
+
onChange: B,
|
|
90
|
+
title: "",
|
|
91
|
+
id: h,
|
|
92
|
+
accept: a.map((i) => `.${i}`).join(", "),
|
|
93
|
+
disabled: f
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ r(
|
|
97
|
+
"label",
|
|
98
|
+
{
|
|
99
|
+
"data-testid-react": e == null ? void 0 : e.label,
|
|
100
|
+
htmlFor: h,
|
|
101
|
+
ref: b,
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ l(
|
|
104
|
+
X,
|
|
105
|
+
{
|
|
106
|
+
dataTestIdReactMap: {
|
|
107
|
+
button: e == null ? void 0 : e.button,
|
|
108
|
+
isIconButton: e == null ? void 0 : e.buttonIcon
|
|
109
|
+
},
|
|
110
|
+
size: F,
|
|
111
|
+
variant: S,
|
|
112
|
+
leftIcon: /* @__PURE__ */ l(P, { iconName: "UnionIcon16px" }),
|
|
113
|
+
onClick: C,
|
|
114
|
+
disabled: f,
|
|
115
|
+
className: z,
|
|
116
|
+
children: N
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
!E && /* @__PURE__ */ r(L, { children: [
|
|
120
|
+
d && /* @__PURE__ */ l("b", { "data-testid-react": e == null ? void 0 : e.title, children: d }),
|
|
121
|
+
/* @__PURE__ */ r(
|
|
122
|
+
"span",
|
|
123
|
+
{
|
|
124
|
+
"data-testid-react": e == null ? void 0 : e.description,
|
|
125
|
+
className: m["upload-text"],
|
|
126
|
+
children: [
|
|
127
|
+
"Максимальный размер одного файла – ",
|
|
128
|
+
u,
|
|
129
|
+
" Мб",
|
|
130
|
+
/* @__PURE__ */ l("br", {}),
|
|
131
|
+
"Загрузить можно файлы следующих форматов: ",
|
|
132
|
+
a.join(", ")
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] })
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
);
|
|
112
143
|
}
|
|
113
144
|
);
|
|
114
145
|
export {
|
|
115
|
-
|
|
146
|
+
R as Uploader
|
|
116
147
|
};
|