mimir-ui-kit 1.22.0 → 1.24.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/Drawer.css +1 -1
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/TabTrail.css +1 -1
- package/dist/components/Accordion/Accordion.d.ts +2 -0
- package/dist/components/Accordion/Accordion.js +15 -2
- package/dist/components/Drawer/Drawer.js +19 -19
- package/dist/components/SelectSearch/SelectSearch.js +27 -22
- package/dist/components/Steps/Steps.js +2 -2
- package/dist/components/Steps/constants.d.ts +11 -1
- package/dist/components/Steps/constants.js +44 -0
- package/dist/components/TabTrail/TabTrail.js +9 -9
- package/dist/components/Uploader/Uploader.d.ts +4 -0
- package/dist/components/Uploader/Uploader.js +3 -2
- package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +4 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.js +12 -4
- package/dist/components/Vote/index.d.ts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/components/12px/MessageRead12px.d.ts +4 -0
- package/dist/icons/components/12px/MessageRead12px.js +37 -0
- package/dist/icons/components/32px/PersonalManager32px.d.ts +4 -0
- package/dist/icons/components/32px/PersonalManager32px.js +112 -0
- package/dist/icons/components/StepXL.d.ts +4 -0
- package/dist/icons/components/StepXL.js +32 -0
- package/dist/icons/components/index.d.ts +3 -0
- package/dist/icons/components/index.js +543 -540
- package/dist/{index-Cxiikb7g.js → index-FDVpKRvA.js} +550 -539
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +1 -3
- package/package.json +1 -1
- package/dist/assets/ListFiles.css +0 -1
- package/dist/components/ListFiles/ListFiles.d.ts +0 -26
- package/dist/components/ListFiles/ListFiles.js +0 -42
- package/dist/components/ListFiles/constants.d.ts +0 -3
- package/dist/components/ListFiles/constants.js +0 -33
- package/dist/components/ListFiles/index.d.ts +0 -2
- package/dist/components/ListFiles/index.js +0 -4
- package/dist/components/UploaderFiles/UploaderFiles.d.ts +0 -38
- package/dist/components/UploaderFiles/UploaderFiles.js +0 -68
- package/dist/components/UploaderFiles/index.d.ts +0 -2
- package/dist/components/UploaderFiles/index.js +0 -4
- package/dist/utils/formating/FileSize.d.ts +0 -1
- package/dist/utils/formating/FileSize.js +0 -13
package/dist/utils/index.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import { default as Date } from './formating/Date';
|
2
|
-
import { default as Size } from './formating/FileSize';
|
3
2
|
import { default as Month } from './formating/Month';
|
4
3
|
import { default as Number } from './formating/Numbers';
|
5
4
|
import { default as UUIDv4 } from './UUID4';
|
@@ -9,5 +8,4 @@ export declare const formating: {
|
|
9
8
|
Month: typeof Month;
|
10
9
|
Date: typeof Date;
|
11
10
|
UUIDv4: typeof UUIDv4;
|
12
|
-
Size: typeof Size;
|
13
11
|
};
|
package/dist/utils/index.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import _Date from "./formating/Date.js";
|
2
|
-
import Size from "./formating/FileSize.js";
|
3
2
|
import Month from "./formating/Month.js";
|
4
3
|
import Numbers from "./formating/Numbers.js";
|
5
4
|
import UUIDv4 from "./UUID4.js";
|
@@ -7,8 +6,7 @@ const formating = {
|
|
7
6
|
Number: Numbers,
|
8
7
|
Month,
|
9
8
|
Date: _Date,
|
10
|
-
UUIDv4
|
11
|
-
Size
|
9
|
+
UUIDv4
|
12
10
|
};
|
13
11
|
export {
|
14
12
|
formating
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
._file-info_d2me4_2{display:flex;flex-direction:column;gap:8px;overflow:hidden}._file-info_d2me4_2 span{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:18px;text-align:left;color:#b2b2b2}._file-info_d2me4_2 ._file-info__name-wrapper_d2me4_16{display:table;table-layout:fixed;width:100%}._file-info_d2me4_2 ._file-info__name-wrapper_d2me4_16 div{font-family:Inter,sans-serif;font-size:18px;font-weight:400;line-height:24px;text-align:left;color:#000;display:table-cell;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}._file-upload-container_d2me4_34{display:flex;flex-direction:column;width:100%;padding-left:0;margin-bottom:0;gap:8px}._file-upload-container_d2me4_34 li{display:flex;justify-content:space-between;align-items:center;background:#fff;position:relative;padding:8px 16px;border-radius:6px}._file-upload-container_d2me4_34 li button{background:#f2f2f2;position:absolute;right:4px;top:4px}._file-upload-container_d2me4_34 li span{display:flex}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
export type TListFiles = {
|
2
|
-
/**
|
3
|
-
* Массив фото
|
4
|
-
*/
|
5
|
-
value: TFilesDetail[];
|
6
|
-
/**
|
7
|
-
* функция -callback, которая вызывается при изменении списка и передает обновленный список и deleteId,
|
8
|
-
*/
|
9
|
-
onChange?: (e: TFileValue) => void;
|
10
|
-
};
|
11
|
-
export type TFileItem = {
|
12
|
-
id: number;
|
13
|
-
url: string;
|
14
|
-
};
|
15
|
-
export type TFileValue = {
|
16
|
-
deleteId?: number;
|
17
|
-
list: TFilesDetail[];
|
18
|
-
};
|
19
|
-
export type TFilesDetail = {
|
20
|
-
id: number;
|
21
|
-
url: string;
|
22
|
-
name: string;
|
23
|
-
size?: number;
|
24
|
-
type?: string;
|
25
|
-
};
|
26
|
-
export declare function ListFiles({ value, onChange }: TListFiles): import("react/jsx-runtime").JSX.Element;
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
2
|
-
import { useState, useEffect } from "react";
|
3
|
-
import { formating } from "../../utils/index.js";
|
4
|
-
import { Button } from "../Button/Button.js";
|
5
|
-
import '../../assets/ListFiles.css';const cls = {
|
6
|
-
"file-info": "_file-info_d2me4_2",
|
7
|
-
"file-info__name-wrapper": "_file-info__name-wrapper_d2me4_16",
|
8
|
-
"file-upload-container": "_file-upload-container_d2me4_34"
|
9
|
-
};
|
10
|
-
function ListFiles({ value, onChange }) {
|
11
|
-
const [list, setList] = useState(value);
|
12
|
-
useEffect(() => {
|
13
|
-
setList(value);
|
14
|
-
}, [value]);
|
15
|
-
const onDelete = async (id) => {
|
16
|
-
const newList = [...list.filter((el) => el.id !== id)];
|
17
|
-
setList(newList);
|
18
|
-
onChange == null ? void 0 : onChange({ deleteId: id, list: newList });
|
19
|
-
};
|
20
|
-
return /* @__PURE__ */ jsx("ul", { className: cls["file-upload-container"], children: list.map((el, key) => /* @__PURE__ */ jsxs("li", { children: [
|
21
|
-
/* @__PURE__ */ jsxs("div", { className: cls["file-info"], children: [
|
22
|
-
(el == null ? void 0 : el.size) && /* @__PURE__ */ jsxs("span", { children: [
|
23
|
-
" ",
|
24
|
-
formating.Size(el == null ? void 0 : el.size)
|
25
|
-
] }),
|
26
|
-
/* @__PURE__ */ jsx("div", { className: cls["file-info__name-wrapper"], children: /* @__PURE__ */ jsx("div", { children: el.name }) })
|
27
|
-
] }),
|
28
|
-
/* @__PURE__ */ jsx(
|
29
|
-
Button,
|
30
|
-
{
|
31
|
-
isIconButton: true,
|
32
|
-
iconName: "Close12px",
|
33
|
-
size: "m-s",
|
34
|
-
variant: "secondary-gray",
|
35
|
-
onClick: () => onDelete(el.id)
|
36
|
-
}
|
37
|
-
)
|
38
|
-
] }, key)) });
|
39
|
-
}
|
40
|
-
export {
|
41
|
-
ListFiles
|
42
|
-
};
|
@@ -1,33 +0,0 @@
|
|
1
|
-
const photos = [
|
2
|
-
{
|
3
|
-
id: 111,
|
4
|
-
name: "ООО “КИЗ-СТРОЙ” - Свидетельство о регистрации (06.12.2003).xls",
|
5
|
-
url: "https://i.pinimg.com/736x/5a/e6/12/5ae612a7ecf50870c8f41961fefc332f.jpg",
|
6
|
-
size: 1024,
|
7
|
-
type: "image/png"
|
8
|
-
},
|
9
|
-
{
|
10
|
-
id: 112,
|
11
|
-
name: "ООО “КИЗ-СТРОЙ” - Доверенность (20.10.2005).xls",
|
12
|
-
url: "https://i1.sndcdn.com/artworks-rQAPPfrs44UvRwIz-WJkvyQ-t500x500.jpg",
|
13
|
-
size: 1024,
|
14
|
-
type: "image/png"
|
15
|
-
},
|
16
|
-
{
|
17
|
-
id: 113,
|
18
|
-
name: "Скан паспорта.pdf",
|
19
|
-
url: "https://i1.sndcdn.com/avatars-000095020320-0pmjnu-t500x500.jpg",
|
20
|
-
size: 2064,
|
21
|
-
type: "image/png"
|
22
|
-
},
|
23
|
-
{
|
24
|
-
id: 114,
|
25
|
-
name: "Прочие документы.xls",
|
26
|
-
url: "https://i1.sndcdn.com/avatars-000151937348-27m28p-t500x500.jpg",
|
27
|
-
size: 1024,
|
28
|
-
type: "image/png"
|
29
|
-
}
|
30
|
-
];
|
31
|
-
export {
|
32
|
-
photos
|
33
|
-
};
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import { TFilesDetail } from '../ListFiles/ListFiles';
|
2
|
-
import { imageTypesArr } from '../Uploader/constants';
|
3
|
-
import { TFileItem } from '../Uploader/Uploader';
|
4
|
-
|
5
|
-
export type TUploaderFiles = {
|
6
|
-
/**
|
7
|
-
* Массив разрешенных типов файлов для настройки валидации
|
8
|
-
* 'jpeg' | 'jpg' | 'png' | 'tiff' | 'gif' | 'doc' | 'xls' | 'pdf' |'docx' | 'txt'
|
9
|
-
*/
|
10
|
-
filesType: imageTypesArr[];
|
11
|
-
/**
|
12
|
-
* Наименование передаваемого массива файлов
|
13
|
-
*/
|
14
|
-
arrayName: string;
|
15
|
-
/**
|
16
|
-
* Максимальный размер файлов.
|
17
|
-
*/
|
18
|
-
maxSize: number;
|
19
|
-
/**
|
20
|
-
* Функция обратного вызова, передает параметры type и data,
|
21
|
-
* type 'add' в data передает массив файлов,
|
22
|
-
* type:'delete' в data передает id удаленного файла
|
23
|
-
*/
|
24
|
-
onChange: (j: TOnChangeFilesUpdate) => void;
|
25
|
-
/**
|
26
|
-
* Передаваемые файлы.
|
27
|
-
*/
|
28
|
-
value?: TFilesDetail[];
|
29
|
-
/**
|
30
|
-
* Максимальное количество файлов.
|
31
|
-
*/
|
32
|
-
maxFiles: number;
|
33
|
-
};
|
34
|
-
export type TOnChangeFilesUpdate = {
|
35
|
-
type: string;
|
36
|
-
data: TFileItem[] | number;
|
37
|
-
};
|
38
|
-
export declare const UploaderFiles: import('react').ForwardRefExoticComponent<TUploaderFiles & import('react').RefAttributes<HTMLDivElement>>;
|
@@ -1,68 +0,0 @@
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
-
import { c as classNames } from "../../index-CweZ_OcN.js";
|
3
|
-
import { forwardRef, useState, useEffect } from "react";
|
4
|
-
import { ListFiles } from "../ListFiles/ListFiles.js";
|
5
|
-
import { Uploader } from "../Uploader/Uploader.js";
|
6
|
-
import '../../assets/UploaderPhotos.css';const cls = {
|
7
|
-
"upload-file__wrapper": "_upload-file__wrapper_17bcu_2"
|
8
|
-
};
|
9
|
-
const UploaderFiles = forwardRef(
|
10
|
-
(props, ref) => {
|
11
|
-
const { filesType, arrayName, maxSize, onChange, value, maxFiles } = props;
|
12
|
-
const [files, setFiles] = useState(value || []);
|
13
|
-
const isMaxFilesReached = files.length >= maxFiles;
|
14
|
-
useEffect(() => {
|
15
|
-
if (value) {
|
16
|
-
setFiles(value);
|
17
|
-
}
|
18
|
-
}, [value]);
|
19
|
-
const onChangeValue = (e) => {
|
20
|
-
const newFiles = [
|
21
|
-
...files,
|
22
|
-
...e.value.map((el) => {
|
23
|
-
var _a, _b, _c;
|
24
|
-
return {
|
25
|
-
id: el.id,
|
26
|
-
url: "",
|
27
|
-
size: (_a = el == null ? void 0 : el.file) == null ? void 0 : _a.size,
|
28
|
-
name: (_b = el == null ? void 0 : el.file) == null ? void 0 : _b.name,
|
29
|
-
type: (_c = el == null ? void 0 : el.file) == null ? void 0 : _c.type
|
30
|
-
};
|
31
|
-
})
|
32
|
-
];
|
33
|
-
setFiles(newFiles);
|
34
|
-
onChange == null ? void 0 : onChange({ type: "add", data: e.value });
|
35
|
-
};
|
36
|
-
const onDelete = (j) => {
|
37
|
-
setFiles(j.list);
|
38
|
-
if (j.deleteId) onChange == null ? void 0 : onChange({ type: "delete", data: j.deleteId });
|
39
|
-
};
|
40
|
-
return /* @__PURE__ */ jsxs(
|
41
|
-
"div",
|
42
|
-
{
|
43
|
-
className: classNames(
|
44
|
-
cls["upload-file__wrapper"],
|
45
|
-
isMaxFilesReached && cls.disabled
|
46
|
-
),
|
47
|
-
children: [
|
48
|
-
/* @__PURE__ */ jsx(
|
49
|
-
Uploader,
|
50
|
-
{
|
51
|
-
filesType,
|
52
|
-
arrayName,
|
53
|
-
maxSize,
|
54
|
-
onChangeValue,
|
55
|
-
ref,
|
56
|
-
maxFiles,
|
57
|
-
isDisabled: isMaxFilesReached
|
58
|
-
}
|
59
|
-
),
|
60
|
-
/* @__PURE__ */ jsx(ListFiles, { value: files, onChange: onDelete })
|
61
|
-
]
|
62
|
-
}
|
63
|
-
);
|
64
|
-
}
|
65
|
-
);
|
66
|
-
export {
|
67
|
-
UploaderFiles
|
68
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export default function Size(size: number): string;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
function Size(size) {
|
2
|
-
if (!size) return "";
|
3
|
-
let i = -1;
|
4
|
-
const b = [" Kb", " Mb", " Gb", " Tb", "Pb", "Eb", "Zb", "Yb"];
|
5
|
-
do {
|
6
|
-
size /= 1024;
|
7
|
-
i += 1;
|
8
|
-
} while (size > 1024);
|
9
|
-
return Math.max(size, 0.1).toFixed(1) + b[i];
|
10
|
-
}
|
11
|
-
export {
|
12
|
-
Size as default
|
13
|
-
};
|