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.
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/{combobox-CVtJDVoZ.js → combobox-DgSZTriw.js} +254 -251
- package/dist/components/Accordion/Accordion.js +3 -3
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/DatePicker/hooks.js +12 -12
- package/dist/components/Dropdown/Dropdown.js +32 -32
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +18 -18
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.js +116 -116
- package/dist/components/Switcher/Switcher.js +4 -4
- package/dist/components/TabTrail/TabTrail.js +4 -4
- package/dist/components/UniversalUploader/UniversalUploader.js +56 -50
- package/dist/components/Uploader/Uploader.d.ts +12 -0
- package/dist/components/Uploader/Uploader.js +64 -59
- package/dist/components/UploaderFiles/UploaderFiles.d.ts +12 -0
- package/dist/components/UploaderFiles/UploaderFiles.js +45 -39
- package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +12 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.js +40 -34
- package/dist/{field-FJ34aSs4.js → field-C1kt7aNM.js} +2 -2
- package/dist/{focus-management-DE4t_lW3.js → focus-management-BtPpk3D1.js} +1 -1
- package/dist/{hidden-DbgtYPOH.js → hidden-PvGXrYUY.js} +1 -1
- package/dist/{keyboard-B0lm_zyn.js → keyboard-mgWkd2Vh.js} +114 -111
- package/dist/{label-y3ANLTNC.js → label-D4GFpe5F.js} +2 -2
- package/dist/open-closed-D2VjDhAN.js +86 -0
- package/dist/portal-DPqg52FR.js +1946 -0
- package/dist/{use-active-press-86hajhdd.js → use-active-press-CqLGIFz7.js} +1 -1
- package/package.json +1 -1
- package/dist/open-closed-CdldUPoq.js +0 -86
- package/dist/portal-WDFNoIMz.js +0 -1908
@@ -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 o, jsx as n, Fragment as A } from "react/jsx-runtime";
|
2
|
+
import { forwardRef as B, useRef as _, useId as k } from "react";
|
3
|
+
import { Icon as D } from "../../icons/Icon.js";
|
4
|
+
import { Button as G } from "../Button/Button.js";
|
5
|
+
import { EButtonVariantDefault as O } from "../Button/constants.js";
|
6
|
+
import '../../assets/Uploader.css';const s = {
|
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
|
+
}, j = {
|
11
11
|
jpeg: "image/jpeg",
|
12
12
|
jpg: "image/jpg",
|
13
13
|
png: "image/png",
|
@@ -21,85 +21,90 @@ import '../../assets/Uploader.css';const p = {
|
|
21
21
|
xls: "application/excel",
|
22
22
|
txt: "text/plain",
|
23
23
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
24
|
-
},
|
24
|
+
}, L = [
|
25
25
|
"jpeg",
|
26
26
|
"jpg",
|
27
27
|
"png",
|
28
28
|
"tiff",
|
29
29
|
"gif",
|
30
30
|
"heic"
|
31
|
-
],
|
31
|
+
], X = () => {
|
32
32
|
let i = 0;
|
33
33
|
return () => (i = (i + 1) % Number.MAX_SAFE_INTEGER, i);
|
34
|
-
},
|
35
|
-
(i,
|
34
|
+
}, q = X(), W = B(
|
35
|
+
(i, v) => {
|
36
36
|
const {
|
37
|
-
filesType:
|
38
|
-
onChangeValue:
|
39
|
-
arrayName:
|
40
|
-
maxSize:
|
41
|
-
maxFiles:
|
42
|
-
isDisabled:
|
43
|
-
titleUploader:
|
44
|
-
buttonText:
|
45
|
-
showOnlyUploadButton:
|
46
|
-
uploadButtonVariant:
|
47
|
-
buttonSize:
|
48
|
-
buttonClassName:
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
},
|
37
|
+
filesType: l = L,
|
38
|
+
onChangeValue: I,
|
39
|
+
arrayName: N,
|
40
|
+
maxSize: c = 15,
|
41
|
+
maxFiles: d,
|
42
|
+
isDisabled: f,
|
43
|
+
titleUploader: m = "Или перетащите сюда",
|
44
|
+
buttonText: T = "Выберите файлы",
|
45
|
+
showOnlyUploadButton: E = !1,
|
46
|
+
uploadButtonVariant: F = O.SecondaryAsphalt,
|
47
|
+
buttonSize: z = "m",
|
48
|
+
buttonClassName: S,
|
49
|
+
onMaxFilesExceeded: u,
|
50
|
+
onMaxSizeExceeded: g,
|
51
|
+
onInvalidFileType: x
|
52
|
+
} = i, h = _(null), p = _(null), b = k(), C = (e) => {
|
53
|
+
var a;
|
54
|
+
return e.type ? e.type : ((a = e.name.split(".").pop()) == null ? void 0 : a.toLowerCase()) === "heic" ? "image/heic" : "";
|
55
|
+
}, M = (e) => {
|
53
56
|
if (e.target.files && e.target.files[0]) {
|
54
|
-
const
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
57
|
+
const r = Array.from(e.target.files);
|
58
|
+
r.length > d && u && u();
|
59
|
+
const a = r.filter((t) => {
|
60
|
+
const U = C(t), w = l.map((V) => j[V]).includes(U), y = t.size / 1024 ** 2 <= c;
|
61
|
+
return !w && x && x(t.name), !y && g && g(t.name), w && y;
|
62
|
+
}).slice(0, d).map((t) => ({ file: t, id: q() }));
|
63
|
+
I({ arrayName: N, value: a }), p.current && (p.current.value = "");
|
59
64
|
}
|
60
|
-
},
|
65
|
+
}, R = () => {
|
61
66
|
var e;
|
62
|
-
(e =
|
67
|
+
(e = h.current) == null || e.click();
|
63
68
|
};
|
64
|
-
return /* @__PURE__ */
|
65
|
-
/* @__PURE__ */
|
69
|
+
return /* @__PURE__ */ o("div", { className: s["upload-file-wrapper"], ref: v, children: [
|
70
|
+
/* @__PURE__ */ n(
|
66
71
|
"input",
|
67
72
|
{
|
68
|
-
ref:
|
73
|
+
ref: p,
|
69
74
|
type: "file",
|
70
|
-
className:
|
75
|
+
className: s["upload-file-input"],
|
71
76
|
"aria-label": "Upload",
|
72
77
|
name: "image[]",
|
73
78
|
multiple: !0,
|
74
|
-
onChange:
|
79
|
+
onChange: M,
|
75
80
|
title: "",
|
76
|
-
id:
|
77
|
-
accept:
|
78
|
-
disabled:
|
81
|
+
id: b,
|
82
|
+
accept: l.map((e) => j[e]).join(),
|
83
|
+
disabled: f
|
79
84
|
}
|
80
85
|
),
|
81
|
-
/* @__PURE__ */
|
82
|
-
/* @__PURE__ */
|
83
|
-
|
86
|
+
/* @__PURE__ */ o("label", { htmlFor: b, ref: h, children: [
|
87
|
+
/* @__PURE__ */ n(
|
88
|
+
G,
|
84
89
|
{
|
85
|
-
size:
|
86
|
-
variant:
|
87
|
-
leftIcon: /* @__PURE__ */
|
88
|
-
onClick:
|
89
|
-
disabled:
|
90
|
-
className:
|
91
|
-
children:
|
90
|
+
size: z,
|
91
|
+
variant: F,
|
92
|
+
leftIcon: /* @__PURE__ */ n(D, { iconName: "UnionIcon16px" }),
|
93
|
+
onClick: R,
|
94
|
+
disabled: f,
|
95
|
+
className: S,
|
96
|
+
children: T
|
92
97
|
}
|
93
98
|
),
|
94
|
-
!
|
95
|
-
|
96
|
-
/* @__PURE__ */
|
99
|
+
!E && /* @__PURE__ */ o(A, { children: [
|
100
|
+
m && /* @__PURE__ */ n("b", { children: m }),
|
101
|
+
/* @__PURE__ */ o("span", { className: s["upload-text"], children: [
|
97
102
|
"Максимальный размер одного файла – ",
|
98
|
-
|
103
|
+
c,
|
99
104
|
" Мб",
|
100
|
-
/* @__PURE__ */
|
105
|
+
/* @__PURE__ */ n("br", {}),
|
101
106
|
"Загрузить можно файлы следующих форматов: ",
|
102
|
-
|
107
|
+
l.join(", ")
|
103
108
|
] })
|
104
109
|
] })
|
105
110
|
] })
|
@@ -107,5 +112,5 @@ import '../../assets/Uploader.css';const p = {
|
|
107
112
|
}
|
108
113
|
);
|
109
114
|
export {
|
110
|
-
|
115
|
+
W as Uploader
|
111
116
|
};
|
@@ -38,6 +38,18 @@ export type TUploaderFiles = {
|
|
38
38
|
* необязательное поле, имя формы загрузчика на случай, если на странице несколько форм
|
39
39
|
*/
|
40
40
|
name?: string;
|
41
|
+
/**
|
42
|
+
* Проп для обработки ошибки при превышении максимального количества файлов
|
43
|
+
*/
|
44
|
+
onMaxFilesExceeded?: () => void;
|
45
|
+
/**
|
46
|
+
* Проп для обработки ошибки при превышении максимального размера файла
|
47
|
+
*/
|
48
|
+
onMaxSizeExceeded?: (fileName: string) => void;
|
49
|
+
/**
|
50
|
+
* Проп для обработки ошибки при загрузке файла неразрешенного типа
|
51
|
+
*/
|
52
|
+
onInvalidFileType?: (fileName: string) => void;
|
41
53
|
};
|
42
54
|
export type TOnChangeFilesUpdate = {
|
43
55
|
type: string;
|
@@ -1,70 +1,76 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import { forwardRef as
|
4
|
-
import { ListFiles as
|
5
|
-
import { Uploader as
|
6
|
-
import '../../assets/UploaderPhotos.css';const
|
1
|
+
import { jsxs as S, jsx as n } from "react/jsx-runtime";
|
2
|
+
import { c as T } from "../../index-DIxK0V-G.js";
|
3
|
+
import { forwardRef as _, useState as h, useEffect as D } from "react";
|
4
|
+
import { ListFiles as R } from "../ListFiles/ListFiles.js";
|
5
|
+
import { Uploader as U } from "../Uploader/Uploader.js";
|
6
|
+
import '../../assets/UploaderPhotos.css';const c = {
|
7
7
|
"upload-file-wrapper": "_upload-file-wrapper_1a115_2"
|
8
|
-
},
|
8
|
+
}, q = _(
|
9
9
|
(u, x) => {
|
10
10
|
const {
|
11
|
-
filesType:
|
12
|
-
arrayName:
|
11
|
+
filesType: F,
|
12
|
+
arrayName: y,
|
13
13
|
maxSize: v,
|
14
14
|
onChange: a,
|
15
|
-
value:
|
16
|
-
name:
|
17
|
-
maxFiles:
|
18
|
-
buttonText: w
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}, [t]);
|
23
|
-
|
15
|
+
value: s,
|
16
|
+
name: d,
|
17
|
+
maxFiles: r,
|
18
|
+
buttonText: w,
|
19
|
+
onMaxFilesExceeded: z,
|
20
|
+
onMaxSizeExceeded: b,
|
21
|
+
onInvalidFileType: E
|
22
|
+
} = u, [t, o] = h(s || []), l = t.length >= r;
|
23
|
+
D(() => {
|
24
|
+
s && o(s);
|
25
|
+
}, [s]);
|
26
|
+
const I = (i) => {
|
24
27
|
const N = [
|
25
|
-
...
|
26
|
-
...
|
27
|
-
var
|
28
|
+
...t,
|
29
|
+
...i.value.map((e) => {
|
30
|
+
var p, f, m;
|
28
31
|
return {
|
29
32
|
id: e.id,
|
30
33
|
url: "",
|
31
|
-
size: (
|
34
|
+
size: (p = e == null ? void 0 : e.file) == null ? void 0 : p.size,
|
32
35
|
name: (f = e == null ? void 0 : e.file) == null ? void 0 : f.name,
|
33
36
|
type: (m = e == null ? void 0 : e.file) == null ? void 0 : m.type
|
34
37
|
};
|
35
38
|
})
|
36
39
|
];
|
37
|
-
|
38
|
-
},
|
39
|
-
|
40
|
+
o(N), a == null || a({ type: "add", data: i.value, name: d });
|
41
|
+
}, M = (i) => {
|
42
|
+
o(i.list), i.deleteId && (a == null || a({ type: "delete", data: i.deleteId, name: d }));
|
40
43
|
};
|
41
|
-
return /* @__PURE__ */
|
44
|
+
return /* @__PURE__ */ S(
|
42
45
|
"div",
|
43
46
|
{
|
44
|
-
className:
|
45
|
-
|
46
|
-
|
47
|
+
className: T(
|
48
|
+
c["upload-file-wrapper"],
|
49
|
+
l && c.disabled
|
47
50
|
),
|
48
51
|
children: [
|
49
|
-
/* @__PURE__ */
|
50
|
-
|
52
|
+
/* @__PURE__ */ n(
|
53
|
+
U,
|
51
54
|
{
|
52
|
-
filesType:
|
53
|
-
arrayName:
|
55
|
+
filesType: F,
|
56
|
+
arrayName: y,
|
54
57
|
maxSize: v,
|
55
|
-
onChangeValue:
|
58
|
+
onChangeValue: I,
|
56
59
|
ref: x,
|
57
|
-
maxFiles:
|
58
|
-
isDisabled:
|
59
|
-
buttonText: w
|
60
|
+
maxFiles: r,
|
61
|
+
isDisabled: l,
|
62
|
+
buttonText: w,
|
63
|
+
onMaxFilesExceeded: z,
|
64
|
+
onMaxSizeExceeded: b,
|
65
|
+
onInvalidFileType: E
|
60
66
|
}
|
61
67
|
),
|
62
|
-
/* @__PURE__ */
|
68
|
+
/* @__PURE__ */ n(R, { value: t, onChange: M })
|
63
69
|
]
|
64
70
|
}
|
65
71
|
);
|
66
72
|
}
|
67
73
|
);
|
68
74
|
export {
|
69
|
-
|
75
|
+
q as UploaderFiles
|
70
76
|
};
|
@@ -39,6 +39,18 @@ export type TUploaderPhotos = {
|
|
39
39
|
* необязательное поле, имя формы загрузчика на случай, если на странице несколько форм
|
40
40
|
*/
|
41
41
|
name?: string;
|
42
|
+
/**
|
43
|
+
* Проп для обработки ошибки при превышении максимального количества файлов
|
44
|
+
*/
|
45
|
+
onMaxFilesExceeded?: () => void;
|
46
|
+
/**
|
47
|
+
* Проп для обработки ошибки при превышении максимального размера файла
|
48
|
+
*/
|
49
|
+
onMaxSizeExceeded?: (fileName: string) => void;
|
50
|
+
/**
|
51
|
+
* Проп для обработки ошибки при загрузке файла неразрешенного типа
|
52
|
+
*/
|
53
|
+
onInvalidFileType?: (fileName: string) => void;
|
42
54
|
};
|
43
55
|
export type TOnChangePhotosUpdate = {
|
44
56
|
type: string;
|
@@ -1,61 +1,67 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import { forwardRef as
|
4
|
-
import { ListPhotos as
|
5
|
-
import { Uploader as
|
1
|
+
import { jsxs as R, jsx as p } from "react/jsx-runtime";
|
2
|
+
import { c as E } from "../../index-DIxK0V-G.js";
|
3
|
+
import { forwardRef as I, useState as L, useEffect as M } from "react";
|
4
|
+
import { ListPhotos as N } from "../ListPhotos/ListPhotos.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
|
-
}, j =
|
9
|
-
(
|
8
|
+
}, j = I(
|
9
|
+
(n, m) => {
|
10
10
|
const {
|
11
|
-
filesType:
|
11
|
+
filesType: f,
|
12
12
|
arrayName: u,
|
13
|
-
maxSize:
|
13
|
+
maxSize: x,
|
14
14
|
onChange: e,
|
15
15
|
value: a,
|
16
16
|
maxFiles: l,
|
17
|
-
titleUploader:
|
18
|
-
name:
|
19
|
-
buttonText: v = "Выберите файлы"
|
20
|
-
|
21
|
-
|
17
|
+
titleUploader: h,
|
18
|
+
name: i,
|
19
|
+
buttonText: v = "Выберите файлы",
|
20
|
+
onMaxFilesExceeded: w,
|
21
|
+
onMaxSizeExceeded: y,
|
22
|
+
onInvalidFileType: U
|
23
|
+
} = n, [o, s] = L(a || []), d = o.length >= l;
|
24
|
+
M(() => {
|
22
25
|
a && s(a);
|
23
26
|
}, [a]);
|
24
|
-
const
|
25
|
-
const
|
27
|
+
const b = (t) => {
|
28
|
+
const P = [
|
26
29
|
...o,
|
27
|
-
...t.value.map((
|
28
|
-
url: URL.createObjectURL(
|
29
|
-
id:
|
30
|
+
...t.value.map((r) => ({
|
31
|
+
url: URL.createObjectURL(r.file),
|
32
|
+
id: r.id
|
30
33
|
}))
|
31
34
|
];
|
32
|
-
s(
|
33
|
-
},
|
34
|
-
s(t.list), t.deleteId && (e == null || e({ type: "delete", data: t.deleteId, name:
|
35
|
+
s(P), e == null || e({ type: "add", data: t.value, name: i });
|
36
|
+
}, F = (t) => {
|
37
|
+
s(t.list), t.deleteId && (e == null || e({ type: "delete", data: t.deleteId, name: i }));
|
35
38
|
};
|
36
|
-
return /* @__PURE__ */
|
39
|
+
return /* @__PURE__ */ R(
|
37
40
|
"div",
|
38
41
|
{
|
39
|
-
className:
|
42
|
+
className: E(
|
40
43
|
c["upload-file-wrapper"],
|
41
|
-
|
44
|
+
d && c.disabled
|
42
45
|
),
|
43
46
|
children: [
|
44
47
|
/* @__PURE__ */ p(
|
45
|
-
|
48
|
+
S,
|
46
49
|
{
|
47
|
-
filesType:
|
50
|
+
filesType: f,
|
48
51
|
arrayName: u,
|
49
|
-
maxSize:
|
50
|
-
onChangeValue:
|
51
|
-
ref:
|
52
|
+
maxSize: x,
|
53
|
+
onChangeValue: b,
|
54
|
+
ref: m,
|
52
55
|
maxFiles: l,
|
53
|
-
isDisabled:
|
54
|
-
titleUploader:
|
55
|
-
buttonText: v
|
56
|
+
isDisabled: d,
|
57
|
+
titleUploader: h,
|
58
|
+
buttonText: v,
|
59
|
+
onMaxFilesExceeded: w,
|
60
|
+
onMaxSizeExceeded: y,
|
61
|
+
onInvalidFileType: U
|
56
62
|
}
|
57
63
|
),
|
58
|
-
!!o.length && /* @__PURE__ */ p(
|
64
|
+
!!o.length && /* @__PURE__ */ p(N, { value: o, onChange: F })
|
59
65
|
]
|
60
66
|
}
|
61
67
|
);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import l, { useId as u, useMemo as f } from "react";
|
2
|
-
import { z as p, U as h, a as v, l as E, f as b, W as $ } from "./label-
|
3
|
-
import { W as H, H as W } from "./keyboard-
|
2
|
+
import { z as p, U as h, a as v, l as E, f as b, W as $ } from "./label-D4GFpe5F.js";
|
3
|
+
import { W as H, H as W } from "./keyboard-mgWkd2Vh.js";
|
4
4
|
let P = "div";
|
5
5
|
function _(a, i) {
|
6
6
|
let d = `headlessui-control-${u()}`, [o, n] = p(), [m, s] = h(), c = v(), { disabled: e = c || !1, ...t } = a, r = f(() => ({ disabled: e }), [e]);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { u as N, a as v } from "./keyboard-
|
1
|
+
import { u as N, a as v } from "./keyboard-mgWkd2Vh.js";
|
2
2
|
let m = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(","), F = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
3
3
|
var h = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e[e.AutoFocus = 64] = "AutoFocus", e))(h || {}), x = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(x || {}), A = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(A || {});
|
4
4
|
function y(e = document.body) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { W as t, H as a } from "./keyboard-
|
1
|
+
import { W as t, H as a } from "./keyboard-mgWkd2Vh.js";
|
2
2
|
let l = "span";
|
3
3
|
var p = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(p || {});
|
4
4
|
function s(e, n) {
|