@astral/ui 4.96.0 → 4.98.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/components/Link/Link.d.ts +8 -0
- package/components/Link/Link.js +12 -2
- package/components/Link/constants.d.ts +4 -0
- package/components/Link/constants.js +5 -0
- package/components/Link/index.d.ts +1 -0
- package/components/Link/index.js +1 -0
- package/components/Link/public.d.ts +1 -0
- package/components/Link/public.js +1 -0
- package/components/Link/styles.js +17 -0
- package/components/fileUploading/FileInfo/FileInfo.d.ts +5 -1
- package/components/fileUploading/FileInfo/FileInfo.js +11 -2
- package/components/fileUploading/FileInfo/constants.d.ts +4 -0
- package/components/fileUploading/FileInfo/constants.js +5 -0
- package/components/fileUploading/FileInfo/index.d.ts +1 -0
- package/components/fileUploading/FileInfo/index.js +1 -0
- package/components/fileUploading/FileInfo/styles.js +19 -0
- package/components/fileUploading/FileUploader/FIleList/styles.js +4 -0
- package/components/fileUploading/FileUploaderDropzone/DropzoneWrapper/styles.js +3 -0
- package/components/fileUploading/FileUploaderDropzone/FileUploaderContainer/FileUploaderContainer.js +2 -1
- package/components/fileUploading/FileUploaderDropzone/FileUploaderContainer/styles.d.ts +5 -0
- package/components/fileUploading/FileUploaderDropzone/FileUploaderContainer/styles.js +6 -0
- package/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.js +3 -3
- package/components/fileUploading/FileUploaderDropzone/HintPlaceholder/styles.d.ts +4 -0
- package/components/fileUploading/FileUploaderDropzone/HintPlaceholder/styles.js +5 -0
- package/components/fileUploading/FileUploaderFile/Actions/Actions.js +4 -2
- package/components/fileUploading/FileUploaderFile/FileUploaderFile.js +1 -1
- package/components/fileUploading/FileUploaderFile/styles.js +7 -0
- package/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/HintPlaceholder.js +2 -2
- package/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/styles.d.ts +4 -0
- package/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/styles.js +5 -0
- package/components/fileUploading/PreviewFileUploaderDropZone/PlaceholderWrapper/styles.js +4 -0
- package/components/fileUploading/PreviewFileUploaderFile/FileError/FileError.js +2 -2
- package/components/fileUploading/PreviewFileUploaderFile/FileError/styles.d.ts +15 -0
- package/components/fileUploading/PreviewFileUploaderFile/FileError/styles.js +17 -4
- package/components/fileUploading/PreviewFileUploaderFile/FileLoading/FileLoading.js +1 -1
- package/components/fileUploading/PreviewFileUploaderFile/FilePreview/FilePreview.js +4 -9
- package/components/fileUploading/PreviewFileUploaderFile/FilePreview/styles.d.ts +1 -0
- package/components/fileUploading/PreviewFileUploaderFile/FilePreview/styles.js +39 -13
- package/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.d.ts +49 -14
- package/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.js +60 -8
- package/components/theme/palette/componentsColors/linkColors/linkColors.d.ts +5 -0
- package/components/theme/palette/componentsColors/linkColors/linkColors.js +5 -0
- package/node/components/Link/Link.d.ts +8 -0
- package/node/components/Link/Link.js +12 -2
- package/node/components/Link/constants.d.ts +4 -0
- package/node/components/Link/constants.js +8 -0
- package/node/components/Link/index.d.ts +1 -0
- package/node/components/Link/index.js +3 -1
- package/node/components/Link/public.d.ts +1 -0
- package/node/components/Link/public.js +3 -1
- package/node/components/Link/styles.js +17 -0
- package/node/components/fileUploading/FileInfo/FileInfo.d.ts +5 -1
- package/node/components/fileUploading/FileInfo/FileInfo.js +11 -2
- package/node/components/fileUploading/FileInfo/constants.d.ts +4 -0
- package/node/components/fileUploading/FileInfo/constants.js +8 -0
- package/node/components/fileUploading/FileInfo/index.d.ts +1 -0
- package/node/components/fileUploading/FileInfo/index.js +3 -0
- package/node/components/fileUploading/FileInfo/styles.js +19 -0
- package/node/components/fileUploading/FileUploader/FIleList/styles.js +4 -0
- package/node/components/fileUploading/FileUploaderDropzone/DropzoneWrapper/styles.js +3 -0
- package/node/components/fileUploading/FileUploaderDropzone/FileUploaderContainer/FileUploaderContainer.js +2 -1
- package/node/components/fileUploading/FileUploaderDropzone/FileUploaderContainer/styles.d.ts +5 -0
- package/node/components/fileUploading/FileUploaderDropzone/FileUploaderContainer/styles.js +9 -0
- package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.js +2 -2
- package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/styles.d.ts +4 -0
- package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/styles.js +6 -1
- package/node/components/fileUploading/FileUploaderFile/Actions/Actions.js +3 -1
- package/node/components/fileUploading/FileUploaderFile/FileUploaderFile.js +1 -1
- package/node/components/fileUploading/FileUploaderFile/styles.js +7 -0
- package/node/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/HintPlaceholder.js +1 -1
- package/node/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/styles.d.ts +4 -0
- package/node/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/styles.js +6 -1
- package/node/components/fileUploading/PreviewFileUploaderDropZone/PlaceholderWrapper/styles.js +4 -0
- package/node/components/fileUploading/PreviewFileUploaderFile/FileError/FileError.js +1 -1
- package/node/components/fileUploading/PreviewFileUploaderFile/FileError/styles.d.ts +15 -0
- package/node/components/fileUploading/PreviewFileUploaderFile/FileError/styles.js +18 -5
- package/node/components/fileUploading/PreviewFileUploaderFile/FileLoading/FileLoading.js +1 -1
- package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/FilePreview.js +3 -8
- package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/styles.d.ts +1 -0
- package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/styles.js +39 -13
- package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.d.ts +49 -14
- package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.js +60 -8
- package/node/components/theme/palette/componentsColors/linkColors/linkColors.d.ts +5 -0
- package/node/components/theme/palette/componentsColors/linkColors/linkColors.js +5 -0
- package/package.json +1 -1
|
@@ -1,26 +1,61 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type FilePreviewProps } from '../FilePreview';
|
|
3
3
|
type UseLogicParams = FilePreviewProps;
|
|
4
|
-
export declare const useLogic: ({ fileId, file, fileUrl, generateDownloadLink, onDelete, onView, fileType, }: UseLogicParams) => {
|
|
5
|
-
|
|
4
|
+
export declare const useLogic: ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDelete, onView, fileType, isDeletingFile, }: UseLogicParams) => {
|
|
5
|
+
isImageFile: boolean;
|
|
6
|
+
isPdfFile: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Формат файла отличающийся от pdf и изображения
|
|
9
|
+
*/
|
|
10
|
+
isOtherFile: boolean;
|
|
11
|
+
getActionsList: () => {
|
|
12
|
+
type: string;
|
|
13
|
+
tooltip: string;
|
|
14
|
+
title: string;
|
|
15
|
+
variant: "light";
|
|
16
|
+
color: "grey";
|
|
17
|
+
icon: import("react").FunctionComponentElement<import("../../../..").SvgIconProps>;
|
|
18
|
+
loading: boolean | undefined;
|
|
6
19
|
onClick: () => void;
|
|
7
|
-
}
|
|
8
|
-
downloadButtonProps: {
|
|
9
|
-
href: string;
|
|
10
|
-
};
|
|
11
|
-
viewButtonProps: {
|
|
20
|
+
}[] | ({
|
|
12
21
|
component: import("react").ElementType;
|
|
13
22
|
href: string;
|
|
14
23
|
target: string;
|
|
15
24
|
rel: string;
|
|
25
|
+
type: string;
|
|
26
|
+
tooltip: string;
|
|
27
|
+
variant: "light";
|
|
28
|
+
color: "grey";
|
|
29
|
+
icon: import("react").FunctionComponentElement<import("../../../..").SvgIconProps>;
|
|
16
30
|
} | {
|
|
17
31
|
onClick: () => void | undefined;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
type: string;
|
|
33
|
+
tooltip: string;
|
|
34
|
+
variant: "light";
|
|
35
|
+
color: "grey";
|
|
36
|
+
icon: import("react").FunctionComponentElement<import("../../../..").SvgIconProps>;
|
|
37
|
+
} | {
|
|
38
|
+
type: string;
|
|
39
|
+
tooltip: string;
|
|
40
|
+
component: "a";
|
|
41
|
+
variant: "light";
|
|
42
|
+
color: "grey";
|
|
43
|
+
icon: import("react").FunctionComponentElement<import("../../../..").SvgIconProps>;
|
|
44
|
+
download: string;
|
|
45
|
+
href: string;
|
|
46
|
+
loading?: undefined;
|
|
47
|
+
onClick?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
type: string;
|
|
50
|
+
tooltip: string;
|
|
51
|
+
variant: "light";
|
|
52
|
+
color: "grey";
|
|
53
|
+
icon: import("react").FunctionComponentElement<import("../../../..").SvgIconProps>;
|
|
54
|
+
loading: boolean | undefined;
|
|
55
|
+
onClick: () => void;
|
|
56
|
+
component?: undefined;
|
|
57
|
+
download?: undefined;
|
|
58
|
+
href?: undefined;
|
|
59
|
+
})[];
|
|
25
60
|
};
|
|
26
61
|
export {};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import { BinOutlineMd } from '../../../../../icons/BinOutlineMd';
|
|
3
|
+
import { DownloadOutlineMd } from '../../../../../icons/DownloadOutlineMd';
|
|
4
|
+
import { EyeOutlineMd } from '../../../../../icons/EyeOutlineMd';
|
|
1
5
|
import { ErrorService } from '../../../../services/ErrorService';
|
|
6
|
+
import { useViewportType } from '../../../../useViewportType';
|
|
2
7
|
import { EXTENSIONS_IN_NEW_TAB, VIEW_NEW_TAB_ERROR_MESSAGE, } from '../../../constants';
|
|
3
8
|
import { useGenerateLocalFileURL } from '../../../hooks/useGenerateLocalFileURL';
|
|
4
9
|
import { MimeTypeRegistry } from '../../../services/MimeTypeRegistry';
|
|
5
10
|
import { generateAttrLinkNewTab } from '../../../utils/generateAttrLinkNewTab';
|
|
6
|
-
export const useLogic = ({ fileId, file, fileUrl, generateDownloadLink, onDelete, onView, fileType, }) => {
|
|
11
|
+
export const useLogic = ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDelete, onView, fileType, isDeletingFile, }) => {
|
|
7
12
|
const { generateUrl } = useGenerateLocalFileURL();
|
|
13
|
+
const { isMobile } = useViewportType();
|
|
8
14
|
const isPdfFile = MimeTypeRegistry.getInstance()
|
|
9
15
|
.getExtensionsByMimeType((file?.type || fileType))
|
|
10
16
|
?.includes('pdf') || false;
|
|
@@ -50,19 +56,65 @@ export const useLogic = ({ fileId, file, fileUrl, generateDownloadLink, onDelete
|
|
|
50
56
|
},
|
|
51
57
|
};
|
|
52
58
|
};
|
|
59
|
+
const getViewActionsList = () => {
|
|
60
|
+
return isOtherFile
|
|
61
|
+
? []
|
|
62
|
+
: [
|
|
63
|
+
{
|
|
64
|
+
type: 'iconButton',
|
|
65
|
+
tooltip: 'Посмотреть',
|
|
66
|
+
variant: 'light',
|
|
67
|
+
color: 'grey',
|
|
68
|
+
icon: createElement(EyeOutlineMd),
|
|
69
|
+
...getPropsViewButton(),
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
};
|
|
73
|
+
const getActionsList = () => {
|
|
74
|
+
if (isMobile) {
|
|
75
|
+
return [
|
|
76
|
+
{
|
|
77
|
+
type: isOtherFile ? 'button' : 'iconButton',
|
|
78
|
+
tooltip: 'Удалить',
|
|
79
|
+
title: 'Удалить',
|
|
80
|
+
variant: 'light',
|
|
81
|
+
color: 'grey',
|
|
82
|
+
icon: createElement(BinOutlineMd),
|
|
83
|
+
loading: isDeletingFile,
|
|
84
|
+
onClick: handleDelete,
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
return [
|
|
89
|
+
...getViewActionsList(),
|
|
90
|
+
{
|
|
91
|
+
type: 'iconButton',
|
|
92
|
+
tooltip: 'Скачать',
|
|
93
|
+
component: 'a',
|
|
94
|
+
variant: 'light',
|
|
95
|
+
color: 'grey',
|
|
96
|
+
icon: createElement(DownloadOutlineMd),
|
|
97
|
+
download: fileName,
|
|
98
|
+
href: downloadLink,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: 'iconButton',
|
|
102
|
+
tooltip: 'Удалить',
|
|
103
|
+
variant: 'light',
|
|
104
|
+
color: 'grey',
|
|
105
|
+
icon: createElement(BinOutlineMd),
|
|
106
|
+
loading: isDeletingFile,
|
|
107
|
+
onClick: handleDelete,
|
|
108
|
+
},
|
|
109
|
+
];
|
|
110
|
+
};
|
|
53
111
|
return {
|
|
54
|
-
deleteButtonProps: {
|
|
55
|
-
onClick: handleDelete,
|
|
56
|
-
},
|
|
57
|
-
downloadButtonProps: {
|
|
58
|
-
href: downloadLink,
|
|
59
|
-
},
|
|
60
|
-
viewButtonProps: getPropsViewButton(),
|
|
61
112
|
isImageFile,
|
|
62
113
|
isPdfFile,
|
|
63
114
|
/**
|
|
64
115
|
* Формат файла отличающийся от pdf и изображения
|
|
65
116
|
*/
|
|
66
117
|
isOtherFile,
|
|
118
|
+
getActionsList,
|
|
67
119
|
};
|
|
68
120
|
};
|
|
@@ -16,6 +16,10 @@ export type LinkProps = Pick<WithoutEmotionSpecific<MuiLinkProps>, 'rel' | 'href
|
|
|
16
16
|
* добавляет значение атрибуту 'download' тега 'a'
|
|
17
17
|
*/
|
|
18
18
|
downloadFilename?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Позволяет переключить цвета ссылки на более контрастные
|
|
21
|
+
*/
|
|
22
|
+
isContrast?: boolean;
|
|
19
23
|
};
|
|
20
24
|
export declare const Link: import("react").ForwardRefExoticComponent<Pick<WithoutEmotionSpecific<MuiLinkProps>, "classes" | "className" | "style" | "rel" | "children" | "target" | "href" | "key"> & {
|
|
21
25
|
/**
|
|
@@ -32,4 +36,8 @@ export declare const Link: import("react").ForwardRefExoticComponent<Pick<Withou
|
|
|
32
36
|
* добавляет значение атрибуту 'download' тега 'a'
|
|
33
37
|
*/
|
|
34
38
|
downloadFilename?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Позволяет переключить цвета ссылки на более контрастные
|
|
41
|
+
*/
|
|
42
|
+
isContrast?: boolean | undefined;
|
|
35
43
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -5,8 +5,18 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const DownloadVOutlineSm_1 = require("../../icons/DownloadVOutlineSm");
|
|
7
7
|
const OpenLinkOutlineSm_1 = require("../../icons/OpenLinkOutlineSm");
|
|
8
|
+
const cn_1 = require("../utils/cn");
|
|
9
|
+
const cva_1 = require("../utils/cva");
|
|
10
|
+
const constants_1 = require("./constants");
|
|
8
11
|
const styles_1 = require("./styles");
|
|
9
|
-
|
|
12
|
+
const linkCva = (0, cva_1.cva)(constants_1.linkClassnames.root, {
|
|
13
|
+
variants: {
|
|
14
|
+
isContrast: {
|
|
15
|
+
true: constants_1.linkClassnames.isContrast,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
exports.Link = (0, react_1.forwardRef)(({ withAdornment, isDownload, downloadFilename, isContrast, children, className, ...props }, ref) => {
|
|
10
20
|
const icon = isDownload ? (0, jsx_runtime_1.jsx)(DownloadVOutlineSm_1.DownloadVOutlineSm, {}) : (0, jsx_runtime_1.jsx)(OpenLinkOutlineSm_1.OpenLinkOutlineSm, {});
|
|
11
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledLink, { download: downloadFilename ?? isDownload, ref: ref, ...props, children: [withAdornment === 'start' && icon, children, withAdornment === 'end' && icon, !withAdornment && isDownload && (0, jsx_runtime_1.jsx)(DownloadVOutlineSm_1.DownloadVOutlineSm, {})] }));
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledLink, { download: downloadFilename ?? isDownload, className: (0, cn_1.cn)(linkCva({ isContrast }), className), ref: ref, ...props, children: [withAdornment === 'start' && icon, children, withAdornment === 'end' && icon, !withAdornment && isDownload && (0, jsx_runtime_1.jsx)(DownloadVOutlineSm_1.DownloadVOutlineSm, {})] }));
|
|
12
22
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.linkClassnames = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../utils/createUIKitClassname");
|
|
5
|
+
exports.linkClassnames = {
|
|
6
|
+
root: (0, createUIKitClassname_1.createUIKitClassname)('link'),
|
|
7
|
+
isContrast: (0, createUIKitClassname_1.createUIKitClassname)('link__contrast-color'),
|
|
8
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Link = void 0;
|
|
3
|
+
exports.linkClassnames = exports.Link = void 0;
|
|
4
4
|
var Link_1 = require("./Link");
|
|
5
5
|
Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return Link_1.Link; } });
|
|
6
|
+
var constants_1 = require("./constants");
|
|
7
|
+
Object.defineProperty(exports, "linkClassnames", { enumerable: true, get: function () { return constants_1.linkClassnames; } });
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Link = void 0;
|
|
3
|
+
exports.Link = exports.linkClassnames = void 0;
|
|
4
|
+
var constants_1 = require("./constants");
|
|
5
|
+
Object.defineProperty(exports, "linkClassnames", { enumerable: true, get: function () { return constants_1.linkClassnames; } });
|
|
4
6
|
var Link_1 = require("./Link");
|
|
5
7
|
Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return Link_1.Link; } });
|
|
@@ -7,6 +7,7 @@ exports.StyledLink = void 0;
|
|
|
7
7
|
const Link_1 = __importDefault(require("@mui/material/Link"));
|
|
8
8
|
const SvgIcon_1 = require("../SvgIcon");
|
|
9
9
|
const styled_1 = require("../styled");
|
|
10
|
+
const constants_1 = require("./constants");
|
|
10
11
|
exports.StyledLink = (0, styled_1.styled)(Link_1.default) `
|
|
11
12
|
display: inline-flex;
|
|
12
13
|
gap: ${({ theme }) => theme.spacing(1)};
|
|
@@ -30,6 +31,22 @@ exports.StyledLink = (0, styled_1.styled)(Link_1.default) `
|
|
|
30
31
|
text-decoration: underline;
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
&.${constants_1.linkClassnames.isContrast} {
|
|
35
|
+
color: ${({ theme }) => theme.palette.components.link.contrast.main};
|
|
36
|
+
|
|
37
|
+
&:visited {
|
|
38
|
+
color: ${({ theme }) => theme.palette.components.link.contrast.visited};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:hover {
|
|
42
|
+
color: ${({ theme }) => theme.palette.components.link.contrast.hover};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:active {
|
|
46
|
+
color: ${({ theme }) => theme.palette.components.link.active};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
33
50
|
&:focus-visible {
|
|
34
51
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
35
52
|
outline: 2px solid ${({ theme }) => theme.palette.components.focused};
|
|
@@ -11,6 +11,10 @@ type FileInfoProps = {
|
|
|
11
11
|
* Размер файла в байтах
|
|
12
12
|
*/
|
|
13
13
|
fileSize?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Флаг загрузки файла
|
|
16
|
+
*/
|
|
17
|
+
isLoading?: boolean;
|
|
14
18
|
};
|
|
15
|
-
export declare const FileInfo: ({ className, fileName, fileSize }: FileInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const FileInfo: ({ className, fileName, fileSize, isLoading, }: FileInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
20
|
export {};
|
|
@@ -3,8 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FileInfo = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const formatFileSizeToView_1 = require("@astral/utils/file/formatFileSizeToView");
|
|
6
|
+
const cva_1 = require("../../utils/cva");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
6
8
|
const styles_1 = require("./styles");
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
+
const fileSizeCva = (0, cva_1.cva)(constants_1.fileSizeClassnames.fileSize, {
|
|
10
|
+
variants: {
|
|
11
|
+
isLoading: {
|
|
12
|
+
true: constants_1.fileSizeClassnames.isLoading,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
const FileInfo = ({ className, fileName, fileSize, isLoading, }) => {
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: className, children: [(0, jsx_runtime_1.jsx)(styles_1.StyledFilename, { children: fileName }), (0, jsx_runtime_1.jsxs)(styles_1.FileSize, { className: fileSizeCva({ isLoading }), children: [(0, jsx_runtime_1.jsx)(styles_1.DotIcon, {}), (0, formatFileSizeToView_1.formatFileSizeToView)(fileSize)] })] }));
|
|
9
18
|
};
|
|
10
19
|
exports.FileInfo = FileInfo;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fileSizeClassnames = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../../utils/createUIKitClassname");
|
|
5
|
+
exports.fileSizeClassnames = {
|
|
6
|
+
isLoading: (0, createUIKitClassname_1.createUIKitClassname)('file-info_loading'),
|
|
7
|
+
fileSize: (0, createUIKitClassname_1.createUIKitClassname)('file-info_file_size'),
|
|
8
|
+
};
|
|
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.fileSizeClassnames = void 0;
|
|
17
18
|
__exportStar(require("./FileInfo"), exports);
|
|
19
|
+
var constants_1 = require("./constants");
|
|
20
|
+
Object.defineProperty(exports, "fileSizeClassnames", { enumerable: true, get: function () { return constants_1.fileSizeClassnames; } });
|
|
@@ -5,12 +5,17 @@ const DotOutlineSm_1 = require("../../../icons/DotOutlineSm");
|
|
|
5
5
|
const Filename_1 = require("../../Filename");
|
|
6
6
|
const styled_1 = require("../../styled");
|
|
7
7
|
const Typography_1 = require("../../Typography");
|
|
8
|
+
const constants_1 = require("./constants");
|
|
8
9
|
exports.Wrapper = styled_1.styled.div `
|
|
9
10
|
overflow: hidden;
|
|
10
11
|
display: flex;
|
|
11
12
|
gap: ${({ theme }) => theme.spacing(1)};
|
|
12
13
|
|
|
13
14
|
width: 100%;
|
|
15
|
+
|
|
16
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
}
|
|
14
19
|
`;
|
|
15
20
|
exports.StyledFilename = (0, styled_1.styled)(Filename_1.Filename) `
|
|
16
21
|
overflow: hidden;
|
|
@@ -21,8 +26,22 @@ exports.FileSize = (0, styled_1.styled)(Typography_1.Typography) `
|
|
|
21
26
|
align-items: center;
|
|
22
27
|
|
|
23
28
|
white-space: nowrap;
|
|
29
|
+
|
|
30
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
31
|
+
font-size: ${({ theme }) => theme.typography.caption.fontSize};
|
|
32
|
+
line-height: ${({ theme }) => theme.typography.caption.lineHeight};
|
|
33
|
+
color: ${({ theme }) => theme.palette.grey[600]};
|
|
34
|
+
|
|
35
|
+
&.${constants_1.fileSizeClassnames.isLoading} {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
24
39
|
`;
|
|
25
40
|
exports.DotIcon = (0, styled_1.styled)(DotOutlineSm_1.DotOutlineSm) `
|
|
26
41
|
width: 16px;
|
|
27
42
|
height: 16px;
|
|
43
|
+
|
|
44
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
28
47
|
`;
|
|
@@ -9,4 +9,8 @@ exports.Wrapper = (0, styled_1.styled)('ul') `
|
|
|
9
9
|
grid-gap: ${({ theme }) => theme.spacing(2)};
|
|
10
10
|
|
|
11
11
|
margin-bottom: ${({ theme, $isMultiple }) => $isMultiple ? theme.spacing(5) : 0};
|
|
12
|
+
|
|
13
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
14
|
+
margin-bottom: ${({ theme, $isMultiple }) => $isMultiple ? theme.spacing(4) : 0};
|
|
15
|
+
}
|
|
12
16
|
`;
|
|
@@ -26,4 +26,7 @@ exports.Wrapper = styled_1.styled.div `
|
|
|
26
26
|
transition: ${({ theme }) => theme.transitions.create(['background', 'border'], {
|
|
27
27
|
duration: theme.transitions.duration.short,
|
|
28
28
|
})};
|
|
29
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
30
|
+
padding: ${({ theme }) => theme.spacing(5, 4)};
|
|
31
|
+
}
|
|
29
32
|
`;
|
|
@@ -4,5 +4,6 @@ exports.FileUploaderContainer = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const FileUploaderLabel_1 = require("../../FileUploaderLabel");
|
|
6
6
|
const HelperText_1 = require("../../HelperText");
|
|
7
|
-
const
|
|
7
|
+
const styles_1 = require("./styles");
|
|
8
|
+
const FileUploaderContainer = ({ className, label, children, isError, helperText, }) => ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: className, children: [label && (0, jsx_runtime_1.jsx)(FileUploaderLabel_1.FileUploaderLabel, { children: label }), children, isError && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, { isError: isError, children: helperText })] }));
|
|
8
9
|
exports.FileUploaderContainer = FileUploaderContainer;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Wrapper = void 0;
|
|
4
|
+
const styled_1 = require("../../../styled");
|
|
5
|
+
exports.Wrapper = styled_1.styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
9
|
+
`;
|
package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.js
CHANGED
|
@@ -16,8 +16,8 @@ const HintPlaceholder = (props) => {
|
|
|
16
16
|
return placeholder;
|
|
17
17
|
}
|
|
18
18
|
if (isMultiple) {
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)(Typography_1.Typography, { className: className, color: "grey", colorIntensity: "600", variant: "caption", align: "center", children: ["\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u043B\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B. \u041D\u0435 \u0431\u043E\u043B\u0435\u0435
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(Typography_1.Typography, { className: className, color: "grey", colorIntensity: "600", variant: "caption", align: "center", children: [(0, jsx_runtime_1.jsx)(styles_1.MobileWrapper, { children: "\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u043B\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B. " }), "\u041D\u0435 \u0431\u043E\u043B\u0435\u0435", ' ', maxFileCount, " ", (0, declensionFile_1.declensionFile)(maxFileCount), " \u0440\u0430\u0437\u043C\u0435\u0440\u043E\u043C \u043D\u0435 \u0431\u043E\u043B\u0435\u0435", ' ', (0, formatFileSizeToView_1.formatFileSizeToView)(maxFileSize), extensions && ' в формате ', (0, jsx_runtime_1.jsx)(styles_1.Extensions, { children: extensions })] }));
|
|
20
20
|
}
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)(Typography_1.Typography, { className: className, color: "grey", colorIntensity: "600", variant: "caption", align: "center", children: ["\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u043B\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0444\u0430\u0439\u043B. \u0420\u0430\u0437\u043C\u0435\u0440\u043E\u043C \u043D\u0435 \u0431\u043E\u043B\u0435\u0435", ' ', (0, formatFileSizeToView_1.formatFileSizeToView)(maxFileSize), extensions && ' в формате ', (0, jsx_runtime_1.jsx)(styles_1.Extensions, { children: extensions })] }));
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)(Typography_1.Typography, { className: className, color: "grey", colorIntensity: "600", variant: "caption", align: "center", children: [(0, jsx_runtime_1.jsx)(styles_1.MobileWrapper, { children: "\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u043B\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0444\u0430\u0439\u043B. " }), "\u0420\u0430\u0437\u043C\u0435\u0440", (0, jsx_runtime_1.jsx)(styles_1.MobileWrapper, { children: "\u043E\u043C" }), " \u043D\u0435 \u0431\u043E\u043B\u0435\u0435", ' ', (0, formatFileSizeToView_1.formatFileSizeToView)(maxFileSize), extensions && ' в формате ', (0, jsx_runtime_1.jsx)(styles_1.Extensions, { children: extensions })] }));
|
|
22
22
|
};
|
|
23
23
|
exports.HintPlaceholder = HintPlaceholder;
|
|
@@ -3,3 +3,7 @@ export declare const Extensions: import("@emotion/styled/dist/declarations/src/t
|
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
6
|
+
export declare const MobileWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Extensions = void 0;
|
|
3
|
+
exports.MobileWrapper = exports.Extensions = void 0;
|
|
4
4
|
const styled_1 = require("../../../styled");
|
|
5
5
|
exports.Extensions = styled_1.styled.span `
|
|
6
6
|
text-transform: uppercase;
|
|
7
7
|
`;
|
|
8
|
+
exports.MobileWrapper = styled_1.styled.span `
|
|
9
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
@@ -9,10 +9,12 @@ const EyeOutlineMd_1 = require("../../../../icons/EyeOutlineMd");
|
|
|
9
9
|
const RetryOutlineMd_1 = require("../../../../icons/RetryOutlineMd");
|
|
10
10
|
const IconButton_1 = require("../../../IconButton");
|
|
11
11
|
const Tooltip_1 = require("../../../Tooltip");
|
|
12
|
+
const useViewportType_1 = require("../../../useViewportType");
|
|
12
13
|
const styles_1 = require("./styles");
|
|
13
14
|
const useLogic_1 = require("./useLogic");
|
|
14
15
|
const Actions = (props) => {
|
|
15
16
|
const { downloadButtonProps, viewButtonProps, isVisibleAbortButton, isVisibleRetryButton, handleAbort, handleDelete, handleRetry, isLoading, isError, isDeletingFile, fileName, } = (0, useLogic_1.useLogic)(props);
|
|
17
|
+
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
16
18
|
if (isLoading) {
|
|
17
19
|
return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: isVisibleAbortButton && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443", children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", onClick: handleAbort, children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) }) })) }));
|
|
18
20
|
}
|
|
@@ -20,6 +22,6 @@ const Actions = (props) => {
|
|
|
20
22
|
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [isVisibleRetryButton && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443", children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", onClick: handleRetry, children: (0, jsx_runtime_1.jsx)(RetryOutlineMd_1.RetryOutlineMd, {}) }) })), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C", children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", onClick: handleDelete, loading: isDeletingFile, children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) }) })] }));
|
|
21
23
|
}
|
|
22
24
|
const { isShowViewButton, ...restViewButtonProps } = viewButtonProps;
|
|
23
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [isShowViewButton && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C", children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", ...restViewButtonProps, children: (0, jsx_runtime_1.jsx)(EyeOutlineMd_1.EyeOutlineMd, {}) }) })), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u0421\u043A\u0430\u0447\u0430\u0442\u044C", children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { component: "a", variant: "text", download: fileName, ...downloadButtonProps, children: (0, jsx_runtime_1.jsx)(DownloadOutlineMd_1.DownloadOutlineMd, {}) }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C", children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", onClick: handleDelete, loading: isDeletingFile, children: (0, jsx_runtime_1.jsx)(BinOutlineMd_1.BinOutlineMd, {}) }) })] }));
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [!isMobile && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isShowViewButton && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C", children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", ...restViewButtonProps, children: (0, jsx_runtime_1.jsx)(EyeOutlineMd_1.EyeOutlineMd, {}) }) })), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u0421\u043A\u0430\u0447\u0430\u0442\u044C", children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { component: "a", variant: "text", download: fileName, ...downloadButtonProps, children: (0, jsx_runtime_1.jsx)(DownloadOutlineMd_1.DownloadOutlineMd, {}) }) })] })), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C", children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", onClick: handleDelete, loading: isDeletingFile, children: (0, jsx_runtime_1.jsx)(BinOutlineMd_1.BinOutlineMd, {}) }) })] }));
|
|
24
26
|
};
|
|
25
27
|
exports.Actions = Actions;
|
|
@@ -12,6 +12,6 @@ const FileUploaderFile = (props) => {
|
|
|
12
12
|
const { id, name, file, url, size, status, ...actions } = props;
|
|
13
13
|
const { isLoading, isUploadError, isRestrictionError, errorMsg, progress } = status || {};
|
|
14
14
|
const isError = isUploadError || isRestrictionError;
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)(Grow_1.Grow, { in: true, children: (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$isLoading": isLoading, "$isError": isError, children: [(0, jsx_runtime_1.jsxs)(styles_1.Content, { children: [(0, jsx_runtime_1.jsx)(FileInfo_1.FileInfo, { fileName: name, fileSize: size }), isLoading && (0, jsx_runtime_1.jsx)(Progress_1.Progress, { progress: progress }), isError && ((0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "caption", color: "error", children: errorMsg }))] }), (0, jsx_runtime_1.jsx)(Actions_1.Actions, { fileId: id, file: file, fileName: name, fileUrl: url, isLoading: isLoading, isError: isError, isUploadError: isUploadError, ...actions })] }) }));
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(Grow_1.Grow, { in: true, children: (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$isLoading": isLoading, "$isError": isError, children: [(0, jsx_runtime_1.jsxs)(styles_1.Content, { children: [(0, jsx_runtime_1.jsx)(FileInfo_1.FileInfo, { fileName: name, fileSize: size, isLoading: isLoading }), isLoading && (0, jsx_runtime_1.jsx)(Progress_1.Progress, { progress: progress }), isError && ((0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "caption", color: "error", children: errorMsg }))] }), (0, jsx_runtime_1.jsx)(Actions_1.Actions, { fileId: id, file: file, fileName: name, fileUrl: url, isLoading: isLoading, isError: isError, isUploadError: isUploadError, ...actions })] }) }));
|
|
16
16
|
};
|
|
17
17
|
exports.FileUploaderFile = FileUploaderFile;
|
|
@@ -24,6 +24,13 @@ exports.Wrapper = (0, styled_1.styled)('div', {
|
|
|
24
24
|
|
|
25
25
|
border: ${({ theme, $isLoading, $isError }) => `1px solid ${getBorderColor(theme, $isLoading, $isError)}`};
|
|
26
26
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
27
|
+
|
|
28
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
29
|
+
grid-template-columns: ${({ $isLoading }) => ($isLoading ? '1fr 32px' : '1fr auto')};
|
|
30
|
+
gap: ${({ theme }) => theme.spacing(3)};
|
|
31
|
+
|
|
32
|
+
padding: ${({ theme }) => theme.spacing(3, 3, 3, 4)};
|
|
33
|
+
}
|
|
27
34
|
|
|
28
35
|
&:not(:last-of-type) {
|
|
29
36
|
margin-bottom: ${({ theme }) => theme.spacing(2)};
|
package/node/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/HintPlaceholder.js
CHANGED
|
@@ -10,7 +10,7 @@ const HintPlaceholder = (props) => {
|
|
|
10
10
|
const { extensions, imageProps, maxFileSize, placeholder, className, RenderImage, } = (0, useLogic_1.useLogic)(props);
|
|
11
11
|
const renderPlaceholder = () => {
|
|
12
12
|
if (!placeholder) {
|
|
13
|
-
return ((0, jsx_runtime_1.jsxs)(Typography_1.Typography, { component: "p", color: "textSecondary", variant: "caption", align: "center", children: ["\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u043B\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0444\u0430\u0439\u043B. \u0420\u0430\u0437\u043C\u0435\u0440\u043E\u043C \u043D\u0435 \u0431\u043E\u043B\u0435\u0435", ' ', (0, formatFileSizeToView_1.formatFileSizeToView)(maxFileSize), extensions && ' в формате ', (0, jsx_runtime_1.jsx)(styles_1.Extensions, { children: extensions })] }));
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)(Typography_1.Typography, { component: "p", color: "textSecondary", variant: "caption", align: "center", children: [(0, jsx_runtime_1.jsx)(styles_1.MobileWrapper, { children: "\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u043B\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0444\u0430\u0439\u043B. " }), "\u0420\u0430\u0437\u043C\u0435\u0440", (0, jsx_runtime_1.jsx)(styles_1.MobileWrapper, { children: "\u043E\u043C" }), " \u043D\u0435 \u0431\u043E\u043B\u0435\u0435", ' ', (0, formatFileSizeToView_1.formatFileSizeToView)(maxFileSize), extensions && ' в формате ', (0, jsx_runtime_1.jsx)(styles_1.Extensions, { children: extensions })] }));
|
|
14
14
|
}
|
|
15
15
|
if (typeof placeholder === 'string') {
|
|
16
16
|
return ((0, jsx_runtime_1.jsx)(Typography_1.Typography, { component: "p", color: "textSecondary", variant: "caption", align: "center", children: placeholder }));
|
package/node/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/styles.d.ts
CHANGED
|
@@ -27,3 +27,7 @@ export declare const Extensions: import("@emotion/styled/dist/declarations/src/t
|
|
|
27
27
|
theme?: import("@emotion/react").Theme | undefined;
|
|
28
28
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
29
29
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
30
|
+
export declare const MobileWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
31
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
32
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
33
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Extensions = exports.setDefaultImageStyles = exports.Image = exports.Wrapper = void 0;
|
|
3
|
+
exports.MobileWrapper = exports.Extensions = exports.setDefaultImageStyles = exports.Image = exports.Wrapper = void 0;
|
|
4
4
|
const styled_1 = require("../../../styled");
|
|
5
5
|
exports.Wrapper = styled_1.styled.div `
|
|
6
6
|
display: flex;
|
|
@@ -20,3 +20,8 @@ exports.setDefaultImageStyles = exports.Image.withComponent;
|
|
|
20
20
|
exports.Extensions = styled_1.styled.span `
|
|
21
21
|
text-transform: uppercase;
|
|
22
22
|
`;
|
|
23
|
+
exports.MobileWrapper = styled_1.styled.span `
|
|
24
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
@@ -13,6 +13,6 @@ const useLogic_1 = require("./useLogic");
|
|
|
13
13
|
const FileError = (props) => {
|
|
14
14
|
const { isVisibleRetryButton, imageProps, deleteButtonProps, retryButtonProps, RenderImage, } = (0, useLogic_1.useLogic)(props);
|
|
15
15
|
const { fileName, fileSize, errorMsg } = props;
|
|
16
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [(0, jsx_runtime_1.jsx)(RenderImage, { ...imageProps, alt: "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u044B\u0439 \u0444\u0430\u0439\u043B" }), (0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "caption", color: "error", children: errorMsg }), (0, jsx_runtime_1.jsxs)(styles_1.Details, { className: constants_1.previewFileUploaderClassnames.details, children: [(0, jsx_runtime_1.jsx)(styles_1.StyledFileInfo, { fileName: fileName, fileSize: fileSize }), (0, jsx_runtime_1.jsxs)(styles_1.Actions, { children: [isVisibleRetryButton && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443", disableInteractive: true, children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "light", color: "grey", ...retryButtonProps, children: (0, jsx_runtime_1.jsx)(RetryOutlineMd_1.RetryOutlineMd, {}) }) })), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C", disableInteractive: true, children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "light", color: "grey", ...deleteButtonProps, children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) }) })] })] })] }));
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [(0, jsx_runtime_1.jsx)(RenderImage, { ...imageProps, alt: "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u044B\u0439 \u0444\u0430\u0439\u043B" }), (0, jsx_runtime_1.jsx)(styles_1.Temp, { children: (0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "caption", color: "error", children: errorMsg }) }), (0, jsx_runtime_1.jsx)(styles_1.ButtonMobile, { ...deleteButtonProps, color: "error", children: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C" }), (0, jsx_runtime_1.jsxs)(styles_1.Details, { className: constants_1.previewFileUploaderClassnames.details, children: [(0, jsx_runtime_1.jsx)(styles_1.StyledFileInfo, { fileName: fileName, fileSize: fileSize }), (0, jsx_runtime_1.jsxs)(styles_1.Actions, { children: [isVisibleRetryButton && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443", disableInteractive: true, children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "light", color: "grey", ...retryButtonProps, children: (0, jsx_runtime_1.jsx)(RetryOutlineMd_1.RetryOutlineMd, {}) }) })), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C", disableInteractive: true, children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "light", color: "grey", ...deleteButtonProps, children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) }) })] })] })] }));
|
|
17
17
|
};
|
|
18
18
|
exports.FileError = FileError;
|