@topconsultnpm/sdkui-react-beta 6.13.19 → 6.13.21
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/TMPanel.d.ts +2 -2
- package/lib/components/base/TMPanel.js +17 -12
- package/lib/components/base/TMPanelManagerMatrix.js +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 +18 -9
- 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 +2 -2
@@ -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;
|
@@ -236,7 +236,7 @@ const TMPanelManagerMatrix = (props) => {
|
|
236
236
|
opacity: isHiddenPanel ? 0 : 1,
|
237
237
|
};
|
238
238
|
const panelStyle = maximizedPanelId ? (isMaximized ? { ...baseStyle, ...maximizedStyle } : hiddenStyle) : { ...baseStyle, ...defaultStyle };
|
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),
|
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, showHeader: row.panel.showHeader ?? true, allowMaximize: !isMobile, onClose: (!isMobile && toolbarState) ? () => togglePanelVisibility(toolbarState.items.find(item => item.panelManagerMatrixRowId === row.id)) : undefined, onMaximize: () => toogleMaximizeMinimizePanelCallback(row.id), onHeaderDoubleClick: () => toogleMaximizeMinimizePanelCallback(row.id), children: _jsx("div", { style: { width: '100%', height: '100%' }, children: typeof row.content === "function" ? row.content(togglePanelVisibility, toogleMaximizeMinimizePanelCallback, toggleToolbarItemDisabled, toggleToolbarItemVisibility) : row.content }) })
|
240
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);
|
241
241
|
}) }) }, "TMPanelManagerMatrix-c-" + column));
|
242
242
|
}) : _jsxs("div", { style: {
|
@@ -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) })] }));
|
@@ -5,7 +5,7 @@ import TMSavedQuerySelector from './TMSavedQuerySelector';
|
|
5
5
|
import TMTreeSelector from './TMTreeSelector';
|
6
6
|
import { TabPanel, Item } from 'devextreme-react/tab-panel';
|
7
7
|
import TMSearchQueryPanel, { refreshLastSearch } from './TMSearchQueryPanel';
|
8
|
-
import { getSysAllDcmtsSQD, IconProgressReady, IconSavedQuery, IconTree, SDKUI_Globals, SDKUI_Localizator } from '../../../helper';
|
8
|
+
import { getSysAllDcmtsSQD, IconProgressReady, IconSavedQuery, IconSearch, IconTree, SDKUI_Globals, SDKUI_Localizator } from '../../../helper';
|
9
9
|
import TMSearchResult from './TMSearchResult';
|
10
10
|
import TMRecentsManager from '../../grids/TMRecentsManager';
|
11
11
|
import { SearchResultContext } from '../../../ts';
|
@@ -43,7 +43,7 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
43
43
|
content: (togglePanelVisibility) => _jsx(TMTreeSelector, { onClose: () => togglePanelVisibility({
|
44
44
|
id: 'toolbar-item-treeSelector',
|
45
45
|
icon: 'optionsgear',
|
46
|
-
tooltipName:
|
46
|
+
tooltipName: SDK_Localizator.Trees,
|
47
47
|
panelManagerMatrixRowId: 'treeSelector',
|
48
48
|
}), onSelectedTIDChanged: (tid) => {
|
49
49
|
setCurrentTID(tid);
|
@@ -66,7 +66,17 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
66
66
|
id: 'recentsManager',
|
67
67
|
height: '100%',
|
68
68
|
width: '100%',
|
69
|
-
content: _jsx(TMRecentsManager, { mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
69
|
+
content: (togglePanelVisibility) => _jsx(TMRecentsManager, { mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
70
|
+
setCurrentMruTID(tid);
|
71
|
+
setCurrentTID(tid);
|
72
|
+
togglePanelVisibility({
|
73
|
+
id: 'toolbar-item-searchQueryPanel',
|
74
|
+
icon: _jsx(IconSearch, {}),
|
75
|
+
tooltipName: SDKUI_Localizator.Search,
|
76
|
+
panelManagerMatrixRowId: 'searchQueryPanel',
|
77
|
+
// visible: deviceType === DeviceType.MOBILE
|
78
|
+
});
|
79
|
+
}, onDeletedTID: (tid) => {
|
70
80
|
let newMruTIDS = mruTIDs.slice();
|
71
81
|
let index = newMruTIDS.findIndex(o => o == tid);
|
72
82
|
if (index >= 0)
|
@@ -145,28 +155,27 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
145
155
|
{
|
146
156
|
id: 'toolbar-item-treeSelector',
|
147
157
|
icon: _jsx(IconTree, {}),
|
148
|
-
tooltipName:
|
158
|
+
tooltipName: SDK_Localizator.Trees,
|
149
159
|
panelManagerMatrixRowId: 'treeSelector',
|
150
160
|
},
|
151
161
|
{
|
152
162
|
id: 'toolbar-item-recentsManager',
|
153
163
|
icon: _jsx(IconProgressReady, {}),
|
154
|
-
tooltipName:
|
164
|
+
tooltipName: "Scorciatoie",
|
155
165
|
panelManagerMatrixRowId: 'recentsManager',
|
156
166
|
},
|
157
167
|
{
|
158
168
|
id: 'toolbar-item-searchQueryPanel',
|
159
|
-
icon: _jsx(
|
160
|
-
tooltipName:
|
169
|
+
icon: _jsx(IconSearch, {}),
|
170
|
+
tooltipName: SDKUI_Localizator.Search,
|
161
171
|
panelManagerMatrixRowId: 'searchQueryPanel',
|
162
172
|
visible: deviceType === DeviceType.MOBILE
|
163
173
|
},
|
164
174
|
{
|
165
175
|
id: 'toolbar-item-savedQuery',
|
166
176
|
icon: _jsx(IconSavedQuery, {}),
|
167
|
-
tooltipName:
|
177
|
+
tooltipName: SDK_Localizator.SavedQueries,
|
168
178
|
panelManagerMatrixRowId: 'savedQuery',
|
169
|
-
// alternativePanelManagerMatrixRowId: ['distinctValues']
|
170
179
|
}
|
171
180
|
]
|
172
181
|
};
|
@@ -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',
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@topconsultnpm/sdkui-react-beta",
|
3
|
-
"version": "6.13.
|
3
|
+
"version": "6.13.21",
|
4
4
|
"description": "",
|
5
5
|
"scripts": {
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
@@ -42,7 +42,7 @@
|
|
42
42
|
"lib"
|
43
43
|
],
|
44
44
|
"dependencies": {
|
45
|
-
"@topconsultnpm/sdk-ts-beta": "6.13.
|
45
|
+
"@topconsultnpm/sdk-ts-beta": "6.13.2",
|
46
46
|
"buffer": "^6.0.3",
|
47
47
|
"devextreme": "24.2.6",
|
48
48
|
"devextreme-react": "24.2.6",
|