@topconsultnpm/sdkui-react 6.21.0-dev4.8 → 6.21.0-dev5.1
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/ContextMenu/styles.d.ts +43 -19
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +79 -27
- package/lib/components/base/Styled.d.ts +77 -41
- package/lib/components/base/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +2 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -2
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +2 -1
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +21 -16
- package/lib/components/base/TMTreeView.js +230 -64
- package/lib/components/base/TMUserAvatar.d.ts +2 -1
- package/lib/components/base/TMVilViewer.d.ts +2 -1
- package/lib/components/base/TMWaitPanel.d.ts +3 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +42 -10
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +4 -1
- package/lib/components/features/documents/TMDcmtIcon.js +5 -32
- package/lib/components/features/documents/TMDcmtPreview.d.ts +6 -4
- package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +1 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.js +50 -11
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -1
- package/lib/components/features/documents/TMMergeToPdfForm.js +91 -48
- package/lib/components/features/documents/TMRelationViewer.d.ts +12 -10
- package/lib/components/features/documents/TMRelationViewer.js +400 -96
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +4 -3
- package/lib/components/features/documents/copyAndMergeDcmtsShared.js +47 -23
- package/lib/components/features/documents/mergePdfUtils.d.ts +52 -0
- package/lib/components/features/documents/mergePdfUtils.js +268 -0
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +2 -1
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -3
- package/lib/components/features/search/TMSearchResult.js +20 -5
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
- package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -1
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -1
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/TMChooserForm.d.ts +2 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +6 -3
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +10 -6
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -2
- package/lib/components/sidebar/TMHeader.d.ts +3 -3
- package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.js +14 -2
- package/lib/helper/SDKUI_Globals.d.ts +1 -0
- package/lib/helper/SDKUI_Globals.js +1 -0
- package/lib/helper/SDKUI_Localizator.d.ts +28 -0
- package/lib/helper/SDKUI_Localizator.js +292 -12
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +278 -278
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +37 -5
- package/lib/helper/TMUtils.js +104 -1
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/helper/helpers.js +9 -0
- package/lib/hooks/useDocumentOperations.js +1 -1
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/services/platform_services.d.ts +3 -2
- package/package.json +3 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
3
|
import { DownloadTypes } from '../../../ts';
|
|
4
|
-
import { calcResponsiveSizes, IconFolderOpen, IconPlay, IconUndo,
|
|
4
|
+
import { calcResponsiveSizes, getExceptionMessage, IconFolderOpen, IconPlay, IconUndo, SDKUI_Globals, SDKUI_Localizator, } from '../../../helper';
|
|
5
5
|
import { DcmtOpers, FileFormats, GeneralRetrieveFormats, ResultTypes, RetrieveFileOptions, ValidationItem, } from '@topconsultnpm/sdk-ts';
|
|
6
6
|
import TMModal from '../../base/TMModal';
|
|
7
7
|
import { useDeviceType } from '../../base/TMDeviceProvider';
|
|
@@ -12,16 +12,19 @@ import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
|
12
12
|
import { TMSplitterLayout } from '../../base/TMLayout';
|
|
13
13
|
import { TMColors } from '../../../utils/theme';
|
|
14
14
|
import TMDownloadRelationViewerSection from './TMDownloadRelationViewerSection';
|
|
15
|
-
import { getDcmtInfosToDownload, getFloatingLabelStyle, isDirectoryPickerSupported,
|
|
15
|
+
import { getDcmtInfosToDownload, getFloatingLabelStyle, isDirectoryPickerSupported, MIN_PDF_FOR_MERGE, } from './copyAndMergeDcmtsShared';
|
|
16
|
+
import { createMetadataPdfFromDocument, getMergePdfSelectionStats, isMetadataOnlyDcmt } from './mergePdfUtils';
|
|
16
17
|
import ShowAlert from '../../base/TMAlert';
|
|
17
18
|
import TMTooltip from '../../base/TMTooltip';
|
|
18
19
|
import MergePdfManager from '../../../helper/MergePdfManager';
|
|
20
|
+
import { TMResultManager } from '../../forms/TMResultDialog';
|
|
19
21
|
/**
|
|
20
22
|
* Form per l'unione di più documenti PDF in un singolo file.
|
|
21
23
|
* Condivide TMDownloadRelationViewerSection e gli helper in copyAndMergeDcmtsShared
|
|
22
24
|
* con TMCopyToFolderForm.
|
|
23
25
|
*/
|
|
24
|
-
const TMMergeToPdfForm = (
|
|
26
|
+
const TMMergeToPdfForm = (props) => {
|
|
27
|
+
const { mode, selectedDcmtInfos, selectedItemsFull, onClose, showTMRelationViewer, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers } = props;
|
|
25
28
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, } = useDcmtOperations();
|
|
26
29
|
const deviceType = useDeviceType();
|
|
27
30
|
const [pdfFileName, setPdfFileName] = useState(`${SDKUI_Localizator.Result.toLowerCase()}.pdf`);
|
|
@@ -79,36 +82,7 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
|
|
|
79
82
|
pdfValidationItems.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.PdfFileName, SDKUI_Localizator.RequiredField));
|
|
80
83
|
}
|
|
81
84
|
// ---- Statistiche selezione PDF / convertibili / non-PDF ----
|
|
82
|
-
const convertibleSelectedItems = (
|
|
83
|
-
if (showTMRelationViewer) {
|
|
84
|
-
return selectedItemsRelationViewer
|
|
85
|
-
.filter(i => i.isDcmt && isConvertibleToPdfExt(i.fileExt))
|
|
86
|
-
.map(i => ({ key: `${i.tid}_${i.did}`, ext: i.fileExt ?? undefined }));
|
|
87
|
-
}
|
|
88
|
-
return selectedDcmtInfos
|
|
89
|
-
.filter(d => isConvertibleToPdfExt(d.FILEEXT))
|
|
90
|
-
.map(d => ({ key: `${d.TID}_${d.DID}`, ext: d.FILEEXT }));
|
|
91
|
-
})();
|
|
92
|
-
const hasConvertibleSelected = convertibleSelectedItems.length > 0;
|
|
93
|
-
const nonPdfSelectedItems = (() => {
|
|
94
|
-
if (showTMRelationViewer) {
|
|
95
|
-
return selectedItemsRelationViewer
|
|
96
|
-
.filter(i => i.isDcmt && !isPdfExt(i.fileExt) && !isConvertibleToPdfExt(i.fileExt))
|
|
97
|
-
.map(i => ({ key: `${i.tid}_${i.did}`, ext: i.fileExt ?? undefined }));
|
|
98
|
-
}
|
|
99
|
-
return selectedDcmtInfos
|
|
100
|
-
.filter(d => !isPdfExt(d.FILEEXT) && !isConvertibleToPdfExt(d.FILEEXT))
|
|
101
|
-
.map(d => ({ key: `${d.TID}_${d.DID}`, ext: d.FILEEXT }));
|
|
102
|
-
})();
|
|
103
|
-
const hasNonPdfSelected = nonPdfSelectedItems.length > 0;
|
|
104
|
-
// Conteggio file unibili: PDF nativi + file convertibili
|
|
105
|
-
const mergeableSelectedCount = (() => {
|
|
106
|
-
if (showTMRelationViewer) {
|
|
107
|
-
return selectedItemsRelationViewer.filter(i => i.isDcmt && (isPdfExt(i.fileExt) || isConvertibleToPdfExt(i.fileExt))).length;
|
|
108
|
-
}
|
|
109
|
-
return selectedDcmtInfos.filter(d => isPdfExt(d.FILEEXT) || isConvertibleToPdfExt(d.FILEEXT)).length;
|
|
110
|
-
})();
|
|
111
|
-
const hasEnoughPdfForMerge = mergeableSelectedCount >= MIN_PDF_FOR_MERGE;
|
|
85
|
+
const { convertibleSelectedItems, hasConvertibleSelected, nonPdfSelectedItems, hasNonPdfSelected, metadataOnlySelectedItems, hasMetadataOnlySelected, mergeableSelectedCount, hasEnoughPdfForMerge, } = getMergePdfSelectionStats(selectedDcmtInfos, selectedItemsFull, selectedItemsRelationViewer, showTMRelationViewer);
|
|
112
86
|
const isFormValid = () => pdfValidationItems.length === 0;
|
|
113
87
|
// ---- Recupero dei file PDF da unire (condiviso tra Esegui e Anteprima) ----
|
|
114
88
|
const collectPdfFilesToMerge = async () => {
|
|
@@ -133,17 +107,81 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
|
|
|
133
107
|
});
|
|
134
108
|
return null;
|
|
135
109
|
}
|
|
110
|
+
// Mappa per lookup veloce di FILECOUNT e FILEEXT da selectedItemsFull
|
|
111
|
+
const fileInfoMap = new Map(selectedItemsFull.map(d => [`${d.TID}_${d.DID}`, { fileExt: d.FILEEXT, fileCount: d.FILECOUNT }]));
|
|
112
|
+
// Mappa per i risultati: mantiene l'ordine originale
|
|
113
|
+
const pdfFilesMap = new Map();
|
|
114
|
+
// Identifica documenti di soli metadati e documenti con file
|
|
115
|
+
const metadataOnlyDcmts = [];
|
|
116
|
+
const dcmtsWithFile = [];
|
|
117
|
+
for (const dcmt of pdfDcmtInfosToDownload) {
|
|
118
|
+
const key = `${dcmt.TID}_${dcmt.DID}`;
|
|
119
|
+
const info = fileInfoMap.get(key);
|
|
120
|
+
if (isMetadataOnlyDcmt(info?.fileExt, info?.fileCount)) {
|
|
121
|
+
metadataOnlyDcmts.push(dcmt);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
dcmtsWithFile.push(dcmt);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// Per i documenti di soli metadati, genera PDF con createMetadataPdfFromDocument
|
|
128
|
+
// Raccoglie gli errori come downloadDcmtsAsync
|
|
129
|
+
const metadataConversionResults = [];
|
|
130
|
+
if (metadataOnlyDcmts.length > 0) {
|
|
131
|
+
setIsMergingPdf(true);
|
|
132
|
+
setMergeProgressMax(metadataOnlyDcmts.length);
|
|
133
|
+
setMergeProgressValue(0);
|
|
134
|
+
setMergeProgressText('Creazione PDF metadati...');
|
|
135
|
+
for (let i = 0; i < metadataOnlyDcmts.length; i++) {
|
|
136
|
+
const dcmt = metadataOnlyDcmts[i];
|
|
137
|
+
try {
|
|
138
|
+
setMergeProgressValue(i);
|
|
139
|
+
setMergeProgressText(`Creazione PDF metadati... (${i + 1}/${metadataOnlyDcmts.length})`);
|
|
140
|
+
const conversionResult = await createMetadataPdfFromDocument(dcmt);
|
|
141
|
+
if (conversionResult) {
|
|
142
|
+
pdfFilesMap.set(`${dcmt.TID}_${dcmt.DID}`, conversionResult.file);
|
|
143
|
+
metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.SUCCESS });
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
// createMetadataPdfFromDocument ha restituito null (errore interno loggato)
|
|
147
|
+
metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: 'Creazione PDF metadati fallita' });
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
console.error(`Errore creazione PDF metadati per TID=${dcmt.TID}, DID=${dcmt.DID}`, error);
|
|
152
|
+
metadataConversionResults.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
setMergeProgressValue(metadataOnlyDcmts.length);
|
|
156
|
+
setIsMergingPdf(false);
|
|
157
|
+
// Mostra riepilogo errori se presenti (come downloadDcmtsAsync)
|
|
158
|
+
const hasErrors = metadataConversionResults.some(r => r.resultType === ResultTypes.ERROR);
|
|
159
|
+
if (hasErrors) {
|
|
160
|
+
TMResultManager.show(metadataConversionResults, 'Conversione PDF metadati', 'TID', 'DID', undefined, undefined, false);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// Per i documenti con file, usa il download normale
|
|
164
|
+
if (dcmtsWithFile.length > 0) {
|
|
165
|
+
const rfo = new RetrieveFileOptions();
|
|
166
|
+
rfo.retrieveReason = DcmtOpers.None;
|
|
167
|
+
rfo.generalRetrieveFormat = GeneralRetrieveFormats.OriginalUnsigned;
|
|
168
|
+
rfo.cvtFormat = FileFormats.PDF;
|
|
169
|
+
rfo.invoiceRetrieveFormat = SDKUI_Globals.userSettings?.searchSettings.invoiceRetrieveFormat;
|
|
170
|
+
rfo.orderRetrieveFormat = SDKUI_Globals.userSettings?.searchSettings.orderRetrieveFormat;
|
|
171
|
+
const collectFileForMerge = async (file, dcmtInfo) => {
|
|
172
|
+
pdfFilesMap.set(`${dcmtInfo.TID}_${dcmtInfo.DID}`, file);
|
|
173
|
+
};
|
|
174
|
+
await downloadDcmtsAsync({ inputDcmts: dcmtsWithFile, downloadType: DownloadTypes.Dcmt, downloadMode: 'download', onFileDownloaded: collectFileForMerge, skipConfirmation: true, retrieveOptions: rfo, useCache: false });
|
|
175
|
+
}
|
|
176
|
+
// Ricostruisci l'array pdfFiles nell'ordine originale di selezione
|
|
136
177
|
const pdfFiles = [];
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
pdfFiles.push(file);
|
|
145
|
-
};
|
|
146
|
-
await downloadDcmtsAsync({ inputDcmts: pdfDcmtInfosToDownload, downloadType: DownloadTypes.Dcmt, downloadMode: 'download', onFileDownloaded: collectFileForMerge, skipConfirmation: true, retrieveOptions: rfo, useCache: false });
|
|
178
|
+
for (const dcmt of pdfDcmtInfosToDownload) {
|
|
179
|
+
const key = `${dcmt.TID}_${dcmt.DID}`;
|
|
180
|
+
const file = pdfFilesMap.get(key);
|
|
181
|
+
if (file) {
|
|
182
|
+
pdfFiles.push(file);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
147
185
|
if (pdfFiles.length === 0) {
|
|
148
186
|
TMMessageBoxManager.show({ message: SDKUI_Localizator.NoFilesAvailableForMerge, buttons: [ButtonNames.OK] });
|
|
149
187
|
return null;
|
|
@@ -244,7 +282,7 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
|
|
|
244
282
|
width: 'max-content',
|
|
245
283
|
backgroundColor: TMColors.default_background,
|
|
246
284
|
zIndex: 1,
|
|
247
|
-
}, children: SDKUI_Localizator.Path }), _jsxs("div", { style: { border: `1px solid ${TMColors.border_normal}`, borderRadius: '5px', padding: '4px 10px 4px 13px', display: 'flex', alignItems: 'center', gap: '8px', backgroundColor: '#fafafa' }, children: [_jsx(IconFolderOpen, {}), _jsx("span", { style: { fontSize: '0.9rem', color: '#333' }, children: "Download" })] }), _jsx("span", { style: { fontSize: '0.8rem', color: '#888', fontStyle: 'italic', marginTop: '4px', display: 'block' }, children: SDKUI_Localizator.BrowserDoesNotSupportFolderSelection })] }) })), _jsx("div", { style: { flex: '1.5 1 420px', minWidth: '350px', width: '100%' }, children: _jsx(TMTextBox, { label: SDKUI_Localizator.PdfFileName, value: pdfFileName, validationItems: pdfValidationItems, autoComplete: "one-time-code", onValueChanged: (e) => setPdfFileName(e.target.value) }) })] }), (hasConvertibleSelected || !hasEnoughPdfForMerge || hasNonPdfSelected) && (_jsxs("div", { style: {
|
|
285
|
+
}, children: SDKUI_Localizator.Path }), _jsxs("div", { style: { border: `1px solid ${TMColors.border_normal}`, borderRadius: '5px', padding: '4px 10px 4px 13px', display: 'flex', alignItems: 'center', gap: '8px', backgroundColor: '#fafafa' }, children: [_jsx(IconFolderOpen, {}), _jsx("span", { style: { fontSize: '0.9rem', color: '#333' }, children: "Download" })] }), _jsx("span", { style: { fontSize: '0.8rem', color: '#888', fontStyle: 'italic', marginTop: '4px', display: 'block' }, children: SDKUI_Localizator.BrowserDoesNotSupportFolderSelection })] }) })), _jsx("div", { style: { flex: '1.5 1 420px', minWidth: '350px', width: '100%' }, children: _jsx(TMTextBox, { label: SDKUI_Localizator.PdfFileName, value: pdfFileName, validationItems: pdfValidationItems, autoComplete: "one-time-code", onValueChanged: (e) => setPdfFileName(e.target.value) }) })] }), (hasConvertibleSelected || hasMetadataOnlySelected || !hasEnoughPdfForMerge || hasNonPdfSelected) && (_jsxs("div", { style: {
|
|
248
286
|
display: 'flex',
|
|
249
287
|
flexDirection: 'column',
|
|
250
288
|
gap: '6px',
|
|
@@ -264,14 +302,19 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
|
|
|
264
302
|
borderBottom: '1px solid #e0e0e0',
|
|
265
303
|
paddingBottom: '6px',
|
|
266
304
|
marginBottom: '2px'
|
|
267
|
-
}, children: SDKUI_Localizator.NotesAndWarnings }), _jsxs("ul", { style: { margin: 0, paddingLeft: '18px', display: 'flex', flexDirection: 'column', gap: '4px' }, children: [hasConvertibleSelected && (_jsx("li", { style: { color: '#00527a' }, children: (() => {
|
|
268
|
-
|
|
305
|
+
}, children: SDKUI_Localizator.NotesAndWarnings }), _jsxs("ul", { style: { margin: 0, paddingLeft: '18px', display: 'flex', flexDirection: 'column', gap: '4px' }, children: [(hasConvertibleSelected || hasMetadataOnlySelected) && (_jsx("li", { style: { color: '#00527a' }, children: (() => {
|
|
306
|
+
// Combina convertibili + metadataOnly
|
|
307
|
+
const allConvertible = [...convertibleSelectedItems, ...metadataOnlySelectedItems];
|
|
308
|
+
const extSet = Array.from(new Set([
|
|
309
|
+
...convertibleSelectedItems.map(i => (i.ext ?? '').toString().trim().toLowerCase().replace(/^\./, '')).filter(e => e.length > 0),
|
|
310
|
+
...(hasMetadataOnlySelected ? ['metadati'] : [])
|
|
311
|
+
]));
|
|
269
312
|
const extLabel = extSet.length > 0
|
|
270
313
|
? ` (${extSet.map(e => '.' + e).join(', ')})`
|
|
271
314
|
: '';
|
|
272
|
-
return
|
|
315
|
+
return allConvertible.length === 1
|
|
273
316
|
? SDKUI_Localizator.DocumentWillBeConvertedDuringMerge.replaceParams(extLabel)
|
|
274
|
-
: SDKUI_Localizator.DocumentsWillBeConvertedDuringMerge.replaceParams(
|
|
317
|
+
: SDKUI_Localizator.DocumentsWillBeConvertedDuringMerge.replaceParams(allConvertible.length.toString(), extLabel);
|
|
275
318
|
})() })), !hasEnoughPdfForMerge && (_jsx("li", { style: { color: '#7a5d00' }, children: mergeableSelectedCount === 0
|
|
276
319
|
? SDKUI_Localizator.NoPdfOrConvertibleFilesSelected_Param.replaceParams(MIN_PDF_FOR_MERGE.toString())
|
|
277
320
|
: SDKUI_Localizator.OnlyOnePdfOrConvertibleFileSelected.replaceParams(MIN_PDF_FOR_MERGE.toString()) })), hasNonPdfSelected && (_jsx("li", { style: { color: '#7a5d00' }, children: (() => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DcmtTypeDescriptor, SearchResultDescriptor, DataColumnDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { DcmtMetadataMap } from '../../../helper';
|
|
3
4
|
import { DcmtInfo, MetadataValueDescriptorEx } from '../../../ts';
|
|
4
5
|
import { ITMTreeItem } from '../../base/TMTreeView';
|
|
5
6
|
/**
|
|
@@ -19,7 +20,7 @@ export interface RelationTreeItem extends ITMTreeItem {
|
|
|
19
20
|
isSeparator?: boolean;
|
|
20
21
|
isInfoMessage?: boolean;
|
|
21
22
|
isLogDel?: number;
|
|
22
|
-
values?:
|
|
23
|
+
values?: DcmtMetadataMap;
|
|
23
24
|
searchResult?: SearchResultDescriptor[];
|
|
24
25
|
itemsCount?: number;
|
|
25
26
|
fileExt?: string;
|
|
@@ -72,7 +73,10 @@ export interface TMRelationViewerProps {
|
|
|
72
73
|
* Value rendering respects DataDomain (uses TMDataListItemViewer for lists, TMDataUserIdItemViewer for users, etc.)
|
|
73
74
|
*/
|
|
74
75
|
showMetadataNames?: boolean;
|
|
75
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Maximum depth level for recursive loading (default: 2).
|
|
78
|
+
* Use 0 for unlimited depth (expand as much as possible).
|
|
79
|
+
*/
|
|
76
80
|
maxDepthLevel?: number;
|
|
77
81
|
/**
|
|
78
82
|
* If true (default), when isForMaster=true shows: detail doc → master docs as children (inverted navigation)
|
|
@@ -122,6 +126,11 @@ export interface TMRelationViewerProps {
|
|
|
122
126
|
* (root container + first document + first correlation folder).
|
|
123
127
|
*/
|
|
124
128
|
defaultExpandAll?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Callback invoked when loading state changes.
|
|
131
|
+
* Useful to disable interactions (like context menu) during loading.
|
|
132
|
+
*/
|
|
133
|
+
onLoadingStateChanged?: (isLoading: boolean) => void;
|
|
125
134
|
}
|
|
126
135
|
/**
|
|
127
136
|
* Check if document type has detail relations
|
|
@@ -131,14 +140,6 @@ export declare const hasDetailRelations: (mTID: number | undefined) => Promise<b
|
|
|
131
140
|
* Check if document type has master relations
|
|
132
141
|
*/
|
|
133
142
|
export declare const hasMasterRelations: (dTID: number | undefined) => Promise<boolean>;
|
|
134
|
-
/**
|
|
135
|
-
* Get metadata keys excluding system metadata
|
|
136
|
-
*/
|
|
137
|
-
export declare const getMetadataKeys: (obj: any) => string[];
|
|
138
|
-
/**
|
|
139
|
-
* Get display value keys for a document (max 5, prioritize SYS_Abstract)
|
|
140
|
-
*/
|
|
141
|
-
export declare const getDcmtDisplayValue: (obj: any) => string[];
|
|
142
143
|
/**
|
|
143
144
|
* Get display value formatted by column type
|
|
144
145
|
*/
|
|
@@ -147,5 +148,6 @@ export declare const getDisplayValueByColumn: (col: DataColumnDescriptor | undef
|
|
|
147
148
|
* Convert SearchResultDescriptor to structured data source with metadata
|
|
148
149
|
*/
|
|
149
150
|
export declare const searchResultToDataSource: (searchResult: SearchResultDescriptor | undefined, hideSysMetadata?: boolean) => Promise<any[]>;
|
|
151
|
+
export declare const DEFAULT_RELATION_EXPAND_LEVEL = 4;
|
|
150
152
|
declare const TMRelationViewer: React.FC<TMRelationViewerProps>;
|
|
151
153
|
export default TMRelationViewer;
|