@topconsultnpm/sdkui-react 6.20.0-dev1.80 → 6.20.0-dev1.82
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/lib/components/base/TMFileManager.d.ts +4 -3
- package/lib/components/base/TMFileManager.js +18 -10
- package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
- package/lib/components/base/TMFileManagerDataGridView.js +1 -11
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
- package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
- package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
- package/lib/components/features/search/TMSearch.js +3 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +2 -15
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FileItem
|
|
1
|
+
import { FileItem } from "./TMFileManagerUtils";
|
|
2
|
+
import { TMContextMenuItemProps } from '../NewComponents/ContextMenu/types';
|
|
2
3
|
interface TMFileManagerProps {
|
|
3
4
|
/** The currently focused file */
|
|
4
5
|
focusedFile: FileItem | undefined;
|
|
@@ -17,9 +18,9 @@ interface TMFileManagerProps {
|
|
|
17
18
|
/** Represents the file system tree structure */
|
|
18
19
|
treeFs: FileItem;
|
|
19
20
|
/** Context menu items for folders */
|
|
20
|
-
folderContextMenuItems: Array<
|
|
21
|
+
folderContextMenuItems: Array<TMContextMenuItemProps>;
|
|
21
22
|
/** Context menu items for files */
|
|
22
|
-
fileContextMenuItems: Array<
|
|
23
|
+
fileContextMenuItems: Array<TMContextMenuItemProps>;
|
|
23
24
|
/** Optional: Callback to handle folder selection changes */
|
|
24
25
|
handleSelectedFolder?: (folderItem: FileItem | undefined) => void;
|
|
25
26
|
/** Optional: Callback for handling double-click events on a file */
|
|
@@ -3,11 +3,12 @@ import { useCallback, useEffect, useMemo, useState } from "react";
|
|
|
3
3
|
import { extractTextsFromDirectory, findFileItems, setFolderTreeViewItems } from "./TMFileManagerUtils";
|
|
4
4
|
import { DeviceType, useDeviceType } from "./TMDeviceProvider";
|
|
5
5
|
import { formatBytes, Globalization, IconDashboard, IconFolder, IconHide, IconList, IconMenuVertical, IconRefresh, IconShow, SDKUI_Globals, SDKUI_Localizator, TMCommandsContextMenu, TMConditionalWrapper } from "../../helper";
|
|
6
|
+
import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
|
|
6
7
|
import TMTooltip from "./TMTooltip";
|
|
7
8
|
import { TMColors } from "../../utils/theme";
|
|
8
9
|
import TMPanel from "./TMPanel";
|
|
9
10
|
import { TMSplitterLayout } from "./TMLayout";
|
|
10
|
-
import {
|
|
11
|
+
import { TreeView } from "devextreme-react";
|
|
11
12
|
import Toolbar, { Item as ToolbarItem } from 'devextreme-react/toolbar';
|
|
12
13
|
import TMButton from "./TMButton";
|
|
13
14
|
import { TMSearchBar } from "../sidebar/TMHeader";
|
|
@@ -29,12 +30,12 @@ const TMFileManager = (props) => {
|
|
|
29
30
|
const [viewMode, setViewMode] = useState(initialViewMode ?? 'details');
|
|
30
31
|
// State to store transformed directory data for file manager
|
|
31
32
|
const [treeViewData, setTreeViewData] = useState([]);
|
|
32
|
-
// State to store the
|
|
33
|
-
const [
|
|
33
|
+
// State to store the tree view context menu control
|
|
34
|
+
const [treeViewContextMenuControl, setTreeViewContextMenuControl] = useState({ visible: false, position: { x: 0, y: 0 } });
|
|
34
35
|
// State to store the filtered file items after search or filtering
|
|
35
36
|
const [filteredFileItems, setFilteredFileItems] = useState([]);
|
|
36
|
-
// State to store the
|
|
37
|
-
const [
|
|
37
|
+
// State to store the thumbnails view context menu control
|
|
38
|
+
const [thumbViewContextMenuControl, setThumbViewContextMenuControl] = useState({ visible: false, position: { x: 0, y: 0 } });
|
|
38
39
|
// State to store the search text entered by the user
|
|
39
40
|
const [searchText, setSearchText] = useState('');
|
|
40
41
|
// State to control the collapse/expand of the left panel
|
|
@@ -112,7 +113,7 @@ const TMFileManager = (props) => {
|
|
|
112
113
|
], showEvent: "click", children: _jsx(IconMenuVertical, { id: "TMPanel-FileManager-Commands-Header", color: 'white', cursor: 'pointer' }) }), [isLeftPanelCollapsed]);
|
|
113
114
|
// Handle closing the context menu
|
|
114
115
|
const closeTreeViewContextMenu = useCallback(() => {
|
|
115
|
-
|
|
116
|
+
setTreeViewContextMenuControl(prev => ({ ...prev, visible: false }));
|
|
116
117
|
}, []);
|
|
117
118
|
const handleTreeViewItemClick = useCallback((e) => {
|
|
118
119
|
if (!e)
|
|
@@ -161,7 +162,10 @@ const TMFileManager = (props) => {
|
|
|
161
162
|
if (event === undefined)
|
|
162
163
|
return;
|
|
163
164
|
event.preventDefault();
|
|
164
|
-
|
|
165
|
+
setTreeViewContextMenuControl({
|
|
166
|
+
visible: true,
|
|
167
|
+
position: { x: event.clientX, y: event.clientY }
|
|
168
|
+
});
|
|
165
169
|
handleFocusedFolder?.(undefined);
|
|
166
170
|
}, []);
|
|
167
171
|
const onItemTreeViewContextMenu = useCallback((contextMenuEvent) => {
|
|
@@ -198,11 +202,15 @@ const TMFileManager = (props) => {
|
|
|
198
202
|
const handleDragLeave = (e) => {
|
|
199
203
|
setIsDragging(false);
|
|
200
204
|
};
|
|
201
|
-
return _jsx(TMPanel, { title: SDKUI_Localizator.Drafts, totalItems: dcmtsFound ?? 0, showHeader: showPanel, onBack: (isMobile && openDraftList) ? onBackCallback : undefined, onClose: onClosePanel, allowMaximize: !isMobile ? allowMaximize : false, onMaximize: !isMobile ? onMaximizePanel : undefined, onHeaderDoubleClick: !isMobile ? onMaximizePanel : undefined, toolbar: toolbar, children: _jsx("div", { style: { flexDirection: "column", height: "100%", width: "100%", }, children: _jsxs(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: "flex", flexGrow: 1, height: "100%" }, children: _jsx(TMSplitterLayout, { direction: 'horizontal', showSeparator: true, separatorColor: 'transparent', separatorActiveColor: 'transparent', min: ['0', '0'], start: [isLeftPanelCollapsed ? '0%' : "32%", isLeftPanelCollapsed ? '100%' : "68%"], children: children }, "TMWGs-panels-treeView") }), children: [_jsxs("div", { style: {
|
|
205
|
+
return _jsx(TMPanel, { title: SDKUI_Localizator.Drafts, totalItems: dcmtsFound ?? 0, showHeader: showPanel, onBack: (isMobile && openDraftList) ? onBackCallback : undefined, onClose: onClosePanel, allowMaximize: !isMobile ? allowMaximize : false, onMaximize: !isMobile ? onMaximizePanel : undefined, onHeaderDoubleClick: !isMobile ? onMaximizePanel : undefined, toolbar: toolbar, children: _jsx("div", { style: { flexDirection: "column", height: "100%", width: "100%", }, children: _jsxs(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: "flex", flexGrow: 1, height: "100%" }, children: _jsx(TMSplitterLayout, { direction: 'horizontal', showSeparator: true, separatorColor: 'transparent', separatorActiveColor: 'transparent', min: ['0', '0'], start: [isLeftPanelCollapsed ? '0%' : "32%", isLeftPanelCollapsed ? '100%' : "68%"], children: children }, "TMWGs-panels-treeView") }), children: [_jsxs("div", { id: "file-manager-tree-view-container", style: {
|
|
202
206
|
height: "100%",
|
|
203
207
|
width: "100%",
|
|
204
208
|
...(isMobile && { display: openDraftList ? 'none' : 'block', transition: "opacity 0.3s ease-in-out" }),
|
|
205
|
-
}, onContextMenu: onBackgroundTreeViewContextMenu, children: [_jsx(TreeView, { height: "100%", width: "100%", useNativeScrolling: SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar === 1, dataSource: treeViewData, displayExpr: "text", itemRender: renderTreeViewItem, onItemClick: handleTreeViewItemClick, onItemContextMenu: onItemTreeViewContextMenu }),
|
|
209
|
+
}, onContextMenu: onBackgroundTreeViewContextMenu, children: [_jsx(TreeView, { height: "100%", width: "100%", useNativeScrolling: SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar === 1, dataSource: treeViewData, displayExpr: "text", itemRender: renderTreeViewItem, onItemClick: handleTreeViewItemClick, onItemContextMenu: onItemTreeViewContextMenu }), _jsx(TMContextMenu, { items: folderContextMenuItems, target: "#file-manager-tree-view-container", externalControl: {
|
|
210
|
+
visible: treeViewContextMenuControl.visible,
|
|
211
|
+
position: treeViewContextMenuControl.position,
|
|
212
|
+
onClose: closeTreeViewContextMenu
|
|
213
|
+
} })] }), _jsxs("div", { style: {
|
|
206
214
|
backgroundColor: "#fff",
|
|
207
215
|
width: "100%",
|
|
208
216
|
height: "100%",
|
|
@@ -228,6 +236,6 @@ const TMFileManager = (props) => {
|
|
|
228
236
|
pointerEvents: "none",
|
|
229
237
|
backdropFilter: "blur(3px)",
|
|
230
238
|
textShadow: "0 2px 4px rgba(0,0,0,0.5)"
|
|
231
|
-
}, children: SDKUI_Localizator.DropFileToShare }), viewMode === 'thumbnails' && _jsx(TMFileManagerThumbnailsView, { items: filteredFileItems ?? [], allUsers: allUsers, focusedFile: focusedFile, handleFocusedFile: handleFocusedFile, selectedFiles: selectedFiles, handleSelectedFiles: handleSelectedFiles, fileContextMenuItems: fileContextMenuItems, searchText: searchText, userID: userID,
|
|
239
|
+
}, children: SDKUI_Localizator.DropFileToShare }), viewMode === 'thumbnails' && _jsx(TMFileManagerThumbnailsView, { items: filteredFileItems ?? [], allUsers: allUsers, focusedFile: focusedFile, handleFocusedFile: handleFocusedFile, selectedFiles: selectedFiles, handleSelectedFiles: handleSelectedFiles, fileContextMenuItems: fileContextMenuItems, searchText: searchText, userID: userID, thumbViewContextMenuControl: thumbViewContextMenuControl, setThumbViewContextMenuControl: setThumbViewContextMenuControl, onDoubleClickHandler: onDoubleClickHandler }), viewMode === 'details' && _jsx(TMFileManagerDataGridView, { items: filteredFileItems ?? [], allUsers: allUsers, focusedFile: focusedFile, handleFocusedFile: handleFocusedFile, selectedFiles: selectedFiles, handleSelectedFiles: handleSelectedFiles, fileContextMenuItems: fileContextMenuItems, searchText: searchText, userID: userID, onDoubleClickHandler: onDoubleClickHandler })] })] })] }) }) });
|
|
232
240
|
};
|
|
233
241
|
export default TMFileManager;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { FileItem
|
|
1
|
+
import { FileItem } from "./TMFileManagerUtils";
|
|
2
2
|
import { UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { TMContextMenuItemProps } from "../NewComponents/ContextMenu/types";
|
|
3
4
|
interface TMFileManagerDataGridViewProps {
|
|
4
5
|
items: Array<FileItem>;
|
|
5
6
|
allUsers: Array<UserDescriptor>;
|
|
@@ -7,7 +8,7 @@ interface TMFileManagerDataGridViewProps {
|
|
|
7
8
|
handleFocusedFile: (fileItem: FileItem | undefined) => void;
|
|
8
9
|
selectedFiles: Array<FileItem>;
|
|
9
10
|
handleSelectedFiles: (fileItems: Array<FileItem>) => void;
|
|
10
|
-
fileContextMenuItems: Array<
|
|
11
|
+
fileContextMenuItems: Array<TMContextMenuItemProps>;
|
|
11
12
|
searchText: string;
|
|
12
13
|
userID?: number;
|
|
13
14
|
onDoubleClickHandler?: (fileItem: FileItem | undefined) => void;
|
|
@@ -48,16 +48,6 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
48
48
|
if (onDoubleClickHandler)
|
|
49
49
|
onDoubleClickHandler(e.data);
|
|
50
50
|
}, [onDoubleClickHandler]);
|
|
51
|
-
const onContextMenuPreparing = (e) => {
|
|
52
|
-
if (e === undefined)
|
|
53
|
-
return;
|
|
54
|
-
if (e.target === 'content') {
|
|
55
|
-
if (handleFocusedFile && e.row)
|
|
56
|
-
handleFocusedFile(e.row.data);
|
|
57
|
-
e.items = e.items || [];
|
|
58
|
-
e.items = fileContextMenuItems ? [...fileContextMenuItems] : [];
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
51
|
const cellDefaultRender = useCallback((cellData) => {
|
|
62
52
|
const value = cellData.value ?? '';
|
|
63
53
|
return renderHighlightedText(value.toString(), searchText, false);
|
|
@@ -96,6 +86,6 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
96
86
|
{ dataField: "creationTime", caption: SDKUI_Localizator.CreationTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
|
|
97
87
|
];
|
|
98
88
|
}, [searchText]);
|
|
99
|
-
return _jsx(TMDataGrid, { dataSource: items ?? [], dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, onFocusedRowChanged: onFocusedRowChanged, onSelectionChanged: onSelectionChanged, onCellDblClick: onCellDblClick,
|
|
89
|
+
return _jsx(TMDataGrid, { dataSource: items ?? [], dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, onFocusedRowChanged: onFocusedRowChanged, onSelectionChanged: onSelectionChanged, onCellDblClick: onCellDblClick, customContextMenuItems: fileContextMenuItems, showSearchPanel: false, noDataText: SDKUI_Localizator.FolderIsEmpty }, items.length);
|
|
100
90
|
};
|
|
101
91
|
export default TMFileManagerDataGridView;
|
|
@@ -10,7 +10,13 @@ export interface TMFileManagerThumbnailItemsProps {
|
|
|
10
10
|
selectedFiles: Array<FileItem>;
|
|
11
11
|
handleSelectedFiles: (fileItems: Array<FileItem>) => void;
|
|
12
12
|
searchText: string;
|
|
13
|
-
|
|
13
|
+
setThumbViewContextMenuControl: React.Dispatch<React.SetStateAction<{
|
|
14
|
+
visible: boolean;
|
|
15
|
+
position: {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
}>>;
|
|
14
20
|
onDoubleClick?: (file: FileItem) => void;
|
|
15
21
|
userID?: number;
|
|
16
22
|
}
|
|
@@ -6,7 +6,7 @@ import TMTooltip from './TMTooltip';
|
|
|
6
6
|
import TMDcmtIcon from '../features/documents/TMDcmtIcon';
|
|
7
7
|
const TMFileManagerThumbnailItems = (props) => {
|
|
8
8
|
// Destructuring props for cleaner usage
|
|
9
|
-
const { items, allUsers, paginatedItems, selectedFiles, searchText, userID, onDoubleClick, handleSelectedFiles, handleFocusedFile,
|
|
9
|
+
const { items, allUsers, paginatedItems, selectedFiles, searchText, userID, onDoubleClick, handleSelectedFiles, handleFocusedFile, setThumbViewContextMenuControl } = props;
|
|
10
10
|
// Ref for the scrollable container
|
|
11
11
|
const containerRef = useRef(null);
|
|
12
12
|
// Stores index of the last selected item for shift selection
|
|
@@ -109,7 +109,10 @@ const TMFileManagerThumbnailItems = (props) => {
|
|
|
109
109
|
// Right-click to open context menu and set focus
|
|
110
110
|
const onContextMenu = useCallback((e, item) => {
|
|
111
111
|
e.preventDefault();
|
|
112
|
-
|
|
112
|
+
setThumbViewContextMenuControl({
|
|
113
|
+
visible: true,
|
|
114
|
+
position: { x: e.clientX, y: e.clientY }
|
|
115
|
+
});
|
|
113
116
|
handleFocusedFile(item);
|
|
114
117
|
}, []);
|
|
115
118
|
const findCheckOutUserName = useCallback((item) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { FileItem
|
|
2
|
+
import { FileItem } from "./TMFileManagerUtils";
|
|
3
3
|
import { UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
4
|
+
import { TMContextMenuItemProps } from '../NewComponents/ContextMenu/types';
|
|
4
5
|
interface TMFileManagerThumbnailsViewProps {
|
|
5
6
|
items: Array<FileItem>;
|
|
6
7
|
allUsers: Array<UserDescriptor>;
|
|
@@ -8,12 +9,24 @@ interface TMFileManagerThumbnailsViewProps {
|
|
|
8
9
|
handleFocusedFile: (fileItem: FileItem | undefined) => void;
|
|
9
10
|
selectedFiles: Array<FileItem>;
|
|
10
11
|
handleSelectedFiles: (fileItems: Array<FileItem>) => void;
|
|
11
|
-
fileContextMenuItems: Array<
|
|
12
|
+
fileContextMenuItems: Array<TMContextMenuItemProps>;
|
|
12
13
|
searchText: string;
|
|
13
14
|
userID?: number;
|
|
14
15
|
onDoubleClickHandler?: (fileItem: FileItem | undefined) => void;
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
thumbViewContextMenuControl: {
|
|
17
|
+
visible: boolean;
|
|
18
|
+
position: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
setThumbViewContextMenuControl: React.Dispatch<React.SetStateAction<{
|
|
24
|
+
visible: boolean;
|
|
25
|
+
position: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
}>>;
|
|
17
30
|
}
|
|
18
31
|
declare const TMFileManagerThumbnailsView: (props: TMFileManagerThumbnailsViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
32
|
export default TMFileManagerThumbnailsView;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useState } from "react";
|
|
3
3
|
import { TMFileManagerPageSize } from "./TMFileManagerUtils";
|
|
4
|
-
import {
|
|
4
|
+
import { Pagination, ScrollView } from "devextreme-react";
|
|
5
|
+
import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
|
|
5
6
|
import TMFileManagerThumbnailItems from "./TMFileManagerThumbnailItems";
|
|
6
7
|
import { SDKUI_Localizator } from "../../helper";
|
|
7
8
|
const TMFileManagerThumbnailsView = (props) => {
|
|
8
|
-
const { items, allUsers, focusedFile, handleFocusedFile, selectedFiles = [], handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler,
|
|
9
|
+
const { items, allUsers, focusedFile, handleFocusedFile, selectedFiles = [], handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler, thumbViewContextMenuControl, setThumbViewContextMenuControl } = props;
|
|
9
10
|
const PAGE_SIZES = [TMFileManagerPageSize.Small, TMFileManagerPageSize.Medium, TMFileManagerPageSize.Large];
|
|
10
11
|
const initPageSize = TMFileManagerPageSize.Small;
|
|
11
12
|
const showPagination = (items?.length ?? 0) > initPageSize;
|
|
@@ -26,7 +27,7 @@ const TMFileManagerThumbnailsView = (props) => {
|
|
|
26
27
|
}, []);
|
|
27
28
|
// Handle closing the context menu
|
|
28
29
|
const closeViewContextMenu = useCallback(() => {
|
|
29
|
-
|
|
30
|
+
setThumbViewContextMenuControl(prev => ({ ...prev, visible: false }));
|
|
30
31
|
}, []);
|
|
31
32
|
const onBackgroundContextMenu = (event) => {
|
|
32
33
|
if (event === undefined)
|
|
@@ -34,13 +35,24 @@ const TMFileManagerThumbnailsView = (props) => {
|
|
|
34
35
|
if (event.target.closest('.tm-file-manager-thumbnail-items'))
|
|
35
36
|
return;
|
|
36
37
|
event.preventDefault();
|
|
37
|
-
|
|
38
|
+
setThumbViewContextMenuControl({
|
|
39
|
+
visible: true,
|
|
40
|
+
position: { x: event.clientX, y: event.clientY }
|
|
41
|
+
});
|
|
38
42
|
handleFocusedFile?.(undefined);
|
|
39
43
|
handleSelectedFiles?.([]);
|
|
40
44
|
};
|
|
41
45
|
return items.length > 0 ?
|
|
42
|
-
_jsxs("div", { style: { width: "100%", height: "100%" }, onContextMenu: onBackgroundContextMenu, children: [_jsx(ScrollView, { width: "100%", height: showPagination ? "calc(100% - 50px)" : "100%", useNative: true, direction: 'vertical', children: _jsx(TMFileManagerThumbnailItems, { items: items, allUsers: allUsers, paginatedItems: paginatedItems, focusedFile: focusedFile, selectedFiles: selectedFiles, userID: userID, searchText: searchText, handleFocusedFile: handleFocusedFile, handleSelectedFiles: handleSelectedFiles, onDoubleClick: handleItemDoubleClick,
|
|
46
|
+
_jsxs("div", { id: "file-manager-thumbnails-view", style: { width: "100%", height: "100%" }, onContextMenu: onBackgroundContextMenu, children: [_jsx(ScrollView, { width: "100%", height: showPagination ? "calc(100% - 50px)" : "100%", useNative: true, direction: 'vertical', children: _jsx(TMFileManagerThumbnailItems, { items: items, allUsers: allUsers, paginatedItems: paginatedItems, focusedFile: focusedFile, selectedFiles: selectedFiles, userID: userID, searchText: searchText, handleFocusedFile: handleFocusedFile, handleSelectedFiles: handleSelectedFiles, onDoubleClick: handleItemDoubleClick, setThumbViewContextMenuControl: setThumbViewContextMenuControl }) }), showPagination && _jsx(Pagination, { height: "50px", showInfo: true, showNavigationButtons: true, allowedPageSizes: PAGE_SIZES, displayMode: 'compact', itemCount: items.length, pageIndex: pageIndex, pageSize: pageSize, onPageIndexChange: setPageIndex, onPageSizeChange: setPageSize }), _jsx(TMContextMenu, { items: fileContextMenuItems, target: "#file-manager-thumbnails-view", externalControl: {
|
|
47
|
+
visible: thumbViewContextMenuControl.visible,
|
|
48
|
+
position: thumbViewContextMenuControl.position,
|
|
49
|
+
onClose: closeViewContextMenu
|
|
50
|
+
} })] })
|
|
43
51
|
:
|
|
44
|
-
_jsxs("div", { onContextMenu: onBackgroundContextMenu, style: { width: "100%", height: "100%", display: 'flex', justifyContent: 'center', alignItems: 'center', marginTop: '10px' }, children: [SDKUI_Localizator.FolderIsEmpty,
|
|
52
|
+
_jsxs("div", { id: "file-manager-thumbnails-view-empty", onContextMenu: onBackgroundContextMenu, style: { width: "100%", height: "100%", display: 'flex', justifyContent: 'center', alignItems: 'center', marginTop: '10px' }, children: [SDKUI_Localizator.FolderIsEmpty, _jsx(TMContextMenu, { items: fileContextMenuItems, target: "#file-manager-thumbnails-view-empty", externalControl: {
|
|
53
|
+
visible: thumbViewContextMenuControl.visible,
|
|
54
|
+
position: thumbViewContextMenuControl.position,
|
|
55
|
+
onClose: closeViewContextMenu
|
|
56
|
+
} })] });
|
|
45
57
|
};
|
|
46
58
|
export default TMFileManagerThumbnailsView;
|
|
@@ -19,18 +19,6 @@ export interface FileItem {
|
|
|
19
19
|
size?: number;
|
|
20
20
|
version?: number;
|
|
21
21
|
}
|
|
22
|
-
export interface TMFileManagerContextMenuItem {
|
|
23
|
-
text: string;
|
|
24
|
-
icon: string;
|
|
25
|
-
onClick?: (param?: any) => void;
|
|
26
|
-
operationType?: 'singleRow' | 'multiRow';
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
id?: string;
|
|
29
|
-
items?: Array<TMFileManagerContextMenuItem>;
|
|
30
|
-
beginGroup?: boolean;
|
|
31
|
-
tooltip?: string;
|
|
32
|
-
visible?: boolean;
|
|
33
|
-
}
|
|
34
22
|
export interface TMFileManagerTreeViewDirectory {
|
|
35
23
|
id: number;
|
|
36
24
|
text: string;
|
|
@@ -142,6 +142,9 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
142
142
|
}, []);
|
|
143
143
|
const onRefreshSearchAsync = async () => {
|
|
144
144
|
try {
|
|
145
|
+
if (lastQdSearched) {
|
|
146
|
+
lastQdSearched.maxDcmtsToBeReturned = maxDcmtsToBeReturned;
|
|
147
|
+
}
|
|
145
148
|
const newResult = (await refreshLastSearch(lastQdSearched)) ?? [];
|
|
146
149
|
setSearchResult(newResult);
|
|
147
150
|
}
|
|
@@ -1662,24 +1662,11 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1662
1662
|
const finalPercentage = Math.min(roundedPercentage, 100);
|
|
1663
1663
|
return finalPercentage / 100;
|
|
1664
1664
|
}, [wfDiagram]);
|
|
1665
|
-
const handleZoomToFit = useCallback(() => {
|
|
1666
|
-
const optimalZoom = calculateOptimalZoom();
|
|
1667
|
-
setZoomLevel(optimalZoom);
|
|
1668
|
-
setTranslateX(0);
|
|
1669
|
-
setTranslateY(0);
|
|
1670
|
-
setIsAutoZoomEnabled(true);
|
|
1671
|
-
}, [calculateOptimalZoom]);
|
|
1672
1665
|
const handleToggleAutoZoom = useCallback(() => {
|
|
1673
1666
|
setIsAutoZoomEnabled(prev => {
|
|
1674
1667
|
const newValue = !prev;
|
|
1675
|
-
if (
|
|
1676
|
-
// Se si
|
|
1677
|
-
setZoomLevel(1);
|
|
1678
|
-
setTranslateX(0);
|
|
1679
|
-
setTranslateY(0);
|
|
1680
|
-
}
|
|
1681
|
-
else {
|
|
1682
|
-
// Se si attiva AutoZoom, calcola lo zoom ottimale
|
|
1668
|
+
if (newValue) {
|
|
1669
|
+
// Se si attiva AutoZoom, calcola lo zoom ottimale, altrimenti mantieni il livello di zoom corrente
|
|
1683
1670
|
const optimalZoom = calculateOptimalZoom();
|
|
1684
1671
|
setZoomLevel(optimalZoom);
|
|
1685
1672
|
setTranslateX(0);
|