@topconsultnpm/sdkui-react 6.21.0-dev2.6 → 6.21.0-dev2.60
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/TMAccordionNew.js +1 -0
- package/lib/components/base/TMAreaManager.js +19 -3
- package/lib/components/base/TMDataGrid.js +2 -2
- package/lib/components/base/TMModal.d.ts +1 -0
- package/lib/components/base/TMModal.js +2 -2
- package/lib/components/base/TMPanel.d.ts +7 -4
- package/lib/components/base/TMPanel.js +58 -26
- package/lib/components/base/TMTreeView.js +12 -2
- package/lib/components/base/TMWaitPanel.js +7 -4
- package/lib/components/choosers/TMDistinctValues.js +35 -21
- package/lib/components/choosers/TMUserChooser.d.ts +4 -0
- package/lib/components/choosers/TMUserChooser.js +7 -5
- package/lib/components/editors/TMFormulaEditor.d.ts +2 -0
- package/lib/components/editors/TMFormulaEditor.js +75 -21
- package/lib/components/editors/TMMetadataValues.js +2 -1
- package/lib/components/editors/TMRadioButton.js +7 -5
- package/lib/components/editors/TMTextBox.d.ts +2 -0
- package/lib/components/editors/TMTextBox.js +3 -3
- package/lib/components/features/archive/TMArchive.js +1 -1
- package/lib/components/features/documents/TMCopyToFolderForm.d.ts +24 -0
- package/lib/components/features/documents/TMCopyToFolderForm.js +379 -0
- package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtForm.js +107 -29
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +17 -2
- package/lib/components/features/documents/TMDcmtPreview.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtPreview.js +2 -2
- package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtTasks.js +2 -2
- package/lib/components/features/documents/TMDownloadRelationViewerSection.d.ts +23 -0
- package/lib/components/features/documents/TMDownloadRelationViewerSection.js +173 -0
- package/lib/components/features/documents/TMFileUploader.js +1 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +4 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +29 -9
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +26 -0
- package/lib/components/features/documents/TMMergeToPdfForm.js +293 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +13 -0
- package/lib/components/features/documents/TMRelationViewer.js +75 -6
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +71 -0
- package/lib/components/features/documents/copyAndMergeDcmtsShared.js +304 -0
- package/lib/components/features/search/SignatureParamsManager.d.ts +70 -0
- package/lib/components/features/search/SignatureParamsManager.js +145 -0
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSavedQuerySelector.js +3 -2
- package/lib/components/features/search/TMSearch.d.ts +6 -1
- package/lib/components/features/search/TMSearch.js +16 -10
- package/lib/components/features/search/TMSearchQueryPanel.js +1 -1
- package/lib/components/features/search/TMSearchResult.d.ts +4 -0
- package/lib/components/features/search/TMSearchResult.js +118 -22
- package/lib/components/features/workflow/diagram/queryDescriptorParser.js +3 -6
- package/lib/components/forms/Login/TMLoginForm.d.ts +9 -0
- package/lib/components/forms/Login/TMLoginForm.js +61 -0
- package/lib/components/forms/TMResultDialog.d.ts +1 -1
- package/lib/components/forms/TMResultDialog.js +4 -2
- package/lib/components/grids/TMBlogAttachments.d.ts +1 -0
- package/lib/components/grids/TMBlogAttachments.js +38 -12
- package/lib/components/grids/TMBlogsPost.js +7 -1
- package/lib/components/grids/TMBlogsPostUtils.js +11 -17
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/pages/TMPage.js +3 -1
- package/lib/components/query/TMQueryEditor.js +1 -1
- package/lib/components/viewers/TMTidViewer.js +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +15 -0
- package/lib/helper/SDKUI_Globals.js +15 -1
- package/lib/helper/SDKUI_Localizator.d.ts +106 -2
- package/lib/helper/SDKUI_Localizator.js +1060 -12
- package/lib/helper/TMPdfViewer.js +25 -24
- package/lib/helper/TMUtils.d.ts +20 -0
- package/lib/helper/TMUtils.js +17 -0
- package/lib/helper/ZipManager.d.ts +56 -0
- package/lib/helper/ZipManager.js +127 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useDataUserIdItem.js +6 -4
- package/lib/hooks/useDcmtOperations.d.ts +9 -2
- package/lib/hooks/useDcmtOperations.js +77 -34
- package/lib/hooks/useDocumentOperations.d.ts +5 -0
- package/lib/hooks/useDocumentOperations.js +238 -27
- package/lib/hooks/useForm.js +5 -2
- package/lib/hooks/useResizeObserver.d.ts +1 -1
- package/lib/hooks/useResizeObserver.js +16 -15
- package/package.json +3 -2
|
@@ -57,7 +57,7 @@ export var InvocationContext;
|
|
|
57
57
|
let abortControllerLocal = new AbortController();
|
|
58
58
|
;
|
|
59
59
|
//#endregion
|
|
60
|
-
const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMode = FormModes.Update, invocationContext = InvocationContext.Default, showHeader = true, showBackButton = true, showDcmtFormSidebar = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, isModal = false, titleModal, widthModal = "100%", heightModal = "100%", allowNavigation = true, canNext, canPrev, count, itemIndex, onNext, onPrev, inputFile = null, inputMids = [], connectorFileSave = undefined, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowRelations = true, allowButtonsRefs = false, openS4TViewer = false, enableDragDropOverlay = false, onClose, onSavedAsyncCallback, onSaveRecents, onWFOperationCompleted, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, onTaskCompleted, onTaskCreateRequest, moreInfoTasks, taskFormDialogComponent, handleNavigateToWGs, handleNavigateToDossiers, onReferenceClick, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, s4TViewerDialogComponent, onScanRequest, passToSearch, datagridUtility }) => {
|
|
60
|
+
const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMode = FormModes.Update, invocationContext = InvocationContext.Default, showHeader = true, showBackButton = true, showDcmtFormSidebar = true, isClosable = false, showTodoDcmtForm = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, isModal = false, titleModal, widthModal = "100%", heightModal = "100%", allowNavigation = true, canNext, canPrev, count, itemIndex, onNext, onPrev, inputFile = null, inputMids = [], connectorFileSave = undefined, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowRelations = true, allowButtonsRefs = false, openS4TViewer = false, enableDragDropOverlay = false, onClose, onSavedAsyncCallback, onSaveRecents, onWFOperationCompleted, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, onTaskCompleted, onTaskCreateRequest, moreInfoTasks, taskFormDialogComponent, handleNavigateToWGs, handleNavigateToDossiers, onReferenceClick, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, s4TViewerDialogComponent, onScanRequest, passToSearch, datagridUtility }) => {
|
|
61
61
|
const { onRefreshSearchAsyncDatagrid, onRefreshBlogDatagrid, onRefreshPreviewDatagrid } = datagridUtility || {};
|
|
62
62
|
const floatingBarContainerRef = useRef(null);
|
|
63
63
|
const [id, setID] = useState('');
|
|
@@ -91,6 +91,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
91
91
|
const formDataRef = useRef([]);
|
|
92
92
|
const fromDTDRef = useRef();
|
|
93
93
|
const dcmtFileRef = useRef(null);
|
|
94
|
+
const metadataDcmtOriginRef = useRef(null);
|
|
94
95
|
const [isOpenDistinctValues, setIsOpenDistinctValues] = useState(false);
|
|
95
96
|
const [isOpenFormulaEditor, setIsOpenFormulaEditor] = useState(false);
|
|
96
97
|
const [currentTIDHasDetailRelations, setCurrentTIDHasDetailRelations] = useState();
|
|
@@ -135,7 +136,30 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
135
136
|
if (!did)
|
|
136
137
|
return;
|
|
137
138
|
TMSpinner.show({ description: 'Loading Metadata...' });
|
|
138
|
-
let res = getMetadataResult
|
|
139
|
+
let res = getMetadataResult;
|
|
140
|
+
if (!res) {
|
|
141
|
+
try {
|
|
142
|
+
res = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(TID, did, true);
|
|
143
|
+
}
|
|
144
|
+
catch (metadataError) {
|
|
145
|
+
// Estrai ErrorCode dal campo detail se disponibile
|
|
146
|
+
let errorCode = undefined;
|
|
147
|
+
if (metadataError?.isApiException && metadataError?.response?.detail) {
|
|
148
|
+
try {
|
|
149
|
+
const detailObj = JSON.parse(metadataError.response.detail);
|
|
150
|
+
errorCode = detailObj?.ErrorCode;
|
|
151
|
+
}
|
|
152
|
+
catch (parseError) {
|
|
153
|
+
console.log("Impossibile parsare il detail dell'eccezione:", parseError);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// Se ErrorCode è -5, ignora silenziosamente, altrimenti mostra l'eccezione originale
|
|
157
|
+
if (errorCode !== -5) {
|
|
158
|
+
TMExceptionBoxManager.show({ exception: metadataError });
|
|
159
|
+
}
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
139
163
|
const origin = { fromName: res?.fromName, fromTID: res?.fromTID };
|
|
140
164
|
let dtd = res?.dtdResult;
|
|
141
165
|
let rows = dtd.rows ? dtd.rows[0] : [];
|
|
@@ -307,7 +331,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
307
331
|
}
|
|
308
332
|
else {
|
|
309
333
|
const renderedMetadata = dtd?.metadata?.filter((metadata) => handleArchiveVisibility(metadata)) ?? [];
|
|
310
|
-
const metadataList = searchResultToMetadataValues(dtd?.id, undefined, [], [], renderedMetadata, layoutMode, isReadOnlyOriginCallback(
|
|
334
|
+
const metadataList = searchResultToMetadataValues(dtd?.id, undefined, [], [], renderedMetadata, layoutMode, isReadOnlyOriginCallback(metadataDcmtOriginRef.current?.fromTID));
|
|
311
335
|
setFormDataOrig(structuredClone(metadataList));
|
|
312
336
|
setFormData(structuredClone(metadataList));
|
|
313
337
|
formDataOrigRef.current = structuredClone(metadataList);
|
|
@@ -322,7 +346,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
322
346
|
setIsInitialLoading(false);
|
|
323
347
|
setIsNavigating(false);
|
|
324
348
|
}
|
|
325
|
-
}, [TID, DID, layoutMode, inputFile, setMetadataList, handleReset, allowButtonsRefs, isReadOnlyOriginCallback
|
|
349
|
+
}, [TID, DID, layoutMode, inputFile, setMetadataList, handleReset, allowButtonsRefs, isReadOnlyOriginCallback]);
|
|
326
350
|
const currentSearchResults = useMemo(() => {
|
|
327
351
|
if (!formData || formData.length === 0 || !TID || !DID)
|
|
328
352
|
return [];
|
|
@@ -477,6 +501,9 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
477
501
|
useEffect(() => {
|
|
478
502
|
dcmtFileRef.current = dcmtFile;
|
|
479
503
|
}, [dcmtFile]);
|
|
504
|
+
useEffect(() => {
|
|
505
|
+
metadataDcmtOriginRef.current = metadataDcmtOrigin;
|
|
506
|
+
}, [metadataDcmtOrigin]);
|
|
480
507
|
useEffect(() => {
|
|
481
508
|
if (!inputFile || inputFile === null)
|
|
482
509
|
return;
|
|
@@ -775,7 +802,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
775
802
|
// Verifica che ci siano riferimenti renderizzabili (solo Dossier o WorkingGroup)
|
|
776
803
|
return dcmtReferences.some(ref => ref.objClass === ObjectClasses.Dossier || ref.objClass === ObjectClasses.WorkingGroup);
|
|
777
804
|
}, [allowButtonsRefs, layoutMode, dcmtReferences, isOpenDetails, isOpenMaster]);
|
|
778
|
-
const isToppyVisible = useMemo(() => Boolean((showToppyForApprove || showToppyForCompleteMoreInfo || showToppyForReferences) && !openS4TViewer), [showToppyForApprove, showToppyForCompleteMoreInfo, showToppyForReferences, openS4TViewer]);
|
|
805
|
+
const isToppyVisible = useMemo(() => Boolean((showToppyForApprove || showToppyForCompleteMoreInfo || showToppyForReferences) && !openS4TViewer && !showTodoDcmtForm), [showToppyForApprove, showToppyForCompleteMoreInfo, showToppyForReferences, openS4TViewer, showTodoDcmtForm]);
|
|
779
806
|
const isModified = useMemo(() => calcIsModified(formData, formDataOrig), [formData, formDataOrig]);
|
|
780
807
|
const formToolbar = useMemo(() => _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowNavigation && canPrev != undefined && _jsx("p", { style: { textAlign: 'center', padding: '1px 4px', display: 'flex' }, children: `${itemIndex}/${count}` }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: isModified, formMode: formMode, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: isModified, formMode: formMode, canNext: canNext, onNext: onNext }), layoutMode === LayoutModes.Update &&
|
|
781
808
|
_jsx(ContextMenu, { items: operationItems, trigger: "left", children: _jsx(IconMenuVertical, { color: 'white', cursor: 'pointer' }) }), layoutMode === LayoutModes.Ark &&
|
|
@@ -844,7 +871,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
844
871
|
const handleArchiveCompleted = useCallback(async () => {
|
|
845
872
|
let firstBlock = true;
|
|
846
873
|
let maxFileSize = 0;
|
|
847
|
-
let operationTitle =
|
|
874
|
+
let operationTitle = SDKUI_Localizator.Archiving;
|
|
848
875
|
setUseWaitPanelLocalState(true);
|
|
849
876
|
setShowWaitPanelLocal(true);
|
|
850
877
|
setShowPrimaryLocal(false);
|
|
@@ -893,7 +920,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
893
920
|
firstBlock = false;
|
|
894
921
|
}
|
|
895
922
|
setWaitPanelValueSecondaryLocal(pd.ProgressBarValue);
|
|
896
|
-
setWaitPanelTextSecondaryLocal(
|
|
923
|
+
setWaitPanelTextSecondaryLocal(`${SDKUI_Localizator.Archiving}... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
|
|
897
924
|
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
898
925
|
setWaitPanelMaxValueSecondaryLocal(0);
|
|
899
926
|
setWaitPanelValueSecondaryLocal(0);
|
|
@@ -1016,6 +1043,21 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1016
1043
|
fd.tid = TID;
|
|
1017
1044
|
return fd;
|
|
1018
1045
|
}, [focusedMetadataValue?.value, focusedMetadataValue?.mid, TID]);
|
|
1046
|
+
/**
|
|
1047
|
+
* Restituisce l'handler onBack per i pannelli, evitando duplicazione di codice.
|
|
1048
|
+
* @param isMainPanel - Se true, è il pannello principale (tmDcmtForm)
|
|
1049
|
+
*/
|
|
1050
|
+
const getOnBackHandler = (isMainPanel = false) => {
|
|
1051
|
+
// Se showBackButton è false, non mostrare mai il back
|
|
1052
|
+
if (showBackButton === false)
|
|
1053
|
+
return undefined;
|
|
1054
|
+
// Mobile: mostra back su tutti i pannelli (se showBackButton è definito e non è closable)
|
|
1055
|
+
if (isMobile) {
|
|
1056
|
+
return (showBackButton !== undefined && !isClosable) ? handleClose : undefined;
|
|
1057
|
+
}
|
|
1058
|
+
// Desktop: mostra back solo sul pannello principale (se showBackButton è definito e non è closable)
|
|
1059
|
+
return (showBackButton !== undefined && isMainPanel && !isClosable) ? handleClose : undefined;
|
|
1060
|
+
};
|
|
1019
1061
|
// Determina se showAll deve essere automaticamente true
|
|
1020
1062
|
// Best practice: usa useMemo per calcolare valori derivati invece di useEffect con setState
|
|
1021
1063
|
const shouldShowAll = useMemo(() => {
|
|
@@ -1100,7 +1142,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1100
1142
|
]);
|
|
1101
1143
|
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: TID, did: DID, fetchBlogDataTrigger: refreshBlogTrigger, onRefreshBlogDatagrid: onRefreshBlogDatagrid, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), [TID, DID, allTasks, refreshBlogTrigger, handleNavigateToWGs, handleNavigateToDossiers]);
|
|
1102
1144
|
const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: layoutMode, openChooserBySingleClick: !isOpenDistinctValues, TID: TID, isReadOnly: true, deviceType: deviceType, metadataValues: formData.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: formData.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [], inputMids: inputMids }), [TID, layoutMode, formData, deviceType, inputMids]);
|
|
1103
|
-
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { refreshPreviewTrigger: refreshPreviewTrigger, fromDTD: fromDTD, currentDcmt: currentDcmt, dcmtFile: dcmtFile ?? inputFile, deviceType: deviceType, layoutMode: layoutMode, onFileUpload: (file) => { setDcmtFile(file); }, openFileUploaderPdfEditor: openFileUploaderPdfEditor, enableDragDropOverlay: enableDragDropOverlay, onScanRequest: onScanRequest }), [currentDcmt, dcmtFile, deviceType, fromDTD, layoutMode, inputFile, enableDragDropOverlay, setDcmtFile, onScanRequest, openFileUploaderPdfEditor, refreshPreviewTrigger]);
|
|
1145
|
+
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { refreshPreviewTrigger: refreshPreviewTrigger, fromDTD: fromDTD, currentDcmt: currentDcmt, dcmtFile: dcmtFile ?? inputFile, deviceType: deviceType, onBack: getOnBackHandler(), layoutMode: layoutMode, onFileUpload: (file) => { setDcmtFile(file); }, openFileUploaderPdfEditor: openFileUploaderPdfEditor, enableDragDropOverlay: enableDragDropOverlay, onScanRequest: onScanRequest }), [currentDcmt, dcmtFile, deviceType, fromDTD, layoutMode, inputFile, enableDragDropOverlay, setDcmtFile, onScanRequest, openFileUploaderPdfEditor, refreshPreviewTrigger]);
|
|
1104
1146
|
const tmWF = useMemo(() => {
|
|
1105
1147
|
if (isWFDataLoading) {
|
|
1106
1148
|
return (_jsx("div", { style: {
|
|
@@ -1171,7 +1213,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1171
1213
|
did: Number(DID),
|
|
1172
1214
|
name: fromDTD?.nameLoc ?? SDKUI_Localizator.Widget_Activities,
|
|
1173
1215
|
},
|
|
1174
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, afterTaskSaved: afterTaskSaved, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }));
|
|
1216
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, afterTaskSaved: afterTaskSaved, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onBack: getOnBackHandler() }));
|
|
1175
1217
|
}, [allTasks, TID, DID, fromDTD]);
|
|
1176
1218
|
const normalizedTID = TID !== undefined ? Number(TID) : undefined;
|
|
1177
1219
|
const defaultPanelDimensions = {
|
|
@@ -1230,7 +1272,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1230
1272
|
showHeader: showHeader,
|
|
1231
1273
|
title: titleDcmtFormPanel,
|
|
1232
1274
|
allowMaximize: !isMobile,
|
|
1233
|
-
onBack:
|
|
1275
|
+
onBack: getOnBackHandler(true),
|
|
1234
1276
|
onClose: isClosable ? () => { } : undefined,
|
|
1235
1277
|
toolbar: allowNavigation ? formToolbar : _jsx(_Fragment, {})
|
|
1236
1278
|
},
|
|
@@ -1245,7 +1287,14 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1245
1287
|
{
|
|
1246
1288
|
id: 'tmBlog',
|
|
1247
1289
|
name: SDKUI_Localizator.BlogCase,
|
|
1248
|
-
contentOptions: {
|
|
1290
|
+
contentOptions: {
|
|
1291
|
+
component: tmBlog,
|
|
1292
|
+
panelContainer: {
|
|
1293
|
+
title: SDKUI_Localizator.BlogCase,
|
|
1294
|
+
allowMaximize: !isMobile,
|
|
1295
|
+
onBack: getOnBackHandler(),
|
|
1296
|
+
}
|
|
1297
|
+
},
|
|
1249
1298
|
toolbarOptions: {
|
|
1250
1299
|
icon: _jsx(IconBoard, { fontSize: 24 }),
|
|
1251
1300
|
visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmBlog,
|
|
@@ -1257,7 +1306,14 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1257
1306
|
{
|
|
1258
1307
|
id: 'tmSysMetadata',
|
|
1259
1308
|
name: SDKUI_Localizator.MetadataSystem,
|
|
1260
|
-
contentOptions: {
|
|
1309
|
+
contentOptions: {
|
|
1310
|
+
component: tmSysMetadata,
|
|
1311
|
+
panelContainer: {
|
|
1312
|
+
title: SDKUI_Localizator.MetadataSystem,
|
|
1313
|
+
allowMaximize: !isMobile,
|
|
1314
|
+
onBack: getOnBackHandler(),
|
|
1315
|
+
}
|
|
1316
|
+
},
|
|
1261
1317
|
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSysMetadata, disabled: isSysMetadataDisabled, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
|
|
1262
1318
|
},
|
|
1263
1319
|
{
|
|
@@ -1278,7 +1334,8 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1278
1334
|
contentOptions: {
|
|
1279
1335
|
component: tmWF,
|
|
1280
1336
|
panelContainer: {
|
|
1281
|
-
title: "Workflow", allowMaximize: !isMobile
|
|
1337
|
+
title: "Workflow", allowMaximize: !isMobile,
|
|
1338
|
+
onBack: getOnBackHandler(),
|
|
1282
1339
|
}
|
|
1283
1340
|
},
|
|
1284
1341
|
toolbarOptions: {
|
|
@@ -1537,38 +1594,59 @@ const validateMaxLength = (mvd, value, validationItems) => {
|
|
|
1537
1594
|
//#endregion Validation
|
|
1538
1595
|
// Synchronizes panel visibility and toolbar button disabled states when panels become disabled
|
|
1539
1596
|
const PanelDisabledStateHandler = ({ isWFDisabled, isSysMetadataDisabled, isBoardDisabled, isDcmtTasksDisabled, isPreviewDisabled }) => {
|
|
1540
|
-
const { setPanelVisibilityById, setToolbarButtonDisabled
|
|
1597
|
+
const { setPanelVisibilityById, setToolbarButtonDisabled } = useTMPanelManagerContext();
|
|
1541
1598
|
useEffect(() => {
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
setToolbarButtonDisabled('tmBlog', isBoardDisabled);
|
|
1545
|
-
setToolbarButtonDisabled('tmWF', isWFDisabled);
|
|
1546
|
-
setToolbarButtonDisabled('tmDcmtTasks', isDcmtTasksDisabled);
|
|
1547
|
-
setToolbarButtonDisabled('tmDcmtPreview', isPreviewDisabled);
|
|
1548
|
-
// Chiude il pannello solo se è attualmente visibile e deve essere disabilitato
|
|
1549
|
-
if (isSysMetadataDisabled && panelVisibility['tmSysMetadata']) {
|
|
1599
|
+
if (isSysMetadataDisabled) {
|
|
1600
|
+
setToolbarButtonDisabled('tmSysMetadata', true);
|
|
1550
1601
|
setPanelVisibilityById('tmSysMetadata', false);
|
|
1551
1602
|
}
|
|
1552
|
-
|
|
1603
|
+
else {
|
|
1604
|
+
setToolbarButtonDisabled('tmSysMetadata', false);
|
|
1605
|
+
}
|
|
1606
|
+
}, [isSysMetadataDisabled]);
|
|
1607
|
+
useEffect(() => {
|
|
1608
|
+
if (isBoardDisabled) {
|
|
1609
|
+
setToolbarButtonDisabled('tmBlog', true);
|
|
1553
1610
|
setPanelVisibilityById('tmBlog', false);
|
|
1554
1611
|
}
|
|
1555
|
-
|
|
1612
|
+
else {
|
|
1613
|
+
setToolbarButtonDisabled('tmBlog', false);
|
|
1614
|
+
}
|
|
1615
|
+
}, [isBoardDisabled]);
|
|
1616
|
+
useEffect(() => {
|
|
1617
|
+
if (isWFDisabled) {
|
|
1618
|
+
setToolbarButtonDisabled('tmWF', true);
|
|
1556
1619
|
setPanelVisibilityById('tmWF', false);
|
|
1557
1620
|
}
|
|
1558
|
-
|
|
1621
|
+
else {
|
|
1622
|
+
setToolbarButtonDisabled('tmWF', false);
|
|
1623
|
+
}
|
|
1624
|
+
}, [isWFDisabled]);
|
|
1625
|
+
useEffect(() => {
|
|
1626
|
+
if (isDcmtTasksDisabled) {
|
|
1627
|
+
setToolbarButtonDisabled('tmDcmtTasks', true);
|
|
1559
1628
|
setPanelVisibilityById('tmDcmtTasks', false);
|
|
1560
1629
|
}
|
|
1561
|
-
|
|
1630
|
+
else {
|
|
1631
|
+
setToolbarButtonDisabled('tmDcmtTasks', false);
|
|
1632
|
+
}
|
|
1633
|
+
}, [isDcmtTasksDisabled]);
|
|
1634
|
+
useEffect(() => {
|
|
1635
|
+
if (isPreviewDisabled) {
|
|
1636
|
+
setToolbarButtonDisabled('tmDcmtPreview', true);
|
|
1562
1637
|
setPanelVisibilityById('tmDcmtPreview', false);
|
|
1563
1638
|
}
|
|
1564
|
-
|
|
1639
|
+
else {
|
|
1640
|
+
setToolbarButtonDisabled('tmDcmtPreview', false);
|
|
1641
|
+
}
|
|
1642
|
+
}, [isPreviewDisabled]);
|
|
1565
1643
|
return null;
|
|
1566
1644
|
};
|
|
1567
|
-
const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, fromDTD, currentDcmt, layoutMode, dcmtFile, deviceType, isVisible, onFileUpload, openFileUploaderPdfEditor, enableDragDropOverlay = false, onScanRequest }) => {
|
|
1645
|
+
const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, fromDTD, currentDcmt, layoutMode, dcmtFile, deviceType, isVisible, onFileUpload, openFileUploaderPdfEditor, enableDragDropOverlay = false, onScanRequest, onBack }) => {
|
|
1568
1646
|
const { setPanelVisibilityById, toggleMaximize, isResizingActive, countVisibleLeafPanels, panelVisibility } = useTMPanelManagerContext();
|
|
1569
1647
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
1570
1648
|
return (layoutMode === LayoutModes.Update ?
|
|
1571
|
-
_jsx(TMDcmtPreview, { dcmtData: currentDcmt, isVisible: isVisible, onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, isResizingActive: isResizingActive }, refreshPreviewTrigger) :
|
|
1649
|
+
_jsx(TMDcmtPreview, { dcmtData: currentDcmt, isVisible: isVisible, onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, onBack: onBack, isResizingActive: isResizingActive }, refreshPreviewTrigger) :
|
|
1572
1650
|
_jsx(TMFileUploader, { fromDTD: fromDTD, onFileUpload: onFileUpload, openFileUploaderPdfEditor: openFileUploaderPdfEditor, onClose: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, isRequired: fromDTD?.archiveConstraint === ArchiveConstraints.ContentCompulsory && dcmtFile === null, defaultBlob: dcmtFile, deviceType: deviceType, isResizingActive: isResizingActive, enableDragDropOverlay: panelVisibility['tmDcmtPreview'] && enableDragDropOverlay, onScanRequest: onScanRequest }));
|
|
1573
1651
|
};
|
|
1574
1652
|
const Ribbon = styled.div `
|
|
@@ -19,6 +19,18 @@ const TMDcmtFormActionButtons = (props) => {
|
|
|
19
19
|
return null;
|
|
20
20
|
return moreInfoTasks[0];
|
|
21
21
|
}, [moreInfoTasks]);
|
|
22
|
+
// Verifica se la More Info Card sarà effettivamente renderizzata (non null)
|
|
23
|
+
const isMoreInfoCardVisible = useMemo(() => {
|
|
24
|
+
if (!firstTask)
|
|
25
|
+
return false;
|
|
26
|
+
const userID = SDK_Globals.tmSession?.SessionDescr?.userID;
|
|
27
|
+
const isSender = firstTask?.fromID !== undefined && firstTask.fromID === userID;
|
|
28
|
+
const isRecipient = firstTask?.toID !== undefined && firstTask.toID === userID;
|
|
29
|
+
// Caso 4: L'utente è sia mittente che destinatario - la card non viene renderizzata
|
|
30
|
+
if (isSender && isRecipient)
|
|
31
|
+
return false;
|
|
32
|
+
return true;
|
|
33
|
+
}, [firstTask]);
|
|
22
34
|
const { hasMoreInfo, hasApprove, hasReferences } = useMemo(() => {
|
|
23
35
|
const referencesExist = showToppyForReferences && dcmtReferences?.some(ref => ref.objClass === ObjectClasses.Dossier || ref.objClass === ObjectClasses.WorkingGroup);
|
|
24
36
|
return {
|
|
@@ -56,6 +68,9 @@ const TMDcmtFormActionButtons = (props) => {
|
|
|
56
68
|
const senderNameTruncated = task?.fromName ? truncate(task.fromName, 30) : 'N/A';
|
|
57
69
|
const recipientNameTruncated = task?.toName ? truncate(task.toName, 30) : 'N/A';
|
|
58
70
|
const taskNameTrunc = task?.name ? truncate(task.name.replace(TASK_MORE_INFO_PREFIX_NAME ?? '', ''), 30) : 'N/A';
|
|
71
|
+
// Caso 4: L'utente è sia mittente che destinatario - non renderizzare nulla
|
|
72
|
+
if (isSender && isRecipient)
|
|
73
|
+
return null;
|
|
59
74
|
return (_jsxs("div", { style: { position: 'relative', display: 'flex' }, children: [_jsxs("div", { style: {
|
|
60
75
|
padding: '10px',
|
|
61
76
|
color: '#FFFFFF',
|
|
@@ -156,10 +171,10 @@ const TMDcmtFormActionButtons = (props) => {
|
|
|
156
171
|
e.currentTarget.style.transform = 'translateY(-50%)';
|
|
157
172
|
}, children: formatBadgeCount(othersCount) }))] }));
|
|
158
173
|
};
|
|
159
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [hasMoreInfo && firstTask && (_jsx("div", { style: { display: 'flex', gap: "10px", flexDirection: 'column', alignItems: 'center', paddingRight: tasksNumber > 1 ? '36px' : '0' }, children: renderMoreInfoCard(firstTask, tasksNumber > 1) })), hasMoreInfo && hasApprove && _jsx(Divider, {}), hasApprove && (workItems.length === 1 ?
|
|
174
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [hasMoreInfo && firstTask && isMoreInfoCardVisible && (_jsx("div", { style: { display: 'flex', gap: "10px", flexDirection: 'column', alignItems: 'center', paddingRight: tasksNumber > 1 ? '36px' : '0' }, children: renderMoreInfoCard(firstTask, tasksNumber > 1) })), hasMoreInfo && isMoreInfoCardVisible && hasApprove && _jsx(Divider, {}), hasApprove && (workItems.length === 1 ?
|
|
160
175
|
_jsx(WorkFlowOperationButtons, { dtd: fromDTD, deviceType: deviceType, onApprove: () => updateShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => updateShowRejectPopup(true), onReAssign: () => updateShowReAssignPopup(true), onMoreInfo: () => updateShowMoreInfoPopup(true) })
|
|
161
176
|
:
|
|
162
|
-
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Questo documento è associato a ${workItems.length} workitem.`, _jsx("br", {}), `Per approvare, vai alla pagina "Approvazione workflow".`] })), (hasApprove && hasReferences) || (hasMoreInfo && !hasApprove && hasReferences) ? (_jsx(Divider, {})) : null, hasReferences && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px', alignItems: 'center' }, children: [dossierRefs.length > 0 && (_jsx("div", { style: { paddingRight: dossierRefs.length > 1 ? '36px' : '0' }, children: renderReferenceCard(dossierRefs[0], dossierRefs, dossierRefs.length > 1, () => setShowAllDossiersModal(true)) })), workingGroupRefs.length > 0 && (_jsx("div", { style: { paddingRight: workingGroupRefs.length > 1 ? '36px' : '0' }, children: renderReferenceCard(workingGroupRefs[0], workingGroupRefs, workingGroupRefs.length > 1, () => setShowAllWorkingGroupsModal(true)) }))] }))] }), showAllMoreInfoModal && moreInfoTasks && moreInfoTasks.length > 1 && (_jsx(TMModal, { title: `Altre richieste maggiori informazioni (${moreInfoTasks.length - 1})`, onClose: () => setShowAllMoreInfoModal(false), width: calcResponsiveSizes(deviceType, '450px', '450px', '95%'), height: 'auto', children: _jsx("div", { style: {
|
|
177
|
+
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Questo documento è associato a ${workItems.length} workitem.`, _jsx("br", {}), `Per approvare, vai alla pagina "Approvazione workflow".`] })), (hasApprove && hasReferences) || (hasMoreInfo && isMoreInfoCardVisible && !hasApprove && hasReferences) ? (_jsx(Divider, {})) : null, hasReferences && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px', alignItems: 'center' }, children: [dossierRefs.length > 0 && (_jsx("div", { style: { paddingRight: dossierRefs.length > 1 ? '36px' : '0' }, children: renderReferenceCard(dossierRefs[0], dossierRefs, dossierRefs.length > 1, () => setShowAllDossiersModal(true)) })), workingGroupRefs.length > 0 && (_jsx("div", { style: { paddingRight: workingGroupRefs.length > 1 ? '36px' : '0' }, children: renderReferenceCard(workingGroupRefs[0], workingGroupRefs, workingGroupRefs.length > 1, () => setShowAllWorkingGroupsModal(true)) }))] }))] }), showAllMoreInfoModal && moreInfoTasks && moreInfoTasks.length > 1 && (_jsx(TMModal, { title: `Altre richieste maggiori informazioni (${moreInfoTasks.length - 1})`, onClose: () => setShowAllMoreInfoModal(false), width: calcResponsiveSizes(deviceType, '450px', '450px', '95%'), height: 'auto', children: _jsx("div", { style: {
|
|
163
178
|
display: 'flex',
|
|
164
179
|
flexDirection: 'column',
|
|
165
180
|
gap: '8px',
|
|
@@ -22,7 +22,7 @@ const ErrorContent = ({ error, isAbortError, onRetry }) => {
|
|
|
22
22
|
}
|
|
23
23
|
return _jsx(TMNothingToShow, { icon: _jsx(IconCloseOutline, { fontSize: 92, color: TMColors.error }), text: error });
|
|
24
24
|
};
|
|
25
|
-
const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev, onClosePanel, onNext, onPrev, allowMaximize = true, onMaximizePanel }) => {
|
|
25
|
+
const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev, onClosePanel, onBack, onNext, onPrev, allowMaximize = true, onMaximizePanel }) => {
|
|
26
26
|
const [dcmtBlob, setDcmtBlob] = useState(undefined);
|
|
27
27
|
const [showPreview, setShowPreview] = useState(false);
|
|
28
28
|
const [isFromCache, setIsFromCache] = useState(false);
|
|
@@ -183,7 +183,7 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
|
|
|
183
183
|
{ icon: _jsx(IconCloseCircle, {}), name: SDKUI_Localizator.RemoveFromCache, onClick: () => { removeDcmtsFileCache(cacheKey); setIsFromCache(false); } },
|
|
184
184
|
{ icon: _jsx(IconClear, {}), name: SDKUI_Localizator.ClearCache, onClick: () => { clearDcmtsFileCache(); setIsFromCache(false); } },
|
|
185
185
|
], [cacheKey, removeDcmtsFileCache, clearDcmtsFileCache, setIsFromCache]);
|
|
186
|
-
return (_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsx(TMPanel, { padding: '0', title: titleHandler(), onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, toolbar: _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [onPrev && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), onNext && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(StyledHeaderIcon, { "$color": TMColors.primaryColor, children: _jsx(ContextMenu, { items: cacheMenuItems, trigger: "left", children: _jsx(IconMenuVertical, {}) }) }), _jsx(StyledHeaderIcon, { onClick: reOpenDcmt, "$color": TMColors.primaryColor, children: _jsx(TMTooltip, { content: SDKUI_Localizator.ReopenDocument, children: _jsx(IconRefresh, {}) }) })] }), children: error
|
|
186
|
+
return (_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsx(TMPanel, { padding: '0', title: titleHandler(), onClose: onClosePanel, onBack: onBack, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, toolbar: _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [onPrev && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), onNext && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(StyledHeaderIcon, { "$color": TMColors.primaryColor, children: _jsx(ContextMenu, { items: cacheMenuItems, trigger: "left", children: _jsx(IconMenuVertical, {}) }) }), _jsx(StyledHeaderIcon, { onClick: reOpenDcmt, "$color": TMColors.primaryColor, children: _jsx(TMTooltip, { content: SDKUI_Localizator.ReopenDocument, children: _jsx(IconRefresh, {}) }) })] }), children: error
|
|
187
187
|
? _jsx(ErrorContent, { error: error, isAbortError: isAbortError, onRetry: reOpenDcmt })
|
|
188
188
|
: renderedPreview(dcmtData?.tid, dcmtData?.did, dcmtData?.fileExt, dcmtData?.fileSize, dcmtData?.fileCount, extensionHandler(dcmtData?.fileExt), showPreview, isResizingActive, () => { isBasketMode ? loadBasketFile() : loadDocumentWithCache(); setShowPreview(true); }, dcmtBlob, isBasketMode) }) }));
|
|
189
189
|
};
|
|
@@ -10,6 +10,7 @@ interface TMDcmtTasksProps {
|
|
|
10
10
|
afterTaskSaved: (task: TaskDescriptor | undefined, formMode: FormModes | undefined, forceRefresh?: boolean) => Promise<void>;
|
|
11
11
|
handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
|
|
12
12
|
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
13
|
+
onBack?: () => void;
|
|
13
14
|
}
|
|
14
15
|
declare const TMDcmtTasks: (props: TMDcmtTasksProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export default TMDcmtTasks;
|
|
@@ -6,7 +6,7 @@ import { useTMPanelManagerContext } from "../../layout/panelManager/TMPanelManag
|
|
|
6
6
|
import TMPanel from "../../base/TMPanel";
|
|
7
7
|
import TMTasksPanelContent from "../tasks/TMTasksPanelContent";
|
|
8
8
|
const TMDcmtTasks = (props) => {
|
|
9
|
-
const { taskContext, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, afterTaskSaved, handleNavigateToWGs, handleNavigateToDossiers } = props;
|
|
9
|
+
const { taskContext, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, afterTaskSaved, handleNavigateToWGs, handleNavigateToDossiers, onBack } = props;
|
|
10
10
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
11
11
|
const deviceType = useDeviceType();
|
|
12
12
|
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
|
@@ -19,6 +19,6 @@ const TMDcmtTasks = (props) => {
|
|
|
19
19
|
text: SDKUI_Localizator.Refresh,
|
|
20
20
|
},
|
|
21
21
|
], children: _jsx(IconMenuVertical, { id: "TMTaksPanel-Commands-Header", color: 'white', cursor: 'pointer' }) }), []);
|
|
22
|
-
return _jsx("div", { style: { width: "100%", height: "100%", position: 'relative' }, children: _jsx(TMPanel, { title: SDKUI_Localizator.Widget_Activities, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onClose: countVisibleLeafPanels() > 1 ? () => togglePanelVisibility("tmDcmtTasks") : undefined, onMaximize: countVisibleLeafPanels() > 1 ? () => toggleMaximize("tmDcmtTasks") : undefined, toolbar: toolbar, children: _jsx(TMTasksPanelContent, { id: "dcmtTasks", taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs ? handleNavigateToWGs : () => { return Promise.resolve(); }, handleNavigateToDossiers: handleNavigateToDossiers ? handleNavigateToDossiers : () => { return Promise.resolve(); }, afterTaskSaved: afterTaskSaved }) }) });
|
|
22
|
+
return _jsx("div", { style: { width: "100%", height: "100%", position: 'relative' }, children: _jsx(TMPanel, { title: SDKUI_Localizator.Widget_Activities, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onClose: countVisibleLeafPanels() > 1 ? () => togglePanelVisibility("tmDcmtTasks") : undefined, onMaximize: countVisibleLeafPanels() > 1 ? () => toggleMaximize("tmDcmtTasks") : undefined, toolbar: toolbar, onBack: onBack, children: _jsx(TMTasksPanelContent, { id: "dcmtTasks", taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs ? handleNavigateToWGs : () => { return Promise.resolve(); }, handleNavigateToDossiers: handleNavigateToDossiers ? handleNavigateToDossiers : () => { return Promise.resolve(); }, afterTaskSaved: afterTaskSaved }) }) });
|
|
23
23
|
};
|
|
24
24
|
export default TMDcmtTasks;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HomeBlogPost, TaskDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { DcmtInfo } from '../../../ts';
|
|
4
|
+
import { IRelatedDcmt } from './TMMasterDetailDcmts';
|
|
5
|
+
interface ITMDownloadRelationViewerSectionProps {
|
|
6
|
+
selectedDcmtInfos: Array<DcmtInfo>;
|
|
7
|
+
/** Notifica al parent la lista dei documenti correlati selezionati (deduplicati) */
|
|
8
|
+
onSelectionChanged: (items: Array<IRelatedDcmt>) => void;
|
|
9
|
+
allTasks?: Array<TaskDescriptor>;
|
|
10
|
+
getAllTasks?: () => Promise<void>;
|
|
11
|
+
deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
12
|
+
addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
13
|
+
editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
14
|
+
handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
|
|
15
|
+
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Sezione condivisa tra TMCopyToFolderForm e TMMergeToPdfForm
|
|
19
|
+
* che mostra l'elenco dei documenti correlati e il tree di selezione
|
|
20
|
+
* per tipo documento / "solo metadati".
|
|
21
|
+
*/
|
|
22
|
+
declare const TMDownloadRelationViewerSection: React.FC<ITMDownloadRelationViewerSectionProps>;
|
|
23
|
+
export default TMDownloadRelationViewerSection;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useRef, useState } from 'react';
|
|
3
|
+
import TreeView from 'devextreme-react/tree-view';
|
|
4
|
+
import { LayoutModes } from '@topconsultnpm/sdk-ts';
|
|
5
|
+
import { SDKUI_Localizator } from '../../../helper';
|
|
6
|
+
import { TMColors } from '../../../utils/theme';
|
|
7
|
+
import { TMSplitterLayout } from '../../base/TMLayout';
|
|
8
|
+
import TMRelationViewer from './TMRelationViewer';
|
|
9
|
+
import TMDcmtForm from './TMDcmtForm';
|
|
10
|
+
import { dedupeByTidDid, getDcmtKey, getFloatingLabelStyle, } from './copyAndMergeDcmtsShared';
|
|
11
|
+
/**
|
|
12
|
+
* Sezione condivisa tra TMCopyToFolderForm e TMMergeToPdfForm
|
|
13
|
+
* che mostra l'elenco dei documenti correlati e il tree di selezione
|
|
14
|
+
* per tipo documento / "solo metadati".
|
|
15
|
+
*/
|
|
16
|
+
const TMDownloadRelationViewerSection = ({ selectedDcmtInfos, onSelectionChanged, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers }) => {
|
|
17
|
+
const [focusedItem, setFocusedItem] = useState(null);
|
|
18
|
+
const [selectedItems, setSelectedItems] = useState([]);
|
|
19
|
+
const [allItems, setAllItems] = useState([]);
|
|
20
|
+
const didInitSelectionRef = useRef(false);
|
|
21
|
+
// State for TMDcmtForm modal
|
|
22
|
+
const [isOpenDcmtForm, setIsOpenDcmtForm] = useState(false);
|
|
23
|
+
const [dcmtFormTID, setDcmtFormTID] = useState(undefined);
|
|
24
|
+
const [dcmtFormDID, setDcmtFormDID] = useState(undefined);
|
|
25
|
+
const [dcmtFormTitle, setDcmtFormTitle] = useState('');
|
|
26
|
+
const updateSelection = useCallback((items) => {
|
|
27
|
+
const deduped = dedupeByTidDid(items);
|
|
28
|
+
setSelectedItems(deduped);
|
|
29
|
+
onSelectionChanged(deduped);
|
|
30
|
+
}, [onSelectionChanged]);
|
|
31
|
+
const handleFocusedItemChanged = useCallback((item) => {
|
|
32
|
+
setFocusedItem(item);
|
|
33
|
+
}, []);
|
|
34
|
+
const handleSelectedItemsChanged = useCallback((items) => {
|
|
35
|
+
updateSelection(items);
|
|
36
|
+
}, [updateSelection]);
|
|
37
|
+
const handleAllItemsChanged = useCallback((items) => {
|
|
38
|
+
setAllItems(items);
|
|
39
|
+
if (!didInitSelectionRef.current && items.some(i => i.isDcmt)) {
|
|
40
|
+
didInitSelectionRef.current = true;
|
|
41
|
+
updateSelection(items.filter(i => i.isDcmt));
|
|
42
|
+
}
|
|
43
|
+
}, [updateSelection]);
|
|
44
|
+
const handleDocumentDoubleClick = useCallback((tid, did, name) => {
|
|
45
|
+
setDcmtFormTID(tid);
|
|
46
|
+
setDcmtFormDID(did);
|
|
47
|
+
setDcmtFormTitle(name ?? '');
|
|
48
|
+
setIsOpenDcmtForm(true);
|
|
49
|
+
}, []);
|
|
50
|
+
return (_jsxs("div", { style: {
|
|
51
|
+
position: 'relative',
|
|
52
|
+
height: '100%',
|
|
53
|
+
minHeight: 0,
|
|
54
|
+
display: 'flex',
|
|
55
|
+
flexDirection: 'column',
|
|
56
|
+
boxSizing: 'border-box'
|
|
57
|
+
}, children: [_jsx("div", { style: { flex: 1, minHeight: 0, overflow: 'visible', paddingTop: '10px' }, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', showSeparator: true, separatorSize: 8, separatorColor: 'transparent', separatorActiveColor: 'transparent', overflow: 'visible', min: ["50", "50"], start: ["75%", "25%"], children: [_jsxs("div", { style: {
|
|
58
|
+
position: 'relative',
|
|
59
|
+
height: '100%',
|
|
60
|
+
minHeight: 0,
|
|
61
|
+
overflow: 'visible',
|
|
62
|
+
border: `1px solid ${TMColors.border_normal}`,
|
|
63
|
+
borderRadius: '8px',
|
|
64
|
+
padding: '4px 2px 2px 2px',
|
|
65
|
+
backgroundColor: '#fff',
|
|
66
|
+
boxSizing: 'border-box',
|
|
67
|
+
display: 'flex',
|
|
68
|
+
flexDirection: 'column'
|
|
69
|
+
}, children: [_jsxs("span", { style: getFloatingLabelStyle(), title: `Documenti correlati (${SDKUI_Localizator.Selected}: ${selectedItems.filter(item => item.isDcmt).length})`, children: ["Documenti correlati (", SDKUI_Localizator.Selected, ": ", selectedItems.filter(item => item.isDcmt).length, ")"] }), _jsx("div", { style: { flex: 1, minHeight: 0, overflowX: 'auto', overflowY: 'auto' }, children: _jsx("div", { style: { minWidth: 'max-content', height: '100%' }, children: _jsx(TMRelationViewer, { inputDcmts: selectedDcmtInfos, isForMaster: false, defaultExpandAll: true, showMetadataNames: true, allowMultipleSelection: true, showExpandAllButton: true, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged, onAllItemsChanged: handleAllItemsChanged, onDocumentDoubleClick: handleDocumentDoubleClick }) }) })] }), _jsxs("div", { style: {
|
|
70
|
+
position: 'relative',
|
|
71
|
+
height: '100%',
|
|
72
|
+
minHeight: 0,
|
|
73
|
+
overflow: 'visible',
|
|
74
|
+
border: `1px solid ${TMColors.border_normal}`,
|
|
75
|
+
borderRadius: '8px',
|
|
76
|
+
padding: '4px 2px 2px 2px',
|
|
77
|
+
backgroundColor: '#fff',
|
|
78
|
+
boxSizing: 'border-box',
|
|
79
|
+
display: 'flex',
|
|
80
|
+
flexDirection: 'column'
|
|
81
|
+
}, children: [_jsx("span", { style: getFloatingLabelStyle(), title: "Tipo documento o vista", children: "Tipo documento o vista" }), _jsx("div", { style: { flex: 1, minHeight: 0, overflow: 'auto', padding: '8px', display: 'flex', flexDirection: 'column', gap: '6px' }, children: (() => {
|
|
82
|
+
const dcmtItems = dedupeByTidDid(allItems.filter(item => item.isDcmt));
|
|
83
|
+
const metadataOnlyItems = dcmtItems.filter(item => item.fileExt === null || item.fileExt === undefined);
|
|
84
|
+
const totalDcmts = dcmtItems.length;
|
|
85
|
+
const totalMetadataOnly = metadataOnlyItems.length;
|
|
86
|
+
const selectedDcmtsList = selectedItems.filter(item => item.isDcmt);
|
|
87
|
+
const selectedDcmts = selectedDcmtsList.length;
|
|
88
|
+
const allSelected = totalDcmts > 0 && selectedDcmts === totalDcmts;
|
|
89
|
+
const selectedMetadataOnlyCount = selectedDcmtsList.filter(item => item.fileExt === null || item.fileExt === undefined).length;
|
|
90
|
+
const allMetadataOnlySelected = totalMetadataOnly > 0 && selectedMetadataOnlyCount === totalMetadataOnly;
|
|
91
|
+
// Raggruppa per nome del DcmtTypeDescriptor (campo dtd.name)
|
|
92
|
+
const getDtdName = (item) => item.dtd?.name ?? undefined;
|
|
93
|
+
const dtdGroups = new Map();
|
|
94
|
+
for (const item of dcmtItems) {
|
|
95
|
+
const name = getDtdName(item);
|
|
96
|
+
if (!name)
|
|
97
|
+
continue;
|
|
98
|
+
const arr = dtdGroups.get(name);
|
|
99
|
+
if (arr)
|
|
100
|
+
arr.push(item);
|
|
101
|
+
else
|
|
102
|
+
dtdGroups.set(name, [item]);
|
|
103
|
+
}
|
|
104
|
+
const sortedDtdNames = Array.from(dtdGroups.keys()).sort((a, b) => a.localeCompare(b));
|
|
105
|
+
const selectedKeysSet = new Set(selectedDcmtsList.map(getDcmtKey));
|
|
106
|
+
const dtdGroupInfos = sortedDtdNames.map((name) => {
|
|
107
|
+
const items = dtdGroups.get(name) ?? [];
|
|
108
|
+
const selectedCount = items.filter(it => selectedKeysSet.has(getDcmtKey(it))).length;
|
|
109
|
+
return {
|
|
110
|
+
name,
|
|
111
|
+
items,
|
|
112
|
+
total: items.length,
|
|
113
|
+
allSelected: items.length > 0 && selectedCount === items.length,
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
const treeItems = [
|
|
117
|
+
{
|
|
118
|
+
id: 'all',
|
|
119
|
+
text: `Seleziona tutti (${totalDcmts})`,
|
|
120
|
+
expanded: true,
|
|
121
|
+
selected: allSelected,
|
|
122
|
+
items: [
|
|
123
|
+
...dtdGroupInfos.map((g) => ({
|
|
124
|
+
id: `dtd::${g.name}`,
|
|
125
|
+
text: `${g.name} (${g.total})`,
|
|
126
|
+
selected: g.allSelected,
|
|
127
|
+
})),
|
|
128
|
+
{
|
|
129
|
+
id: 'metadataOnly',
|
|
130
|
+
text: `Documenti di soli metadati (${totalMetadataOnly})`,
|
|
131
|
+
selected: allMetadataOnlySelected,
|
|
132
|
+
},
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
];
|
|
136
|
+
const handleItemSelectionChanged = (e) => {
|
|
137
|
+
const itemData = e.itemData;
|
|
138
|
+
if (!itemData)
|
|
139
|
+
return;
|
|
140
|
+
if (itemData.id === 'all') {
|
|
141
|
+
updateSelection(itemData.selected ? dcmtItems : []);
|
|
142
|
+
}
|
|
143
|
+
else if (itemData.id === 'metadataOnly') {
|
|
144
|
+
if (itemData.selected) {
|
|
145
|
+
updateSelection([...selectedItems, ...metadataOnlyItems]);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
const metadataKeys = new Set(metadataOnlyItems.map(getDcmtKey));
|
|
149
|
+
updateSelection(selectedItems.filter(item => !metadataKeys.has(getDcmtKey(item))));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else if (typeof itemData.id === 'string' && itemData.id.startsWith('dtd::')) {
|
|
153
|
+
const dtdName = itemData.id.substring('dtd::'.length);
|
|
154
|
+
const groupItems = dtdGroups.get(dtdName) ?? [];
|
|
155
|
+
if (itemData.selected) {
|
|
156
|
+
updateSelection([...selectedItems, ...groupItems]);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
const groupKeys = new Set(groupItems.map(getDcmtKey));
|
|
160
|
+
updateSelection(selectedItems.filter(item => !groupKeys.has(getDcmtKey(item))));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
const dtdSignature = dtdGroupInfos.map(g => `${g.name}:${g.total}:${g.allSelected ? 1 : 0}`).join('|');
|
|
165
|
+
return (_jsx("div", { style: { minWidth: '280px', width: 'max-content', flexShrink: 0 }, children: _jsx(TreeView, { items: treeItems, showCheckBoxesMode: 'normal', selectionMode: 'multiple', selectNodesRecursive: false, selectByClick: true, onItemSelectionChanged: handleItemSelectionChanged }, `tv-${allSelected}-${allMetadataOnlySelected}-${totalDcmts}-${totalMetadataOnly}-${dtdSignature}`) }));
|
|
166
|
+
})() })] })] }, "TMDocumentDownload-relation-horizontal") }), isOpenDcmtForm && dcmtFormTID !== undefined && dcmtFormDID !== undefined && (_jsx(TMDcmtForm, { isModal: true, titleModal: dcmtFormTitle, TID: dcmtFormTID, DID: dcmtFormDID, layoutMode: LayoutModes.Update, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onClose: () => {
|
|
167
|
+
setIsOpenDcmtForm(false);
|
|
168
|
+
setDcmtFormTID(undefined);
|
|
169
|
+
setDcmtFormDID(undefined);
|
|
170
|
+
setDcmtFormTitle('');
|
|
171
|
+
} }))] }));
|
|
172
|
+
};
|
|
173
|
+
export default TMDownloadRelationViewerSection;
|
|
@@ -97,7 +97,7 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
|
|
|
97
97
|
document.getElementById('fileInput')?.click();
|
|
98
98
|
}, []);
|
|
99
99
|
let content = !uploadedFile ?
|
|
100
|
-
_jsxs("div", { style: { display: 'flex', gap: 10, width: '100%', height: '100%' }, children: [_jsx(HiddenInput, { id: "fileInput", type: "file", onChange: handleInputChange }), _jsxs(UploadContainer, { ref: uploaderRef, tabIndex: 0, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, style: { backgroundColor: dragOver ? '#76b1e6' : 'white' }, onDoubleClick: browseHandler, "$isRequired": isRequired, children: [_jsxs("div", { style: { display: 'flex', gap: '10px', flexDirection: 'column', position: 'absolute', right: 5, top: 5 }, children: [_jsx(TMButton, { btnStyle: 'icon', caption: 'Sfoglia', color: isRequired && !uploadedFile ? 'error' : 'primary', onClick: browseHandler, icon: _jsx(IconFolderOpen, { fontSize: 22 }) }), showScannerIcon && isScannerLicenseConfigured() && onScanRequest && _jsx(TMButton, { btnStyle: 'icon', caption: 'Scanner', color: 'primary', onClick: () => { onScanRequest((file) => { onFileUpload?.(file); }); }, icon: _jsx(IconScanner, { fontSize: 22 }) }), showScannerIcon && isScannerLicenseConfigured() && !onScanRequest && _jsx(TMButton, { btnStyle: 'icon', caption: 'Scanner', color: 'primary', onClick: () => { ShowAlert({ message: SDKUI_Localizator.ScanFeatureUnavailableInThisContext, mode: 'info', duration: 3000, title: 'Scanner' }); }, icon: _jsx(IconScanner, { fontSize: 22 }) })] }), _jsx("p", { style: { fontSize: '1.2rem', fontWeight: 'bold' }, children: deviceType === DeviceType.MOBILE ?
|
|
100
|
+
_jsxs("div", { style: { display: 'flex', gap: 10, width: '100%', height: '100%' }, children: [_jsx(HiddenInput, { id: "fileInput", type: "file", onChange: handleInputChange }), _jsxs(UploadContainer, { ref: uploaderRef, tabIndex: 0, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, style: { backgroundColor: dragOver ? '#76b1e6' : 'white' }, onDoubleClick: browseHandler, "$isRequired": isRequired, children: [_jsxs("div", { style: { display: 'flex', gap: '10px', flexDirection: 'column', position: 'absolute', right: 5, top: 5 }, children: [_jsx(TMButton, { btnStyle: 'icon', caption: 'Sfoglia', color: isRequired && !uploadedFile ? 'error' : 'primary', onClick: browseHandler, icon: _jsx(IconFolderOpen, { fontSize: 22 }) }), showScannerIcon && isScannerLicenseConfigured() && onScanRequest && _jsx(TMButton, { btnStyle: 'icon', caption: 'Scanner', color: 'primary', onClick: () => { onScanRequest((file) => { onFileUpload?.(file); }); }, icon: _jsx(IconScanner, { fontSize: 22 }) }), showScannerIcon && isScannerLicenseConfigured() && !onScanRequest && _jsx(TMButton, { btnStyle: 'icon', caption: 'Scanner', color: 'primary', onClick: () => { ShowAlert({ message: SDKUI_Localizator.ScanFeatureUnavailableInThisContext, mode: 'info', duration: 3000, title: 'Scanner' }); }, icon: _jsx(IconScanner, { fontSize: 22 }) })] }), _jsx("p", { style: { fontSize: '1.2rem', fontWeight: 'bold' }, children: deviceType === DeviceType.MOBILE ? SDKUI_Localizator.ClickToBrowseFile : SDKUI_Localizator.DragOrDoubleClickToBrowseFile }), isRequired && _jsxs("p", { style: { fontWeight: 'bold' }, children: [" ", SDKUI_Localizator.RequiredField, " "] })] })] }) :
|
|
101
101
|
_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 10, width: '100%', height: '100%' }, children: [_jsxs("div", { style: { backgroundColor: 'white', padding: '5px 10px', borderRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'space-between', color: TMColors.primaryColor }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 5 }, children: [_jsx("p", { children: "File name:" }), _jsxs("div", { style: { fontWeight: 'bold' }, children: [fileName, " ", _jsxs("span", { children: [" ", ` (${formatBytes(fileSize)})`, " "] })] })] }), uploadedFile && _jsx(TMButton, { btnStyle: 'icon', color: 'error', caption: 'Pulisci', onClick: () => clearFile(true), icon: _jsx(IconClear, { fontSize: 22 }) })] }), extensionHandler(fileExt) === FileExtensionHandler.READY_TO_SHOW ? _jsx(TMFileViewer, { fileBlob: uploadedFile, isResizingActive: isResizingActive }) :
|
|
102
102
|
_jsx("div", { style: { backgroundColor: '#f6dbdb', padding: '5px 10px', borderRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'space-between', color: TMColors.error }, children: _jsxs("div", { children: [" ", 'Anteprima non disponibile.', fileExt && _jsx("b", { children: ` (*.${fileExt})` })] }) })] });
|
|
103
103
|
const innerContent = (_jsxs("div", { style: { width: '100%', height: '100%', padding: '2px', display: 'flex', flexDirection: 'column', gap: 10 }, children: [enableDragDropOverlay && _jsx(TMDragDropOverlay, { handleFile: handleFile, refocusAfterFileInput: refocusAfterFileInput }), content] }));
|