@topconsultnpm/sdkui-react 6.21.0-dev2.42 → 6.21.0-dev2.43

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.
@@ -46,21 +46,21 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
46
46
  const getTitle = () => {
47
47
  const count = ` (${selectedDcmtInfos.length})`;
48
48
  const modeLabelMap = {
49
- onlySelected: 'I documenti selezionati',
50
- customized: 'I documenti selezionati e i correlati',
49
+ onlySelected: SDKUI_Localizator.SelectedDocuments,
50
+ customized: SDKUI_Localizator.SelectedDocumentsAndRelated,
51
51
  };
52
52
  const modeLabel = modeLabelMap[mode] || modeLabelMap.onlySelected;
53
- return `Copia in una cartella - ${modeLabel}${count}`;
53
+ return `${SDKUI_Localizator.CopyToFolder} - ${modeLabel}${count}`;
54
54
  };
55
55
  const isUsingDefaultDownloads = settings.destinationFolder === 'Download' && !folderHandleRef.current;
56
56
  // ---- Validazione ----
57
57
  const folderValidationItems = [];
58
58
  if (settings.exportMode === 'copy' && !settings.destinationFolder.trim()) {
59
- folderValidationItems.push(new ValidationItem(ResultTypes.ERROR, 'Cartella di destinazione', SDKUI_Localizator.RequiredField));
59
+ folderValidationItems.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.Path, SDKUI_Localizator.RequiredField));
60
60
  }
61
61
  const zipValidationItems = [];
62
62
  if (settings.exportMode === 'zip' && !settings.zipFileName.trim()) {
63
- zipValidationItems.push(new ValidationItem(ResultTypes.ERROR, 'Nome file zip', SDKUI_Localizator.RequiredField));
63
+ zipValidationItems.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.ZipFileName, SDKUI_Localizator.RequiredField));
64
64
  }
65
65
  const isFormValid = () => {
66
66
  if (settings.exportMode === 'copy')
@@ -89,7 +89,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
89
89
  }
90
90
  catch (err) {
91
91
  if (err.name !== 'AbortError') {
92
- console.error('Errore nella selezione della cartella:', err);
92
+ console.error('Error selecting folder:', err);
93
93
  }
94
94
  }
95
95
  finally {
@@ -149,16 +149,16 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
149
149
  // ---- Esecuzione (Copia oppure ZIP) ----
150
150
  const run = async () => {
151
151
  if (settings.exportMode === 'copy' && folderValidationItems.length > 0) {
152
- TMMessageBoxManager.show({ message: 'Per favore, correggi gli errori prima di procedere.', buttons: [ButtonNames.OK] });
152
+ TMMessageBoxManager.show({ message: SDKUI_Localizator.PleaseCorrectErrorsBeforeProceeding, buttons: [ButtonNames.OK] });
153
153
  return;
154
154
  }
155
155
  if (settings.exportMode === 'zip' && zipValidationItems.length > 0) {
156
- TMMessageBoxManager.show({ message: 'Per favore, correggi gli errori prima di procedere.', buttons: [ButtonNames.OK] });
156
+ TMMessageBoxManager.show({ message: SDKUI_Localizator.PleaseCorrectErrorsBeforeProceeding, buttons: [ButtonNames.OK] });
157
157
  return;
158
158
  }
159
159
  const dcmtInfosToDownload = getDcmtInfosToDownload(selectedDcmtInfos, selectedItemsRelationViewer, showTMRelationViewer);
160
160
  if (dcmtInfosToDownload.length === 0) {
161
- TMMessageBoxManager.show({ message: 'Nessun documento selezionato.', buttons: [ButtonNames.OK] });
161
+ TMMessageBoxManager.show({ message: SDKUI_Localizator.NoDocumentsSelected, buttons: [ButtonNames.OK] });
162
162
  return;
163
163
  }
164
164
  const retrieveOptions = new RetrieveFileOptions();
@@ -211,7 +211,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
211
211
  await writable.close();
212
212
  }
213
213
  catch (err) {
214
- console.error('Errore nel salvataggio ZIP nella cartella, fallback al download standard:', err);
214
+ console.error('Error saving ZIP to folder, fallback to standard download:', err);
215
215
  // Fallback: download standard del browser
216
216
  ZipManager.downloadBlob(zipBlob, zipFileName);
217
217
  }
@@ -223,7 +223,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
223
223
  }
224
224
  }
225
225
  else {
226
- TMMessageBoxManager.show({ message: 'Modalità di esportazione non supportata.', buttons: [ButtonNames.OK] });
226
+ TMMessageBoxManager.show({ message: SDKUI_Localizator.ExportModeNotSupported, buttons: [ButtonNames.OK] });
227
227
  return;
228
228
  }
229
229
  onClose();
@@ -236,7 +236,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
236
236
  const hasChanges = JSON.stringify(settings) !== JSON.stringify(defaults);
237
237
  if (hasChanges) {
238
238
  setHasSavedLayout(true);
239
- ShowAlert({ mode: 'success', message: 'Layout salvato con successo', title: 'Successo', duration: 3000 });
239
+ ShowAlert({ mode: 'success', message: SDKUI_Localizator.OperationSuccess, title: SDKUI_Localizator.Save, duration: 3000 });
240
240
  }
241
241
  };
242
242
  const removeLayout = () => {
@@ -245,7 +245,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
245
245
  setSettings(defaults);
246
246
  folderHandleRef.current = null;
247
247
  setHasSavedLayout(false);
248
- ShowAlert({ mode: 'success', message: 'Layout rimosso con successo', title: 'Successo', duration: 3000 });
248
+ ShowAlert({ mode: 'success', message: SDKUI_Localizator.OperationSuccess, title: SDKUI_Localizator.Remove, duration: 3000 });
249
249
  };
250
250
  const isLayoutSameAsSaved = () => {
251
251
  const saved = SDKUI_Globals.userSettings.documentDownloadSettings;
@@ -268,10 +268,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
268
268
  display: 'flex',
269
269
  flexDirection: 'column',
270
270
  boxSizing: 'border-box'
271
- }, children: [_jsx("span", { style: {
272
- ...getFloatingLabelStyle(),
273
- fontWeight: 600
274
- }, children: "Parametri di configurazione" }), _jsxs("div", { style: {
271
+ }, children: [_jsx("span", { style: { ...getFloatingLabelStyle(), fontWeight: 600 }, children: SDKUI_Localizator.ConfigurationParameters }), _jsxs("div", { style: {
275
272
  position: 'absolute',
276
273
  top: '-8px',
277
274
  right: '12px',
@@ -281,31 +278,31 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
281
278
  backgroundColor: 'white',
282
279
  padding: '0 4px',
283
280
  zIndex: 1
284
- }, children: [_jsx(TMButton, { btnStyle: "toolbar", icon: _jsx(IconSave, {}), caption: "Salva Layout", color: "success", disabled: isLayoutSameAsSaved(), onClick: saveLayout }), hasSavedLayout && (_jsx(TMButton, { btnStyle: "toolbar", icon: _jsx(IconDelete, {}), caption: "Rimuovi Layout", color: "error", onClick: removeLayout }))] }), _jsxs("div", { style: {
281
+ }, children: [_jsx(TMButton, { btnStyle: "toolbar", icon: _jsx(IconSave, {}), caption: SDKUI_Localizator.SaveLayout, color: "success", disabled: isLayoutSameAsSaved(), onClick: saveLayout }), hasSavedLayout && (_jsx(TMButton, { btnStyle: "toolbar", icon: _jsx(IconDelete, {}), caption: SDKUI_Localizator.RemoveLayout, color: "error", onClick: removeLayout }))] }), _jsxs("div", { style: {
285
282
  display: 'flex',
286
283
  flexDirection: 'column',
287
284
  flex: 1,
288
285
  overflowY: 'auto',
289
286
  minHeight: 0,
290
287
  }, children: [_jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center' }, children: _jsx(TMRadioButton, { dataSource: [
291
- { value: 'copy', display: 'Copia in una cartella' },
292
- { value: 'zip', display: 'Comprimi in un file zip' }
293
- ], value: settings.exportMode, direction: "row", onValueChanged: (value) => updateSettings('exportMode', value) }) }), isDirectoryPickerSupported() ? (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '4px' }, children: [_jsx(TMTextBox, { label: "Percorso", value: settings.destinationFolder, validationItems: folderValidationItems, onValueChanged: handleFolderValueChange, readOnly: true, placeHolder: "Download", onClick: handleSelectFolder, buttons: [
288
+ { value: 'copy', display: SDKUI_Localizator.CopyToFolder },
289
+ { value: 'zip', display: SDKUI_Localizator.CompressToZipFile }
290
+ ], value: settings.exportMode, direction: "row", onValueChanged: (value) => updateSettings('exportMode', value) }) }), isDirectoryPickerSupported() ? (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '4px' }, children: [_jsx(TMTextBox, { label: SDKUI_Localizator.Path, value: settings.destinationFolder, validationItems: folderValidationItems, onValueChanged: handleFolderValueChange, readOnly: true, placeHolder: "Download", onClick: handleSelectFolder, buttons: [
294
291
  {
295
292
  icon: _jsx(IconFolderOpen, {}),
296
- text: 'Seleziona cartella',
293
+ text: SDKUI_Localizator.SelectFolder,
297
294
  onClick: handleSelectFolder
298
295
  },
299
296
  ...(!isUsingDefaultDownloads ? [{
300
297
  icon: _jsx(IconUndo, {}),
301
- text: 'Ripristina Download',
298
+ text: SDKUI_Localizator.RestoreDownload,
302
299
  onClick: () => {
303
300
  skipSelectFolderRef.current = true;
304
301
  updateSettings('destinationFolder', 'Download');
305
302
  folderHandleRef.current = null;
306
303
  }
307
304
  }] : [])
308
- ] }), SDKUI_Globals.userSettings.documentDownloadSettings?.destinationFolder && (_jsxs("span", { style: { fontSize: '0.8rem', color: '#666', fontStyle: 'italic' }, children: ["Destinazione salvata: ", SDKUI_Globals.userSettings.documentDownloadSettings.destinationFolder] }))] })) : (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '4px' }, children: [_jsx("label", { style: { fontSize: '0.9rem', color: '#525252' }, children: "Percorso" }), _jsxs("div", { style: {
305
+ ] }), SDKUI_Globals.userSettings.documentDownloadSettings?.destinationFolder && (_jsxs("span", { style: { fontSize: '0.8rem', color: '#666', fontStyle: 'italic' }, children: [SDKUI_Localizator.SavedDestination, ": ", SDKUI_Globals.userSettings.documentDownloadSettings.destinationFolder] }))] })) : (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '4px' }, children: [_jsx("label", { style: { fontSize: '0.9rem', color: '#525252' }, children: SDKUI_Localizator.Path }), _jsxs("div", { style: {
309
306
  display: 'flex',
310
307
  alignItems: 'center',
311
308
  gap: '8px',
@@ -313,16 +310,16 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
313
310
  border: `1px solid ${TMColors.border_normal}`,
314
311
  borderRadius: '5px',
315
312
  backgroundColor: '#fafafa',
316
- }, children: [_jsx(IconFolderOpen, {}), _jsx("span", { style: { fontSize: '0.9rem', color: '#333' }, children: "Download" })] }), _jsx("span", { style: { fontSize: '0.8rem', color: '#888', fontStyle: 'italic' }, children: "Il browser in uso non supporta la selezione della cartella. I file verranno scaricati nella cartella Download." })] })), settings.exportMode === 'zip' && (_jsxs("div", { style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))', gap: '12px' }, children: [_jsx(TMTextBox, { label: "Nome file zip", value: settings.zipFileName, validationItems: zipValidationItems, autoComplete: "one-time-code", onValueChanged: (e) => updateSettings('zipFileName', e.target.value) }), _jsx(TMTextBox, { label: "Proteggi con password (opzionale)", value: settings.zipPassword, type: "password", autoComplete: "one-time-code", onValueChanged: (e) => updateSettings('zipPassword', e.target.value) })] })), settings.exportMode === 'copy' && isDirectoryPickerSupported() && (_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '4px', marginTop: '8px' }, children: isUsingDefaultDownloads ? (_jsx("span", { style: { fontSize: '0.8rem', color: '#888', fontStyle: 'italic' }, children: "Nella cartella Download il browser rinomina automaticamente i file duplicati." })) : (_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '12px', flexWrap: 'wrap' }, children: [_jsx("label", { style: { fontSize: '0.9rem', color: '#525252', fontWeight: 500 }, children: "Se il file esiste" }), _jsx(TMRadioButton, { dataSource: [
317
- { value: 'overwrite', display: 'Copia e sostituisci' },
318
- { value: 'skip', display: 'Non copiare' },
319
- { value: 'rename', display: 'Copia, ma rinomina' },
320
- ], value: settings.fileExistsMode, direction: "row", onValueChanged: (value) => updateSettings('fileExistsMode', value) })] })) })), _jsxs("div", { style: { display: 'flex', alignItems: 'flex-end', gap: '12px', flexWrap: 'wrap' }, children: [_jsx("div", { style: { flex: '0 0 auto', minWidth: '160px' }, children: _jsx(TMDropDown, { label: "Per il nome file usa", value: settings.fileNamingMode, dataSource: [
321
- { value: 'onlyDid', display: 'Solo DID' },
322
- { value: 'documentTypeAndDid', display: 'Nome tipo documento e DID' },
323
- { value: 'documentTypeAndCustomMetadata', display: 'Nome tipo documento e metadati personalizzati' },
324
- { value: 'onlyCustomMetadata', display: 'Solo metadati personalizzati' },
325
- ], onValueChanged: handleFileNamingModeChange }) }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_jsx("label", { style: { fontSize: '0.9rem', color: '#525252', whiteSpace: 'nowrap' }, children: "Carattere separatore" }), _jsx("input", { type: "text", value: settings.separatorChar, maxLength: 1, onChange: handleSeparatorChange, style: {
313
+ }, children: [_jsx(IconFolderOpen, {}), _jsx("span", { style: { fontSize: '0.9rem', color: '#333' }, children: "Download" })] }), _jsx("span", { style: { fontSize: '0.8rem', color: '#888', fontStyle: 'italic' }, children: SDKUI_Localizator.BrowserDoesNotSupportFolderSelection })] })), settings.exportMode === 'zip' && (_jsxs("div", { style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))', gap: '12px' }, children: [_jsx(TMTextBox, { label: SDKUI_Localizator.ZipFileName, value: settings.zipFileName, validationItems: zipValidationItems, autoComplete: "one-time-code", onValueChanged: (e) => updateSettings('zipFileName', e.target.value) }), _jsx(TMTextBox, { label: SDKUI_Localizator.ProtectWithPasswordOptional, value: settings.zipPassword, type: "password", autoComplete: "one-time-code", onValueChanged: (e) => updateSettings('zipPassword', e.target.value) })] })), settings.exportMode === 'copy' && isDirectoryPickerSupported() && (_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '4px', marginTop: '8px' }, children: isUsingDefaultDownloads ? (_jsxs("span", { style: { fontSize: '0.8rem', color: '#888', fontStyle: 'italic' }, children: [SDKUI_Localizator.BrowserAutoRenamesDuplicateFilesInDownloadsFolder, "."] })) : (_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '12px', flexWrap: 'wrap' }, children: [_jsx("label", { style: { fontSize: '0.9rem', color: '#525252', fontWeight: 500 }, children: SDKUI_Localizator.IfFileExists }), _jsx(TMRadioButton, { dataSource: [
314
+ { value: 'overwrite', display: SDKUI_Localizator.CopyAndReplace },
315
+ { value: 'skip', display: SDKUI_Localizator.DoNotCopy },
316
+ { value: 'rename', display: SDKUI_Localizator.CopyButRename },
317
+ ], value: settings.fileExistsMode, direction: "row", onValueChanged: (value) => updateSettings('fileExistsMode', value) })] })) })), _jsxs("div", { style: { display: 'flex', alignItems: 'flex-end', gap: '12px', flexWrap: 'wrap' }, children: [_jsx("div", { style: { flex: '0 0 auto', minWidth: '160px' }, children: _jsx(TMDropDown, { label: SDKUI_Localizator.UseForFileName, value: settings.fileNamingMode, dataSource: [
318
+ { value: 'onlyDid', display: SDKUI_Localizator.OnlyDID },
319
+ { value: 'documentTypeAndDid', display: SDKUI_Localizator.DocumentTypeNameAndDID },
320
+ { value: 'documentTypeAndCustomMetadata', display: SDKUI_Localizator.DocumentTypeNameAndCustomMetadata },
321
+ { value: 'onlyCustomMetadata', display: SDKUI_Localizator.OnlyCustomMetadata },
322
+ ], onValueChanged: handleFileNamingModeChange }) }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_jsx("label", { style: { fontSize: '0.9rem', color: '#525252', whiteSpace: 'nowrap' }, children: SDKUI_Localizator.SeparatorCharacter }), _jsx("input", { type: "text", value: settings.separatorChar, maxLength: 1, onChange: handleSeparatorChange, style: {
326
323
  width: '32px',
327
324
  height: '28px',
328
325
  textAlign: 'center',
@@ -340,7 +337,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
340
337
  }, onBlur: (e) => {
341
338
  e.target.style.backgroundImage = 'none';
342
339
  e.target.style.borderBottom = `1px solid ${TMColors.border_normal}`;
343
- } })] }), _jsx(TMCheckBox, { label: "Rimuovi la firma se presente", value: settings.removeSignature, onValueChanged: (value) => updateSettings('removeSignature', value) })] }), _jsxs("div", { style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))', gap: '12px' }, children: [_jsx(TMInvoiceRetrieveFormats, { width: '100%', label: SDKUI_Localizator.ElectronicInvoice + ' - ' + SDKUI_Localizator.DisplayFormat, onValueChanged: (newValue) => updateSettings('invoiceFormat', newValue), value: settings.invoiceFormat, valueOrig: settings.invoiceFormat }), _jsx(TMOrderRetrieveFormats, { width: '100%', label: SDKUI_Localizator.ElectronicOrder + ' - ' + SDKUI_Localizator.DisplayFormat, value: settings.orderFormat, valueOrig: settings.orderFormat, onValueChanged: (newValue) => updateSettings('orderFormat', newValue) })] })] })] }));
344
- return (_jsx(TMModal, { width: calcResponsiveSizes(deviceType, showTMRelationViewer ? '95%' : '780px', showTMRelationViewer ? '95%' : '780px', '95%'), height: calcResponsiveSizes(deviceType, showTMRelationViewer ? '95%' : '450px', showTMRelationViewer ? '95%' : '450px', '95%'), title: getTitle(), onClose: onClose, showCloseButton: true, children: _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: _jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { display: 'flex', flexDirection: 'column', padding: '4px 4px 16px 4px', width: '100%', height: '100%', boxSizing: 'border-box', overflow: 'hidden' }, children: [showTMRelationViewer ? (_jsx("div", { style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: _jsxs(TMSplitterLayout, { direction: 'vertical', showSeparator: true, separatorSize: 8, separatorColor: 'transparent', separatorActiveColor: 'transparent', overflow: 'hidden', min: SPLITTER_MIN, start: SPLITTER_START_60_40, children: [_jsx(TMDownloadRelationViewerSection, { selectedDcmtInfos: selectedDcmtInfos, onSelectionChanged: setSelectedItemsRelationViewer, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), configSection] }, "TMCopyToFolder-relation-config") })) : (configSection), _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexShrink: 0, marginTop: '12px' }, children: _jsx(TMButton, { caption: "Esegui", icon: _jsx(IconPlay, {}), color: 'success', showTooltip: false, disabled: !isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0), onClick: run }) })] }) }) }));
340
+ } })] }), _jsx(TMCheckBox, { label: SDKUI_Localizator.RemoveSignatureIfPresent, value: settings.removeSignature, onValueChanged: (value) => updateSettings('removeSignature', value) })] }), _jsxs("div", { style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))', gap: '12px' }, children: [_jsx(TMInvoiceRetrieveFormats, { width: '100%', label: SDKUI_Localizator.ElectronicInvoice + ' - ' + SDKUI_Localizator.DisplayFormat, onValueChanged: (newValue) => updateSettings('invoiceFormat', newValue), value: settings.invoiceFormat, valueOrig: settings.invoiceFormat }), _jsx(TMOrderRetrieveFormats, { width: '100%', label: SDKUI_Localizator.ElectronicOrder + ' - ' + SDKUI_Localizator.DisplayFormat, value: settings.orderFormat, valueOrig: settings.orderFormat, onValueChanged: (newValue) => updateSettings('orderFormat', newValue) })] })] })] }));
341
+ return (_jsx(TMModal, { width: calcResponsiveSizes(deviceType, showTMRelationViewer ? '95%' : '780px', showTMRelationViewer ? '95%' : '780px', '95%'), height: calcResponsiveSizes(deviceType, showTMRelationViewer ? '95%' : '450px', showTMRelationViewer ? '95%' : '450px', '95%'), title: getTitle(), onClose: onClose, showCloseButton: true, children: _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: _jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { display: 'flex', flexDirection: 'column', padding: '4px 4px 16px 4px', width: '100%', height: '100%', boxSizing: 'border-box', overflow: 'hidden' }, children: [showTMRelationViewer ? (_jsx("div", { style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: _jsxs(TMSplitterLayout, { direction: 'vertical', showSeparator: true, separatorSize: 8, separatorColor: 'transparent', separatorActiveColor: 'transparent', overflow: 'hidden', min: SPLITTER_MIN, start: SPLITTER_START_60_40, children: [_jsx(TMDownloadRelationViewerSection, { selectedDcmtInfos: selectedDcmtInfos, onSelectionChanged: setSelectedItemsRelationViewer, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), configSection] }, "TMCopyToFolder-relation-config") })) : (configSection), _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexShrink: 0, marginTop: '12px' }, children: _jsx(TMButton, { caption: SDKUI_Localizator.Execute, icon: _jsx(IconPlay, {}), color: 'success', showTooltip: false, disabled: !isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0), onClick: run }) })] }) }) }));
345
342
  };
346
343
  export default TMCopyToFolderForm;
@@ -51,7 +51,7 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
51
51
  }
52
52
  catch (err) {
53
53
  if (err.name !== 'AbortError') {
54
- console.error('Errore nella selezione della cartella:', err);
54
+ console.error('Error selecting folder::', err);
55
55
  }
56
56
  }
57
57
  finally {
@@ -61,16 +61,16 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
61
61
  const getTitle = () => {
62
62
  const count = ` (${selectedDcmtInfos.length})`;
63
63
  const modeLabelMap = {
64
- onlySelected: 'Documenti selezionati',
65
- customized: 'Documenti selezionati e i correlati',
64
+ onlySelected: SDKUI_Localizator.SelectedDocuments,
65
+ customized: SDKUI_Localizator.SelectedDocumentsAndRelated,
66
66
  };
67
67
  const modeLabel = modeLabelMap[mode] || modeLabelMap.onlySelected;
68
- return `Unisci in un file PDF - ${modeLabel}${count}`;
68
+ return `${SDKUI_Localizator.MergeToPdf} - ${modeLabel}${count}`;
69
69
  };
70
70
  // ---- Validazione ----
71
71
  const pdfValidationItems = [];
72
72
  if (!pdfFileName.trim()) {
73
- pdfValidationItems.push(new ValidationItem(ResultTypes.ERROR, 'Nome file PDF', SDKUI_Localizator.RequiredField));
73
+ pdfValidationItems.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.PdfFileName, SDKUI_Localizator.RequiredField));
74
74
  }
75
75
  // ---- Helper per file convertibili in PDF ----
76
76
  const isConvertibleToPdfExt = (ext) => {
@@ -122,21 +122,21 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
122
122
  const collectPdfFilesToMerge = async () => {
123
123
  const dcmtInfosToDownload = getDcmtInfosToDownload(selectedDcmtInfos, selectedItemsRelationViewer, showTMRelationViewer);
124
124
  if (dcmtInfosToDownload.length === 0) {
125
- TMMessageBoxManager.show({ message: 'Nessun documento selezionato.', buttons: [ButtonNames.OK] });
125
+ TMMessageBoxManager.show({ message: SDKUI_Localizator.NoDcmtSelected, buttons: [ButtonNames.OK] });
126
126
  return null;
127
127
  }
128
128
  const nonPdfKeys = new Set(nonPdfSelectedItems.map(i => i.key));
129
129
  const pdfDcmtInfosToDownload = dcmtInfosToDownload.filter(d => !nonPdfKeys.has(`${d.TID}_${d.DID}`));
130
130
  if (pdfDcmtInfosToDownload.length === 0) {
131
131
  TMMessageBoxManager.show({
132
- message: 'Tra i documenti selezionati non è presente alcun file PDF o convertibile in PDF: l\'unione non può essere eseguita.',
132
+ message: SDKUI_Localizator.NoPdfOrConvertibleFilesAmongSelectedMergeBlocked,
133
133
  buttons: [ButtonNames.OK]
134
134
  });
135
135
  return null;
136
136
  }
137
137
  if (pdfDcmtInfosToDownload.length < MIN_PDF_FOR_MERGE) {
138
138
  TMMessageBoxManager.show({
139
- message: `Tra i documenti selezionati è presente un solo file PDF o convertibile: per l'unione ne servono almeno ${MIN_PDF_FOR_MERGE}.`,
139
+ message: SDKUI_Localizator.OnlyOnePdfOrConvertibleFileMergeBlocked.replaceParams(MIN_PDF_FOR_MERGE.toString()),
140
140
  buttons: [ButtonNames.OK]
141
141
  });
142
142
  return null;
@@ -153,7 +153,7 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
153
153
  };
154
154
  await downloadDcmtsAsync(pdfDcmtInfosToDownload, DownloadTypes.Dcmt, 'download', collectFileForMerge, undefined, true, rfo, false);
155
155
  if (pdfFiles.length === 0) {
156
- TMMessageBoxManager.show({ message: 'Nessun file disponibile per l\'unione.', buttons: [ButtonNames.OK] });
156
+ TMMessageBoxManager.show({ message: SDKUI_Localizator.NoFilesAvailableForMerge, buttons: [ButtonNames.OK] });
157
157
  return null;
158
158
  }
159
159
  return pdfFiles;
@@ -161,11 +161,11 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
161
161
  // ---- Esecuzione: scarica i PDF e li unisce ----
162
162
  const run = async () => {
163
163
  if (pdfValidationItems.length > 0) {
164
- TMMessageBoxManager.show({ message: 'Per favore, correggi gli errori prima di procedere.', buttons: [ButtonNames.OK] });
164
+ TMMessageBoxManager.show({ message: SDKUI_Localizator.PleaseCorrectErrorsBeforeProceeding, buttons: [ButtonNames.OK] });
165
165
  return;
166
166
  }
167
167
  if (!mergePdfManager) {
168
- TMMessageBoxManager.show({ message: 'La funzionalità di unione PDF non è disponibile.', buttons: [ButtonNames.OK] });
168
+ TMMessageBoxManager.show({ message: SDKUI_Localizator.PdfMergeFeatureNotAvailable, buttons: [ButtonNames.OK] });
169
169
  return;
170
170
  }
171
171
  const pdfFiles = await collectPdfFilesToMerge();
@@ -180,17 +180,17 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
180
180
  const writable = await fileHandle.createWritable();
181
181
  await writable.write(mergedFile);
182
182
  await writable.close();
183
- ShowAlert({ message: `Il file PDF unito è stato salvato nella cartella "${folderHandleRef.current.name}".`, mode: 'success', duration: 3000, title: 'Successo' });
183
+ ShowAlert({ message: SDKUI_Localizator.PdfMergedSavedInFolder.replaceParams(folderHandleRef.current.name), mode: 'success', duration: 3000, title: SDKUI_Localizator.MergeToPdf });
184
184
  }
185
185
  else {
186
186
  // Altrimenti usa il download standard del browser
187
187
  await mergePdfManager.mergeAndDownload(pdfFiles, finalName);
188
- ShowAlert({ message: 'Il file PDF unito è stato scaricato.', mode: 'success', duration: 3000, title: 'Successo' });
188
+ ShowAlert({ message: SDKUI_Localizator.PdfMergedSavedInFolder.replaceParams('Download'), mode: 'success', duration: 3000, title: SDKUI_Localizator.MergeToPdf });
189
189
  }
190
190
  }
191
191
  catch (err) {
192
- console.error('Errore durante l\'unione dei file PDF o convertibili:', err);
193
- TMMessageBoxManager.show({ message: 'Errore durante l\'unione dei file PDF o convertibili.', buttons: [ButtonNames.OK] });
192
+ console.error('Error merging PDF or convertible files:', err);
193
+ TMMessageBoxManager.show({ message: SDKUI_Localizator.PdfMergeError, buttons: [ButtonNames.OK] });
194
194
  return;
195
195
  }
196
196
  onClose();
@@ -208,29 +208,29 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
208
208
  display: 'flex',
209
209
  flexDirection: 'column',
210
210
  boxSizing: 'border-box'
211
- }, children: [_jsx("span", { style: getFloatingLabelStyle(), title: "Parametri di configurazione (Unisci in PDF)", children: "Parametri di configurazione" }), _jsxs("div", { style: {
211
+ }, children: [_jsx("span", { style: getFloatingLabelStyle(), title: `${SDKUI_Localizator.ConfigurationParameters} (${SDKUI_Localizator.MergeToPdf})`, children: SDKUI_Localizator.ConfigurationParameters }), _jsxs("div", { style: {
212
212
  display: 'flex',
213
213
  flexDirection: 'column',
214
214
  gap: '12px',
215
215
  flex: 1,
216
216
  overflowY: 'auto',
217
217
  minHeight: 0,
218
- }, children: [_jsxs("div", { style: { display: 'grid', gridTemplateColumns: isDirectoryPickerSupported() ? '1fr 1fr' : '1fr', gap: '12px' }, children: [isDirectoryPickerSupported() && (_jsx(TMTextBox, { label: "Percorso", value: destinationFolder, onValueChanged: handleFolderValueChange, readOnly: true, placeHolder: "Download", onClick: handleSelectFolder, buttons: [
218
+ }, children: [_jsxs("div", { style: { display: 'grid', gridTemplateColumns: isDirectoryPickerSupported() ? '1fr 1fr' : '1fr', gap: '12px' }, children: [isDirectoryPickerSupported() && (_jsx(TMTextBox, { label: SDKUI_Localizator.Path, value: destinationFolder, onValueChanged: handleFolderValueChange, readOnly: true, placeHolder: "Download", onClick: handleSelectFolder, buttons: [
219
219
  {
220
220
  icon: _jsx(IconFolderOpen, {}),
221
- text: 'Seleziona cartella',
221
+ text: SDKUI_Localizator.SelectFolder,
222
222
  onClick: handleSelectFolder
223
223
  },
224
224
  ...(!isUsingDefaultDownloads ? [{
225
225
  icon: _jsx(IconUndo, {}),
226
- text: 'Ripristina Download',
226
+ text: SDKUI_Localizator.RestoreDownload,
227
227
  onClick: () => {
228
228
  skipSelectFolderRef.current = true;
229
229
  setDestinationFolder('Download');
230
230
  folderHandleRef.current = null;
231
231
  }
232
232
  }] : [])
233
- ] })), _jsx(TMTextBox, { label: "Nome file PDF", value: pdfFileName, validationItems: pdfValidationItems, autoComplete: "one-time-code", onValueChanged: (e) => setPdfFileName(e.target.value) })] }), hasConvertibleSelected && (_jsxs("div", { style: {
233
+ ] })), _jsx(TMTextBox, { label: SDKUI_Localizator.PdfFileName, value: pdfFileName, validationItems: pdfValidationItems, autoComplete: "one-time-code", onValueChanged: (e) => setPdfFileName(e.target.value) })] }), hasConvertibleSelected && (_jsxs("div", { style: {
234
234
  display: 'flex',
235
235
  flexDirection: 'column',
236
236
  gap: '6px',
@@ -240,14 +240,14 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
240
240
  backgroundColor: '#e2f0fd',
241
241
  color: '#00527a',
242
242
  fontSize: '0.85rem'
243
- }, children: [_jsx("strong", { children: "Nota" }), _jsx("ul", { style: { margin: 0, paddingLeft: '18px', display: 'flex', flexDirection: 'column', gap: '4px' }, children: _jsx("li", { children: (() => {
243
+ }, children: [_jsx("strong", { children: SDKUI_Localizator.Note }), _jsx("ul", { style: { margin: 0, paddingLeft: '18px', display: 'flex', flexDirection: 'column', gap: '4px' }, children: _jsx("li", { children: (() => {
244
244
  const extSet = Array.from(new Set(convertibleSelectedItems.map(i => (i.ext ?? '').toString().trim().toLowerCase().replace(/^\./, '')).filter(e => e.length > 0)));
245
245
  const extLabel = extSet.length > 0
246
246
  ? ` (${extSet.map(e => '.' + e).join(', ')})`
247
247
  : '';
248
248
  return convertibleSelectedItems.length === 1
249
- ? `Un documento${extLabel} verrà convertito in PDF durante l'unione.`
250
- : `${convertibleSelectedItems.length} documenti${extLabel} verranno convertiti in PDF durante l'unione.`;
249
+ ? SDKUI_Localizator.DocumentWillBeConvertedDuringMerge.replaceParams(extLabel)
250
+ : SDKUI_Localizator.DocumentsWillBeConvertedDuringMerge.replaceParams(convertibleSelectedItems.length.toString(), extLabel);
251
251
  })() }) })] })), (!hasEnoughPdfForMerge || hasNonPdfSelected || !isDirectoryPickerSupported()) && (_jsxs("div", { style: {
252
252
  display: 'flex',
253
253
  flexDirection: 'column',
@@ -258,18 +258,16 @@ const TMMergeToPdfForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationView
258
258
  backgroundColor: '#fdf5e2',
259
259
  color: '#7a5d00',
260
260
  fontSize: '0.85rem'
261
- }, children: [_jsx("strong", { children: "Attenzione" }), _jsxs("ul", { style: { margin: 0, paddingLeft: '18px', display: 'flex', flexDirection: 'column', gap: '4px' }, children: [!isDirectoryPickerSupported() && (_jsx("li", { children: "Il browser in uso non supporta la selezione della cartella. I file verranno scaricati nella cartella Download." })), !hasEnoughPdfForMerge && (_jsx("li", { children: mergeableSelectedCount === 0
262
- ? `Nessun file PDF o convertibile tra i selezionati: ne servono almeno ${MIN_PDF_FOR_MERGE}.`
263
- : `Solo 1 file PDF o convertibile tra i selezionati: ne servono almeno ${MIN_PDF_FOR_MERGE}.` })), hasNonPdfSelected && (_jsx("li", { children: (() => {
261
+ }, children: [_jsx("strong", { children: SDKUI_Localizator.Warning }), _jsxs("ul", { style: { margin: 0, paddingLeft: '18px', display: 'flex', flexDirection: 'column', gap: '4px' }, children: [!isDirectoryPickerSupported() && (_jsx("li", { children: SDKUI_Localizator.BrowserDoesNotSupportFolderSelection })), !hasEnoughPdfForMerge && (_jsx("li", { children: mergeableSelectedCount === 0
262
+ ? SDKUI_Localizator.NoPdfOrConvertibleFilesSelected_Param.replaceParams(MIN_PDF_FOR_MERGE.toString())
263
+ : SDKUI_Localizator.OnlyOnePdfOrConvertibleFileSelected.replaceParams(MIN_PDF_FOR_MERGE.toString()) })), hasNonPdfSelected && (_jsx("li", { children: (() => {
264
264
  const extSet = Array.from(new Set(nonPdfSelectedItems.map(i => (i.ext ?? '').toString().trim().toLowerCase().replace(/^\./, '')).filter(e => e.length > 0)));
265
- const extLabel = extSet.length > 0
266
- ? ` (${extSet.map(e => '.' + e).join(', ')})`
267
- : '';
265
+ const extLabel = extSet.length > 0 ? ` (${extSet.map(e => '.' + e).join(', ')})` : '';
268
266
  return nonPdfSelectedItems.length === 1
269
- ? `Un documento non è in formato PDF${extLabel} e sarà escluso dall'unione.`
270
- : `${nonPdfSelectedItems.length} documenti non sono in formato PDF${extLabel} e saranno esclusi dall'unione.`;
267
+ ? SDKUI_Localizator.FileNotPdfWillBeExcluded.replaceParams(extLabel)
268
+ : SDKUI_Localizator.FilesNotPdfWillBeExcluded.replaceParams(nonPdfSelectedItems.length.toString(), extLabel);
271
269
  })() }))] })] }))] })] }));
272
- return (_jsx(TMModal, { width: calcResponsiveSizes(deviceType, showTMRelationViewer ? '90%' : '500px', showTMRelationViewer ? '90%' : '500px', '95%'), height: calcResponsiveSizes(deviceType, showTMRelationViewer ? '90%' : '500px', showTMRelationViewer ? '90%' : '500px', showTMRelationViewer ? '95%' : '500px'), title: getTitle(), onClose: onClose, showCloseButton: true, children: _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: _jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { display: 'flex', flexDirection: 'column', gap: '16px', padding: '16px', width: '100%', height: '100%', boxSizing: 'border-box', overflow: 'hidden' }, children: [showTMRelationViewer ? (_jsx("div", { style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: _jsxs(TMSplitterLayout, { direction: 'vertical', showSeparator: true, separatorSize: 8, separatorColor: 'transparent', separatorActiveColor: 'transparent', overflow: 'hidden', min: SPLITTER_MIN, start: SPLITTER_START_70_30, children: [_jsx(TMDownloadRelationViewerSection, { selectedDcmtInfos: selectedDcmtInfos, onSelectionChanged: setSelectedItemsRelationViewer, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), configSection] }, "TMMergeToPdf-relation-config") })) : (configSection), _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '12px', flexShrink: 0 }, children: _jsx(TMButton, { caption: mergeableSelectedCount === 0 ? 'Unisci in PDF' : `Unisci ${mergeableSelectedCount} file in PDF`, icon: _jsx(IconPlay, {}), color: 'success', showTooltip: false, disabled: !isFormValid()
270
+ return (_jsx(TMModal, { width: calcResponsiveSizes(deviceType, showTMRelationViewer ? '90%' : '500px', showTMRelationViewer ? '90%' : '500px', '95%'), height: calcResponsiveSizes(deviceType, showTMRelationViewer ? '90%' : '500px', showTMRelationViewer ? '90%' : '500px', showTMRelationViewer ? '95%' : '500px'), title: getTitle(), onClose: onClose, showCloseButton: true, children: _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: _jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { display: 'flex', flexDirection: 'column', gap: '16px', padding: '16px', width: '100%', height: '100%', boxSizing: 'border-box', overflow: 'hidden' }, children: [showTMRelationViewer ? (_jsx("div", { style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: _jsxs(TMSplitterLayout, { direction: 'vertical', showSeparator: true, separatorSize: 8, separatorColor: 'transparent', separatorActiveColor: 'transparent', overflow: 'hidden', min: SPLITTER_MIN, start: SPLITTER_START_70_30, children: [_jsx(TMDownloadRelationViewerSection, { selectedDcmtInfos: selectedDcmtInfos, onSelectionChanged: setSelectedItemsRelationViewer, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), configSection] }, "TMMergeToPdf-relation-config") })) : (configSection), _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '12px', flexShrink: 0 }, children: _jsx(TMButton, { caption: mergeableSelectedCount === 0 ? SDKUI_Localizator.MergeToPdf : SDKUI_Localizator.MergeFilesToPdf.replaceParams(mergeableSelectedCount.toString()), icon: _jsx(IconPlay, {}), color: 'success', showTooltip: false, disabled: !isFormValid()
273
271
  || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0)
274
272
  || !hasEnoughPdfForMerge, onClick: run }) })] }) }) }));
275
273
  };