@astral/ui 4.97.0 → 4.99.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/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/icons/CarOutlineMd/CarOutlineMd.d.ts +3 -0
- package/icons/CarOutlineMd/CarOutlineMd.js +3 -0
- package/icons/CarOutlineMd/index.d.ts +1 -0
- package/icons/CarOutlineMd/index.js +1 -0
- package/icons/CarOutlineMd/public.d.ts +1 -0
- package/icons/CarOutlineMd/public.js +1 -0
- package/icons/index.d.ts +1 -0
- package/icons/index.js +1 -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/icons/CarOutlineMd/CarOutlineMd.d.ts +3 -0
- package/node/icons/CarOutlineMd/CarOutlineMd.js +7 -0
- package/node/icons/CarOutlineMd/index.d.ts +1 -0
- package/node/icons/CarOutlineMd/index.js +5 -0
- package/node/icons/CarOutlineMd/public.d.ts +1 -0
- package/node/icons/CarOutlineMd/public.js +5 -0
- package/node/icons/index.d.ts +1 -0
- package/node/icons/index.js +4 -2
- package/package.json +1 -1
|
@@ -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
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SvgIcon } from '../../components/SvgIcon';
|
|
3
|
+
export const CarOutlineMd = ({ ...props }) => (_jsx(SvgIcon, { ...props, children: _jsx("path", { d: "M20.15 7.621c.663 0 1.261.398 1.52 1.008l1.197 2.834c.086.203.13.422.13.643v4.262a1.65 1.65 0 0 1-1.65 1.65h-.166a2.994 2.994 0 0 1-2.913 2.307l-.154-.004a3 3 0 0 1-2.761-2.303H8.978a2.994 2.994 0 0 1-2.913 2.307l-.154-.004a2.995 2.995 0 0 1-2.761-2.303H1.684a.65.65 0 0 1 0-1.3h1.45a2.996 2.996 0 0 1 2.93-2.382l.154.004a2.996 2.996 0 0 1 2.778 2.378h6.34a3 3 0 0 1 2.932-2.382l.153.004a2.996 2.996 0 0 1 2.778 2.378h.148a.35.35 0 0 0 .35-.35v-4.262a.4.4 0 0 0-.028-.137l-1.197-2.834a.35.35 0 0 0-.322-.213h-3.092a.65.65 0 0 1 0-1.3zM6.065 15.636a1.695 1.695 0 1 0 0 3.389 1.695 1.695 0 0 0 0-3.39m12.203 0a1.696 1.696 0 1 0 0 3.388 1.696 1.696 0 0 0 0-3.388M13.45 3.675c.911 0 1.65.739 1.65 1.65v8.23c0 .912-.74 1.65-1.65 1.65h-3.226a.65.65 0 1 1 0-1.3h3.226a.35.35 0 0 0 .35-.35v-8.23a.35.35 0 0 0-.35-.35H2.653a.35.35 0 0 0-.35.35v9.23a.65.65 0 0 1-1.3 0v-9.23c0-.911.739-1.65 1.65-1.65z" }) }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CarOutlineMd } from './public';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CarOutlineMd } from './public';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CarOutlineMd } from './CarOutlineMd';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CarOutlineMd } from './CarOutlineMd';
|
package/icons/index.d.ts
CHANGED
|
@@ -233,6 +233,7 @@ export { UserArrowDownOutlineMd } from './UserArrowDownOutlineMd';
|
|
|
233
233
|
export { UserArrowUpOutlineMd } from './UserArrowUpOutlineMd';
|
|
234
234
|
export { UserCheckOutlineMd } from './UserCheckOutlineMd';
|
|
235
235
|
export { UserCrossOutlineMd } from './UserCrossOutlineMd';
|
|
236
|
+
export { CarOutlineMd } from './CarOutlineMd';
|
|
236
237
|
export { AddOutlineSm } from './AddOutlineSm';
|
|
237
238
|
export { AddSmOutlineSm } from './AddSmOutlineSm';
|
|
238
239
|
export { ArrowDwnOutlineSm } from './ArrowDwnOutlineSm';
|
package/icons/index.js
CHANGED
|
@@ -233,6 +233,7 @@ export { UserArrowDownOutlineMd } from './UserArrowDownOutlineMd';
|
|
|
233
233
|
export { UserArrowUpOutlineMd } from './UserArrowUpOutlineMd';
|
|
234
234
|
export { UserCheckOutlineMd } from './UserCheckOutlineMd';
|
|
235
235
|
export { UserCrossOutlineMd } from './UserCrossOutlineMd';
|
|
236
|
+
export { CarOutlineMd } from './CarOutlineMd';
|
|
236
237
|
export { AddOutlineSm } from './AddOutlineSm';
|
|
237
238
|
export { AddSmOutlineSm } from './AddSmOutlineSm';
|
|
238
239
|
export { ArrowDwnOutlineSm } from './ArrowDwnOutlineSm';
|
|
@@ -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;
|
|
@@ -3,6 +3,20 @@ export declare const Wrapper: import("@emotion/styled/dist/declarations/src/type
|
|
|
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<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const ButtonMobile: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
7
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
8
|
+
loading?: boolean | undefined;
|
|
9
|
+
color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
|
|
10
|
+
component?: import("react").ElementType | undefined;
|
|
11
|
+
selected?: boolean | undefined;
|
|
12
|
+
size?: "large" | "medium" | undefined;
|
|
13
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
14
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
15
|
+
}, {}, {}>;
|
|
16
|
+
export declare const Temp: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
17
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
18
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
19
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
20
|
export declare const Image: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
7
21
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
22
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
@@ -31,6 +45,7 @@ export declare const StyledFileInfo: import("@emotion/styled/dist/declarations/s
|
|
|
31
45
|
className?: string | undefined;
|
|
32
46
|
fileName: string;
|
|
33
47
|
fileSize?: number | undefined;
|
|
48
|
+
isLoading?: boolean | undefined;
|
|
34
49
|
} & {
|
|
35
50
|
theme?: import("@emotion/react").Theme | undefined;
|
|
36
51
|
}, {}, {}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Actions = exports.StyledFileInfo = exports.Details = exports.setDefaultImageStyles = exports.Image = exports.Wrapper = void 0;
|
|
3
|
+
exports.Actions = exports.StyledFileInfo = exports.Details = exports.setDefaultImageStyles = exports.Image = exports.Temp = exports.ButtonMobile = exports.Wrapper = void 0;
|
|
4
|
+
const Button_1 = require("../../../Button");
|
|
4
5
|
const styled_1 = require("../../../styled");
|
|
5
6
|
const constants_1 = require("../../constants");
|
|
6
7
|
const FileInfo_1 = require("../../FileInfo");
|
|
@@ -9,19 +10,31 @@ exports.Wrapper = styled_1.styled.div `
|
|
|
9
10
|
display: flex;
|
|
10
11
|
flex-direction: column;
|
|
11
12
|
flex-grow: 1;
|
|
13
|
+
gap: ${({ theme }) => theme.spacing(4)};
|
|
12
14
|
align-items: center;
|
|
13
15
|
justify-content: center;
|
|
14
16
|
|
|
15
17
|
width: 100%;
|
|
18
|
+
height: 1000px;
|
|
16
19
|
padding: ${({ theme }) => theme.spacing(4)};
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
${({ theme }) => theme.breakpoints.up('sm')} {
|
|
22
|
+
&:hover {
|
|
23
|
+
.${constants_1.previewFileUploaderClassnames.details} {
|
|
24
|
+
visibility: visible;
|
|
25
|
+
opacity: 1;
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
`;
|
|
30
|
+
exports.ButtonMobile = (0, styled_1.styled)(Button_1.Button) `
|
|
31
|
+
${({ theme }) => theme.breakpoints.up('sm')} {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
exports.Temp = styled_1.styled.div `
|
|
36
|
+
text-align: center;
|
|
37
|
+
`;
|
|
25
38
|
exports.Image = styled_1.styled.img `
|
|
26
39
|
display: block;
|
|
27
40
|
|
|
@@ -10,6 +10,6 @@ const styles_1 = require("./styles");
|
|
|
10
10
|
const useLogic_1 = require("./useLogic");
|
|
11
11
|
const FileLoading = (props) => {
|
|
12
12
|
const { abortButtonProps, fileName, fileSize, progress } = (0, useLogic_1.useLogic)(props);
|
|
13
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [(0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "h5", children: "\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0430..." }), (0, jsx_runtime_1.jsxs)(styles_1.Content, { children: [(0, jsx_runtime_1.jsx)(FileInfo_1.FileInfo, { fileName: fileName, fileSize: fileSize }), (0, jsx_runtime_1.jsx)(Progress_1.Progress, { progress: progress })] }), (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "light", color: "grey", ...abortButtonProps, children: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443" })] }));
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [(0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "h5", children: "\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0430..." }), (0, jsx_runtime_1.jsxs)(styles_1.Content, { children: [(0, jsx_runtime_1.jsx)(FileInfo_1.FileInfo, { fileName: fileName, fileSize: fileSize, isLoading: true }), (0, jsx_runtime_1.jsx)(Progress_1.Progress, { progress: progress })] }), (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "light", color: "grey", ...abortButtonProps, children: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443" })] }));
|
|
14
14
|
};
|
|
15
15
|
exports.FileLoading = FileLoading;
|
|
@@ -2,22 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FilePreview = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const BinOutlineMd_1 = require("../../../../icons/BinOutlineMd");
|
|
6
|
-
const DownloadOutlineMd_1 = require("../../../../icons/DownloadOutlineMd");
|
|
7
|
-
const EyeOutlineMd_1 = require("../../../../icons/EyeOutlineMd");
|
|
8
5
|
const Button_1 = require("../../../Button");
|
|
9
6
|
const IconButton_1 = require("../../../IconButton");
|
|
10
7
|
const Tooltip_1 = require("../../../Tooltip");
|
|
11
8
|
const Typography_1 = require("../../../Typography");
|
|
12
|
-
const useViewportType_1 = require("../../../useViewportType");
|
|
13
9
|
const constants_1 = require("../../constants");
|
|
14
10
|
const Preview_1 = require("./Preview");
|
|
15
11
|
const styles_1 = require("./styles");
|
|
16
12
|
const useLogic_1 = require("./useLogic");
|
|
17
13
|
const FilePreview = (props) => {
|
|
18
|
-
const {
|
|
19
|
-
const { file, fileName, fileSize, fileUrl, generateDownloadLink, isHidePersonalData, PdfViewer,
|
|
20
|
-
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [(0, jsx_runtime_1.jsx)(Preview_1.Preview, { isImageFile: isImageFile, isPdfFile: isPdfFile, file: file, fileUrl: fileUrl, generateDownloadLink: generateDownloadLink, isHidePersonalData: isHidePersonalData, PdfViewer: PdfViewer }), (0, jsx_runtime_1.jsxs)(styles_1.Details, { className: constants_1.previewFileUploaderClassnames.details, "$isOtherFile": isOtherFile, children: [isOtherFile && (0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "h6", children: "\u0424\u0430\u0439\u043B \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D" }), (0, jsx_runtime_1.jsx)(styles_1.StyledFileInfo, { "$isOtherFile": isOtherFile, fileName: fileName, fileSize: fileSize }), (0, jsx_runtime_1.jsx)(styles_1.Actions, { children: isMobile && isOtherFile ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "light", color: "grey", loading: isDeletingFile, ...deleteButtonProps, children: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C" })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isOtherFile && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: "\u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C", disableInteractive: true, children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "light", color: "grey", ...viewButtonProps, 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", disableInteractive: true, children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { component: "a", variant: "light", color: "grey", 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", disableInteractive: true, children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "light", color: "grey", loading: isDeletingFile, ...deleteButtonProps, children: (0, jsx_runtime_1.jsx)(BinOutlineMd_1.BinOutlineMd, {}) }) })] })) })] })] }));
|
|
14
|
+
const { getActionsList, isImageFile, isPdfFile, isOtherFile } = (0, useLogic_1.useLogic)(props);
|
|
15
|
+
const { file, fileName, fileSize, fileUrl, generateDownloadLink, isHidePersonalData, PdfViewer, } = props;
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [!isOtherFile && ((0, jsx_runtime_1.jsx)(Preview_1.Preview, { isImageFile: isImageFile, isPdfFile: isPdfFile, file: file, fileUrl: fileUrl, generateDownloadLink: generateDownloadLink, isHidePersonalData: isHidePersonalData, PdfViewer: PdfViewer })), (0, jsx_runtime_1.jsxs)(styles_1.Details, { className: constants_1.previewFileUploaderClassnames.details, "$isOtherFile": isOtherFile, children: [isOtherFile && (0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "h6", children: "\u0424\u0430\u0439\u043B \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D" }), (0, jsx_runtime_1.jsx)(styles_1.StyledFileInfo, { "$isOtherFile": isOtherFile, fileName: fileName, fileSize: fileSize }), (0, jsx_runtime_1.jsx)(styles_1.Actions, { children: getActionsList().map(({ type, ...action }) => ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: action.tooltip, disableInteractive: true, children: type === 'iconButton' ? ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { ...action, children: action.icon })) : ((0, jsx_runtime_1.jsx)(Button_1.Button, { ...action, children: 'title' in action ? action.title : '' })) }, action.tooltip))) })] })] }));
|
|
22
17
|
};
|
|
23
18
|
exports.FilePreview = FilePreview;
|
|
@@ -13,6 +13,7 @@ export declare const StyledFileInfo: import("@emotion/styled/dist/declarations/s
|
|
|
13
13
|
className?: string | undefined;
|
|
14
14
|
fileName: string;
|
|
15
15
|
fileSize?: number | undefined;
|
|
16
|
+
isLoading?: boolean | undefined;
|
|
16
17
|
} & {
|
|
17
18
|
theme?: import("@emotion/react").Theme | undefined;
|
|
18
19
|
} & {
|