@topconsultnpm/sdkui-react-beta 6.13.18 → 6.13.20
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/assets/Designer-bianco.svg +20 -20
- package/lib/assets/Orchestrator-bianco.svg +71 -71
- package/lib/assets/Surfer-bianco.svg +18 -18
- package/lib/assets/icomoon.svg +96 -96
- package/lib/assets/italy.svg +16 -16
- package/lib/assets/topmedia-six.svg +65 -65
- package/lib/assets/topmeida-six-bianco.svg +65 -65
- package/lib/components/base/TMFileManager.d.ts +6 -0
- package/lib/components/base/TMFileManager.js +11 -5
- package/lib/components/base/TMPanel.d.ts +2 -2
- package/lib/components/base/TMPanel.js +17 -12
- package/lib/components/base/TMPanelManagerMatrix.js +36 -12
- package/lib/components/base/TMPanelManagerMatrixUtils.d.ts +1 -1
- package/lib/components/features/archive/TMArchive.js +2 -1
- package/lib/components/features/search/TMSavedQuerySelector.js +8 -8
- package/lib/components/features/search/TMSearch.js +0 -1
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +0 -3
- package/lib/components/features/search/TMSearchQueryPanel.js +3 -2
- package/lib/components/features/search/TMSearchResultsMenuItems.js +13 -2
- package/lib/components/grids/TMRecentsManager.js +16 -16
- package/package.json +1 -1
@@ -4,7 +4,7 @@ import Toolbar, { Item as ToolbarItem } from 'devextreme-react/cjs/toolbar';
|
|
4
4
|
import TreeView from 'devextreme-react/cjs/tree-view';
|
5
5
|
import ScrollView from 'devextreme-react/cjs/scroll-view';
|
6
6
|
import { ContextMenu, Pagination } from 'devextreme-react';
|
7
|
-
import { IconFolder, SDKUI_Localizator, IconHide, IconShow, IconDashboard, IconList, getFileIcon, formatBytes, Globalization } from '../../helper';
|
7
|
+
import { IconFolder, SDKUI_Localizator, IconHide, IconShow, IconDashboard, IconList, getFileIcon, formatBytes, Globalization, IconMenuVertical } from '../../helper';
|
8
8
|
import { TMSearchBar } from '../sidebar/TMHeader';
|
9
9
|
import TMButton from './TMButton';
|
10
10
|
import TMDataGrid from './TMDataGrid';
|
@@ -13,6 +13,7 @@ import { DeviceType, useDeviceType } from './TMDeviceProvider';
|
|
13
13
|
import TMToolbarCard from './TMToolbarCard';
|
14
14
|
import TMFileManagerThumbnailItems from './TMFileManagerThumbnailItems';
|
15
15
|
import TMTooltip from './TMTooltip';
|
16
|
+
import TMPanel from './TMPanel';
|
16
17
|
export var TMFileManagerPageSize;
|
17
18
|
(function (TMFileManagerPageSize) {
|
18
19
|
TMFileManagerPageSize[TMFileManagerPageSize["Small"] = 30] = "Small";
|
@@ -21,7 +22,7 @@ export var TMFileManagerPageSize;
|
|
21
22
|
})(TMFileManagerPageSize || (TMFileManagerPageSize = {}));
|
22
23
|
const TMFileManager = (props) => {
|
23
24
|
// Destructure the treeFs prop to get the root file system
|
24
|
-
const { treeFs, selectedFolder, selectedFiles, focusedFile, userID, handleSelectedFiles, handleFocusedFile, handleFocusedFolder, handleSelectedFolder, viewMode: initialViewMode, onDoubleClickHandler, handleDropFileCallback, dcmtsFound, folderContextMenuItems, fileContextMenuItems } = props;
|
25
|
+
const { treeFs, selectedFolder, selectedFiles, focusedFile, userID, handleSelectedFiles, handleFocusedFile, handleFocusedFolder, handleSelectedFolder, viewMode: initialViewMode, onDoubleClickHandler, handleDropFileCallback, dcmtsFound, folderContextMenuItems, fileContextMenuItems, showPanel = false, onClosePanel, onMaximizePanel } = props;
|
25
26
|
// State to manage the current view mode ('thumbnails' or 'details')
|
26
27
|
const [viewMode, setViewMode] = useState(initialViewMode ?? 'thumbnails');
|
27
28
|
// State to store the search text entered by the user
|
@@ -36,8 +37,6 @@ const TMFileManager = (props) => {
|
|
36
37
|
const [droppedFiles, setDroppedFiles] = useState([]);
|
37
38
|
// State to track whether a file drag operation is in progress
|
38
39
|
const [isDragging, setIsDragging] = useState(false);
|
39
|
-
/* // State to store context menu items for file manager actions
|
40
|
-
const [menuItems, setMenuItems] = useState<{folder: Array<TMFileManagerContextMenuItem>; file: Array<TMFileManagerContextMenuItem>;}>({folder: [], file: []}); */
|
41
40
|
// State to store the anchor element for the tree view context menu.
|
42
41
|
const [treeViewAnchor, setTreeViewAnchor] = useState(null);
|
43
42
|
// State to store the anchor element for another view-related menu
|
@@ -210,7 +209,14 @@ const TMFileManager = (props) => {
|
|
210
209
|
}
|
211
210
|
};
|
212
211
|
// Main render of the file manager component with a split layout
|
213
|
-
return _jsxs("div", { style: { height: "100%", width: "100%" }, children: [!isMobile &&
|
212
|
+
return _jsxs("div", { style: { height: "100%", width: "100%" }, children: [!isMobile &&
|
213
|
+
_jsx(TMPanel, { title: SDKUI_Localizator.Drafts, totalItems: dcmtsFound ?? 0, showHeader: showPanel, onClose: onClosePanel, onMaximize: onMaximizePanel, toolbar: _jsxs(_Fragment, { children: [_jsx(IconMenuVertical, { id: "TMPanel-Draft-Commands-Header", color: 'white', cursor: 'pointer' }), _jsx(ContextMenu, { showEvent: 'click', dataSource: [
|
214
|
+
{
|
215
|
+
icon: isLeftPanelCollapsed ? "eyeclose" : "eyeopen",
|
216
|
+
onClick: () => setIsLeftPanelCollapsed(prev => !prev),
|
217
|
+
text: isLeftPanelCollapsed ? SDKUI_Localizator.ShowLeftPanel : SDKUI_Localizator.HideLeftPanel,
|
218
|
+
},
|
219
|
+
], target: '#TMPanel-Draft-Commands-Header' })] }), children: _jsx("div", { style: { flexDirection: "column", height: "100%", width: "100%", }, children: _jsx("div", { style: { display: "flex", flexGrow: 1, height: "100%" }, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', showSeparator: true, separatorColor: 'transparent', separatorActiveColor: 'transparent', min: ['0', '0'], start: [isLeftPanelCollapsed ? '0%' : "50%", isLeftPanelCollapsed ? '100%' : "50%"], children: [_jsxs("div", { style: { height: "100%", width: "100%" }, onContextMenu: onTreeViewContextMenu, children: [_jsx(TreeView, { style: { marginTop: "10px" }, dataSource: treeViewData, displayExpr: "text", itemRender: renderTreeViewItem, onItemClick: handleTreeViewItemClick, onItemContextMenu: handleTreeViewContextMenu }), treeViewAnchor && _jsx(ContextMenu, { id: 'treeViewContextMenuDesktop', dataSource: folderContextMenuItems, target: treeViewAnchor, onHiding: closeTreeViewContextMenu })] }), _jsxs("div", { style: { backgroundColor: "#fff", width: "100%", height: "100%" }, children: [_jsxs(Toolbar, { style: { backgroundColor: '#f4f4f4', height: "40px", paddingLeft: "5px", paddingRight: '5px' }, children: [!showPanel && _jsx(ToolbarItem, { location: "before", children: _jsx(TMButton, { caption: isLeftPanelCollapsed ? SDKUI_Localizator.ShowLeftPanel : SDKUI_Localizator.HideLeftPanel, btnStyle: 'toolbar', color: 'primaryOutline', icon: isLeftPanelCollapsed ? _jsx(IconHide, {}) : _jsx(IconShow, {}), onClick: () => setIsLeftPanelCollapsed(prev => !prev) }) }), _jsx(ToolbarItem, { location: "before", children: _jsx(TMButton, { caption: viewMode === 'details' ? SDKUI_Localizator.PreviewView : SDKUI_Localizator.DetailsView, btnStyle: 'toolbar', color: 'primaryOutline', icon: viewMode === 'details' ? _jsx(IconDashboard, {}) : _jsx(IconList, {}), onClick: toggleViewMode }) }), _jsx(ToolbarItem, { location: "before", children: _jsx(TMSearchBar, { marginLeft: '0px', maxWidth: '160px', searchValue: searchText, onSearchValueChanged: (e) => handleSearchChange(e) }) })] }), _jsxs("div", { onDrop: handleDrop, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onContextMenu: onContextMenu, style: { width: "100%", height: "calc(100% - 40px)", border: isDragging ? '2px solid red' : '2px solid transparent' }, children: [viewMode === 'thumbnails' && _jsx(ThumbnailsView, { userID: userID, items: filteredFileItems, focusedFile: focusedFile, selectedFiles: selectedFiles, searchText: searchText, handleSelectedFiles: handleSelectedFiles, handleFocusedFile: handleFocusedFile, onDoubleClickHandler: onDoubleClickHandler, setViewAnchor: setViewAnchor }), viewMode === 'details' && _jsx(DetailsView, { userID: userID, items: filteredFileItems, selectedFiles: selectedFiles, searchText: searchText, focusedFile: focusedFile, handleSelectedFiles: handleSelectedFiles, handleFocusedFile: handleFocusedFile, onDoubleClickHandler: onDoubleClickHandler, fileContextMenuItems: fileContextMenuItems }), viewAnchor && _jsx(ContextMenu, { id: 'fileContextMenuDesktop', dataSource: fileContextMenuItems, target: viewAnchor, onHiding: closeViewContextMenu })] })] })] }, "TMWGs-panels-treeView") }) }) }), isMobile && _jsx("div", { style: { height: "100%", width: "100%" }, children: _jsxs(TMToolbarCard, { onBack: openDraftList ? onBackCallback : undefined, title: SDKUI_Localizator.Drafts, totalItems: dcmtsFound ?? 0, children: [_jsxs("div", { style: { display: openDraftList ? 'none' : 'block', transition: 'opacity 0.3s ease-in-out' }, children: [_jsx(TreeView, { style: { marginTop: "10px", }, dataSource: treeViewData, displayExpr: "text", itemRender: renderTreeViewItem, onItemClick: handleTreeViewItemClick }), treeViewAnchor && _jsx(ContextMenu, { id: 'treeViewContextMenuMobile', dataSource: folderContextMenuItems, target: treeViewAnchor, onHiding: closeTreeViewContextMenu })] }), _jsxs("div", { style: { backgroundColor: "#fff", width: "100%", height: "100%", display: openDraftList ? 'block' : 'none', transition: 'opacity 0.3s ease-in-out' }, children: [_jsxs(Toolbar, { style: { backgroundColor: '#f4f4f4', height: "40px", paddingLeft: "5px", paddingRight: '5px' }, children: [_jsx(ToolbarItem, { location: "before", children: _jsx(TMButton, { caption: viewMode === 'details' ? SDKUI_Localizator.PreviewView : SDKUI_Localizator.DetailsView, btnStyle: 'toolbar', color: 'primaryOutline', icon: viewMode === 'details' ? _jsx(IconDashboard, {}) : _jsx(IconList, {}), onClick: toggleViewMode }) }), _jsx(ToolbarItem, { location: "before", children: _jsx(TMSearchBar, { marginLeft: '0px', maxWidth: '160px', searchValue: searchText, onSearchValueChanged: (e) => handleSearchChange(e) }) })] }), _jsxs("div", { onDrop: handleDrop, onDragOver: handleDragOver, onDragLeave: handleDragLeave, style: { width: "100%", height: "calc(100% - 40px)", border: isDragging ? '2px solid red' : '2px solid transparent' }, children: [viewMode === 'thumbnails' && _jsx(ThumbnailsView, { userID: userID, items: filteredFileItems, focusedFile: focusedFile, selectedFiles: selectedFiles, searchText: searchText, handleSelectedFiles: handleSelectedFiles, handleFocusedFile: handleFocusedFile, onDoubleClickHandler: onDoubleClickHandler, setViewAnchor: setViewAnchor }), viewMode === 'details' && _jsx(DetailsView, { items: filteredFileItems, selectedFiles: selectedFiles, searchText: searchText, focusedFile: focusedFile, handleSelectedFiles: handleSelectedFiles, handleFocusedFile: handleFocusedFile, onDoubleClickHandler: onDoubleClickHandler }), viewAnchor && _jsx(ContextMenu, { id: 'fileViewContextMenuMobile', dataSource: fileContextMenuItems, target: viewAnchor, onHiding: closeViewContextMenu })] })] })] }) })] });
|
214
220
|
};
|
215
221
|
export default TMFileManager;
|
216
222
|
const highlightText = (text, searchText, isSelected) => {
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
|
3
|
-
export interface ITMPanelProps extends ITMRightSidebarProps {
|
2
|
+
export interface ITMPanelProps {
|
4
3
|
allowMaximize?: boolean;
|
5
4
|
color?: string;
|
6
5
|
backgroundColor?: string;
|
@@ -12,6 +11,7 @@ export interface ITMPanelProps extends ITMRightSidebarProps {
|
|
12
11
|
totalItems?: number;
|
13
12
|
toolbar?: any;
|
14
13
|
padding?: string;
|
14
|
+
keepActiveState?: boolean;
|
15
15
|
onBack?: () => void;
|
16
16
|
onClose?: () => void;
|
17
17
|
onHeaderDoubleClick?: () => void;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import { useLayoutEffect, useRef, useState } from 'react';
|
2
|
+
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
3
3
|
import styled from 'styled-components';
|
4
|
-
import TMRightSidebar from './TMRightSidebar';
|
5
4
|
import { IconArrowLeft, IconClearButton, IconWindowMaximize, IconWindowMinimize, isPositiveNumber, SDKUI_Localizator } from '../../helper';
|
6
5
|
import TMButton from './TMButton';
|
7
6
|
const StyledPanelContainer = styled.div `
|
@@ -63,17 +62,24 @@ const StyledPanelContent = styled.div `
|
|
63
62
|
outline: none;
|
64
63
|
}
|
65
64
|
`;
|
66
|
-
const
|
67
|
-
outline: none;
|
68
|
-
&:focus {
|
69
|
-
outline: none;
|
70
|
-
}
|
71
|
-
`;
|
72
|
-
const TMPanel = ({ allowMaximize = true, items = [], onItemClick, selectedItem, showPanel, color, backgroundColor, backgroundColorContainer, children, showHeader = true, title, totalItems, displayedItemsCount, toolbar, padding = '5px', onBack, onClose, onHeaderDoubleClick, onMaximize }) => {
|
65
|
+
const TMPanel = ({ allowMaximize = true, color, backgroundColor, backgroundColorContainer, children, showHeader = true, title, totalItems, displayedItemsCount, toolbar, padding = '5px', keepActiveState = false, onBack, onClose, onHeaderDoubleClick, onMaximize }) => {
|
73
66
|
const [isActive, setIsActive] = useState(false);
|
74
67
|
const [isMaximized, setIsMaximized] = useState(false);
|
75
68
|
const [minWidth, setMinWidth] = useState(undefined);
|
76
69
|
const titleRowRef = useRef(null);
|
70
|
+
// If keepActiveState is true, always force isActive to true
|
71
|
+
useEffect(() => {
|
72
|
+
if (keepActiveState)
|
73
|
+
setIsActive(true);
|
74
|
+
}, [keepActiveState]);
|
75
|
+
const handleFocus = () => {
|
76
|
+
if (!keepActiveState)
|
77
|
+
setIsActive(true);
|
78
|
+
};
|
79
|
+
const handleBlur = () => {
|
80
|
+
if (!keepActiveState)
|
81
|
+
setIsActive(false);
|
82
|
+
};
|
77
83
|
useLayoutEffect(() => {
|
78
84
|
if (titleRowRef.current) {
|
79
85
|
setMinWidth(titleRowRef.current.offsetWidth);
|
@@ -91,7 +97,7 @@ const TMPanel = ({ allowMaximize = true, items = [], onItemClick, selectedItem,
|
|
91
97
|
};
|
92
98
|
return (_jsxs(StyledPanelContainer, { "$isMaximized": onMaximize ? false : isMaximized, style: minWidth ? { minWidth } : undefined, children: [showHeader &&
|
93
99
|
_jsx(StyledPanelHeader, { "$backgroundColor": backgroundColor, "$color": color, "$isActive": isActive, onDoubleClick: () => { if (onHeaderDoubleClick)
|
94
|
-
onHeaderDoubleClick(); }, tabIndex: -1, onFocus:
|
100
|
+
onHeaderDoubleClick(); }, tabIndex: -1, onFocus: handleFocus, onBlur: handleBlur, onClick: handleFocus, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', width: '100%' }, children: [_jsxs("div", { ref: titleRowRef, style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '8px' }, children: [onBack &&
|
95
101
|
_jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconArrowLeft, {}), caption: SDKUI_Localizator.Back, onClick: onBack }), _jsx("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center' }, children: _jsxs("p", { style: {
|
96
102
|
whiteSpace: 'nowrap',
|
97
103
|
overflow: 'hidden',
|
@@ -103,7 +109,6 @@ const TMPanel = ({ allowMaximize = true, items = [], onItemClick, selectedItem,
|
|
103
109
|
? ` (${totalItems})`
|
104
110
|
: ''] }) })] }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '5px' }, children: [toolbar, allowMaximize && _jsx(TMButton, { color: 'primaryOutline', caption: isMaximized ? SDKUI_Localizator.Minimize : SDKUI_Localizator.Maximize, icon: isMaximized
|
105
111
|
? _jsx(IconWindowMinimize, { fontSize: 16 })
|
106
|
-
: _jsx(IconWindowMaximize, { fontSize: 16 }), btnStyle: 'icon', onClick: handleMaximize }), onClose && _jsx(TMButton, { color: 'primaryOutline', caption: SDKUI_Localizator.Close, icon: _jsx(IconClearButton, {}), btnStyle: 'icon', onClick: () => { setIsMaximized(false); onClose?.(); } })] })] }) }),
|
107
|
-
_jsx(TMRightSidebar, { items: items, onItemClick: onItemClick, selectedItem: selectedItem, showPanel: showPanel })] })] }));
|
112
|
+
: _jsx(IconWindowMaximize, { fontSize: 16 }), btnStyle: 'icon', onClick: handleMaximize }), onClose && _jsx(TMButton, { color: 'primaryOutline', caption: SDKUI_Localizator.Close, icon: _jsx(IconClearButton, {}), btnStyle: 'icon', onClick: () => { setIsMaximized(false); onClose?.(); } })] })] }) }), _jsx(StyledPanelContent, { "$height": showHeader ? "calc(100% - 40px)" : "100%", "$padding": padding, "$backgroundColor": backgroundColorContainer ?? `#FFFFFF`, tabIndex: -1, onFocus: handleFocus, onBlur: handleBlur, onClick: handleFocus, children: children })] }));
|
108
113
|
};
|
109
114
|
export default TMPanel;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React, { useEffect, useMemo, useState } from 'react';
|
3
|
-
import { SDKUI_Globals, SDKUI_Localizator,
|
4
|
-
import TMButton from './TMButton';
|
3
|
+
import { SDKUI_Globals, SDKUI_Localizator, IconInfo } from '../../helper';
|
5
4
|
import { useDeviceType, DeviceType } from './TMDeviceProvider';
|
6
5
|
import TMPanel from './TMPanel';
|
7
6
|
import { calculatePanelSizes, DesktopToolbar, getDynamicColumnWidth, getInitialMobilePanelID, MobileToolbar } from './TMPanelManagerMatrixUtils';
|
@@ -15,7 +14,29 @@ const TMPanelManagerMatrix = (props) => {
|
|
15
14
|
// State for toolbar items
|
16
15
|
const [toolbarState, setToolbarState] = useState(toolbar);
|
17
16
|
// State to track which panel IDs are currently hidden
|
18
|
-
const [hiddenPanelIds, setHiddenPanelIds] = useState(
|
17
|
+
const [hiddenPanelIds, setHiddenPanelIds] = useState(() => {
|
18
|
+
const initialHidden = new Set();
|
19
|
+
if (isMobile) {
|
20
|
+
// Mobile: mostra solo il primo pannello
|
21
|
+
let firstMobilePanelID = initialMobilePanelID ?? getInitialMobilePanelID(panelMatrixMap);
|
22
|
+
panelMatrixMap.forEach(col => {
|
23
|
+
col.rows.forEach(row => {
|
24
|
+
if (row.id !== firstMobilePanelID)
|
25
|
+
initialHidden.add(row.id);
|
26
|
+
});
|
27
|
+
});
|
28
|
+
}
|
29
|
+
else {
|
30
|
+
// Desktop: nascondi quelli con hidden true
|
31
|
+
panelMatrixMap.forEach(col => {
|
32
|
+
col.rows.forEach(row => {
|
33
|
+
if (row.hidden)
|
34
|
+
initialHidden.add(row.id);
|
35
|
+
});
|
36
|
+
});
|
37
|
+
}
|
38
|
+
return initialHidden;
|
39
|
+
});
|
19
40
|
// State to store the current widths of all column, represented as a Map
|
20
41
|
const [columnWidths, setColumnWidths] = useState(new Map());
|
21
42
|
// State to store the current heights of all panels, represented as a Map
|
@@ -131,7 +152,7 @@ const TMPanelManagerMatrix = (props) => {
|
|
131
152
|
else {
|
132
153
|
// If the panel is maximized, call maximizeMinimizePanelCallback to minimize it
|
133
154
|
if (maximizedPanelId === toolbarItem.panelManagerMatrixRowId) {
|
134
|
-
|
155
|
+
toogleMaximizeMinimizePanelCallback(toolbarItem.panelManagerMatrixRowId);
|
135
156
|
}
|
136
157
|
newHidden.add(toolbarItem.panelManagerMatrixRowId);
|
137
158
|
}
|
@@ -140,20 +161,23 @@ const TMPanelManagerMatrix = (props) => {
|
|
140
161
|
return newHidden;
|
141
162
|
});
|
142
163
|
};
|
143
|
-
const
|
144
|
-
|
145
|
-
setMaximizedPanelId(maximized);
|
164
|
+
const toogleMaximizeMinimizePanelCallback = (id) => {
|
165
|
+
setMaximizedPanelId(prevId => (prevId === id ? null : id));
|
146
166
|
};
|
147
167
|
return (_jsx("div", { style: { width: '100%', height: '100%' }, children: _jsxs("div", { style: {
|
148
168
|
display: isMobile ? 'block' : 'flex',
|
149
169
|
flexDirection: 'row',
|
150
170
|
width: "100%",
|
151
|
-
height: '100%'
|
171
|
+
height: '100%',
|
172
|
+
overflow: 'hidden',
|
173
|
+
position: 'relative',
|
152
174
|
}, children: [_jsx("div", { style: {
|
153
175
|
display: 'flex',
|
154
176
|
flexDirection: 'row',
|
155
177
|
width: (toolbarState && toolbarState.items.length > 0) ? `calc(100% - ${isMobile ? "0px" : "60px"})` : '100%',
|
156
178
|
height: `calc(100% - ${isMobile ? "60px" : "0px"})`,
|
179
|
+
overflow: 'hidden',
|
180
|
+
// transition: 'width 0.3s',
|
157
181
|
}, children: visibleColumns.length > 0 ? visibleColumns.map((column, colIndex) => {
|
158
182
|
// Retrieve the column data from the panelMatrixMap using the current column key
|
159
183
|
const col = panelMatrixMap.get(column);
|
@@ -165,7 +189,7 @@ const TMPanelManagerMatrix = (props) => {
|
|
165
189
|
display: 'flex',
|
166
190
|
flexDirection: 'column',
|
167
191
|
height: '100%',
|
168
|
-
transition: isMobile ? 'none' : 'width 0.3s',
|
192
|
+
// transition: isMobile ? 'none' : 'width 0.3s',
|
169
193
|
paddingRight: (!maximizedPanelId && !isLastColumn) ? `${gutters}px` : '0px'
|
170
194
|
};
|
171
195
|
// Declare a variable to hold the final computed style for the column
|
@@ -187,7 +211,7 @@ const TMPanelManagerMatrix = (props) => {
|
|
187
211
|
const baseStyle = {
|
188
212
|
borderRadius: '8px',
|
189
213
|
display: 'block',
|
190
|
-
transition: isMobile ? 'none' : 'all 0.3s ease',
|
214
|
+
// transition: isMobile ? 'none' : 'all 0.3s ease',
|
191
215
|
paddingBottom: (isHiddenPanel || isLastVisible || isMaximized) ? '0px' : `${gutters}px`,
|
192
216
|
};
|
193
217
|
const hiddenStyle = {
|
@@ -212,8 +236,8 @@ const TMPanelManagerMatrix = (props) => {
|
|
212
236
|
opacity: isHiddenPanel ? 0 : 1,
|
213
237
|
};
|
214
238
|
const panelStyle = maximizedPanelId ? (isMaximized ? { ...baseStyle, ...maximizedStyle } : hiddenStyle) : { ...baseStyle, ...defaultStyle };
|
215
|
-
return _jsx("div", { style: panelStyle, children: row.panel ? _jsx(TMPanel, { title: row.panel.title, totalItems: row.panel.totalItems ?? undefined, displayedItemsCount: row.panel.displayedItemsCount ?? undefined,
|
216
|
-
: _jsx("div", { style: { width: '100%', height: '100%' }, children: typeof row.content === "function" ? row.content(togglePanelVisibility, toggleToolbarItemDisabled, toggleToolbarItemVisibility) : row.content }) }, "TMPanelManagerMatrix-r-" + row.id);
|
239
|
+
return _jsx("div", { style: panelStyle, children: row.panel ? _jsx(TMPanel, { title: row.panel.title, totalItems: row.panel.totalItems ?? undefined, displayedItemsCount: row.panel.displayedItemsCount ?? undefined, onClose: (!isMobile && toolbarState) ? () => togglePanelVisibility(toolbarState.items.find(item => item.panelManagerMatrixRowId === row.id)) : undefined, onMaximize: () => toogleMaximizeMinimizePanelCallback(row.id), onHeaderDoubleClick: () => toogleMaximizeMinimizePanelCallback(row.id), allowMaximize: !isMobile, children: _jsx("div", { style: { width: '100%', height: '100%' }, children: typeof row.content === "function" ? row.content(togglePanelVisibility, toogleMaximizeMinimizePanelCallback, toggleToolbarItemDisabled, toggleToolbarItemVisibility) : row.content }) })
|
240
|
+
: _jsx("div", { style: { width: '100%', height: '100%' }, children: typeof row.content === "function" ? row.content(togglePanelVisibility, toogleMaximizeMinimizePanelCallback, toggleToolbarItemDisabled, toggleToolbarItemVisibility) : row.content }) }, "TMPanelManagerMatrix-r-" + row.id);
|
217
241
|
}) }) }, "TMPanelManagerMatrix-c-" + column));
|
218
242
|
}) : _jsxs("div", { style: {
|
219
243
|
width: '100%',
|
@@ -25,7 +25,7 @@ export interface ExtendedTMPanelProps extends ITMPanelProps {
|
|
25
25
|
export interface TMPanelManagerMatrixRow {
|
26
26
|
id: string;
|
27
27
|
hidden: boolean;
|
28
|
-
content: JSX.Element | ((togglePanelVisibility: (toolbarItem: TMPanelManagerToolbarItem | undefined) => void, toggleToolbarItemDisabled: (toolbarItem: TMPanelManagerToolbarItem | undefined) => void, toggleToolbarItemVisibility: (toolbarItem: TMPanelManagerToolbarItem | undefined) => void) => JSX.Element);
|
28
|
+
content: JSX.Element | ((togglePanelVisibility: (toolbarItem: TMPanelManagerToolbarItem | undefined) => void, toogleMaximizeMinimizePanelCallback: (id: string) => void, toggleToolbarItemDisabled: (toolbarItem: TMPanelManagerToolbarItem | undefined) => void, toggleToolbarItemVisibility: (toolbarItem: TMPanelManagerToolbarItem | undefined) => void) => JSX.Element);
|
29
29
|
height?: string;
|
30
30
|
width?: string;
|
31
31
|
panel?: ExtendedTMPanelProps;
|
@@ -10,6 +10,7 @@ import TMDcmtForm from '../documents/TMDcmtForm';
|
|
10
10
|
import { StyledToppyTextContainer, StyledToppyText } from '../search/TMSearchQueryPanel';
|
11
11
|
import TMTreeSelector from '../search/TMTreeSelector';
|
12
12
|
import TMPanel from '../../base/TMPanel';
|
13
|
+
import TMToolbarCard from '../../base/TMToolbarCard';
|
13
14
|
const TMArchive = ({ inputTID }) => {
|
14
15
|
const TIDs = SDKUI_Globals.userSettings.archivingSettings.mruTIDs;
|
15
16
|
const [currentTID, setCurrentTID] = useState(0);
|
@@ -52,6 +53,6 @@ const TMArchive = ({ inputTID }) => {
|
|
52
53
|
} }) }) }) : _jsx(_Fragment, {}), _jsx(TMLayoutItem, { children: currentTID ?
|
53
54
|
_jsx(TMDcmtForm, { TID: currentTID, DID: undefined, layoutMode: LayoutModes.Ark, customRightSidebarItems: customSidebarItems, showPreview: deviceType !== DeviceType.MOBILE, onClose: deviceType === DeviceType.MOBILE ? () => setCurrentTID(undefined) : undefined, onSaveRecents: (TIDs) => setMruTIDs(TIDs) })
|
54
55
|
:
|
55
|
-
_jsx(
|
56
|
+
_jsx(TMToolbarCard, { items: customSidebarItems, title: 'Archiviazione', children: _jsxs(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: [_jsxs(TMLayoutItem, { width: 'max-content', height: 'max-content', children: [" ", _jsxs(StyledToppyTextContainer, { children: [" ", _jsxs(StyledToppyText, { children: [" ", 'Selezionare un tipo documento', " "] }), " "] }), " "] }), _jsxs(TMLayoutItem, { width: 'max-content', height: 'max-content', children: [" ", _jsx("img", { src: Logo, width: 120, alt: '' }), " "] })] }) }) })] }) })] }));
|
56
57
|
};
|
57
58
|
export default TMArchive;
|
@@ -16,20 +16,20 @@ const StyledSqdItem = styled.div `
|
|
16
16
|
flex-direction: column;
|
17
17
|
align-items: stretch;
|
18
18
|
min-width: 0;
|
19
|
-
padding: 10px
|
19
|
+
padding: 10px;
|
20
20
|
position: relative;
|
21
21
|
white-space: nowrap;
|
22
22
|
text-overflow: ellipsis;
|
23
|
+
border-bottom: 1px solid #00A99D; // separator line
|
23
24
|
|
24
25
|
&:hover {
|
25
26
|
cursor: pointer;
|
26
27
|
}
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
margin: 4px auto;
|
28
|
+
|
29
|
+
&:last-child {
|
30
|
+
border-bottom: none; // remove border for last item
|
31
|
+
margin-bottom: 0;
|
32
|
+
}
|
33
33
|
`;
|
34
34
|
const getSharingModeColor = (sharingMode) => {
|
35
35
|
switch (sharingMode) {
|
@@ -157,7 +157,7 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
157
157
|
justifyContent: 'center',
|
158
158
|
fontSize: '1rem',
|
159
159
|
fontWeight: 'bold'
|
160
|
-
}, children: _jsx(IconApply, { fontSize: 24, color: 'green' }) }), _jsx(
|
160
|
+
}, children: _jsx(IconApply, { fontSize: 24, color: 'green' }) }), _jsx(SavedQueryContexMenu, { sqd: sqd, manageDefault: manageDefault, setDefaultAsync: () => setDefaultSQDAsync(sqd), deleteAsync: () => deleteSQDAsync(sqd), favManageAsync: () => favManageSQDAsync(sqd) })] }, sqd.id))) }), dataSource.length > initialSQDsMaxItems && searchText.length <= 0 &&
|
161
161
|
_jsx(TMButton, { elementStyle: { display: 'flex', justifyContent: 'flex-end', padding: '10px' }, btnStyle: 'icon', caption: showAllRoot ? "Mostra meno" : `Mostra tutte le ricerche (+${dataSource.length - initialSQDsMaxItems})`, icon: showAllRoot ?
|
162
162
|
_jsx("div", { style: { backgroundColor: TMColors.primaryColor, minWidth: '30px', minHeight: '30px', borderRadius: '10px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx("p", { style: { color: 'white' }, children: `-${dataSource.length - initialSQDsMaxItems}` }) }) :
|
163
163
|
_jsx("div", { style: { backgroundColor: TMColors.primaryColor, minWidth: '30px', minHeight: '30px', borderRadius: '10px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx("p", { style: { color: 'white' }, children: `+${dataSource.length - initialSQDsMaxItems}` }) }), onClick: () => setShowAllRoot(!showAllRoot) })] }));
|
@@ -166,7 +166,6 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
166
166
|
icon: _jsx(IconSavedQuery, {}),
|
167
167
|
tooltipName: 'savedQuery',
|
168
168
|
panelManagerMatrixRowId: 'savedQuery',
|
169
|
-
// alternativePanelManagerMatrixRowId: ['distinctValues']
|
170
169
|
}
|
171
170
|
]
|
172
171
|
};
|
@@ -1,14 +1,11 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { DcmtTypeDescriptor, QueryDescriptor, SavedQueryDescriptor, SearchResultDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
3
3
|
import { TID_MID } from '../../../ts';
|
4
|
-
import { ITMRightSidebarItem } from '../../base/TMRightSidebar';
|
5
4
|
interface ITMSearchQueryPanelProps {
|
6
5
|
fromDTD?: DcmtTypeDescriptor;
|
7
6
|
SQD?: SavedQueryDescriptor;
|
8
|
-
rightSidebarItems?: ITMRightSidebarItem[];
|
9
7
|
isExpertMode?: boolean;
|
10
8
|
onBack?: () => void;
|
11
|
-
onRightSidebarItemClick?: (item: string) => void;
|
12
9
|
onSqdSaved?: (newSqd: SavedQueryDescriptor) => void;
|
13
10
|
onFocusedMetadataChanged?: (tid_mid: TID_MID | undefined) => void;
|
14
11
|
onSearchCompleted?: (searchResult: SearchResultDescriptor[], qd: QueryDescriptor | undefined) => void;
|
@@ -22,7 +22,7 @@ import { TMMetadataChooserForm } from '../../choosers/TMMetadataChooser';
|
|
22
22
|
import TMQueryEditor from '../../query/TMQueryEditor';
|
23
23
|
import TMSavedQueryForm from './TMSavedQueryForm';
|
24
24
|
import { AdvancedMenuButtons } from '../../editors/TMMetadataValues';
|
25
|
-
const TMSearchQueryPanel = ({ fromDTD,
|
25
|
+
const TMSearchQueryPanel = ({ fromDTD, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, SQD, onSearchCompleted, onFocusedMetadataChanged, onSqdSaved, onBack }) => {
|
26
26
|
const [confirmQueryParams, ConfirmQueryParamsDialog] = useQueryParametersDialog();
|
27
27
|
const [qd, setQd] = useState();
|
28
28
|
const [lastQdParams, setLastQdParams] = useState([]);
|
@@ -36,6 +36,7 @@ const TMSearchQueryPanel = ({ fromDTD, rightSidebarItems, isExpertMode = SDKUI_G
|
|
36
36
|
const [showOrderByConfig, setShowOrderByConfig] = useState(false);
|
37
37
|
const [showDistinctValuesPanel, setShowDistinctValuesPanel] = useState(false);
|
38
38
|
const [focusedTidMid, setFocusedTidMid] = useState();
|
39
|
+
const [keepStatePanelIsActive, setKeepStatePanelIsActive] = useState(false);
|
39
40
|
const deviceType = useDeviceType();
|
40
41
|
let initialMaxItems = deviceType === DeviceType.MOBILE ? 8 : 12;
|
41
42
|
useEffect(() => {
|
@@ -100,7 +101,7 @@ const TMSearchQueryPanel = ({ fromDTD, rightSidebarItems, isExpertMode = SDKUI_G
|
|
100
101
|
}
|
101
102
|
}
|
102
103
|
};
|
103
|
-
return (_jsxs(_Fragment, { children: [_jsxs(TMPanel, { title: fromDTD?.nameLoc ?? SDKUI_Localizator.Search_Metadata,
|
104
|
+
return (_jsxs(_Fragment, { children: [_jsxs(TMPanel, { title: fromDTD?.nameLoc ?? SDKUI_Localizator.Search_Metadata, onBack: onBack, keepActiveState: keepStatePanelIsActive, toolbar: _jsx(_Fragment, { children: (SQD && !showSqdForm) ?
|
104
105
|
_jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'icon', caption: 'Altro', icon: _jsx(IconMenuVertical, { color: 'white' }), showTooltip: false }), items: [
|
105
106
|
{ icon: _jsx(IconAddCircleOutline, {}), text: SDKUI_Localizator.SavedQueryNew, onClick: () => { openSqdForm(FormModes.Create); } },
|
106
107
|
{ icon: _jsx(IconEdit, {}), text: SDKUI_Localizator.SavedQueryUpdate, disabled: (SQD && SQD.id == 1), onClick: () => { openSqdForm(FormModes.Update); } },
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
|
3
|
-
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconExportTo, IconFileDots, IconHide, IconInfo, IconPreview, IconRelation, IconSearch, IconShow, IconSignature, IconStar, IconSubstFile, IconUndo, SDKUI_Localizator, svgToString } from '../../../helper';
|
3
|
+
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconExportTo, IconFileDots, IconHide, IconInfo, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconSignature, IconStar, IconSubstFile, IconUndo, SDKUI_Localizator, svgToString } from '../../../helper';
|
4
4
|
import ShowAlert from '../../base/TMAlert';
|
5
5
|
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
|
6
6
|
import TMSpinner from '../../base/TMSpinner';
|
@@ -25,6 +25,7 @@ export const getSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat
|
|
25
25
|
return [];
|
26
26
|
};
|
27
27
|
export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler) => {
|
28
|
+
// let ftExplanations = focusedItem?.FTExplanations;
|
28
29
|
return [
|
29
30
|
{
|
30
31
|
icon: svgToString(_jsx(IconFileDots, {})),
|
@@ -328,7 +329,17 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
328
329
|
operationType: 'multiRow',
|
329
330
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
330
331
|
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.FreeSearchPurge); }
|
331
|
-
}
|
332
|
+
},
|
333
|
+
...(focusedItem?.FTExplanations !== undefined
|
334
|
+
? [{
|
335
|
+
icon: svgToString(_jsx(IconPlatform, {})),
|
336
|
+
text: "Dettagli del risultato",
|
337
|
+
operationType: 'singleRow',
|
338
|
+
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
339
|
+
onClick: () => {
|
340
|
+
TMMessageBoxManager.show({ buttons: [ButtonNames.OK], message: focusedItem?.FTExplanations, title: "Dettagli del risultato" });
|
341
|
+
}
|
342
|
+
}] : []),
|
332
343
|
]
|
333
344
|
},
|
334
345
|
{
|
@@ -14,31 +14,31 @@ const StyledRecentTidItem = styled.div `
|
|
14
14
|
flex-direction: column;
|
15
15
|
align-items: stretch;
|
16
16
|
min-width: 0;
|
17
|
-
padding: 10px
|
17
|
+
padding: 10px;
|
18
18
|
position: relative;
|
19
|
+
border-bottom: 1px solid #00A99D; // separator line
|
19
20
|
|
20
21
|
&:hover {
|
21
22
|
cursor: pointer;
|
22
23
|
}
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
margin: 4px auto;
|
24
|
+
|
25
|
+
&:last-child {
|
26
|
+
border-bottom: none; // remove border for last item
|
27
|
+
margin-bottom: 0;
|
28
|
+
}
|
29
29
|
`;
|
30
30
|
const iconDelete = () => ReactDOMServer.renderToString(_jsx(IconDelete, {}));
|
31
31
|
const TMRecentsManager = ({ deviceType, mruTIDs, currentMruTID, onSelectedTID, onDeletedTID }) => {
|
32
32
|
const [showDcmtTypeChooser, setShowDcmtTypeChooser] = useState(false);
|
33
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { overflowY: deviceType === DeviceType.MOBILE ? 'auto' : undefined, display: 'flex', flexDirection: 'column', padding: '5px' }, children: [
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
return (_jsxs(StyledRecentTidItem, { id: `tid-${tid}`, onClick: () => { onSelectedTID?.(tid); }, children: [_jsx("div", { style: { display: 'flex', justifyContent: 'center', width: '100%' }, children: _jsx(TMTidViewer, { tid: tid, color: TMColors.primaryColor, showIcon: false }) }), _jsx(
|
33
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { overflowY: deviceType === DeviceType.MOBILE ? 'auto' : undefined, display: 'flex', flexDirection: 'column', padding: '5px' }, children: [_jsx(StyledRecentTidItem, { id: `tid-${0}`, onClick: () => { setShowDcmtTypeChooser(true); }, children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%' }, children: _jsx("p", { style: {
|
34
|
+
color: TMColors.primaryColor,
|
35
|
+
fontSize: '1rem',
|
36
|
+
fontWeight: 600,
|
37
|
+
whiteSpace: 'nowrap',
|
38
|
+
overflow: 'hidden',
|
39
|
+
textOverflow: 'ellipsis'
|
40
|
+
}, children: `${SDKUI_Localizator.AllDcmtTypes} (${DcmtTypeListCacheService.CacheCount(true)})` }) }) }, 0), mruTIDs.map((tid) => {
|
41
|
+
return (_jsxs(StyledRecentTidItem, { id: `tid-${tid}`, onClick: () => { onSelectedTID?.(tid); }, children: [_jsx("div", { style: { display: 'flex', justifyContent: 'center', width: '100%' }, children: _jsx(TMTidViewer, { tid: tid, color: TMColors.primaryColor, showIcon: false }) }), _jsx(ContextMenu, { dataSource: [{ text: SDKUI_Localizator.Remove, icon: iconDelete(), }], target: `#tid-${tid}`, onItemClick: () => { onDeletedTID?.(tid); } }), currentMruTID == tid &&
|
42
42
|
_jsx("div", { style: {
|
43
43
|
width: '24px',
|
44
44
|
height: '24px',
|