@topconsultnpm/sdkui-react 6.20.0-dev1.97 → 6.20.0-dev1.99
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/NewComponents/FloatingMenuBar/styles.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.js +4 -6
- package/lib/components/features/search/TMSearch.d.ts +1 -0
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchResult.d.ts +1 -0
- package/lib/components/features/search/TMSearchResult.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +1 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +11 -5
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +1 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +10 -4
- package/lib/hooks/useDataListItem.js +3 -2
- package/lib/ts/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -37,7 +37,7 @@ export const FloatingContainer = styled.div.attrs(props => ({
|
|
|
37
37
|
},
|
|
38
38
|
})) `
|
|
39
39
|
position: ${props => props.$isConstrained ? 'absolute' : 'fixed'};
|
|
40
|
-
z-index: ${props => props.$isConfigMode ? 9999 :
|
|
40
|
+
z-index: ${props => props.$isConfigMode ? 9999 : 1500};
|
|
41
41
|
display: flex;
|
|
42
42
|
flex-direction: ${props => props.$orientation === 'horizontal' ? 'row' : 'column'};
|
|
43
43
|
align-items: center;
|
|
@@ -587,14 +587,12 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
587
587
|
return;
|
|
588
588
|
}
|
|
589
589
|
try {
|
|
590
|
-
// Estrai i dati necessari dal primo workItem
|
|
591
|
-
const firstWorkItem = workItems[0];
|
|
592
590
|
// Costruisci WFInstanceDescriptor dai dati disponibili
|
|
593
591
|
const wfInstance = {
|
|
594
592
|
wfid: workflows[0].id,
|
|
595
|
-
tid:
|
|
596
|
-
did: DID,
|
|
597
|
-
instanceId:
|
|
593
|
+
tid: workflows[0].mtid,
|
|
594
|
+
did: DID ? Number(DID) : 0,
|
|
595
|
+
instanceId: undefined,
|
|
598
596
|
rowIndex: 0,
|
|
599
597
|
values: []
|
|
600
598
|
};
|
|
@@ -1629,7 +1627,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1629
1627
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
1630
1628
|
setArchiveRelatedDcmtFormMids([]);
|
|
1631
1629
|
await fetchData();
|
|
1632
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference })), showPairDcmtsModal && (_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshSearchAsync: async () => await fetchData(), onTaskCreateRequest: onTaskCreateRequest, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }))] }));
|
|
1630
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference })), showPairDcmtsModal && (_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshSearchAsync: async () => await fetchData(), onTaskCreateRequest: onTaskCreateRequest, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, toppyHelpCenterUsePortal: true }) }))] }));
|
|
1633
1631
|
};
|
|
1634
1632
|
export default TMDcmtForm;
|
|
1635
1633
|
/**
|
|
@@ -29,6 +29,7 @@ interface ITMSearchProps {
|
|
|
29
29
|
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, onRefreshSearchAsync?: (() => Promise<void>)) => void;
|
|
30
30
|
showTodoDcmtForm?: boolean;
|
|
31
31
|
showToppyDraggableHelpCenter?: boolean;
|
|
32
|
+
toppyHelpCenterUsePortal?: boolean;
|
|
32
33
|
openInOffice?: (selectedDcmtsOrFocused: Array<DcmtInfo>) => Promise<void>;
|
|
33
34
|
passToArchiveCallback?: (outputMids: Array<{
|
|
34
35
|
mid: number;
|
|
@@ -19,7 +19,7 @@ var TMSearchViews;
|
|
|
19
19
|
TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
|
|
20
20
|
TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
|
|
21
21
|
})(TMSearchViews || (TMSearchViews = {}));
|
|
22
|
-
const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, openEditPdf, editPdfForm = false, openS4TViewer, onOpenS4TViewerRequest, showTodoDcmtForm, showToppyDraggableHelpCenter = true, passToArchiveCallback, onCurrentTIDChangedCallback, onlyShowSearchQueryPanel, onReferenceClick }) => {
|
|
22
|
+
const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, openEditPdf, editPdfForm = false, openS4TViewer, onOpenS4TViewerRequest, showTodoDcmtForm, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, passToArchiveCallback, onCurrentTIDChangedCallback, onlyShowSearchQueryPanel, onReferenceClick }) => {
|
|
23
23
|
const [allSQDs, setAllSQDs] = useState([]);
|
|
24
24
|
const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
|
|
25
25
|
const [currentSQD, setCurrentSQD] = useState();
|
|
@@ -254,7 +254,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
254
254
|
toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
|
|
255
255
|
}
|
|
256
256
|
], [tmTreeSelectorElement, showSearchResults, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs]);
|
|
257
|
-
return (_jsxs(_Fragment, { children: [showSearchResults ? _jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true, minPanelSizePx: !isMobile ? 250 : 150 }) }) }) : tmSearchQueryPanelElement, showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsync: onRefreshSearchAsync, onClose: () => { onlyShowSearchQueryPanel ? setShowSearchResults(false) : setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, openEditPdf: openEditPdf, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })] }));
|
|
257
|
+
return (_jsxs(_Fragment, { children: [showSearchResults ? _jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true, minPanelSizePx: !isMobile ? 250 : 150 }) }) }) : tmSearchQueryPanelElement, showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsync: onRefreshSearchAsync, onClose: () => { onlyShowSearchQueryPanel ? setShowSearchResults(false) : setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, openEditPdf: openEditPdf, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })] }));
|
|
258
258
|
};
|
|
259
259
|
export default TMSearch;
|
|
260
260
|
const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
@@ -49,6 +49,7 @@ interface ITMSearchResultProps {
|
|
|
49
49
|
}>, tid?: number) => void;
|
|
50
50
|
showTodoDcmtForm?: boolean;
|
|
51
51
|
showToppyDraggableHelpCenter?: boolean;
|
|
52
|
+
toppyHelpCenterUsePortal?: boolean;
|
|
52
53
|
onReferenceClick?: (ref: ObjectRef) => void;
|
|
53
54
|
}
|
|
54
55
|
declare const TMSearchResult: React.FC<ITMSearchResultProps>;
|
|
@@ -67,7 +67,7 @@ const orderByName = (array) => {
|
|
|
67
67
|
return 1;
|
|
68
68
|
} return 0; });
|
|
69
69
|
};
|
|
70
|
-
const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, floatingActionConfig, openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openEditPdf, openCommentFormCallback, openAddDocumentForm, openS4TViewer = false, onOpenS4TViewerRequest, passToArchiveCallback, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, onReferenceClick, }) => {
|
|
70
|
+
const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, floatingActionConfig, openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openEditPdf, openCommentFormCallback, openAddDocumentForm, openS4TViewer = false, onOpenS4TViewerRequest, passToArchiveCallback, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, onReferenceClick, }) => {
|
|
71
71
|
const [id, setID] = useState('');
|
|
72
72
|
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
|
73
73
|
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
@@ -618,7 +618,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
618
618
|
setIsOpenBatchUpdate(false);
|
|
619
619
|
setIsModifiedBatchUpdate(false);
|
|
620
620
|
await refreshSelectionDataRowsAsync();
|
|
621
|
-
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), _jsx(TMToppyDraggableHelpCenter, { usePortal:
|
|
621
|
+
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), _jsx(TMToppyDraggableHelpCenter, { usePortal: toppyHelpCenterUsePortal, isVisible: isToppyHelpCenterVisible, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => {
|
|
622
622
|
setShowApprovePopup(true);
|
|
623
623
|
}, onSignApprove: () => {
|
|
624
624
|
handleSignApprove();
|
|
@@ -661,7 +661,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
661
661
|
TMSpinner.hide();
|
|
662
662
|
}
|
|
663
663
|
}, onClose: () => setShowManyToManyChooser(false), manageUseLocalizedName: false }), showPairDcmtsModal &&
|
|
664
|
-
_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: onRefreshSearchAsync, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, openEditPdf: openEditPdf, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, passToArchiveCallback: passToArchiveCallback, showTodoDcmtForm: showTodoDcmtForm, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), showPairSearchModal &&
|
|
664
|
+
_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: onRefreshSearchAsync, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, openEditPdf: openEditPdf, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, passToArchiveCallback: passToArchiveCallback, showTodoDcmtForm: showTodoDcmtForm, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter }) }), showPairSearchModal &&
|
|
665
665
|
_jsx(TMModal, { title: "Ricerca documenti", onClose: () => setShowPairSearchModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearch, { onlyShowSearchQueryPanel: true, inputTID: pairSearchModalTargetTID, inputMids: pairSearchModalInputMids, floatingActionConfig: pairSearchModalFloatingActionConfig, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), isOpenSharedArchive && _jsx(TMModal, { title: "Archiviazione condivisa", onClose: () => {
|
|
666
666
|
setIsOpenSharedArchive(false);
|
|
667
667
|
}, width: isMobile ? '90%' : '60%', height: isMobile ? '90%' : '80%', children: _jsx(TMArchive, { inputDID: focusedItem?.DID, inputTID: focusedItem?.TID, inputMids: currentMetadataValues.filter(md => md.mid && md.mid > 100).map(md => ({ mid: md.mid, value: md.value ?? '' })), isSharedArchive: true, inputFile: sharedDcmtFile, onSavedAsyncCallback: async (tid, did) => {
|
|
@@ -6,6 +6,7 @@ interface DiagramItemComponentProps {
|
|
|
6
6
|
isSelected: boolean;
|
|
7
7
|
isCurrent: boolean;
|
|
8
8
|
readOnly: boolean;
|
|
9
|
+
allowItemClick?: boolean;
|
|
9
10
|
onClick: (id: string, event: React.MouseEvent) => void;
|
|
10
11
|
onDrag: (id: string, newX: number, newY: number) => void;
|
|
11
12
|
onDragEnd: (id: string, finalX: number, finalY: number) => void;
|
|
@@ -38,7 +38,13 @@ const AnimatingGroup = styled.g `
|
|
|
38
38
|
`}
|
|
39
39
|
`;
|
|
40
40
|
const StyledDiagramItem = styled.g `
|
|
41
|
-
cursor: ${props =>
|
|
41
|
+
cursor: ${props => {
|
|
42
|
+
if (props.$isReadOnly && props.$allowItemClick)
|
|
43
|
+
return 'pointer';
|
|
44
|
+
if (props.$isReadOnly)
|
|
45
|
+
return 'default';
|
|
46
|
+
return props.$isDragging ? 'grabbing' : 'grab';
|
|
47
|
+
}};
|
|
42
48
|
filter: ${props => (props.$isSelected || props.$isDragging || props.$isHovered ? 'drop-shadow(2px 4px 6px rgba(0,0,0,0.4))' : 'none')};
|
|
43
49
|
|
|
44
50
|
& .item-main-shape {
|
|
@@ -81,7 +87,7 @@ const ConnectorHitArea = styled.circle `
|
|
|
81
87
|
opacity: 0;
|
|
82
88
|
pointer-events: all;
|
|
83
89
|
`;
|
|
84
|
-
const DiagramItemComponent = ({ wf, item, isSelected, isCurrent, readOnly, onClick, onDrag, onDragEnd, onConnectorMouseDown, onConnectorMouseUp, onDimensionsChange, onDoubleClick, backgroundColor, }) => {
|
|
90
|
+
const DiagramItemComponent = ({ wf, item, isSelected, isCurrent, readOnly, allowItemClick = false, onClick, onDrag, onDragEnd, onConnectorMouseDown, onConnectorMouseUp, onDimensionsChange, onDoubleClick, backgroundColor, }) => {
|
|
85
91
|
const diagramItemRef = useRef(null);
|
|
86
92
|
const textRef = useRef(null);
|
|
87
93
|
const [isDragging, setIsDragging] = useState(false);
|
|
@@ -206,12 +212,12 @@ const DiagramItemComponent = ({ wf, item, isSelected, isCurrent, readOnly, onCli
|
|
|
206
212
|
};
|
|
207
213
|
}, [isDragging, handleMouseMove, handleMouseUp, readOnly]);
|
|
208
214
|
const handleItemClick = useCallback((event) => {
|
|
209
|
-
if (readOnly)
|
|
215
|
+
if (readOnly && !allowItemClick)
|
|
210
216
|
return;
|
|
211
217
|
if (!isDragging) {
|
|
212
218
|
onClick(item.ID, event);
|
|
213
219
|
}
|
|
214
|
-
}, [item.ID, onClick, isDragging, readOnly]);
|
|
220
|
+
}, [item.ID, onClick, isDragging, readOnly, allowItemClick]);
|
|
215
221
|
const handleMouseEnter = useCallback(() => {
|
|
216
222
|
setIsHovered(true);
|
|
217
223
|
}, []);
|
|
@@ -258,6 +264,6 @@ const DiagramItemComponent = ({ wf, item, isSelected, isCurrent, readOnly, onCli
|
|
|
258
264
|
}
|
|
259
265
|
return (_jsxs(_Fragment, { children: [isTruncated && _jsx("title", { children: item.ItemName }), backgroundColor && (_jsx("rect", { x: "-5", y: "-5", width: calculatedWidth + 10, height: calculatedHeight + 10, rx: "12", ry: "12", fill: backgroundColor, opacity: "0.4", style: { filter: 'blur(3px)' } })), _jsx("rect", { x: "0", y: "0", width: calculatedWidth, height: calculatedHeight, className: "item-main-shape", fill: "transparent" }), _jsx("g", { transform: `translate(${svgX}, ${svgY})`, children: _jsx(DiagramItemSvgContent, { itemType: item.Type, width: iconRenderWidth, height: iconRenderHeight, statusData: statusData }) }), textLines.length > 0 && (_jsx("text", { ref: textRef, x: calculatedWidth / 2, dominantBaseline: "central", className: "item-text", children: textLines.map((line, index) => (_jsx("tspan", { x: calculatedWidth / 2, dy: index === 0 ? PADDING_TOP + SVG_ICON_SIZE + SPACING_SVG_TEXT : FONT_SIZE + 1, children: line }, index))) })), connectors] }));
|
|
260
266
|
};
|
|
261
|
-
return (_jsx(StyledDiagramItem, { ref: diagramItemRef, transform: `translate(${currentPosition.x}, ${currentPosition.y})`, "$isSelected": isSelected, "$itemType": item.Type, "$isDragging": isDragging, "$isHovered": isHovered, "$isReadOnly": readOnly, onMouseDown: handleMouseDown, onClick: handleItemClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onDoubleClick: handleDoubleClick, children: _jsx(AnimatingGroup, { "$isCurrent": isCurrent, children: renderContent() }) }));
|
|
267
|
+
return (_jsx(StyledDiagramItem, { ref: diagramItemRef, transform: `translate(${currentPosition.x}, ${currentPosition.y})`, "$isSelected": isSelected, "$itemType": item.Type, "$isDragging": isDragging, "$isHovered": isHovered, "$isReadOnly": readOnly, "$allowItemClick": allowItemClick, onMouseDown: handleMouseDown, onClick: handleItemClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onDoubleClick: handleDoubleClick, children: _jsx(AnimatingGroup, { "$isCurrent": isCurrent, children: renderContent() }) }));
|
|
262
268
|
};
|
|
263
269
|
export default React.memo(DiagramItemComponent);
|
|
@@ -7,6 +7,7 @@ interface IWFDiagramProps {
|
|
|
7
7
|
onDiagramChange?: (newXmlDiagram: string) => void;
|
|
8
8
|
workitems?: IWorkItemData[];
|
|
9
9
|
defaultAutoZoom?: boolean;
|
|
10
|
+
onDiagramItemClick?: (itemId: string, event: React.MouseEvent) => void;
|
|
10
11
|
}
|
|
11
12
|
declare const WFDiagram: React.FC<IWFDiagramProps>;
|
|
12
13
|
export default WFDiagram;
|
|
@@ -319,7 +319,7 @@ const DiagramMessage = styled.div `
|
|
|
319
319
|
color: #555;
|
|
320
320
|
text-align: center;
|
|
321
321
|
`;
|
|
322
|
-
const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagramChange, workitems, defaultAutoZoom = false }) => {
|
|
322
|
+
const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagramChange, workitems, defaultAutoZoom = false, onDiagramItemClick }) => {
|
|
323
323
|
const [isReadOnly, setIsReadOnly] = useState(true);
|
|
324
324
|
const [isFullScreen, setIsFullScreen] = useState(false);
|
|
325
325
|
const [zoomLevel, setZoomLevel] = useState(1);
|
|
@@ -1258,6 +1258,12 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1258
1258
|
setDraggedItemType(null);
|
|
1259
1259
|
}, [isDrawingConnection, tempConnectionSource, tempConnectionEnd, isDrawingSelectionRect, selectionRectStart, selectionRectEnd, wfDiagram, zoomLevel, translateX, translateY, isReadOnly, isDraggingExistingConnectionEndpoint, draggingConnectionId, draggingEndpointType, draggingConnectionFixedPoint]);
|
|
1260
1260
|
const handleDiagramItemClick = useCallback((id, event) => {
|
|
1261
|
+
// Se allowEdit è false e ci sono workitems, delega al parent se la callback è definita
|
|
1262
|
+
if (!allowEdit && workitems && workitems.length > 0 && onDiagramItemClick) {
|
|
1263
|
+
event.stopPropagation();
|
|
1264
|
+
onDiagramItemClick(id, event);
|
|
1265
|
+
return;
|
|
1266
|
+
}
|
|
1261
1267
|
if (isReadOnly)
|
|
1262
1268
|
return;
|
|
1263
1269
|
event.stopPropagation();
|
|
@@ -1280,7 +1286,7 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1280
1286
|
});
|
|
1281
1287
|
if (!isCtrlPressed)
|
|
1282
1288
|
setSelectedConnections(new Set());
|
|
1283
|
-
}, [isReadOnly]);
|
|
1289
|
+
}, [isReadOnly, allowEdit, workitems, onDiagramItemClick]);
|
|
1284
1290
|
const handleConnectionClick = useCallback((id, event) => {
|
|
1285
1291
|
if (isReadOnly)
|
|
1286
1292
|
return;
|
|
@@ -1816,7 +1822,7 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1816
1822
|
}, [isFullScreen]);
|
|
1817
1823
|
const diagramContent = (_jsxs(CanvasContainer, { onDoubleClick: handleCanvasDoubleClick, children: [_jsx("input", { ref: fileInputRef, type: "file", accept: ".xml" // Filtra per file XML
|
|
1818
1824
|
, onChange: handleFileChange, style: { display: 'none' } }), SDK_Globals.tmSession?.SessionDescr?.appModuleID === AppModules.SURFER ?
|
|
1819
|
-
_jsx(TMFloatingMenuBar, { containerRef: diagramRef, defaultPosition: { x:
|
|
1825
|
+
_jsx(TMFloatingMenuBar, { containerRef: diagramRef, defaultPosition: { x: 45, y: 85 }, disbaleConfigMode: true, defaultItems: [
|
|
1820
1826
|
{ icon: _jsx(IconZoomIn, {}), name: SDKUI_Localizator.ZoomIn, disabled: isAutoZoomEnabled, onClick: () => { handleZoomIn(); }, id: 'zoom-in', isPinned: true },
|
|
1821
1827
|
{ icon: _jsx(IconZoomOut, {}), name: SDKUI_Localizator.ZoomOut, disabled: isAutoZoomEnabled, onClick: () => { handleZoomOut(); }, id: 'zoom-out', isPinned: true },
|
|
1822
1828
|
{ icon: _jsx(IconZoomAuto, {}), name: 'AutoZoom', onClick: () => { handleToggleAutoZoom(); }, id: 'zoom-auto', isPinned: true, isToggle: isAutoZoomEnabled },
|
|
@@ -1826,7 +1832,7 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1826
1832
|
(_jsxs(StyledLoadingContainer, { children: [_jsx(StyledSpinner, {}), _jsx("span", { children: `${'Caricamento diagramma'}...` })] })) : wfDiagram ? (_jsx(StyledSvg, { ref: svgRef, tabIndex: 0, onKeyDownCapture: handleKeyDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseDown: handleMouseDown, onDrop: handleDropOnCanvas, onDragOver: handleDragOver, width: svgWidth, height: svgHeight, style: {
|
|
1827
1833
|
opacity: (defaultAutoZoom && !isInitialZoomCalculated) ? 0 : 1,
|
|
1828
1834
|
transition: 'opacity 0.15s ease-in'
|
|
1829
|
-
}, children: _jsxs(ScalableGroup, { "$scale": zoomLevel, "$translateX": translateX, "$translateY": translateY, children: [wfDiagram?.DiagramItems.map(item => (_jsx(DiagramItemComponent, { wf: wfDiagram?.Info, readOnly: isReadOnly, item: item, isSelected: selectedItems.has(item.ID), isCurrent: item.ID === currentSetID, onClick: handleDiagramItemClick, onDrag: handleDrag, onDragEnd: handleDragEnd, onConnectorMouseDown: handleConnectorMouseDown, onConnectorMouseUp: handleConnectorMouseUp, onDimensionsChange: handleItemDimensionsChange, onDoubleClick: handleDoubleClickItem, backgroundColor: getWorkItemBackgroundColor(item.ID) }, item.ID))), calculatedConnections.map(connection => {
|
|
1835
|
+
}, children: _jsxs(ScalableGroup, { "$scale": zoomLevel, "$translateX": translateX, "$translateY": translateY, children: [wfDiagram?.DiagramItems.map(item => (_jsx(DiagramItemComponent, { wf: wfDiagram?.Info, readOnly: isReadOnly, allowItemClick: !allowEdit && workitems && workitems.length > 0 && !!onDiagramItemClick, item: item, isSelected: selectedItems.has(item.ID), isCurrent: item.ID === currentSetID, onClick: handleDiagramItemClick, onDrag: handleDrag, onDragEnd: handleDragEnd, onConnectorMouseDown: handleConnectorMouseDown, onConnectorMouseUp: handleConnectorMouseUp, onDimensionsChange: handleItemDimensionsChange, onDoubleClick: handleDoubleClickItem, backgroundColor: getWorkItemBackgroundColor(item.ID) }, item.ID))), calculatedConnections.map(connection => {
|
|
1830
1836
|
const sourceItem = wfDiagram?.DiagramItems.find(item => item.ID === connection.Source.ParentDiagramItem.ID);
|
|
1831
1837
|
const sinkItem = wfDiagram?.DiagramItems.find(item => item.ID === connection.Sink.ParentDiagramItem.ID);
|
|
1832
1838
|
if (!sourceItem || !sinkItem)
|
|
@@ -95,6 +95,7 @@ export const useDataListItem = () => {
|
|
|
95
95
|
const renderDataListCell = useCallback((value, dataListID, dataListViewMode) => {
|
|
96
96
|
const stringValue = convertToDataListValue(value);
|
|
97
97
|
const showIcon = dataListViewMode !== DataListViewModes.Description;
|
|
98
|
+
const showText = dataListViewMode !== DataListViewModes.Image;
|
|
98
99
|
const dataListItem = getDataListItem(dataListID, stringValue);
|
|
99
100
|
const getIcon = () => {
|
|
100
101
|
if (!showIcon)
|
|
@@ -107,7 +108,7 @@ export const useDataListItem = () => {
|
|
|
107
108
|
? _jsx(TMImageLibrary, { imageID: dataListItem.imageID })
|
|
108
109
|
: _jsx(IconWarning, { color: TMColors.warning });
|
|
109
110
|
};
|
|
110
|
-
return (_jsxs(StyledDivHorizontal, { style: { width: '100%' }, title: dataListItem ? dataListItem.value : SDKUI_Localizator.ValueNotPresent, children: [getIcon(), _jsx("p", { style: {
|
|
111
|
+
return (_jsxs(StyledDivHorizontal, { style: { width: '100%' }, title: dataListItem ? dataListItem.value : SDKUI_Localizator.ValueNotPresent, children: [getIcon(), showText && (_jsx("p", { style: {
|
|
111
112
|
textAlign: 'left',
|
|
112
113
|
marginLeft: showIcon ? '5px' : '',
|
|
113
114
|
opacity: dataListItem ? 1 : 0.5,
|
|
@@ -116,7 +117,7 @@ export const useDataListItem = () => {
|
|
|
116
117
|
textOverflow: 'ellipsis',
|
|
117
118
|
flexGrow: 1,
|
|
118
119
|
minWidth: 0
|
|
119
|
-
}, children: dataListItem ? dataListItem.name : convertToDataListDisplayValue(value) })] }));
|
|
120
|
+
}, children: dataListItem ? dataListItem.name : convertToDataListDisplayValue(value) }))] }));
|
|
120
121
|
}, [getDataListItem]);
|
|
121
122
|
return {
|
|
122
123
|
loadDataListsAsync,
|
package/lib/ts/types.d.ts
CHANGED
|
@@ -316,7 +316,7 @@ export declare enum buildTypes {
|
|
|
316
316
|
*/
|
|
317
317
|
export interface WFInstanceDescriptor {
|
|
318
318
|
/** ID dell'istanza */
|
|
319
|
-
instanceId: string;
|
|
319
|
+
instanceId: string | undefined;
|
|
320
320
|
/** Indice della riga nel search result */
|
|
321
321
|
rowIndex: number;
|
|
322
322
|
/** Struttura metadati completa da searchResultToDataSource: { [key: string]: { md: MetadataDescriptor, value: any } } */
|