mimir-ui-kit 1.12.0 → 1.13.1
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/{DatePickerModal-DUUCHAWF.js → DatePickerModal-BM0BgzTb.js} +17 -17
- package/dist/assets/Button.css +1 -1
- package/dist/assets/DatePickerModal.css +1 -1
- package/dist/assets/ListPhotos.css +1 -0
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/Uploader.css +1 -0
- package/dist/assets/UploaderPhotos.css +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/components/Button/Button.js +23 -22
- package/dist/components/Button/constants.d.ts +2 -1
- package/dist/components/Button/constants.js +1 -0
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/DatePicker/DatePickerModal.js +1 -1
- package/dist/components/ListPhotos/ListPhotos.d.ts +23 -0
- package/dist/components/ListPhotos/ListPhotos.js +33 -0
- package/dist/components/ListPhotos/constants.d.ts +3 -0
- package/dist/components/ListPhotos/constants.js +21 -0
- package/dist/components/ListPhotos/index.d.ts +2 -0
- package/dist/components/ListPhotos/index.js +4 -0
- package/dist/components/SelectSearch/SelectSearch.js +23 -19
- package/dist/components/TabTrail/TabTrail.js +1 -1
- package/dist/components/Uploader/Uploader.d.ts +30 -0
- package/dist/components/Uploader/Uploader.js +90 -0
- package/dist/components/Uploader/constants.d.ts +5 -0
- package/dist/components/Uploader/constants.js +16 -0
- package/dist/components/Uploader/index.d.ts +2 -0
- package/dist/components/Uploader/index.js +4 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +29 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.js +46 -0
- package/dist/components/UploaderPhotos/index.d.ts +2 -0
- package/dist/components/UploaderPhotos/index.js +4 -0
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/components/12px/Close12px.d.ts +4 -0
- package/dist/icons/components/12px/Close12px.js +18 -0
- package/dist/icons/components/index.d.ts +1 -0
- package/dist/icons/components/index.js +560 -559
- package/dist/{index-_ACzPKPw.js → index-Cxiikb7g.js} +561 -558
- package/dist/utils/UUID4.d.ts +1 -0
- package/dist/utils/UUID4.js +9 -0
- package/dist/utils/formating/Date.d.ts +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +3 -1
- package/package.json +1 -1
@@ -0,0 +1,29 @@
|
|
1
|
+
import { imageTypesArr } from '../Uploader/constants';
|
2
|
+
import { TFileItem } from '../Uploader/Uploader';
|
3
|
+
|
4
|
+
export type TUploaderPhotos = {
|
5
|
+
/**
|
6
|
+
* Массив разрешенных типов файлов для настройки валидации
|
7
|
+
* 'jpeg' | 'png' | 'tiff' | 'gif' | 'doc' | 'xls' | 'pdf' |'docx' | 'txt'
|
8
|
+
*/
|
9
|
+
filesType: imageTypesArr[];
|
10
|
+
/**
|
11
|
+
* Наименование передаваемого массива файлов
|
12
|
+
*/
|
13
|
+
name: string;
|
14
|
+
/**
|
15
|
+
* Максимальный размер файлов.
|
16
|
+
*/
|
17
|
+
maxSize: number;
|
18
|
+
/**
|
19
|
+
* Функция обратного вызова, передает параметры type и data,
|
20
|
+
* type 'add' в data передает массив файлов,
|
21
|
+
* type:'delete' в data передает id удаленного файла
|
22
|
+
*/
|
23
|
+
onChange: (j: TOnChangePhotosUpdate) => void;
|
24
|
+
};
|
25
|
+
export type TOnChangePhotosUpdate = {
|
26
|
+
type: string;
|
27
|
+
data: TFileItem[] | number;
|
28
|
+
};
|
29
|
+
export declare function UploaderPhotos({ filesType, name, maxSize, onChange }: TUploaderPhotos): import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
+
import { useState } from "react";
|
3
|
+
import { ListPhotos } from "../ListPhotos/ListPhotos.js";
|
4
|
+
import { Uploader } from "../Uploader/Uploader.js";
|
5
|
+
import '../../assets/UploaderPhotos.css';const cls = {
|
6
|
+
"upload-file__wrapper": "_upload-file__wrapper_udscq_2"
|
7
|
+
};
|
8
|
+
function UploaderPhotos({
|
9
|
+
filesType,
|
10
|
+
name,
|
11
|
+
maxSize,
|
12
|
+
onChange
|
13
|
+
}) {
|
14
|
+
const [photos, setPhotos] = useState([]);
|
15
|
+
const onChangeValue = (e) => {
|
16
|
+
setPhotos([
|
17
|
+
...photos,
|
18
|
+
...e.value.map((el) => {
|
19
|
+
return {
|
20
|
+
url: URL.createObjectURL(el.file),
|
21
|
+
id: el.id
|
22
|
+
};
|
23
|
+
})
|
24
|
+
]);
|
25
|
+
onChange == null ? void 0 : onChange({ type: "add", data: e.value });
|
26
|
+
};
|
27
|
+
const onDelete = (j) => {
|
28
|
+
setPhotos(j.list);
|
29
|
+
if (j.deleteId) onChange == null ? void 0 : onChange({ type: "delete", data: j.deleteId });
|
30
|
+
};
|
31
|
+
return /* @__PURE__ */ jsxs("div", { className: cls["upload-file__wrapper"], children: [
|
32
|
+
/* @__PURE__ */ jsx(
|
33
|
+
Uploader,
|
34
|
+
{
|
35
|
+
filesType,
|
36
|
+
name,
|
37
|
+
maxSize,
|
38
|
+
onChangeValue
|
39
|
+
}
|
40
|
+
),
|
41
|
+
/* @__PURE__ */ jsx(ListPhotos, { value: photos, onChange: onDelete })
|
42
|
+
] });
|
43
|
+
}
|
44
|
+
export {
|
45
|
+
UploaderPhotos
|
46
|
+
};
|
package/dist/icons/Icon.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
2
2
|
import { Suspense } from "react";
|
3
|
-
import { i as icons } from "../index-
|
3
|
+
import { i as icons } from "../index-Cxiikb7g.js";
|
4
4
|
const Icon = ({ iconName, ...props }) => {
|
5
5
|
const Component = icons[iconName];
|
6
6
|
if (!Component) {
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
2
|
+
const Close12px = (props) => {
|
3
|
+
return /* @__PURE__ */ jsx(
|
4
|
+
"svg",
|
5
|
+
{
|
6
|
+
width: "12",
|
7
|
+
height: "12",
|
8
|
+
viewBox: "0 0 12 12",
|
9
|
+
fill: "none",
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
11
|
+
...props,
|
12
|
+
children: /* @__PURE__ */ jsx("path", { d: "M3 9L8.99991 3M9 9L3 3", stroke: "#333333", "stroke-width": "1.5" })
|
13
|
+
}
|
14
|
+
);
|
15
|
+
};
|
16
|
+
export {
|
17
|
+
Close12px as default
|
18
|
+
};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
export declare const Close12px: import('react').LazyExoticComponent<(props: import('react').SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
|
1
2
|
export declare const Accept16px: import('react').LazyExoticComponent<(props: import('react').SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
|
2
3
|
export declare const Acts16px: import('react').LazyExoticComponent<(props: import('react').SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
|
3
4
|
export declare const Acts16pxF: import('react').LazyExoticComponent<(props: import('react').SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
|