@astral/ui 4.102.0 → 4.103.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Dialog/Dialog.d.ts +1 -1
- package/components/Dialog/Dialog.js +5 -4
- package/components/Dialog/styles.js +8 -0
- package/components/Dialog/types.d.ts +5 -0
- package/components/Dialog/useLogic/useLogic.d.ts +3 -3
- package/components/Dialog/useLogic/useLogic.js +6 -2
- package/components/HintPopover/styles.js +2 -1
- package/components/NewPopover/NewPopover.js +1 -0
- package/components/NewPopover/constants.d.ts +5 -0
- package/components/NewPopover/constants.js +6 -1
- package/components/NewPopover/styles.js +2 -1
- package/components/NewPopover/types.d.ts +1 -1
- package/components/NewPopover/useLogic/useLogic.d.ts +2 -2
- package/components/NewPopover/useLogic/useLogic.js +12 -12
- package/components/NewPopover/useLogic/utils/getFallbackPlacements/getFallbackPlacements.d.ts +7 -0
- package/components/NewPopover/useLogic/utils/getFallbackPlacements/getFallbackPlacements.js +19 -0
- package/components/NewPopover/useLogic/utils/getFallbackPlacements/index.d.ts +1 -0
- package/components/NewPopover/useLogic/utils/getFallbackPlacements/index.js +1 -0
- package/components/NewPopover/useLogic/utils/index.d.ts +4 -0
- package/components/NewPopover/useLogic/utils/index.js +4 -0
- package/components/Onboarding/types/step.d.ts +1 -1
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +1 -1
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.js +1 -1
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useTrackedRect/constants.d.ts +6 -0
- package/components/Onboarding/ui/hooks/useTrackedRect/constants.js +6 -0
- package/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.js +34 -12
- package/components/fileUploading/FileUploader/FIleList/FileList.d.ts +1 -1
- package/components/fileUploading/FileUploaderFile/Actions/Actions.js +2 -2
- package/components/fileUploading/FileUploaderFile/Actions/styles.js +7 -0
- package/components/fileUploading/FileUploaderFile/Actions/useLogic/useLogic.d.ts +6 -1
- package/components/fileUploading/FileUploaderFile/Actions/useLogic/useLogic.js +2 -1
- package/components/fileUploading/FileUploaderFile/FileUploaderFile.d.ts +1 -1
- package/components/fileUploading/PreviewFileUploader/FileList/FileList.d.ts +1 -1
- package/components/fileUploading/PreviewFileUploaderFile/FilePreview/FilePreview.d.ts +4 -0
- package/components/fileUploading/PreviewFileUploaderFile/FilePreview/FilePreview.js +1 -1
- package/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.d.ts +13 -51
- package/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.js +5 -1
- package/components/fileUploading/PreviewFileUploaderFile/PreviewFileUploaderFile.d.ts +4 -0
- package/components/fileUploading/PreviewFileUploaderFile/PreviewFileUploaderFile.js +2 -2
- package/components/fileUploading/hooks/useFileUploader/useFileUploader.d.ts +1 -0
- package/components/fileUploading/hooks/useFileUploader/useFileUploader.js +1 -0
- package/components/fileUploading/hooks/usePreviewFileUploader/usePreviewFileUploader.d.ts +1 -0
- package/hook-form/FormFilters/FormFiltersDialog/styles.d.ts +1 -0
- package/node/components/Dialog/Dialog.d.ts +1 -1
- package/node/components/Dialog/Dialog.js +5 -4
- package/node/components/Dialog/styles.js +8 -0
- package/node/components/Dialog/types.d.ts +5 -0
- package/node/components/Dialog/useLogic/useLogic.d.ts +3 -3
- package/node/components/Dialog/useLogic/useLogic.js +6 -2
- package/node/components/HintPopover/styles.js +2 -1
- package/node/components/NewPopover/NewPopover.js +1 -0
- package/node/components/NewPopover/constants.d.ts +5 -0
- package/node/components/NewPopover/constants.js +7 -2
- package/node/components/NewPopover/styles.js +1 -0
- package/node/components/NewPopover/types.d.ts +1 -1
- package/node/components/NewPopover/useLogic/useLogic.d.ts +2 -2
- package/node/components/NewPopover/useLogic/useLogic.js +15 -15
- package/node/components/NewPopover/useLogic/utils/getFallbackPlacements/getFallbackPlacements.d.ts +7 -0
- package/node/components/NewPopover/useLogic/utils/getFallbackPlacements/getFallbackPlacements.js +23 -0
- package/node/components/NewPopover/useLogic/utils/getFallbackPlacements/index.d.ts +1 -0
- package/node/components/NewPopover/useLogic/utils/getFallbackPlacements/index.js +17 -0
- package/node/components/NewPopover/useLogic/utils/index.d.ts +4 -0
- package/node/components/NewPopover/useLogic/utils/index.js +20 -0
- package/node/components/Onboarding/types/step.d.ts +1 -1
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +1 -1
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.js +1 -1
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useTrackedRect/constants.d.ts +6 -0
- package/node/components/Onboarding/ui/hooks/useTrackedRect/constants.js +9 -0
- package/node/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.js +34 -12
- package/node/components/fileUploading/FileUploader/FIleList/FileList.d.ts +1 -1
- package/node/components/fileUploading/FileUploaderFile/Actions/Actions.js +2 -2
- package/node/components/fileUploading/FileUploaderFile/Actions/styles.js +7 -0
- package/node/components/fileUploading/FileUploaderFile/Actions/useLogic/useLogic.d.ts +6 -1
- package/node/components/fileUploading/FileUploaderFile/Actions/useLogic/useLogic.js +2 -1
- package/node/components/fileUploading/FileUploaderFile/FileUploaderFile.d.ts +1 -1
- package/node/components/fileUploading/PreviewFileUploader/FileList/FileList.d.ts +1 -1
- package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/FilePreview.d.ts +4 -0
- package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/FilePreview.js +1 -1
- package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.d.ts +13 -51
- package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.js +5 -1
- package/node/components/fileUploading/PreviewFileUploaderFile/PreviewFileUploaderFile.d.ts +4 -0
- package/node/components/fileUploading/PreviewFileUploaderFile/PreviewFileUploaderFile.js +2 -2
- package/node/components/fileUploading/hooks/useFileUploader/useFileUploader.d.ts +1 -0
- package/node/components/fileUploading/hooks/useFileUploader/useFileUploader.js +1 -0
- package/node/components/fileUploading/hooks/usePreviewFileUploader/usePreviewFileUploader.d.ts +1 -0
- package/node/hook-form/FormFilters/FormFiltersDialog/styles.d.ts +1 -0
- package/package.json +1 -1
|
@@ -6,5 +6,5 @@ export type FileListProps = {
|
|
|
6
6
|
* Идентификатор файла, для которого выполняется удаление
|
|
7
7
|
*/
|
|
8
8
|
deletingFileId?: FileId | null;
|
|
9
|
-
} & Pick<PreviewFileUploaderFileProps, 'onDelete' | 'onRetry' | 'onView' | 'generateDownloadLink' | 'selfFiles' | 'setErrorStatusFile'>;
|
|
9
|
+
} & Pick<PreviewFileUploaderFileProps, 'onDelete' | 'onRetry' | 'onView' | 'generateDownloadLink' | 'selfFiles' | 'setErrorStatusFile' | 'isDisabled'>;
|
|
10
10
|
export declare const FileList: ({ files, deletingFileId, ...restProps }: FileListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,6 +13,6 @@ const useLogic_1 = require("./useLogic");
|
|
|
13
13
|
const FilePreview = (props) => {
|
|
14
14
|
const { getActionsList, isImageFile, isPdfFile, isOtherFile } = (0, useLogic_1.useLogic)(props);
|
|
15
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:
|
|
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, withoutContainer: !action.disabled, 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: action.title ?? '' })) }, action.tooltip))) })] })] }));
|
|
17
17
|
};
|
|
18
18
|
exports.FilePreview = FilePreview;
|
package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.d.ts
CHANGED
|
@@ -1,61 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import { type ButtonProps } from '../../../../Button';
|
|
2
3
|
import { type FilePreviewProps } from '../FilePreview';
|
|
3
4
|
type UseLogicParams = FilePreviewProps;
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Действие в списке actions превью файла.
|
|
7
|
+
*/
|
|
8
|
+
type FileAction = Omit<ButtonProps, 'type'> & {
|
|
9
|
+
type: 'button' | 'iconButton';
|
|
10
|
+
tooltip: string;
|
|
11
|
+
icon?: ReactElement;
|
|
12
|
+
title?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const useLogic: ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDelete, onView, fileType, isDeletingFile, isDisabled, }: UseLogicParams) => {
|
|
5
15
|
isImageFile: boolean;
|
|
6
16
|
isPdfFile: boolean;
|
|
7
17
|
/**
|
|
8
18
|
* Формат файла отличающийся от pdf и изображения
|
|
9
19
|
*/
|
|
10
20
|
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;
|
|
19
|
-
onClick: () => void;
|
|
20
|
-
}[] | ({
|
|
21
|
-
component: import("react").ElementType;
|
|
22
|
-
href: string;
|
|
23
|
-
target: string;
|
|
24
|
-
rel: string;
|
|
25
|
-
type: string;
|
|
26
|
-
tooltip: string;
|
|
27
|
-
variant: "light";
|
|
28
|
-
color: "grey";
|
|
29
|
-
icon: import("react").FunctionComponentElement<import("../../../..").SvgIconProps>;
|
|
30
|
-
} | {
|
|
31
|
-
onClick: () => void | undefined;
|
|
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
|
-
})[];
|
|
21
|
+
getActionsList: () => FileAction[];
|
|
60
22
|
};
|
|
61
23
|
export {};
|
package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.js
CHANGED
|
@@ -11,7 +11,7 @@ const constants_1 = require("../../../constants");
|
|
|
11
11
|
const useGenerateLocalFileURL_1 = require("../../../hooks/useGenerateLocalFileURL");
|
|
12
12
|
const MimeTypeRegistry_1 = require("../../../services/MimeTypeRegistry");
|
|
13
13
|
const generateAttrLinkNewTab_1 = require("../../../utils/generateAttrLinkNewTab");
|
|
14
|
-
const useLogic = ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDelete, onView, fileType, isDeletingFile, }) => {
|
|
14
|
+
const useLogic = ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDelete, onView, fileType, isDeletingFile, isDisabled, }) => {
|
|
15
15
|
const { generateUrl } = (0, useGenerateLocalFileURL_1.useGenerateLocalFileURL)();
|
|
16
16
|
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
17
17
|
const isPdfFile = MimeTypeRegistry_1.MimeTypeRegistry.getInstance()
|
|
@@ -84,6 +84,8 @@ const useLogic = ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDel
|
|
|
84
84
|
color: 'grey',
|
|
85
85
|
icon: (0, react_1.createElement)(BinOutlineMd_1.BinOutlineMd),
|
|
86
86
|
loading: isDeletingFile,
|
|
87
|
+
disabled: isDisabled,
|
|
88
|
+
'aria-label': 'Удалить',
|
|
87
89
|
onClick: handleDelete,
|
|
88
90
|
},
|
|
89
91
|
];
|
|
@@ -107,6 +109,8 @@ const useLogic = ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDel
|
|
|
107
109
|
color: 'grey',
|
|
108
110
|
icon: (0, react_1.createElement)(BinOutlineMd_1.BinOutlineMd),
|
|
109
111
|
loading: isDeletingFile,
|
|
112
|
+
disabled: isDisabled,
|
|
113
|
+
'aria-label': 'Удалить',
|
|
110
114
|
onClick: handleDelete,
|
|
111
115
|
},
|
|
112
116
|
];
|
|
@@ -27,6 +27,10 @@ export type PreviewFileUploaderFileProps = UploadFile & {
|
|
|
27
27
|
* Флаг загрузки при удалении файла
|
|
28
28
|
*/
|
|
29
29
|
isDeletingFile?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Флаг блокировки действий
|
|
32
|
+
*/
|
|
33
|
+
isDisabled?: boolean;
|
|
30
34
|
/**
|
|
31
35
|
* Компонент для отображения превью pdf-файлов
|
|
32
36
|
*/
|
|
@@ -8,9 +8,9 @@ const FileLoading_1 = require("./FileLoading");
|
|
|
8
8
|
const FilePreview_1 = require("./FilePreview");
|
|
9
9
|
const styles_1 = require("./styles");
|
|
10
10
|
const PreviewFileUploaderFile = (props) => {
|
|
11
|
-
const { id, name, type, file, url, size, status, generateDownloadLink, onRetry, onDelete, onView, selfFiles, setErrorStatusFile, isHidePersonalData, PdfViewer, isDeletingFile, } = props;
|
|
11
|
+
const { id, name, type, file, url, size, status, generateDownloadLink, onRetry, onDelete, onView, selfFiles, setErrorStatusFile, isHidePersonalData, PdfViewer, isDeletingFile, isDisabled, } = props;
|
|
12
12
|
const { isLoading, isUploadError, isRestrictionError, errorMsg, progress } = status || {};
|
|
13
13
|
const isError = isUploadError || isRestrictionError;
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)(Fade_1.Fade, { in: true, children: (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$isLoading": isLoading, "$isError": isError, children: [!isLoading && !isError && ((0, jsx_runtime_1.jsx)(FilePreview_1.FilePreview, { fileId: id, fileName: name, fileType: type, file: file, fileUrl: url, fileSize: size, generateDownloadLink: generateDownloadLink, onView: onView, onDelete: onDelete, isHidePersonalData: isHidePersonalData, PdfViewer: PdfViewer, isDeletingFile: isDeletingFile })), isLoading && ((0, jsx_runtime_1.jsx)(FileLoading_1.FileLoading, { selfFiles: selfFiles, setErrorStatusFile: setErrorStatusFile, fileId: id, fileName: name, fileSize: size, progress: progress })), isError && ((0, jsx_runtime_1.jsx)(FileError_1.FileError, { fileId: id, fileName: name, file: file, fileSize: size, errorMsg: errorMsg, isUploadError: isUploadError, onRetry: onRetry, onDelete: onDelete }))] }) }));
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(Fade_1.Fade, { in: true, children: (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$isLoading": isLoading, "$isError": isError, children: [!isLoading && !isError && ((0, jsx_runtime_1.jsx)(FilePreview_1.FilePreview, { fileId: id, fileName: name, fileType: type, file: file, fileUrl: url, fileSize: size, generateDownloadLink: generateDownloadLink, onView: onView, onDelete: onDelete, isHidePersonalData: isHidePersonalData, PdfViewer: PdfViewer, isDeletingFile: isDeletingFile, isDisabled: isDisabled })), isLoading && ((0, jsx_runtime_1.jsx)(FileLoading_1.FileLoading, { selfFiles: selfFiles, setErrorStatusFile: setErrorStatusFile, fileId: id, fileName: name, fileSize: size, progress: progress })), isError && ((0, jsx_runtime_1.jsx)(FileError_1.FileError, { fileId: id, fileName: name, file: file, fileSize: size, errorMsg: errorMsg, isUploadError: isUploadError, onRetry: onRetry, onDelete: onDelete }))] }) }));
|
|
15
15
|
};
|
|
16
16
|
exports.PreviewFileUploaderFile = PreviewFileUploaderFile;
|
|
@@ -44,6 +44,7 @@ export declare const useFileUploader: ({ value, isDisabled, isMultiple, accept,
|
|
|
44
44
|
className: string;
|
|
45
45
|
};
|
|
46
46
|
fileListProps: {
|
|
47
|
+
isDisabled: boolean | undefined;
|
|
47
48
|
onDelete: (fileId: FileId) => void;
|
|
48
49
|
onRetry: ((fileId: FileId, file: File) => void) | undefined;
|
|
49
50
|
onView: ((fileId: string, file?: File | undefined, fileUrl?: string | undefined) => void) | undefined;
|
package/node/components/fileUploading/hooks/usePreviewFileUploader/usePreviewFileUploader.d.ts
CHANGED
|
@@ -90,6 +90,7 @@ export declare const usePreviewFileUploader: ({ placeholderImgSrc, isHidePersona
|
|
|
90
90
|
fileListProps: {
|
|
91
91
|
isHidePersonalData: boolean | undefined;
|
|
92
92
|
PdfViewer: LazyExoticComponent<(props: PdfViewerProps) => ReactElement> | ((props: PdfViewerProps) => ReactElement) | undefined;
|
|
93
|
+
isDisabled: boolean | undefined;
|
|
93
94
|
onDelete: (fileId: string) => void;
|
|
94
95
|
onRetry: ((fileId: string, file: File) => void) | undefined;
|
|
95
96
|
onView: ((fileId: string, file?: File | undefined, fileUrl?: string | undefined) => void) | undefined;
|
|
@@ -12,6 +12,7 @@ export declare const StyledDialog: import("@emotion/styled/dist/declarations/src
|
|
|
12
12
|
disableBackdropClick?: boolean | undefined;
|
|
13
13
|
size?: import("../../../components/Dialog").DialogSize | undefined;
|
|
14
14
|
headerContent?: import("react").ReactNode;
|
|
15
|
+
disableMobileDrawer?: boolean | undefined;
|
|
15
16
|
} & {
|
|
16
17
|
theme?: import("@emotion/react").Theme | undefined;
|
|
17
18
|
}, {}, {}>;
|