mimir-ui-kit 1.14.5 → 1.14.7
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +62 -62
- package/dist/SelectSearchOption-snHM9uZX.js +3796 -0
- package/dist/assets/Image.css +1 -0
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/SelectSearchOption.css +1 -0
- package/dist/assets/Tag.css +1 -1
- package/dist/components/Image/Image.d.ts +12 -0
- package/dist/components/Image/Image.js +42 -15
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/SelectSearch/SelectSearch.d.ts +7 -12
- package/dist/components/SelectSearch/SelectSearch.js +681 -3792
- package/dist/components/SelectSearch/constants.d.ts +2 -2
- package/dist/components/SelectSearch/constants.js +1 -1
- package/dist/components/SelectSearch/index.d.ts +2 -1
- package/dist/components/SelectSearch/types.d.ts +40 -0
- package/dist/components/SelectSearch/types.js +1 -0
- package/dist/components/SelectSearchOption/SelectSearchOption.d.ts +10 -0
- package/dist/components/SelectSearchOption/SelectSearchOption.js +8 -0
- package/dist/components/SelectSearchOption/index.d.ts +2 -0
- package/dist/components/SelectSearchOption/index.js +4 -0
- package/dist/components/Slider/Slider.d.ts +2 -0
- package/dist/components/Slider/Slider.js +4 -2
- package/dist/components/Tag/Tag.js +6 -6
- package/dist/components/Uploader/Uploader.d.ts +4 -4
- package/dist/components/Uploader/Uploader.js +5 -4
- package/dist/components/Uploader/constants.d.ts +1 -1
- package/dist/components/Uploader/constants.js +1 -1
- package/dist/components/Uploader/index.d.ts +1 -1
- package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +3 -3
- package/dist/components/UploaderPhotos/UploaderPhotos.js +2 -2
- package/dist/components/UploaderPhotos/index.d.ts +1 -1
- package/dist/components/index.d.ts +7 -1
- package/dist/components/index.js +6 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/useMediaQuery/constants.d.ts +10 -0
- package/dist/hooks/useMediaQuery/constants.js +13 -1
- package/dist/hooks/useMediaQuery/index.d.ts +1 -1
- package/dist/hooks/useMediaQuery/index.js +2 -1
- package/dist/index.js +8 -1
- package/package.json +130 -128
@@ -0,0 +1,40 @@
|
|
1
|
+
import { ESelectSearchSize } from './constants';
|
2
|
+
import { VirtualizedFixedSizeListProps } from './SelectSearch';
|
3
|
+
|
4
|
+
export type TSelectSearchProps = {
|
5
|
+
/**
|
6
|
+
* Текущее выбранное значение.
|
7
|
+
*/
|
8
|
+
value?: Record<string, unknown> | null;
|
9
|
+
/**
|
10
|
+
* Функция обратного вызова при изменении выбранного значения.
|
11
|
+
*/
|
12
|
+
onChange?: (value: Record<string, unknown>) => void;
|
13
|
+
/**
|
14
|
+
* Текст-подсказка для поля ввода.
|
15
|
+
*/
|
16
|
+
placeholder?: string;
|
17
|
+
/**
|
18
|
+
* Размер компонента выбора.
|
19
|
+
*/
|
20
|
+
size?: ESelectSearchSize;
|
21
|
+
/**
|
22
|
+
* Флаг для растягивания компонента на всю ширину контейнера.
|
23
|
+
*/
|
24
|
+
full?: boolean;
|
25
|
+
/**
|
26
|
+
* Дочерние элементы компонента.
|
27
|
+
*/
|
28
|
+
children?: React.ReactNode;
|
29
|
+
/**
|
30
|
+
* Свойства для виртуализированного списка фиксированного размера.
|
31
|
+
*/
|
32
|
+
virtualizedFixedSizeList?: VirtualizedFixedSizeListProps;
|
33
|
+
/**
|
34
|
+
* Значение, отображаемое в поле выбора.
|
35
|
+
*/
|
36
|
+
displayValue?: string;
|
37
|
+
showArrow?: boolean;
|
38
|
+
onSearch?: (value: string) => void;
|
39
|
+
filterOnSearch?: boolean;
|
40
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { ESelectSearchSize } from '../SelectSearch/constants';
|
2
|
+
|
3
|
+
export interface SelectSearchOptionProps {
|
4
|
+
record: Record<string, unknown>;
|
5
|
+
children?: React.ReactNode;
|
6
|
+
size?: ESelectSearchSize;
|
7
|
+
className?: string;
|
8
|
+
title?: string;
|
9
|
+
}
|
10
|
+
export declare function SelectSearchOption({ record, size, children, className }: SelectSearchOptionProps): import("react/jsx-runtime").JSX.Element;
|
@@ -323,7 +323,7 @@ const Slider = ({
|
|
323
323
|
swiperClassName,
|
324
324
|
slideClassName,
|
325
325
|
imageClassName,
|
326
|
-
delay =
|
326
|
+
delay = 3e5
|
327
327
|
}) => {
|
328
328
|
const progressBar = useRef(null);
|
329
329
|
const swiperRef = useRef(null);
|
@@ -401,7 +401,9 @@ const Slider = ({
|
|
401
401
|
AppImage,
|
402
402
|
{
|
403
403
|
className: classNames(cls.image, imageClassName),
|
404
|
-
src: img.image
|
404
|
+
src: img.image,
|
405
|
+
desktopImage: img.imageDesktop,
|
406
|
+
mobileImage: img.imageMobile
|
405
407
|
}
|
406
408
|
)
|
407
409
|
},
|
@@ -2,12 +2,12 @@ import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as classNames } from "../../index-CweZ_OcN.js";
|
3
3
|
import { forwardRef } from "react";
|
4
4
|
import { ETagSize, ETagType } from "./constants.js";
|
5
|
-
import '../../assets/Tag.css';const container = "
|
6
|
-
const disabled = "
|
7
|
-
const inner = "
|
8
|
-
const M = "
|
9
|
-
const S = "
|
10
|
-
const XS = "
|
5
|
+
import '../../assets/Tag.css';const container = "_container_ok6fq_2";
|
6
|
+
const disabled = "_disabled_ok6fq_25";
|
7
|
+
const inner = "_inner_ok6fq_30";
|
8
|
+
const M = "_M_ok6fq_38";
|
9
|
+
const S = "_S_ok6fq_42";
|
10
|
+
const XS = "_XS_ok6fq_50";
|
11
11
|
const cls = {
|
12
12
|
container,
|
13
13
|
disabled,
|
@@ -3,13 +3,13 @@ import { imageTypesArr } from './constants';
|
|
3
3
|
export type TUploader = {
|
4
4
|
/**
|
5
5
|
* Массив разрешенных типов файлов для настройки валидации
|
6
|
-
* 'jpeg' | 'png' | 'tiff'|'gif'|'doc'|'xls'|'pdf'|'docx' |'txt' | 'xlsx'
|
6
|
+
* 'jpeg' | 'jpg' | 'png' | 'tiff' | 'gif' | 'doc' | 'xls' | 'pdf' | 'docx' | 'txt' | 'xlsx'
|
7
7
|
*/
|
8
8
|
filesType: imageTypesArr[];
|
9
9
|
/**
|
10
10
|
* Наименование передаваемого массива файлов
|
11
11
|
*/
|
12
|
-
|
12
|
+
arrayName: string;
|
13
13
|
/**
|
14
14
|
* Функция - callback, которая вызывается при изменении значения и передает имя и новое значение
|
15
15
|
*/
|
@@ -21,10 +21,10 @@ export type TUploader = {
|
|
21
21
|
};
|
22
22
|
export type TUploadValue = {
|
23
23
|
value: TFileItem[];
|
24
|
-
|
24
|
+
arrayName?: string;
|
25
25
|
};
|
26
26
|
export type TFileItem = {
|
27
27
|
id: number;
|
28
28
|
file: File;
|
29
29
|
};
|
30
|
-
export declare function Uploader({ filesType, onChangeValue,
|
30
|
+
export declare function Uploader({ filesType, onChangeValue, arrayName, maxSize }: TUploader): import("react/jsx-runtime").JSX.Element;
|
@@ -9,6 +9,7 @@ import '../../assets/Uploader.css';const cls = {
|
|
9
9
|
};
|
10
10
|
const MIME = {
|
11
11
|
jpeg: "image/jpeg",
|
12
|
+
jpg: "image/jpg",
|
12
13
|
png: "image/png",
|
13
14
|
tiff: "image/tiff",
|
14
15
|
gif: "image/gif",
|
@@ -20,14 +21,14 @@ const MIME = {
|
|
20
21
|
txt: "text/plain",
|
21
22
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
22
23
|
};
|
23
|
-
const filesTyps = ["jpeg", "png", "tiff", "gif"];
|
24
|
+
const filesTyps = ["jpeg", "jpg", "png", "tiff", "gif"];
|
24
25
|
const generateId = (min, max) => {
|
25
26
|
return Math.random() * (max - min) + min;
|
26
27
|
};
|
27
28
|
function Uploader({
|
28
29
|
filesType = filesTyps,
|
29
30
|
onChangeValue,
|
30
|
-
|
31
|
+
arrayName,
|
31
32
|
maxSize = 15
|
32
33
|
}) {
|
33
34
|
const idImg = useId();
|
@@ -36,11 +37,11 @@ function Uploader({
|
|
36
37
|
if (e.target.files && e.target.files[0]) {
|
37
38
|
const list = [];
|
38
39
|
Array.from(e.target.files).forEach((el) => {
|
39
|
-
if (filesType.map((
|
40
|
+
if (filesType.map((name) => MIME[name]).includes(el.type) && el.size / 1024 ** 2 <= maxSize) {
|
40
41
|
list.push({ file: el, id: generateId(1, 100) });
|
41
42
|
}
|
42
43
|
});
|
43
|
-
onChangeValue({
|
44
|
+
onChangeValue({ arrayName, value: list });
|
44
45
|
}
|
45
46
|
};
|
46
47
|
const onOpen = () => {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export type imageTypesArr = 'jpeg' | 'png' | 'tiff' | 'gif' | 'doc' | 'xls' | 'pdf' | 'docx' | 'txt' | 'xlsx';
|
1
|
+
export type imageTypesArr = 'jpeg' | 'jpg' | 'png' | 'tiff' | 'gif' | 'doc' | 'xls' | 'pdf' | 'docx' | 'txt' | 'xlsx';
|
2
2
|
export declare const TypeFilesArray: {
|
3
3
|
images: imageTypesArr[];
|
4
4
|
docs: imageTypesArr[];
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export { Uploader } from './Uploader';
|
2
|
-
export type {
|
2
|
+
export type { TUploader, TFileItem, TUploadValue } from './Uploader';
|
@@ -4,13 +4,13 @@ import { TFileItem } from '../Uploader/Uploader';
|
|
4
4
|
export type TUploaderPhotos = {
|
5
5
|
/**
|
6
6
|
* Массив разрешенных типов файлов для настройки валидации
|
7
|
-
* 'jpeg' | 'png' | 'tiff' | 'gif' | 'doc' | 'xls' | 'pdf' |'docx' | 'txt'
|
7
|
+
* 'jpeg' | 'jpg' | 'png' | 'tiff' | 'gif' | 'doc' | 'xls' | 'pdf' |'docx' | 'txt'
|
8
8
|
*/
|
9
9
|
filesType: imageTypesArr[];
|
10
10
|
/**
|
11
11
|
* Наименование передаваемого массива файлов
|
12
12
|
*/
|
13
|
-
|
13
|
+
arrayName: string;
|
14
14
|
/**
|
15
15
|
* Максимальный размер файлов.
|
16
16
|
*/
|
@@ -26,4 +26,4 @@ export type TOnChangePhotosUpdate = {
|
|
26
26
|
type: string;
|
27
27
|
data: TFileItem[] | number;
|
28
28
|
};
|
29
|
-
export declare function UploaderPhotos({ filesType,
|
29
|
+
export declare function UploaderPhotos({ filesType, arrayName, maxSize, onChange }: TUploaderPhotos): import("react/jsx-runtime").JSX.Element;
|
@@ -7,7 +7,7 @@ import '../../assets/UploaderPhotos.css';const cls = {
|
|
7
7
|
};
|
8
8
|
function UploaderPhotos({
|
9
9
|
filesType,
|
10
|
-
|
10
|
+
arrayName,
|
11
11
|
maxSize,
|
12
12
|
onChange
|
13
13
|
}) {
|
@@ -33,7 +33,7 @@ function UploaderPhotos({
|
|
33
33
|
Uploader,
|
34
34
|
{
|
35
35
|
filesType,
|
36
|
-
|
36
|
+
arrayName,
|
37
37
|
maxSize,
|
38
38
|
onChangeValue
|
39
39
|
}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export { UploaderPhotos } from './UploaderPhotos';
|
2
|
-
export type {
|
2
|
+
export type { TUploaderPhotos, TOnChangePhotosUpdate } from './UploaderPhotos';
|
@@ -20,7 +20,9 @@ export { EDrawerPosition } from './Drawer';
|
|
20
20
|
export { Steps, EStepsPrimaryColor, EStepsSecondaryColor, EStepsSize, type TCommonStepsProps } from './Steps';
|
21
21
|
export { Vote, EVoteSize, type TCommonVoteProps } from './Vote';
|
22
22
|
export { SelectSearch, ESelectSearchSize } from './SelectSearch';
|
23
|
-
export type {
|
23
|
+
export type { TSelectSearchProps } from './SelectSearch';
|
24
|
+
export { SelectSearchOption } from './SelectSearchOption';
|
25
|
+
export type { SelectSearchOptionProps } from './SelectSearchOption';
|
24
26
|
export { Switch } from './Switch';
|
25
27
|
export type { TSwitchProps } from './Switch';
|
26
28
|
export { Tag, ETagSize, ETagType } from './Tag';
|
@@ -30,3 +32,7 @@ export type { TAccordionProps, TAccordionItemProps } from './Accordion';
|
|
30
32
|
export { TabTrail, ETabTrailSize } from './TabTrail';
|
31
33
|
export type { TTabTrailProps, TCategoryTab } from './TabTrail';
|
32
34
|
export { Pagination } from './Pagination';
|
35
|
+
export { UploaderPhotos } from './UploaderPhotos';
|
36
|
+
export type { TUploaderPhotos, TOnChangePhotosUpdate } from './UploaderPhotos';
|
37
|
+
export { Uploader } from './Uploader';
|
38
|
+
export type { TUploadValue, TFileItem } from './Uploader';
|
package/dist/components/index.js
CHANGED
@@ -21,6 +21,7 @@ import { Vote } from "./Vote/Vote.js";
|
|
21
21
|
import { EVoteSize } from "./Vote/constants.js";
|
22
22
|
import { SelectSearch } from "./SelectSearch/SelectSearch.js";
|
23
23
|
import { ESelectSearchSize } from "./SelectSearch/constants.js";
|
24
|
+
import { S } from "../SelectSearchOption-snHM9uZX.js";
|
24
25
|
import { Switch } from "./Switch/Switch.js";
|
25
26
|
import { Tag } from "./Tag/Tag.js";
|
26
27
|
import { ETagSize, ETagType } from "./Tag/constants.js";
|
@@ -31,6 +32,8 @@ import { AccordionItem } from "./Accordion/AccordionItem/AccordionItem.js";
|
|
31
32
|
import { TabTrail } from "./TabTrail/TabTrail.js";
|
32
33
|
import { ETabTrailSize } from "./TabTrail/constants.js";
|
33
34
|
import { Pagination } from "./Pagination/Pagination.js";
|
35
|
+
import { UploaderPhotos } from "./UploaderPhotos/UploaderPhotos.js";
|
36
|
+
import { Uploader } from "./Uploader/Uploader.js";
|
34
37
|
export {
|
35
38
|
Accordion,
|
36
39
|
AccordionItem,
|
@@ -65,12 +68,15 @@ export {
|
|
65
68
|
Pagination,
|
66
69
|
RadioGroup,
|
67
70
|
SelectSearch,
|
71
|
+
S as SelectSearchOption,
|
68
72
|
Slider,
|
69
73
|
Steps,
|
70
74
|
Switch,
|
71
75
|
TabTrail,
|
72
76
|
Tag,
|
73
77
|
Timer,
|
78
|
+
Uploader,
|
79
|
+
UploaderPhotos,
|
74
80
|
Vote,
|
75
81
|
getMaskedInputPhoneValue,
|
76
82
|
getUnmaskedInputValue
|
package/dist/hooks/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export { useMediaQuery, EMediaQuery } from './useMediaQuery';
|
1
|
+
export { useMediaQuery, EMediaQuery, EMinMediaQuery } from './useMediaQuery';
|
2
2
|
export { useLockBodyScroll } from './useLockBodyScroll';
|
3
3
|
export { useInterval } from './useInterval';
|
4
4
|
export { useTimer } from './useTimer';
|
package/dist/hooks/index.js
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
import { useMediaQuery } from "./useMediaQuery/useMediaQuery.js";
|
2
|
-
import { EMediaQuery } from "./useMediaQuery/constants.js";
|
2
|
+
import { EMediaQuery, EMinMediaQuery } from "./useMediaQuery/constants.js";
|
3
3
|
import { useLockBodyScroll } from "./useLockBodyScroll/useLockBodyScroll.js";
|
4
4
|
import { useInterval } from "./useInterval/useInterval.js";
|
5
5
|
import { useTimer } from "./useTimer/index.js";
|
6
6
|
export {
|
7
7
|
EMediaQuery,
|
8
|
+
EMinMediaQuery,
|
8
9
|
useInterval,
|
9
10
|
useLockBodyScroll,
|
10
11
|
useMediaQuery,
|
@@ -8,3 +8,13 @@ export declare enum EMediaQuery {
|
|
8
8
|
XL = "(max-width: 1440px)",
|
9
9
|
XXL = "(max-width: 1920px)"
|
10
10
|
}
|
11
|
+
export declare enum EMinMediaQuery {
|
12
|
+
XSS = "(min-width: 375px)",
|
13
|
+
XS = "(min-width: 600px)",
|
14
|
+
XS1 = "(min-width: 767px)",
|
15
|
+
S = "(min-width: 768px)",
|
16
|
+
M = "(min-width: 960px)",
|
17
|
+
L = "(min-width: 1280px)",
|
18
|
+
XL = "(min-width: 1440px)",
|
19
|
+
XXL = "(min-width: 1920px)"
|
20
|
+
}
|
@@ -9,6 +9,18 @@ var EMediaQuery = /* @__PURE__ */ ((EMediaQuery2) => {
|
|
9
9
|
EMediaQuery2["XXL"] = "(max-width: 1920px)";
|
10
10
|
return EMediaQuery2;
|
11
11
|
})(EMediaQuery || {});
|
12
|
+
var EMinMediaQuery = /* @__PURE__ */ ((EMinMediaQuery2) => {
|
13
|
+
EMinMediaQuery2["XSS"] = "(min-width: 375px)";
|
14
|
+
EMinMediaQuery2["XS"] = "(min-width: 600px)";
|
15
|
+
EMinMediaQuery2["XS1"] = "(min-width: 767px)";
|
16
|
+
EMinMediaQuery2["S"] = "(min-width: 768px)";
|
17
|
+
EMinMediaQuery2["M"] = "(min-width: 960px)";
|
18
|
+
EMinMediaQuery2["L"] = "(min-width: 1280px)";
|
19
|
+
EMinMediaQuery2["XL"] = "(min-width: 1440px)";
|
20
|
+
EMinMediaQuery2["XXL"] = "(min-width: 1920px)";
|
21
|
+
return EMinMediaQuery2;
|
22
|
+
})(EMinMediaQuery || {});
|
12
23
|
export {
|
13
|
-
EMediaQuery
|
24
|
+
EMediaQuery,
|
25
|
+
EMinMediaQuery
|
14
26
|
};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export { useMediaQuery } from './useMediaQuery';
|
2
|
-
export { EMediaQuery } from './constants';
|
2
|
+
export { EMediaQuery, EMinMediaQuery } from './constants';
|
package/dist/index.js
CHANGED
@@ -21,6 +21,7 @@ import { Vote } from "./components/Vote/Vote.js";
|
|
21
21
|
import { EVoteSize } from "./components/Vote/constants.js";
|
22
22
|
import { SelectSearch } from "./components/SelectSearch/SelectSearch.js";
|
23
23
|
import { ESelectSearchSize } from "./components/SelectSearch/constants.js";
|
24
|
+
import { S } from "./SelectSearchOption-snHM9uZX.js";
|
24
25
|
import { Switch } from "./components/Switch/Switch.js";
|
25
26
|
import { Tag } from "./components/Tag/Tag.js";
|
26
27
|
import { ETagSize, ETagType } from "./components/Tag/constants.js";
|
@@ -31,8 +32,10 @@ import { AccordionItem } from "./components/Accordion/AccordionItem/AccordionIte
|
|
31
32
|
import { TabTrail } from "./components/TabTrail/TabTrail.js";
|
32
33
|
import { ETabTrailSize } from "./components/TabTrail/constants.js";
|
33
34
|
import { Pagination } from "./components/Pagination/Pagination.js";
|
35
|
+
import { UploaderPhotos } from "./components/UploaderPhotos/UploaderPhotos.js";
|
36
|
+
import { Uploader } from "./components/Uploader/Uploader.js";
|
34
37
|
import { useMediaQuery } from "./hooks/useMediaQuery/useMediaQuery.js";
|
35
|
-
import { EMediaQuery } from "./hooks/useMediaQuery/constants.js";
|
38
|
+
import { EMediaQuery, EMinMediaQuery } from "./hooks/useMediaQuery/constants.js";
|
36
39
|
import { useLockBodyScroll } from "./hooks/useLockBodyScroll/useLockBodyScroll.js";
|
37
40
|
import { useInterval } from "./hooks/useInterval/useInterval.js";
|
38
41
|
import { useTimer } from "./hooks/useTimer/index.js";
|
@@ -55,6 +58,7 @@ import './assets/index.css';export {
|
|
55
58
|
EInputVariant,
|
56
59
|
EMediaQuery,
|
57
60
|
EMergedButtonVariantRound,
|
61
|
+
EMinMediaQuery,
|
58
62
|
ESelectSearchSize,
|
59
63
|
EStepsPrimaryColor,
|
60
64
|
EStepsSecondaryColor,
|
@@ -74,12 +78,15 @@ import './assets/index.css';export {
|
|
74
78
|
Pagination,
|
75
79
|
RadioGroup,
|
76
80
|
SelectSearch,
|
81
|
+
S as SelectSearchOption,
|
77
82
|
Slider,
|
78
83
|
Steps,
|
79
84
|
Switch,
|
80
85
|
TabTrail,
|
81
86
|
Tag,
|
82
87
|
Timer,
|
88
|
+
Uploader,
|
89
|
+
UploaderPhotos,
|
83
90
|
Vote,
|
84
91
|
formating,
|
85
92
|
getMaskedInputPhoneValue,
|