@topconsultnpm/sdkui-react 6.22.0-dev3.2 → 6.22.0-dev3.20

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.
Files changed (137) hide show
  1. package/lib/components/NewComponents/ContextMenu/styles.d.ts +43 -17
  2. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +78 -19
  3. package/lib/components/base/Styled.d.ts +79 -27
  4. package/lib/components/base/Styled.js +7 -5
  5. package/lib/components/base/TMCounterBar.d.ts +2 -2
  6. package/lib/components/base/TMCounterContainer.d.ts +2 -1
  7. package/lib/components/base/TMCustomButton.d.ts +1 -1
  8. package/lib/components/base/TMDataGrid.d.ts +2 -0
  9. package/lib/components/base/TMDataGrid.js +34 -6
  10. package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
  11. package/lib/components/base/TMFileManager.d.ts +2 -1
  12. package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
  13. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
  14. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
  15. package/lib/components/base/TMFileManagerUtils.d.ts +3 -1
  16. package/lib/components/base/TMLayout.d.ts +4 -4
  17. package/lib/components/base/TMList.d.ts +2 -1
  18. package/lib/components/base/TMListView.d.ts +1 -1
  19. package/lib/components/base/TMPanel.js +167 -167
  20. package/lib/components/base/TMSpinner.d.ts +2 -1
  21. package/lib/components/base/TMTab.d.ts +4 -3
  22. package/lib/components/base/TMTabControl.d.ts +106 -0
  23. package/lib/components/base/TMTabControl.js +664 -0
  24. package/lib/components/base/TMTooltip.d.ts +1 -1
  25. package/lib/components/base/TMTreeView.d.ts +13 -5
  26. package/lib/components/base/TMTreeView.js +19 -1
  27. package/lib/components/base/TMUserAvatar.d.ts +2 -1
  28. package/lib/components/base/TMVilViewer.d.ts +2 -1
  29. package/lib/components/base/TMWaitPanel.d.ts +3 -2
  30. package/lib/components/base/TMWaitPanel.js +1 -1
  31. package/lib/components/choosers/TMDistinctValues.js +27 -18
  32. package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
  33. package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
  34. package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
  35. package/lib/components/choosers/TMQuickSearchInfo.d.ts +2 -1
  36. package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
  37. package/lib/components/choosers/TMUserChooser.d.ts +2 -2
  38. package/lib/components/editors/TMEditorStyled.d.ts +15 -5
  39. package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
  40. package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
  41. package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
  42. package/lib/components/editors/TMMetadataValues.js +5 -5
  43. package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
  44. package/lib/components/features/archive/TMArchive.js +7 -2
  45. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
  46. package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
  47. package/lib/components/features/documents/TMCopyToFolderForm.js +18 -7
  48. package/lib/components/features/documents/TMDcmtForm.js +3 -2
  49. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
  50. package/lib/components/features/documents/TMDcmtIcon.d.ts +2 -1
  51. package/lib/components/features/documents/TMDcmtPreview.d.ts +7 -3
  52. package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
  53. package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
  54. package/lib/components/features/documents/TMFileUploader.js +26 -26
  55. package/lib/components/features/documents/TMMasterDetailDcmts.js +40 -13
  56. package/lib/components/features/documents/TMMasterInfoFields.d.ts +2 -1
  57. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -1
  58. package/lib/components/features/documents/TMMergeToPdfForm.js +8 -7
  59. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +2 -1
  60. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +13 -15
  61. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +4 -4
  62. package/lib/components/features/documents/TMRelationViewer.d.ts +21 -3
  63. package/lib/components/features/documents/TMRelationViewer.js +140 -104
  64. package/lib/components/features/documents/relationTreeState.d.ts +32 -0
  65. package/lib/components/features/documents/relationTreeState.js +89 -0
  66. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
  67. package/lib/components/features/search/TMMetadataOutputForm.d.ts +2 -1
  68. package/lib/components/features/search/TMMetadataSorterForm.d.ts +2 -1
  69. package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
  70. package/lib/components/features/search/TMSearch.d.ts +1 -1
  71. package/lib/components/features/search/TMSearch.js +68 -9
  72. package/lib/components/features/search/TMSearchQueryPanel.d.ts +9 -3
  73. package/lib/components/features/search/TMSearchResult.d.ts +5 -0
  74. package/lib/components/features/search/TMSearchResult.js +13 -4
  75. package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
  76. package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
  77. package/lib/components/features/search/TMTreeSelector.js +37 -35
  78. package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
  79. package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
  80. package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
  81. package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
  82. package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
  83. package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
  84. package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
  85. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
  86. package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
  87. package/lib/components/features/tasks/TMTasksView.js +6 -12
  88. package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
  89. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
  90. package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
  91. package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
  92. package/lib/components/forms/Login/Chooser.d.ts +2 -2
  93. package/lib/components/forms/TMChooserForm.d.ts +2 -1
  94. package/lib/components/forms/TMResultDialog.js +1 -1
  95. package/lib/components/forms/TMSaveForm.d.ts +4 -4
  96. package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
  97. package/lib/components/grids/TMBlogHeader.d.ts +1 -1
  98. package/lib/components/grids/TMBlogsPost.d.ts +1 -1
  99. package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
  100. package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
  101. package/lib/components/index.d.ts +2 -0
  102. package/lib/components/index.js +2 -0
  103. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +2 -1
  104. package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
  105. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +4 -2
  106. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
  107. package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
  108. package/lib/components/pages/TMPage.d.ts +1 -1
  109. package/lib/components/query/TMQueryEditor.d.ts +12 -4
  110. package/lib/components/settings/SettingsAppearance.d.ts +2 -1
  111. package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
  112. package/lib/components/sidebar/TMCommandsPanel.d.ts +3 -1
  113. package/lib/components/sidebar/TMHeader.d.ts +3 -3
  114. package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
  115. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
  116. package/lib/components/viewers/TMMidViewer.d.ts +2 -2
  117. package/lib/components/viewers/TMTidViewer.d.ts +2 -2
  118. package/lib/helper/Enum_Localizator.js +1 -0
  119. package/lib/helper/SDKUI_Localizator.d.ts +6 -0
  120. package/lib/helper/SDKUI_Localizator.js +60 -0
  121. package/lib/helper/TMAppUpdatedModal.d.ts +2 -1
  122. package/lib/helper/TMAppUpdatedModal.js +93 -93
  123. package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
  124. package/lib/helper/TMIcons.d.ts +280 -280
  125. package/lib/helper/TMPdfViewer.d.ts +2 -1
  126. package/lib/helper/TMToppyMessage.d.ts +2 -2
  127. package/lib/helper/TMUtils.d.ts +10 -4
  128. package/lib/helper/helpers.d.ts +1 -1
  129. package/lib/hooks/useDcmtOperations.js +94 -56
  130. package/lib/hooks/useDocumentOperations.d.ts +1 -0
  131. package/lib/hooks/useDocumentOperations.js +2 -2
  132. package/lib/hooks/useInputDialog.d.ts +2 -1
  133. package/lib/hooks/usePreventFileDrop.js +9 -0
  134. package/lib/services/caseflow/CaseFlowService.d.ts +32 -1
  135. package/lib/services/caseflow/CaseFlowService.js +58 -1
  136. package/lib/services/platform_services.d.ts +3 -2
  137. package/package.json +22 -22
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { FormModes, TaskContext } from "../../../ts";
2
3
  import { HomeBlogPost, TaskDescriptor } from "@topconsultnpm/sdk-ts";
3
4
  interface TMDcmtTasksProps {
@@ -12,5 +13,5 @@ interface TMDcmtTasksProps {
12
13
  handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
13
14
  onBack?: () => void;
14
15
  }
15
- declare const TMDcmtTasks: (props: TMDcmtTasksProps) => import("react/jsx-runtime").JSX.Element;
16
+ declare const TMDcmtTasks: (props: TMDcmtTasksProps) => React.JSX.Element;
16
17
  export default TMDcmtTasks;
@@ -2,5 +2,5 @@ interface TMDragDropOverlayProps {
2
2
  handleFile: (file: File) => void;
3
3
  refocusAfterFileInput: () => void;
4
4
  }
5
- declare const TMDragDropOverlay: (props: TMDragDropOverlayProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const TMDragDropOverlay: (props: TMDragDropOverlayProps) => import("react").JSX.Element;
6
6
  export default TMDragDropOverlay;
@@ -29,6 +29,7 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
29
29
  const [fileSize, setFileSize] = useState(undefined);
30
30
  const [fileExt, setFileExt] = useState(undefined);
31
31
  const uploaderRef = useRef(null);
32
+ const fileInputRef = useRef(null);
32
33
  // Ref al TMPanel per chiamare focusPanel()
33
34
  const fileUploaderPanelRef = useRef(null);
34
35
  usePreventFileDrop([uploaderRef]);
@@ -85,19 +86,18 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
85
86
  setFileSize(undefined);
86
87
  setFileExt(undefined);
87
88
  onFileUpload?.(null);
88
- const fileInput = document.getElementById('fileInput');
89
- if (fileInput) {
90
- fileInput.value = '';
89
+ if (fileInputRef.current) {
90
+ fileInputRef.current.value = '';
91
91
  }
92
92
  //Rifocalizza dopo la cancellazione del file
93
93
  if (refocus)
94
94
  refocusAfterFileInput();
95
95
  }, [onFileUpload, refocusAfterFileInput]);
96
96
  const browseHandler = useCallback(() => {
97
- document.getElementById('fileInput')?.click();
97
+ fileInputRef.current?.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 ? SDKUI_Localizator.ClickToBrowseFile : SDKUI_Localizator.DragOrDoubleClickToBrowseFile }), isRequired && _jsxs("p", { style: { fontWeight: 'bold' }, children: [" ", SDKUI_Localizator.RequiredField, " "] })] })] }) :
100
+ _jsxs("div", { style: { display: 'flex', gap: 10, width: '100%', height: '100%' }, children: [_jsx(HiddenInput, { ref: fileInputRef, 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: [" ", SDKUI_Localizator.PreviewNotAvailable, 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] }));
@@ -112,27 +112,27 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
112
112
  }, [deviceType, fromDTD, onClose]);
113
113
  return showTMPanel ? (_jsx(TMPanel, { ref: fileUploaderPanelRef, panelID: 'file-uploader-panel', title: SDKUI_Localizator.FileUpload, onBack: deviceType === DeviceType.MOBILE ? () => onClose?.() : undefined, toolbar: toolbar, children: innerContent })) : (innerContent);
114
114
  };
115
- const UploadContainer = styled.div `
116
- position: relative;
117
- display: flex;
118
- align-items: center;
119
- justify-content: center;
120
- flex-direction: column;
121
- gap: 5px;
122
- border: 2px dashed ${props => props.$isRequired ? () => TMColors.error : () => TMColors.primaryColor};
123
- /* max-height: 100px; */
124
- width: 100%;
125
- height: 100%;
126
- border-radius: 8px;
127
- padding: 30px;
128
- text-align: center;
129
- color: ${props => props.$isRequired ? () => TMColors.error : () => TMColors.primaryColor};
130
- transition: background-color 0.3s;
131
- &:hover {
132
- background-color: #658cab;
133
- }
115
+ const UploadContainer = styled.div `
116
+ position: relative;
117
+ display: flex;
118
+ align-items: center;
119
+ justify-content: center;
120
+ flex-direction: column;
121
+ gap: 5px;
122
+ border: 2px dashed ${props => props.$isRequired ? () => TMColors.error : () => TMColors.primaryColor};
123
+ /* max-height: 100px; */
124
+ width: 100%;
125
+ height: 100%;
126
+ border-radius: 8px;
127
+ padding: 30px;
128
+ text-align: center;
129
+ color: ${props => props.$isRequired ? () => TMColors.error : () => TMColors.primaryColor};
130
+ transition: background-color 0.3s;
131
+ &:hover {
132
+ background-color: #658cab;
133
+ }
134
134
  `;
135
- const HiddenInput = styled.input `
136
- display: none;
135
+ const HiddenInput = styled.input `
136
+ display: none;
137
137
  `;
138
138
  export default TMFileUploader;
@@ -45,6 +45,13 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
45
45
  const [refreshKey, setRefreshKey] = useState(0);
46
46
  // Separate refresh key for TMFormOrResultWrapper only (doesn't affect tmTreeView)
47
47
  const [refreshKeyFormOrResult, setRefreshKeyFormOrResult] = useState(0);
48
+ // Stato dell'albero conservato qui perché il bump di refreshKey rimonta TMRelationViewer:
49
+ // una ref interna al viewer non sopravvivrebbe. Riletto dal useMemo di tmTreeView,
50
+ // che si ricalcola proprio al refresh.
51
+ const treeStateRef = useRef(undefined);
52
+ const handleTreeStateChange = useCallback((state) => {
53
+ treeStateRef.current = state;
54
+ }, []);
48
55
  /** State for transformed focusedItem metadata values (similar to formData in TMDcmtForm) */
49
56
  const [focusedItemFormData, setFocusedItemFormData] = useState([]);
50
57
  // Trigger operationItems refresh (after file substitution, etc.)
@@ -90,12 +97,19 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
90
97
  setIsCheckingFirstLoad(false);
91
98
  handleBack();
92
99
  }, [handleBack]);
100
+ // Avanzamento del calcolo correlazioni, mostrato nell'overlay di primo caricamento
101
+ const [relationsProgress, setRelationsProgress] = useState({ value: 0, max: 0 });
102
+ const handleRelationsProgress = useCallback((value, max) => {
103
+ setRelationsProgress({ value, max });
104
+ }, []);
93
105
  // Notifica all'utente che i dati mostrati sono parziali (non quando si sta uscendo)
94
- const handleRelationsCalculationStopped = useCallback(() => {
106
+ const handleRelationsCalculationStopped = useCallback((loadedCount, totalCount) => {
95
107
  if (isLeavingRef.current)
96
108
  return;
109
+ // Con piu' documenti in input, indica quanti sono stati completati (es. "3/10")
110
+ const progress = totalCount > 1 ? ` (${loadedCount}/${totalCount})` : '';
97
111
  ShowAlert({
98
- message: SDKUI_Localizator.RelationsCalculationStopped,
112
+ message: `${SDKUI_Localizator.RelationsCalculationStopped}${progress}`,
99
113
  title: SDKUI_Localizator.Attention,
100
114
  duration: 4000,
101
115
  mode: 'info',
@@ -379,11 +393,11 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
379
393
  setContextMenuVisible(true);
380
394
  }, children: [_jsx(TMRelationViewerWrapper, { refreshKey: refreshKey, inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, showZeroDcmts: showZeroDcmts,
381
395
  // customItemRender={customItemRender}
382
- allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged, onNoRelationsFound: handleNoRelationsFound, onItemContextMenu: isRelationViewerLoading ? undefined : onItemContextMenu, focusedItemFormData: focusedItemFormData, onLoadingStateChanged: setIsRelationViewerLoading, onStopCalculationReady: handleStopCalculationReady, onCalculationStopped: handleRelationsCalculationStopped }), _jsx(TMContextMenu, { items: operationItems, externalControl: {
396
+ allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged, onNoRelationsFound: handleNoRelationsFound, onItemContextMenu: isRelationViewerLoading ? undefined : onItemContextMenu, focusedItemFormData: focusedItemFormData, onLoadingStateChanged: setIsRelationViewerLoading, onLoadingProgress: handleRelationsProgress, onStopCalculationReady: handleStopCalculationReady, onCalculationStopped: handleRelationsCalculationStopped, initialTreeState: treeStateRef.current, onTreeStateChange: handleTreeStateChange }), _jsx(TMContextMenu, { items: operationItems, externalControl: {
383
397
  visible: contextMenuVisible,
384
398
  position: contextMenuPosition,
385
399
  onClose: () => setContextMenuVisible(false)
386
- } })] }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged, handleNoRelationsFound, onItemContextMenu, contextMenuVisible, contextMenuPosition, refreshKey, focusedItemFormData, isRelationViewerLoading, handleStopCalculationReady, handleRelationsCalculationStopped]);
400
+ } })] }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged, handleNoRelationsFound, onItemContextMenu, contextMenuVisible, contextMenuPosition, refreshKey, focusedItemFormData, isRelationViewerLoading, handleStopCalculationReady, handleRelationsCalculationStopped, handleTreeStateChange]);
387
401
  const tmFormOrResult = useMemo(() => _jsx(TMFormOrResultWrapper, { refreshKey: refreshKeyFormOrResult, deviceType: deviceType, focusedItem: focusedItem, onTaskCreateRequest: onTaskCreateRequest, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, handleNavigateToReference: handleNavigateToReference, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onRefreshSearchResults: onRefreshAllPanels }), [focusedItem, deviceType, allTasks, handleNavigateToWGs, handleNavigateToDossiers, handleNavigateToReference, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshAfterAddDcmtToFavs, refreshKeyFormOrResult]);
388
402
  const initialPanelDimensions = {
389
403
  'tmTreeView': { width: '50%', height: '100%' },
@@ -463,7 +477,12 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
463
477
  toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: false, orderNumber: 2, isActive: allInitialPanelVisibility['tmFormOrResult'] }
464
478
  }
465
479
  ], [tmTreeView, tmFormOrResult, focusedItem?.isDcmt, dtdMaster]);
466
- return (_jsxs("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: [isCheckingFirstLoad && (_jsx(TMLoadingOverlay, { onCancel: handleCancelFirstLoad, onStop: handleStopRelationsCalculation })), _jsxs("div", { style: isCheckingFirstLoad ? { position: 'absolute', width: 0, height: 0, overflow: 'hidden', opacity: 0, pointerEvents: 'none' } : { width: '100%', height: '100%' }, 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: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), renderDcmtOperations, renderFloatingBar] })] }));
480
+ return (_jsxs("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: [isCheckingFirstLoad && (_jsx(TMLoadingOverlay, { onCancel: handleCancelFirstLoad, onStop: handleStopRelationsCalculation, description: relationsProgress.max > 1
481
+ ? `${isForMaster ? SDKUI_Localizator.LoadingMasterDocuments : SDKUI_Localizator.LoadingDetailDocuments} (${relationsProgress.value}/${relationsProgress.max})`
482
+ : undefined, progressValue: relationsProgress.value, progressMax: relationsProgress.max,
483
+ // Con un solo documento in input la chiamata è unica: non ci sono
484
+ // risultati parziali da mostrare, quindi il pulsante resta disabilitato
485
+ stopDisabled: (inputDcmts?.length ?? 0) <= 1 })), _jsxs("div", { style: isCheckingFirstLoad ? { position: 'absolute', width: 0, height: 0, overflow: 'hidden', opacity: 0, pointerEvents: 'none' } : { width: '100%', height: '100%' }, 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: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), renderDcmtOperations, renderFloatingBar] })] }));
467
486
  };
468
487
  export default TMMasterDetailDcmts;
469
488
  /**
@@ -472,7 +491,7 @@ export default TMMasterDetailDcmts;
472
491
  * - Panel visibility toggling
473
492
  * - Focus delay handling
474
493
  */
475
- const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu, focusedItemFormData, onLoadingStateChanged, onStopCalculationReady, onCalculationStopped }) => {
494
+ const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu, focusedItemFormData, onLoadingStateChanged, onLoadingProgress, onStopCalculationReady, onCalculationStopped, initialTreeState, onTreeStateChange }) => {
476
495
  const { setPanelVisibilityById, setToolbarButtonVisibility } = useTMPanelManagerContext();
477
496
  // Monitor device type changes to restore panel visibility when switching from mobile to desktop
478
497
  const deviceType = useDeviceType();
@@ -532,7 +551,7 @@ const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurr
532
551
  onItemContextMenu?.(item, e);
533
552
  }, 100);
534
553
  }, [onItemContextMenu, handleFocusedItemChanged]);
535
- return (_jsx(TMRelationViewer, { inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, initialShowZeroDcmts: showZeroDcmts, customItemRender: customItemRender, allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: onSelectedItemsChanged, maxDepthLevel: 1, invertMasterNavigation: false, showExpandAllButton: true, onNoRelationsFound: onNoRelationsFound, onItemContextMenu: onContextMenu, focusedItemFormData: focusedItemFormData, onLoadingStateChanged: onLoadingStateChanged, onStopCalculationReady: onStopCalculationReady, onCalculationStopped: onCalculationStopped }, refreshKey));
554
+ return (_jsx(TMRelationViewer, { inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, initialShowZeroDcmts: showZeroDcmts, customItemRender: customItemRender, allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: onSelectedItemsChanged, maxDepthLevel: 1, invertMasterNavigation: false, showExpandAllButton: true, onNoRelationsFound: onNoRelationsFound, onItemContextMenu: onContextMenu, focusedItemFormData: focusedItemFormData, onLoadingStateChanged: onLoadingStateChanged, onLoadingProgress: onLoadingProgress, onStopCalculationReady: onStopCalculationReady, onCalculationStopped: onCalculationStopped, initialTreeState: initialTreeState, onTreeStateChange: onTreeStateChange }, refreshKey));
536
555
  };
537
556
  const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid, onRefreshSearchResults, handleNavigateToReference, fetchRemoteCertificates }) => {
538
557
  const { setPanelVisibilityById } = useTMPanelManagerContext();
@@ -542,7 +561,11 @@ const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCrea
542
561
  }, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey) :
543
562
  focusedItem?.searchResult === undefined ? (_jsx(TMPanel, { title: SDKUI_Localizator.SearchResult, children: _jsx(TMToppyMessage, { message: SDKUI_Localizator.SelectDocumentToViewSearchResults }) })) : (_jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, showDcmtFormSidebar: false, autoFocusFirstRow: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setPanelVisibilityById('tmTreeView', true); }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, enablePinIcons: false, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, showBackButton: false, onRefreshSearchAsyncDatagrid: onRefreshSearchResults, onReferenceClick: handleNavigateToReference, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey)) }));
544
563
  };
545
- const TMLoadingOverlay = ({ onCancel, onStop, description, cancelText, stopText }) => {
564
+ const TMLoadingOverlay = ({ onCancel, onStop, description, cancelText, stopText, progressValue, progressMax, stopDisabled }) => {
565
+ // Stesso calcolo di TMWaitPanel: 0 quando il massimo non è ancora noto
566
+ const progressPercent = (progressMax ?? 0) > 0
567
+ ? Math.min(100, ((progressValue ?? 0) / (progressMax ?? 1)) * 100)
568
+ : 0;
546
569
  return (_jsx("div", { style: {
547
570
  position: 'absolute',
548
571
  top: 0,
@@ -612,20 +635,24 @@ const TMLoadingOverlay = ({ onCancel, onStop, description, cancelText, stopText
612
635
  .tm-spinner-animation div:nth-child(7):after { top: 63px; left: 17px; background: #782b7d; }
613
636
  .tm-spinner-animation div:nth-child(8) { animation-delay: -0.288s; }
614
637
  .tm-spinner-animation div:nth-child(8):after { top: 56px; left: 12px; background: #782b7d; }
615
- ` }), _jsxs("div", { className: "tm-spinner-animation", children: [_jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {})] })] }), _jsx("span", { style: { fontSize: '14px', color: '#334155', textAlign: 'center' }, children: description ?? SDKUI_Localizator.Loading }), (onStop || onCancel) && (_jsxs("div", { style: { marginTop: '4px', display: 'flex', alignItems: 'center', justifyContent: 'center', flexWrap: 'wrap', gap: '10px' }, children: [onStop && (_jsx("button", { onClick: onStop, title: SDKUI_Localizator.StopRelationsCalculation, style: {
638
+ ` }), _jsxs("div", { className: "tm-spinner-animation", children: [_jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {})] })] }), _jsx("span", { style: { fontSize: '14px', color: '#334155', textAlign: 'center' }, children: description ?? SDKUI_Localizator.Loading }), (progressMax ?? 0) > 1 && (_jsxs("div", { style: { width: '260px' }, children: [_jsx("div", { style: { width: '100%', height: '20px', background: '#e0e0e0', borderRadius: '10px', overflow: 'hidden' }, children: _jsx("div", { style: { width: `${progressPercent.toFixed(2)}%`, height: '100%', background: '#4caf50', transition: 'width 0.3s ease' } }) }), _jsxs("p", { style: { fontWeight: 'bold', color: '#333', margin: '8px 0 0', textAlign: 'center' }, children: [progressPercent.toFixed(2), "%"] })] })), (onStop || onCancel) && (_jsxs("div", { style: { marginTop: '4px', display: 'flex', alignItems: 'center', justifyContent: 'center', flexWrap: 'wrap', gap: '10px' }, children: [onStop && (_jsx("button", { onClick: onStop, disabled: stopDisabled, title: SDKUI_Localizator.StopRelationsCalculation, style: {
616
639
  padding: '8px 24px',
617
640
  fontSize: '13px',
618
641
  fontWeight: 500,
619
- color: 'white',
620
- background: '#0c448e',
621
- border: '1.5px solid #0c448e',
642
+ color: stopDisabled ? '#94a3b8' : 'white',
643
+ background: stopDisabled ? '#e2e8f0' : '#0c448e',
644
+ border: `1.5px solid ${stopDisabled ? '#e2e8f0' : '#0c448e'}`,
622
645
  borderRadius: '6px',
623
- cursor: 'pointer',
646
+ cursor: stopDisabled ? 'not-allowed' : 'pointer',
624
647
  transition: 'all 0.2s ease',
625
648
  }, onMouseEnter: (e) => {
649
+ if (stopDisabled)
650
+ return;
626
651
  e.currentTarget.style.background = '#0a3872';
627
652
  e.currentTarget.style.borderColor = '#0a3872';
628
653
  }, onMouseLeave: (e) => {
654
+ if (stopDisabled)
655
+ return;
629
656
  e.currentTarget.style.background = '#0c448e';
630
657
  e.currentTarget.style.borderColor = '#0c448e';
631
658
  }, children: stopText ?? SDKUI_Localizator.ShowPartialResults })), onCancel && (_jsx("button", { onClick: onCancel, style: {
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { DcmtTypeDescriptor } from '@topconsultnpm/sdk-ts';
2
3
  import { DcmtInfo } from '../../../ts';
3
4
  interface TMMasterInfoFieldsProps {
@@ -15,5 +16,5 @@ interface TMMasterInfoFieldsProps {
15
16
  */
16
17
  isExpandedView?: boolean;
17
18
  }
18
- declare const TMMasterInfoFields: ({ dtd, dcmt, getValuesByMidAsync, reloadToken, isExpandedView }: TMMasterInfoFieldsProps) => import("react/jsx-runtime").JSX.Element;
19
+ declare const TMMasterInfoFields: ({ dtd, dcmt, getValuesByMidAsync, reloadToken, isExpandedView }: TMMasterInfoFieldsProps) => React.JSX.Element;
19
20
  export default TMMasterInfoFields;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { DcmtInfo } from '../../../ts';
2
3
  import { HomeBlogPost, TaskDescriptor } from '@topconsultnpm/sdk-ts';
3
4
  import { TMCopyToFolderMode } from '../../../hooks/useDocumentOperations';
@@ -19,5 +20,5 @@ interface ITMMergeToPdfFormProps {
19
20
  * Form per l'unione di più documenti PDF in un singolo file.
20
21
  * Condivide TMDownloadRelationViewerSection e gli helper in copyAndMergeDcmtsShared con TMCopyToFolderForm.
21
22
  */
22
- declare const TMMergeToPdfForm: (props: ITMMergeToPdfFormProps) => import("react/jsx-runtime").JSX.Element;
23
+ declare const TMMergeToPdfForm: (props: ITMMergeToPdfFormProps) => React.JSX.Element;
23
24
  export default TMMergeToPdfForm;
@@ -2,7 +2,7 @@ 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
4
  import { calcResponsiveSizes, getExceptionMessage, IconFolderOpen, IconPlay, IconUndo, SDKUI_Globals, SDKUI_Localizator, } from '../../../helper';
5
- import { DcmtOpers, FileFormats, GeneralRetrieveFormats, InvoiceRetrieveFormats, OrderRetrieveFormats, ResultTypes, RetrieveFileOptions, ValidationItem, } from '@topconsultnpm/sdk-ts';
5
+ import { DcmtOpers, FileFormats, GeneralRetrieveFormats, InvoiceRetrieveFormats, OrderRetrieveFormats, ResultTypes, ValidationItem, } from '@topconsultnpm/sdk-ts';
6
6
  import TMModal from '../../base/TMModal';
7
7
  import { useDeviceType } from '../../base/TMDeviceProvider';
8
8
  import TMTextBox from '../../editors/TMTextBox';
@@ -190,12 +190,13 @@ const TMMergeToPdfForm = (props) => {
190
190
  }
191
191
  // Per i documenti con file, usa il download normale
192
192
  if (dcmtsWithFile.length > 0) {
193
- const rfo = new RetrieveFileOptions();
194
- rfo.retrieveReason = DcmtOpers.None;
195
- rfo.generalRetrieveFormat = GeneralRetrieveFormats.OriginalUnsigned;
196
- rfo.cvtFormat = FileFormats.PDF;
197
- rfo.invoiceRetrieveFormat = toPdfInvoiceRetrieveFormat(SDKUI_Globals.userSettings?.searchSettings.invoiceRetrieveFormat);
198
- rfo.orderRetrieveFormat = toPdfOrderRetrieveFormat(SDKUI_Globals.userSettings?.searchSettings.orderRetrieveFormat);
193
+ const rfo = {
194
+ retrieveReason: DcmtOpers.None,
195
+ generalRetrieveFormat: GeneralRetrieveFormats.OriginalUnsigned,
196
+ cvtFormat: FileFormats.PDF,
197
+ invoiceRetrieveFormat: toPdfInvoiceRetrieveFormat(SDKUI_Globals.userSettings?.searchSettings.invoiceRetrieveFormat),
198
+ orderRetrieveFormat: toPdfOrderRetrieveFormat(SDKUI_Globals.userSettings?.searchSettings.orderRetrieveFormat),
199
+ };
199
200
  const collectFileForMerge = async (file, dcmtInfo) => {
200
201
  pdfFilesMap.set(`${dcmtInfo.TID}_${dcmtInfo.DID}`, file);
201
202
  };
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { DcmtTypeDescriptor, HomeBlogPost, ObjectRef, TaskDescriptor } from "@topconsultnpm/sdk-ts";
2
3
  import { DcmtInfo, IGraphometricManagerProp, TaskContext } from "../../../ts";
3
4
  import { IntesiCertificateData } from "../../../helper";
@@ -41,5 +42,5 @@ interface TMMultiMasterDetailDcmtsFormProps {
41
42
  }>, tid?: number) => void;
42
43
  openWGsCopyMoveForm?: (mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void;
43
44
  }
44
- declare const TMMultiMasterDetailDcmtsForm: (props: TMMultiMasterDetailDcmtsFormProps) => import("react/jsx-runtime").JSX.Element | null;
45
+ declare const TMMultiMasterDetailDcmtsForm: (props: TMMultiMasterDetailDcmtsFormProps) => React.JSX.Element | null;
45
46
  export default TMMultiMasterDetailDcmtsForm;
@@ -301,21 +301,19 @@ const TMMultiMasterDetailDcmtsForm = (props) => {
301
301
  // ----- Render principale --------------------------------------------------------------------
302
302
  if (isLoading)
303
303
  return null;
304
- return _jsxs(_Fragment, { children: [_jsx(TMLayoutWaitingContainer, { direction: 'vertical', ...waitPanel, isCancelable: true, abortController: abortController, usePortal: true, children: _jsx(TMModal, { width: modalSize.width, height: modalSize.height, onClose: closeModal, onResized: persistModalSize,
305
- // Cancellato il layout il popup torna alle dimensioni di default
306
- sizeResetToken: layoutResetToken, title: modalTitle, hidePopup: false, askClosingConfirm: archiveRows.length > 0, recenterOnResize: true, titleActions: renderTitleActions(), children: _jsxs("div", { style: styles.content, children: [hasMultipleTypes && _jsx("div", { style: styles.header, children: renderStepper({
307
- steps,
308
- phase,
309
- hasMultipleTypes,
310
- isBackLocked,
311
- showBackArrow: isSummaryPhase,
312
- onBack: backToTypeSelection,
313
- onStepClick: (stepPhase) => (stepPhase === MultiDetailArchivePhase.SelectDcmtType ? backToTypeSelection() : setPhase(stepPhase)),
314
- }) }), !isSummaryPhase
315
- ? renderSelectDcmtType({ detailRelationItems, selectedRelation, onSelectRelation: selectRelation })
316
- : (isSummaryReady
317
- ? renderArchiveSummary()
318
- : _jsx("div", { style: styles.loader, children: _jsx(LoadIndicator, { height: 40, width: 40 }) }))] }) }) }), isOpenAddForm && selectedRelation?.detailTID && (_jsx(TMDcmtForm, { isModal: true, titleModal: getDtdDisplayName(selectedItem?.detailDtd), TID: selectedRelation.detailTID, layoutMode: LayoutModes.Ark, showBackButton: false, allowButtonsRefs: false, inputMids: formInputMids, inputFile: editingRow?.__file ?? null, archiveListMode: {
304
+ return _jsxs(_Fragment, { children: [_jsx("div", { style: { width: 0, height: 0 }, children: _jsx(TMLayoutWaitingContainer, { direction: 'vertical', ...waitPanel, isCancelable: true, abortController: abortController, usePortal: true, children: _jsx(TMModal, { width: modalSize.width, height: modalSize.height, onClose: closeModal, onResized: persistModalSize, sizeResetToken: layoutResetToken, title: modalTitle, hidePopup: false, askClosingConfirm: archiveRows.length > 0, recenterOnResize: true, titleActions: renderTitleActions(), children: _jsxs("div", { style: styles.content, children: [hasMultipleTypes && _jsx("div", { style: styles.header, children: renderStepper({
305
+ steps,
306
+ phase,
307
+ hasMultipleTypes,
308
+ isBackLocked,
309
+ showBackArrow: isSummaryPhase,
310
+ onBack: backToTypeSelection,
311
+ onStepClick: (stepPhase) => (stepPhase === MultiDetailArchivePhase.SelectDcmtType ? backToTypeSelection() : setPhase(stepPhase)),
312
+ }) }), !isSummaryPhase
313
+ ? renderSelectDcmtType({ detailRelationItems, selectedRelation, onSelectRelation: selectRelation })
314
+ : (isSummaryReady
315
+ ? renderArchiveSummary()
316
+ : _jsx("div", { style: styles.loader, children: _jsx(LoadIndicator, { height: 40, width: 40 }) }))] }) }) }) }), isOpenAddForm && selectedRelation?.detailTID && (_jsx(TMDcmtForm, { isModal: true, titleModal: getDtdDisplayName(selectedItem?.detailDtd), TID: selectedRelation.detailTID, layoutMode: LayoutModes.Ark, showBackButton: false, allowButtonsRefs: false, inputMids: formInputMids, inputFile: editingRow?.__file ?? null, archiveListMode: {
319
317
  isEditingRow: editingRowId !== undefined,
320
318
  onUpsertRow: (values, file) => upsertRow(values, file),
321
319
  }, onClose: closeAddForm, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar, showTodoDcmtForm: showTodoDcmtForm, openFileUploaderPdfEditor: openFileUploaderPdfEditor, graphometricManager: graphometricManager })), isOpenMasterForm && masterDcmt?.TID !== undefined && masterDcmt?.DID !== undefined && (_jsx(TMDcmtForm, { isModal: true, titleModal: `${SDKUI_Localizator.Update}: ${getDtdDisplayName(dtd)}`, TID: masterDcmt.TID, DID: masterDcmt.DID, layoutMode: LayoutModes.Update, showBackButton: false, allowRelations: false, allowButtonsRefs: false, onSavedAsyncCallback: handleMasterSavedAsync, onClose: () => setIsOpenMasterForm(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, onTaskCreateRequest: onTaskCreateRequest, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar, showTodoDcmtForm: showTodoDcmtForm, openFileUploaderPdfEditor: openFileUploaderPdfEditor, graphometricManager: graphometricManager, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, fetchRemoteCertificates: fetchRemoteCertificates, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onReferenceClick: onReferenceClick }))] });
@@ -312,7 +312,7 @@ export interface RenderStepperParams {
312
312
  /** Click su uno step completato: riceve la fase di destinazione */
313
313
  onStepClick: (phase: number) => void;
314
314
  }
315
- export declare const renderStepper: ({ steps, phase, hasMultipleTypes, isBackLocked, showBackArrow, onBack, onStepClick }: RenderStepperParams) => import("react/jsx-runtime").JSX.Element;
315
+ export declare const renderStepper: ({ steps, phase, hasMultipleTypes, isBackLocked, showBackArrow, onBack, onStepClick }: RenderStepperParams) => React.JSX.Element;
316
316
  export interface RenderSelectDcmtTypeParams {
317
317
  /** Relazioni di dettaglio fra cui scegliere */
318
318
  detailRelationItems: Array<DetailRelationItem>;
@@ -321,7 +321,7 @@ export interface RenderSelectDcmtTypeParams {
321
321
  /** Selezione di una relazione */
322
322
  onSelectRelation: (item: DetailRelationItem) => void;
323
323
  }
324
- export declare const renderSelectDcmtType: ({ detailRelationItems, selectedRelation, onSelectRelation }: RenderSelectDcmtTypeParams) => import("react/jsx-runtime").JSX.Element;
324
+ export declare const renderSelectDcmtType: ({ detailRelationItems, selectedRelation, onSelectRelation }: RenderSelectDcmtTypeParams) => React.JSX.Element;
325
325
  export interface RenderAccordionHeaderParams {
326
326
  /** Sezione a cui appartiene la testata */
327
327
  section: AccordionSection;
@@ -340,7 +340,7 @@ export interface RenderAccordionHeaderParams {
340
340
  /** Apre/chiude la sezione */
341
341
  onToggleOpen: (section: AccordionSection, isOpen: boolean) => void;
342
342
  }
343
- export declare const renderAccordionHeader: ({ section, isOpen, tooltip, count, title, actions, panel, onToggleOpen }: RenderAccordionHeaderParams) => import("react/jsx-runtime").JSX.Element;
343
+ export declare const renderAccordionHeader: ({ section, isOpen, tooltip, count, title, actions, panel, onToggleOpen }: RenderAccordionHeaderParams) => React.JSX.Element;
344
344
  /**
345
345
  * Contenuto di un pannello: il contesto del panel manager è leggibile solo dentro l'albero del
346
346
  * provider, quindi è qui che si prende lo stato di ingrandimento da passare alla sezione
@@ -349,7 +349,7 @@ export declare const TMSummarySectionSlot: ({ section, render, onBeforeMaximize
349
349
  section: AccordionSection;
350
350
  render: (panel: SectionPanelState) => React.ReactNode;
351
351
  onBeforeMaximize?: (section: AccordionSection) => void;
352
- }) => import("react/jsx-runtime").JSX.Element;
352
+ }) => React.JSX.Element;
353
353
  /**
354
354
  * Segnala che l'utente ha spostato un separatore: è l'unico caso in cui le altezze dei pannelli sono
355
355
  * una sua scelta, quindi la sola da salvare. Le quote calcolate all'apertura del riepilogo o al
@@ -3,6 +3,7 @@ import { DcmtTypeDescriptor, SearchResultDescriptor, DataColumnDescriptor } from
3
3
  import { DcmtMetadataMap } from '../../../helper';
4
4
  import { DcmtInfo, MetadataValueDescriptorEx } from '../../../ts';
5
5
  import { ITMTreeItem } from '../../base/TMTreeView';
6
+ import { RelationTreeState } from './relationTreeState';
6
7
  /**
7
8
  * Tree item structure for relations
8
9
  */
@@ -26,6 +27,7 @@ export interface RelationTreeItem extends ITMTreeItem {
26
27
  fileExt?: string;
27
28
  fileCount?: number;
28
29
  }
30
+ export type { RelationTreeState } from './relationTreeState';
29
31
  /**
30
32
  * Props for TMRelationViewer component
31
33
  */
@@ -132,6 +134,11 @@ export interface TMRelationViewerProps {
132
134
  * Useful to disable interactions (like context menu) during loading.
133
135
  */
134
136
  onLoadingStateChanged?: (isLoading: boolean) => void;
137
+ /**
138
+ * Invoked while the initial correlations load progresses, with how many input
139
+ * documents have been processed out of the total.
140
+ */
141
+ onLoadingProgress?: (value: number, max: number) => void;
135
142
  /**
136
143
  * Invoked on mount to hand over a function that stops the ongoing correlations
137
144
  * calculation: no further GetMetadata calls are performed and only the
@@ -143,8 +150,17 @@ export interface TMRelationViewerProps {
143
150
  /**
144
151
  * Callback invoked when the calculation has actually been stopped
145
152
  * (loadData terminated after an abort request).
153
+ * Riceve quanti documenti di input sono stati completati sul totale.
154
+ */
155
+ onCalculationStopped?: (loadedCount: number, totalCount: number) => void;
156
+ /**
157
+ * Stato dell'albero da ripristinare al primo caricamento, al posto dell'espansione
158
+ * iniziale predefinita: permette al padre di rimontare il viewer dopo un'operazione
159
+ * senza che l'albero torni allo stato di partenza. Se assente vale il default.
146
160
  */
147
- onCalculationStopped?: () => void;
161
+ initialTreeState?: RelationTreeState;
162
+ /** Notifica lo stato dell'albero, da restituire come `initialTreeState` dopo un refresh. */
163
+ onTreeStateChange?: (state: RelationTreeState) => void;
148
164
  }
149
165
  /**
150
166
  * Check if document type has detail relations
@@ -160,8 +176,10 @@ export declare const hasMasterRelations: (dTID: number | undefined) => Promise<b
160
176
  export declare const getDisplayValueByColumn: (col: DataColumnDescriptor | undefined, value: any) => any;
161
177
  /**
162
178
  * Convert SearchResultDescriptor to structured data source with metadata
163
- * For each document, fetches complete metadata using GetMetadataAsync to ensure
164
- * all metadata properties (isSpecialSearchOutput, permissions, etc.) are available
179
+ * I valori dei documenti sono GIÀ presenti nelle righe restituite dalla ricerca:
180
+ * qui vengono solo abbinati ai rispettivi MetadataDescriptor (perm,
181
+ * isSpecialSearchOutput, ...), risolti UNA SOLA VOLTA per tipo documento.
182
+ * Nessuna chiamata al server per riga.
165
183
  */
166
184
  export declare const searchResultToDataSource: (searchResult: SearchResultDescriptor | undefined, hideSysMetadata?: boolean, signal?: AbortSignal) => Promise<any[]>;
167
185
  export declare const DEFAULT_RELATION_EXPAND_LEVEL = 4;