@topconsultnpm/sdkui-react 6.22.0-dev3.24 → 6.22.0-dev3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +43 -45
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +60 -67
- package/lib/components/base/Styled.d.ts +77 -93
- package/lib/components/base/TMAlert.js +6 -8
- package/lib/components/base/TMAreaManager.js +53 -55
- package/lib/components/base/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +1 -2
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +39 -48
- package/lib/components/base/TMDataGridExportForm.d.ts +1 -2
- package/lib/components/base/TMFileManager.d.ts +1 -2
- package/lib/components/base/TMFileManagerDataGridView.d.ts +1 -2
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -4
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +1 -2
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMPanel.js +167 -167
- package/lib/components/base/TMSpinner.d.ts +1 -2
- package/lib/components/base/TMTab.d.ts +3 -4
- package/lib/components/base/TMTabControl.js +208 -208
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +8 -14
- package/lib/components/base/TMTreeView.js +14 -0
- package/lib/components/base/TMUserAvatar.d.ts +1 -2
- package/lib/components/base/TMVilViewer.d.ts +1 -2
- package/lib/components/base/TMWaitPanel.d.ts +2 -3
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +169 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +320 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +52 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +274 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +1 -2
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +1 -2
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +1 -2
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +42 -20
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +1 -2
- package/lib/components/editors/TMHtmlEditor.d.ts +1 -2
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +28 -0
- package/lib/components/features/assistant/TMHelpOnLineChat.js +871 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +1 -2
- package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
- package/lib/components/features/documents/TMCopyToFolderForm.js +32 -35
- package/lib/components/features/documents/TMDcmtForm.js +48 -60
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -4
- package/lib/components/features/documents/TMDcmtIcon.js +3 -5
- package/lib/components/features/documents/TMDcmtPreview.d.ts +6 -8
- package/lib/components/features/documents/TMDcmtPreview.js +5 -3
- package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -2
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +21 -21
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +45 -147
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +48 -47
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +1 -2
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +4 -4
- package/lib/components/features/documents/TMRelationViewer.d.ts +3 -14
- package/lib/components/features/documents/TMRelationViewer.js +115 -79
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +1 -2
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +1 -2
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +1 -2
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.d.ts +1 -2
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -9
- package/lib/components/features/search/TMSearchResult.js +6 -8
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +1 -2
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +1 -2
- package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
- package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksView.js +91 -90
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +2 -3
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +91 -91
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +7 -8
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -3
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -3
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/TMChooserForm.d.ts +1 -2
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +1 -2
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.js +92 -96
- package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
- package/lib/components/grids/TMValidationItemsList.d.ts +1 -2
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.js +3 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +6 -5
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/pages/TMPage.js +29 -31
- package/lib/components/query/TMQueryEditor.d.ts +10 -14
- package/lib/components/settings/SettingsAppearance.d.ts +1 -2
- package/lib/components/sidebar/TMAboutApp.d.ts +1 -2
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMHeader.d.ts +3 -3
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -3
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +2 -3
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/helper/SDKUI_Localizator.d.ts +7 -0
- package/lib/helper/SDKUI_Localizator.js +70 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +1 -2
- package/lib/helper/TMAppUpdatedModal.js +93 -93
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +280 -280
- package/lib/helper/TMPdfViewer.d.ts +1 -2
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +4 -10
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +14 -34
- package/lib/hooks/useDcmtOperations.d.ts +3 -12
- package/lib/hooks/useDcmtOperations.js +130 -160
- package/lib/hooks/useDocumentOperations.js +12 -23
- package/lib/hooks/useInputDialog.d.ts +1 -2
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
- package/lib/hooks/useMultiMasterDetailDcmts.js +62 -65
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/platform_services.d.ts +2 -3
- package/package.json +1 -1
|
@@ -11,5 +11,5 @@ interface TMToppyDraggableHelpCenterProps {
|
|
|
11
11
|
/** Callback chiamato quando si clicca sull'immagine di Toppy */
|
|
12
12
|
onToppyImageClick?: () => void;
|
|
13
13
|
}
|
|
14
|
-
declare const TMToppyDraggableHelpCenter: (props: TMToppyDraggableHelpCenterProps) =>
|
|
14
|
+
declare const TMToppyDraggableHelpCenter: (props: TMToppyDraggableHelpCenterProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export default TMToppyDraggableHelpCenter;
|
|
@@ -60,7 +60,7 @@ const TMToppyButton = styled.div.attrs((props) => ({
|
|
|
60
60
|
height: ${(props) => props.$isCollapsed ? '56px' : '110px'};
|
|
61
61
|
max-width: 100%;
|
|
62
62
|
max-height: 100%;
|
|
63
|
-
z-index:
|
|
63
|
+
z-index: 2147483600;
|
|
64
64
|
background-color: ${(props) => props.$isCollapsed ? '#ffffff' : 'transparent'};
|
|
65
65
|
border: ${(props) => props.$isCollapsed ? '3px solid #3b82f6' : 'none'};
|
|
66
66
|
border-radius: ${(props) => props.$isCollapsed ? '50%' : '0'};
|
|
@@ -130,7 +130,7 @@ const DragOverlay = styled.div `
|
|
|
130
130
|
left: 0;
|
|
131
131
|
right: 0;
|
|
132
132
|
bottom: 0;
|
|
133
|
-
z-index:
|
|
133
|
+
z-index: 2147483599;
|
|
134
134
|
cursor: grabbing;
|
|
135
135
|
`;
|
|
136
136
|
const TMToppyDraggableHelpCenter = (props) => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { BlogPost, UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
2
|
import { FileItem } from '../../base/TMFileManagerUtils';
|
|
4
3
|
import { TMBlogContextDescriptor } from '../../grids/TMBlogsPostUtils';
|
|
@@ -19,5 +18,5 @@ interface TMBlogCommentFormProps {
|
|
|
19
18
|
/** External save handler - when provided, bypasses internal engine logic */
|
|
20
19
|
onCustomSave?: (blogPost: BlogPost) => Promise<void>;
|
|
21
20
|
}
|
|
22
|
-
declare const TMBlogCommentForm: (props: TMBlogCommentFormProps) =>
|
|
21
|
+
declare const TMBlogCommentForm: (props: TMBlogCommentFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
22
|
export default TMBlogCommentForm;
|
|
@@ -6,11 +6,10 @@ import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
|
6
6
|
import { DcmtOperationTypes, FormModes } from '../../../ts';
|
|
7
7
|
import { StyledToolbarCardContainer, StyledFormButtonsContainer } from '../../base/Styled';
|
|
8
8
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
9
|
-
import { TMSplitterLayout } from '../../base/TMLayout';
|
|
9
|
+
import TMLayoutContainer, { TMSplitterLayout } from '../../base/TMLayout';
|
|
10
10
|
import { TMExceptionBoxManager, TMMessageBoxManager, ButtonNames } from '../../base/TMPopUp';
|
|
11
11
|
import TMShowAllOrMaxItemsButton from '../../base/TMShowAllOrMaxItemsButton';
|
|
12
12
|
import TMSpinner from '../../base/TMSpinner';
|
|
13
|
-
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
14
13
|
import TMDistinctValues from '../../choosers/TMDistinctValues';
|
|
15
14
|
import TMFormulaEditor, { FormulaDescriptor, FormulaHelper, FormulaTargets } from '../../editors/TMFormulaEditor';
|
|
16
15
|
import { useMetadataEditableList } from '../../editors/TMMetadataEditor';
|
|
@@ -28,7 +27,7 @@ const TMBatchUpdateForm = ({ inputDcmts, TID, DID, isExpertMode = SDKUI_Globals.
|
|
|
28
27
|
const [showFormulaEditor, setShowFormulaEditor] = useState(false);
|
|
29
28
|
const [focusedMetadataValue, setFocusedMetadataValue] = useState();
|
|
30
29
|
const [addOrRemoveEditableList] = useMetadataEditableList();
|
|
31
|
-
const {
|
|
30
|
+
const { runOperationAsync } = useDcmtOperations();
|
|
32
31
|
const deviceType = useDeviceType();
|
|
33
32
|
useEffect(() => {
|
|
34
33
|
if (!TID)
|
|
@@ -131,7 +130,7 @@ const TMBatchUpdateForm = ({ inputDcmts, TID, DID, isExpertMode = SDKUI_Globals.
|
|
|
131
130
|
});
|
|
132
131
|
};
|
|
133
132
|
const renderContent = () => {
|
|
134
|
-
return (_jsx(
|
|
133
|
+
return (_jsx(TMLayoutContainer, { children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorColor: 'transparent', separatorActiveColor: 'transparent', showSeparator: showFormulaEditor, start: showFormulaEditor ? ['50%', '50%'] : ['100%', '0%'], min: ['0', '0'], children: [_jsx(TMPanel, { title: isModal ? 'Modifica i metadati' : `${SDKUI_Localizator.BatchUpdate} (${inputDcmts.length} documenti selezionati)`, onBack: deviceType === DeviceType.MOBILE ? handleClose : undefined, allowMaximize: !isModal, showHeader: !isModal, children: _jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, isExpertMode: isExpertMode, showCheckBoxes: ShowCheckBoxesMode.Always, showNullValueCheckBoxes: true, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, validationItems: validationItems, isOpenDistinctValues: showDistinctValuesPanel, selectedMID: focusedMetadataValue?.mid, onFocusedItemChanged: (item) => { setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
|
|
135
134
|
setMetadataValues((prevItems) => prevItems.map((item) => {
|
|
136
135
|
const newItem = newItems.find((newItem) => newItem.tid === item.tid && newItem.mid === item.mid);
|
|
137
136
|
return newItem ? { ...item, ...newItem } : item;
|
|
@@ -13,8 +13,8 @@ import TMOrderRetrieveFormats from '../../choosers/TMOrderRetrieveFormats';
|
|
|
13
13
|
import TMButton from '../../base/TMButton';
|
|
14
14
|
import { ButtonNames, TMMessageBoxManager } from '../../base/TMPopUp';
|
|
15
15
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
16
|
-
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
17
16
|
import { TMSplitterLayout } from '../../base/TMLayout';
|
|
17
|
+
import TMWaitPanelManager from '../../base/waitPanel/TMWaitPanelManager';
|
|
18
18
|
import TMCheckBox from '../../editors/TMCheckBox';
|
|
19
19
|
import ShowAlert from '../../base/TMAlert';
|
|
20
20
|
import { TMColors } from '../../../utils/theme';
|
|
@@ -26,17 +26,13 @@ import { buildInitialDownloadSettings, fileExists, generateTargetFileName, gener
|
|
|
26
26
|
* e TMDownloadRelationViewerSection.
|
|
27
27
|
*/
|
|
28
28
|
const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationViewer, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers }) => {
|
|
29
|
-
|
|
29
|
+
// Il wait panel del download lo apre e lo aggiorna l'hook: qui serve solo la funzione.
|
|
30
|
+
const { downloadDcmtsAsync } = useDcmtOperations();
|
|
30
31
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
31
32
|
const deviceType = useDeviceType();
|
|
32
33
|
// ---- Stato dei settings ----
|
|
33
34
|
const [settings, setSettings] = useState(() => buildInitialDownloadSettings(SDKUI_Globals.userSettings.documentDownloadSettings, SDKUI_Globals.userSettings.searchSettings.invoiceRetrieveFormat, SDKUI_Globals.userSettings.searchSettings.orderRetrieveFormat));
|
|
34
35
|
const [selectedItemsRelationViewer, setSelectedItemsRelationViewer] = useState([]);
|
|
35
|
-
// ---- Stato per la creazione ZIP (spinner separato) ----
|
|
36
|
-
const [isCreatingZip, setIsCreatingZip] = useState(false);
|
|
37
|
-
const [zipProgressText, setZipProgressText] = useState('');
|
|
38
|
-
const [zipProgressValue, setZipProgressValue] = useState(0);
|
|
39
|
-
const [zipProgressMax, setZipProgressMax] = useState(0);
|
|
40
36
|
const [hasSavedLayout, setHasSavedLayout] = useState(() => {
|
|
41
37
|
const saved = SDKUI_Globals.userSettings.documentDownloadSettings;
|
|
42
38
|
const defaults = new DocumentDownloadSettings();
|
|
@@ -215,18 +211,19 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
215
211
|
const zipFileName = settings.zipFileName.trim().toLowerCase().endsWith('.zip')
|
|
216
212
|
? settings.zipFileName.trim()
|
|
217
213
|
: settings.zipFileName.trim() + '.zip';
|
|
218
|
-
// Crea il blob ZIP
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
214
|
+
// Crea il blob ZIP: la compressione non e' interrompibile, quindi niente Interrompi.
|
|
215
|
+
const zipPanel = TMWaitPanelManager.show({
|
|
216
|
+
title: SDKUI_Localizator.CompressToZipFile,
|
|
217
|
+
subtitle: SDKUI_Localizator.CompressToZipFile,
|
|
218
|
+
max: zipEntries.length,
|
|
219
|
+
showCounters: false,
|
|
220
|
+
});
|
|
223
221
|
try {
|
|
224
222
|
const zipBlob = await ZipManager.createZip(zipEntries, {
|
|
225
223
|
compressionLevel: 6,
|
|
226
224
|
password: settings.zipPassword.trim() || undefined,
|
|
227
225
|
onProgress: (current, total, filename) => {
|
|
228
|
-
|
|
229
|
-
setZipProgressText(`${SDKUI_Localizator.CompressToZipFile}: ${filename}`);
|
|
226
|
+
zipPanel.update({ value: current, subtitle: `${SDKUI_Localizator.CompressToZipFile}: ${filename}` });
|
|
230
227
|
},
|
|
231
228
|
});
|
|
232
229
|
// Se c'è un handle della cartella: salva direttamente nella cartella selezionata
|
|
@@ -258,7 +255,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
258
255
|
ShowAlert({ message: SDKUI_Localizator.Error, mode: 'error', duration: 5000, title: SDKUI_Localizator.CompressToZipFile });
|
|
259
256
|
}
|
|
260
257
|
finally {
|
|
261
|
-
|
|
258
|
+
zipPanel.close();
|
|
262
259
|
}
|
|
263
260
|
}
|
|
264
261
|
}
|
|
@@ -388,25 +385,25 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
388
385
|
{ value: 'skip', display: SDKUI_Localizator.DoNotCopy },
|
|
389
386
|
{ value: 'rename', display: SDKUI_Localizator.CopyButRename },
|
|
390
387
|
], value: isUsingDefaultDownloads ? 'rename' : settings.fileExistsMode, direction: "row", disabled: isUsingDefaultDownloads, onValueChanged: (value) => updateSettings('fileExistsMode', value), fontSize: '0.9rem' }) }), isUsingDefaultDownloads && (_jsx("span", { style: { fontSize: '0.8rem', color: '#888', fontStyle: 'italic', marginTop: '4px', display: 'block' }, children: SDKUI_Localizator.BrowserAutoRenamesDuplicateFilesInDownloadsFolder }))] }) }), fileNamingRow, formatSelectorsRow] })), settings.exportMode === 'zip' && (_jsxs("div", { style: { display: 'flex', flexWrap: 'wrap', columnGap: '10px' }, children: [_jsxs("div", { style: { display: 'flex', flexWrap: 'wrap', columnGap: '10px', width: '100%' }, children: [folderSelector, _jsx("div", { style: { flex: '1 1 280px', minWidth: '280px' }, children: _jsx(TMTextBox, { label: SDKUI_Localizator.ZipFileName, value: settings.zipFileName, validationItems: zipValidationItems, autoComplete: "one-time-code", onValueChanged: (e) => updateSettings('zipFileName', e.target.value) }) }), _jsx("div", { style: { flex: '1 1 280px', minWidth: '280px' }, children: _jsx(TMTextBox, { label: SDKUI_Localizator.ProtectWithPasswordOptional, value: settings.zipPassword, type: "password", autoComplete: "one-time-code", onValueChanged: (e) => updateSettings('zipPassword', e.target.value) }) })] }), fileNamingRow, formatSelectorsRow] }))] })] }));
|
|
391
|
-
return (_jsx(
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
388
|
+
return (_jsx(TMModal, { width: calcResponsiveSizes(deviceType, showTMRelationViewer ? '95%' : '950px', '95%', '95%'), height: showTMRelationViewer ? '95%' : 'auto', title: getTitle(), onClose: onClose, showCloseButton: true, 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: ["50", "50"], start: ['65%', '35%'], 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: _jsxs("button", { disabled: !isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0), onClick: run, style: {
|
|
389
|
+
display: 'flex',
|
|
390
|
+
alignItems: 'center',
|
|
391
|
+
justifyContent: 'center',
|
|
392
|
+
gap: '6px',
|
|
393
|
+
padding: '8px 20px',
|
|
394
|
+
fontSize: '0.95rem',
|
|
395
|
+
fontWeight: 600,
|
|
396
|
+
color: '#fff',
|
|
397
|
+
background: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0))
|
|
398
|
+
? '#b0b0b0'
|
|
399
|
+
: 'linear-gradient(135deg, #28a745 0%, #218838 100%)',
|
|
400
|
+
border: 'none',
|
|
401
|
+
borderRadius: '6px',
|
|
402
|
+
cursor: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0)) ? 'not-allowed' : 'pointer',
|
|
403
|
+
boxShadow: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0))
|
|
404
|
+
? 'none'
|
|
405
|
+
: '0 2px 8px rgba(40, 167, 69, 0.35)',
|
|
406
|
+
transition: 'all 0.2s ease',
|
|
407
|
+
}, children: [_jsx(IconPlay, {}), _jsx("span", { children: SDKUI_Localizator.Execute })] }) })] }) }));
|
|
411
408
|
};
|
|
412
409
|
export default TMCopyToFolderForm;
|
|
@@ -13,7 +13,8 @@ import ShowAlert from '../../base/TMAlert';
|
|
|
13
13
|
import TMButton from '../../base/TMButton';
|
|
14
14
|
import { TMExceptionBoxManager, TMMessageBoxManager, ButtonNames } from '../../base/TMPopUp';
|
|
15
15
|
import TMSpinner, { Spinner } from '../../base/TMSpinner';
|
|
16
|
-
import
|
|
16
|
+
import TMLayoutContainer from '../../base/TMLayout';
|
|
17
|
+
import TMWaitPanelManager from '../../base/waitPanel/TMWaitPanelManager';
|
|
17
18
|
import TMDistinctValues from '../../choosers/TMDistinctValues';
|
|
18
19
|
import TMFormulaEditor, { FormulaDescriptor, FormulaHelper, FormulaTargets } from '../../editors/TMFormulaEditor';
|
|
19
20
|
import TMMetadataValues, { AdvancedMenuButtons } from '../../editors/TMMetadataValues';
|
|
@@ -64,17 +65,6 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
64
65
|
const { onRefreshSearchAsyncDatagrid, onRefreshBlogDatagrid, onRefreshPreviewDatagrid } = datagridUtility || {};
|
|
65
66
|
const floatingBarContainerRef = useRef(null);
|
|
66
67
|
const [id, setID] = useState('');
|
|
67
|
-
const [showWaitPanelLocal, setShowWaitPanelLocal] = useState(false);
|
|
68
|
-
const [waitPanelTitleLocal, setWaitPanelTitleLocal] = useState('');
|
|
69
|
-
const [showPrimaryLocal, setShowPrimaryLocal] = useState(false);
|
|
70
|
-
const [waitPanelTextPrimaryLocal, setWaitPanelTextPrimaryLocal] = useState('');
|
|
71
|
-
const [waitPanelValuePrimaryLocal, setWaitPanelValuePrimaryLocal] = useState(0);
|
|
72
|
-
const [waitPanelMaxValuePrimaryLocal, setWaitPanelMaxValuePrimaryLocal] = useState(0);
|
|
73
|
-
const [showSecondaryLocal, setShowSecondaryLocal] = useState(false);
|
|
74
|
-
const [waitPanelTextSecondaryLocal, setWaitPanelTextSecondaryLocal] = useState('');
|
|
75
|
-
const [waitPanelValueSecondaryLocal, setWaitPanelValueSecondaryLocal] = useState(0);
|
|
76
|
-
const [waitPanelMaxValueSecondaryLocal, setWaitPanelMaxValueSecondaryLocal] = useState(0);
|
|
77
|
-
const [useWaitPanelLocalState, setUseWaitPanelLocalState] = useState(false);
|
|
78
68
|
const [formData, setFormData] = useState([]);
|
|
79
69
|
const [formDataOrig, setFormDataOrig] = useState([]);
|
|
80
70
|
const [validationItems, setValidationItems] = useState([]);
|
|
@@ -469,7 +459,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
469
459
|
openTaskFormHandler,
|
|
470
460
|
},
|
|
471
461
|
});
|
|
472
|
-
const { handleSignApprove,
|
|
462
|
+
const { handleSignApprove, relatedDocumentsInfo: { isOpenDetails, isOpenMaster, canArchiveDetailRelation, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability, }, toppyOperations: { updateShowApprovePopup, updateShowRejectPopup, updateShowReAssignPopup, updateShowMoreInfoPopup } } = features;
|
|
473
463
|
useEffect(() => {
|
|
474
464
|
const fetchAllUsers = async () => {
|
|
475
465
|
const users = await UserListCacheService.GetAllAsync();
|
|
@@ -970,15 +960,15 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
970
960
|
}
|
|
971
961
|
}, [DID, TID, getSpecificChangedKeysWithValues, refreshMetadataAsync, onSavedAsyncCallback, onClose]);
|
|
972
962
|
const handleArchiveCompleted = useCallback(async () => {
|
|
973
|
-
let firstBlock = true;
|
|
974
|
-
let maxFileSize = 0;
|
|
975
963
|
let operationTitle = SDKUI_Localizator.Archiving;
|
|
976
|
-
setUseWaitPanelLocalState(true);
|
|
977
|
-
setShowWaitPanelLocal(true);
|
|
978
|
-
setShowPrimaryLocal(false);
|
|
979
|
-
setShowSecondaryLocal(true);
|
|
980
|
-
setWaitPanelTitleLocal(operationTitle);
|
|
981
964
|
abortControllerLocal = new AbortController();
|
|
965
|
+
// Interrompi solo sopra il megabyte: sotto, l'upload finisce prima che serva.
|
|
966
|
+
const panel = TMWaitPanelManager.show({
|
|
967
|
+
title: operationTitle,
|
|
968
|
+
showCounters: false,
|
|
969
|
+
cancelable: (dcmtFileRef.current?.size ?? 0) >= 1000000,
|
|
970
|
+
onAbort: () => abortControllerLocal.abort(),
|
|
971
|
+
});
|
|
982
972
|
const ae = new ArchiveEngineByID(SDK_Globals.tmSession);
|
|
983
973
|
ae.TID = TID;
|
|
984
974
|
ae.Metadata_ClearAll();
|
|
@@ -1014,42 +1004,41 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1014
1004
|
sharedDcmt.did = sharedSourceDID;
|
|
1015
1005
|
ae.SharedDcmt = sharedDcmt;
|
|
1016
1006
|
}
|
|
1007
|
+
// Fase 1: upload del file, la barra segue i byte.
|
|
1017
1008
|
let newDID = await ae.ArchiveAsync(abortControllerLocal.signal, (pd) => {
|
|
1018
|
-
|
|
1019
|
-
maxFileSize = pd.ProgressBarMaximum ?? 0;
|
|
1020
|
-
setWaitPanelMaxValueSecondaryLocal(maxFileSize);
|
|
1021
|
-
firstBlock = false;
|
|
1022
|
-
}
|
|
1023
|
-
setWaitPanelValueSecondaryLocal(pd.ProgressBarValue);
|
|
1024
|
-
setWaitPanelTextSecondaryLocal(`${SDKUI_Localizator.Archiving}... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
|
|
1009
|
+
const maxFileSize = pd.ProgressBarMaximum ?? 0;
|
|
1025
1010
|
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
1026
|
-
//
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
firstBlock = true;
|
|
1011
|
+
// Upload finito: fase 2 sulla stessa barra, tre passi, gia' al 20%.
|
|
1012
|
+
panel.update({
|
|
1013
|
+
title: SDKUI_Localizator.ArchivingCompletionInProgress,
|
|
1014
|
+
subtitle: SDKUI_Localizator.ArchivingCompletionInProgress,
|
|
1015
|
+
value: 0.6,
|
|
1016
|
+
max: 3,
|
|
1017
|
+
});
|
|
1018
|
+
return;
|
|
1035
1019
|
}
|
|
1020
|
+
panel.update({
|
|
1021
|
+
value: pd.ProgressBarValue,
|
|
1022
|
+
max: maxFileSize,
|
|
1023
|
+
subtitle: `${SDKUI_Localizator.Archiving}... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`,
|
|
1024
|
+
});
|
|
1036
1025
|
});
|
|
1037
1026
|
// Aggiorna lo stato locale immediatamente dopo il salvataggio riuscito
|
|
1038
1027
|
// Questo garantisce che isModified diventi false anche se il reload fallisce
|
|
1039
1028
|
const savedFormData = structuredClone(formDataRef.current);
|
|
1040
1029
|
setFormDataOrig(savedFormData);
|
|
1041
1030
|
formDataOrigRef.current = savedFormData;
|
|
1042
|
-
// Fase 2: Completamento archiviazione (la
|
|
1031
|
+
// Fase 2: Completamento archiviazione (la barra a tre passi è già visibile dal callback)
|
|
1043
1032
|
// Imposta il titolo anche qui per sicurezza, nel caso il callback non venga eseguito
|
|
1044
|
-
|
|
1033
|
+
panel.update({ title: SDKUI_Localizator.ArchivingCompletionInProgress, max: 3 });
|
|
1045
1034
|
// Step 1/3: Aggiornamento griglia di ricerca
|
|
1046
|
-
|
|
1035
|
+
panel.setValue(1);
|
|
1047
1036
|
await onRefreshSearchAsyncDatagrid?.();
|
|
1048
1037
|
// Step 2/3: Callback di salvataggio
|
|
1049
|
-
|
|
1038
|
+
panel.setValue(2);
|
|
1050
1039
|
await onSavedAsyncCallback?.(ae.TID, newDID);
|
|
1051
1040
|
// Step 3/3: Aggiornamento lista metadati
|
|
1052
|
-
|
|
1041
|
+
panel.setValue(3);
|
|
1053
1042
|
// Usa fromDTDRef.current invece di fromDTD per evitare stale closure,
|
|
1054
1043
|
// garantendo di avere il descrittore del tipo documento corrente.
|
|
1055
1044
|
await setMetadataList(fromDTDRef.current?.metadata ?? [], undefined, true, newDID);
|
|
@@ -1072,8 +1061,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1072
1061
|
return undefined;
|
|
1073
1062
|
}
|
|
1074
1063
|
finally {
|
|
1075
|
-
|
|
1076
|
-
setUseWaitPanelLocalState(false);
|
|
1064
|
+
panel.close();
|
|
1077
1065
|
}
|
|
1078
1066
|
}, [TID, connectorFileSave, onSavedAsyncCallback, onSaveRecents, onClose, DID, setMetadataList, handleReset, layoutMode, isSharedDcmt]);
|
|
1079
1067
|
// Messaggio di conferma dell'archiviazione in base al vincolo del tipo documento (ArchiveConstraints).
|
|
@@ -1678,23 +1666,23 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1678
1666
|
height: '100%',
|
|
1679
1667
|
position: 'relative',
|
|
1680
1668
|
overflow: 'hidden'
|
|
1681
|
-
}, children: [_jsxs("div", { style: { width: '100%', height: '100%', display: isOpenDetails || isOpenMaster ? 'none' : 'flex' }, children: [isNavigating && _jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: false }), (fromDTD) &&
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1669
|
+
}, children: [_jsxs("div", { style: { width: '100%', height: '100%', display: isOpenDetails || isOpenMaster ? 'none' : 'flex' }, children: [isNavigating && _jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: false }), (fromDTD) && _jsxs(TMLayoutContainer, { direction: 'vertical', children: [(groupId && groupId.length > 0)
|
|
1670
|
+
? _jsxs(_Fragment, { children: [_jsx(PanelDisabledStateHandler, { isWFDisabled: isWFDisabled, isSysMetadataDisabled: isSysMetadataDisabled, isBoardDisabled: isBoardDisabled, isDcmtTasksDisabled: isDcmtTasksDisabled, isPreviewDisabled: isPreviewDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })] })
|
|
1671
|
+
: _jsxs(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: defaultPanelDimensions, initialDimensions: defaultPanelDimensions, initialMobilePanelId: 'tmDcmtForm', isPersistenceEnabled: !isMobile && layoutMode !== LayoutModes.Ark ? hasSavedLayout() : false, persistPanelStates: !isMobile && layoutMode !== LayoutModes.Ark ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: layoutMode !== LayoutModes.Ark ? getPersistedPanelStates() : undefined, children: [_jsx(PanelDisabledStateHandler, { isWFDisabled: isWFDisabled, isSysMetadataDisabled: isSysMetadataDisabled, isBoardDisabled: isBoardDisabled, isDcmtTasksDisabled: isDcmtTasksDisabled, isPreviewDisabled: isPreviewDisabled, persistedWFVisible: persistedWFVisibleRef.current }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })] }), isOpenDistinctValues &&
|
|
1672
|
+
_jsx(TMDistinctValues, { tid: TID, mid: focusedMetadataValue?.mid, isModal: true, showHeader: false, layoutMode: layoutMode, onClosePanelCallback: () => setIsOpenDistinctValues(false), onSelectionChanged: (e) => {
|
|
1673
|
+
if (!e)
|
|
1674
|
+
return;
|
|
1675
|
+
setFormData((prevItems) => prevItems.map((item) => item.tid == e.tid && item.mid === e.mid ? { ...item, value: e.newValue } : item));
|
|
1676
|
+
} }), isOpenFormulaEditor &&
|
|
1677
|
+
_jsx(TMFormulaEditor, { isModal: true, formMode: FormModes.Update, inputData: getFormula(), showBack: false, onClose: () => setIsOpenFormulaEditor(false), onApplied: (newFormula) => {
|
|
1678
|
+
setFormData((prevItems) => prevItems.map((item) => item.tid == newFormula.tid && item.mid === newFormula.mid ? { ...item, value: FormulaHelper.addFormulaTag(newFormula.expression), isSelected: true, isEditable: true } : item));
|
|
1679
|
+
setFocusedMetadataValue(prevState => ({
|
|
1680
|
+
...prevState,
|
|
1681
|
+
isSelected: true,
|
|
1682
|
+
isEditable: true,
|
|
1683
|
+
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
|
1684
|
+
}));
|
|
1685
|
+
} }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }), _jsx(TMToppyDraggableHelpCenter, { isVisible: isToppyVisible, content: _jsx(TMDcmtFormActionButtons, { showToppyForApprove: showToppyForApprove, workItems: workItems, caseFlowWorkItems: showToppyForCaseFlow ? caseFlowWorkItems : [], onCompleteCaseFlowWorkItem: completeCaseFlowWorkItem, onRejectCaseFlowWorkItem: rejectCaseFlowWorkItem, deviceType: deviceType, isMobile: isMobile, handleSignApprove: handleSignApprove, updateShowApprovePopup: updateShowApprovePopup, updateShowRejectPopup: updateShowRejectPopup, updateShowReAssignPopup: updateShowReAssignPopup, updateShowMoreInfoPopup: updateShowMoreInfoPopup, fromDTD: fromDTD, showToppyForCompleteMoreInfo: showToppyForCompleteMoreInfo, moreInfoTasks: moreInfoTasks, setShowCommentForm: setShowCommentForm, showToppyForReferences: showToppyForReferences, dcmtReferences: dcmtReferences, referenceActionMap: referenceActionMap, handleNavigateToReference: handleNavigateToReference, setShowMoreInfoTaskPopup: setShowMoreInfoTaskPopup, setShowMoreInfoTaskTask: setShowMoreInfoTaskTask }) })] }), (showCommentForm && TID && DID) &&
|
|
1698
1686
|
_jsx(TMBlogCommentForm, { maxLength: 500, context: blogCommentFormContext, onClose: handleBlogCommentFormClose, onCustomSave: onBlogCommentFormCustomSave, participants: emptyParticipants, showAttachmentsSection: false, allArchivedDocumentsFileItems: emptyArchivedDocumentsFileItems })] }), renderDcmtOperations, renderFloatingBar] }));
|
|
1699
1687
|
};
|
|
1700
1688
|
return (_jsxs("div", { style: (isModal && onClose) ? { width: 0, height: 0 } : { width: '100%', height: '100%' }, children: [(isModal && onClose)
|
|
@@ -41,5 +41,5 @@ interface TMDcmtFormActionButtonsProps {
|
|
|
41
41
|
setShowMoreInfoTaskPopup: React.Dispatch<React.SetStateAction<boolean>>;
|
|
42
42
|
setShowMoreInfoTaskTask: React.Dispatch<React.SetStateAction<TaskDescriptor | undefined>>;
|
|
43
43
|
}
|
|
44
|
-
declare const TMDcmtFormActionButtons: (props: TMDcmtFormActionButtonsProps) =>
|
|
44
|
+
declare const TMDcmtFormActionButtons: (props: TMDcmtFormActionButtonsProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
45
|
export default TMDcmtFormActionButtons;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { DcmtInfo, DownloadModes, DownloadTypes } from '../../../ts';
|
|
3
2
|
import { FileDescriptor } from '@topconsultnpm/sdk-ts';
|
|
4
3
|
interface ITMDcmtIconProps {
|
|
@@ -14,8 +13,6 @@ interface ITMDcmtIconProps {
|
|
|
14
13
|
tooltipContent?: JSX.Element | string;
|
|
15
14
|
openInOffice?: (selectedDcmtsOrFocused: Array<DcmtInfo>) => Promise<void>;
|
|
16
15
|
onDownloadDcmtsAsync?: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => Promise<void>;
|
|
17
|
-
/** Se true, renderizza il wait panel nel body tramite Portal (centrato a schermo intero) */
|
|
18
|
-
usePortal?: boolean;
|
|
19
16
|
}
|
|
20
|
-
declare const TMDcmtIcon: ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode, tooltipContent, openInOffice, onDownloadDcmtsAsync
|
|
17
|
+
declare const TMDcmtIcon: ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode, tooltipContent, openInOffice, onDownloadDcmtsAsync }: ITMDcmtIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
18
|
export default TMDcmtIcon;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useMemo } from 'react';
|
|
3
|
-
import { createPortal } from 'react-dom';
|
|
4
3
|
import styled from 'styled-components';
|
|
5
4
|
import { getFileIcon } from '../../../helper';
|
|
6
5
|
import TMTooltip from '../../base/TMTooltip';
|
|
7
6
|
import { DownloadTypes } from '../../../ts';
|
|
8
7
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
9
8
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
10
|
-
import { TMWaitPanel } from '../../base/TMWaitPanel';
|
|
11
9
|
const StyledCellRenderDcmtIcon = styled.div `
|
|
12
10
|
display: flex;
|
|
13
11
|
flex-direction: row;
|
|
@@ -16,8 +14,8 @@ const StyledCellRenderDcmtIcon = styled.div `
|
|
|
16
14
|
overflow: visible;
|
|
17
15
|
position: relative;
|
|
18
16
|
`;
|
|
19
|
-
const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode = "none", tooltipContent, openInOffice, onDownloadDcmtsAsync
|
|
20
|
-
const { downloadDcmtsAsync
|
|
17
|
+
const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode = "none", tooltipContent, openInOffice, onDownloadDcmtsAsync }) => {
|
|
18
|
+
const { downloadDcmtsAsync } = useDcmtOperations();
|
|
21
19
|
const deviceType = useDeviceType();
|
|
22
20
|
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
23
21
|
const icon = useMemo(() => {
|
|
@@ -59,7 +57,7 @@ const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isS
|
|
|
59
57
|
: deviceType === DeviceType.MOBILE
|
|
60
58
|
? { onClick: handleDownloadAction } // Su mobile, un singolo click sull'icona avvia il download
|
|
61
59
|
: { onDoubleClick: handleDownloadAction } // Su desktop, un doppio click sull'icona avvia il download
|
|
62
|
-
), children: [icon, isLexProt == 1 && _jsx("div", { style: { position: 'absolute', left: '-7px', top: isShared ? undefined : '2px' }, children: _jsx(TMTooltip, { content: "Protezione LEX", children: _jsx(IconLexProtLock, { color: 'blue', fontSize: 13 }) }) }), isShared == 1 && _jsx("div", { style: { position: 'absolute', top: '-7px', left: '-5px' }, children: _jsx(TMTooltip, { content: "Documento condiviso", children: _jsx(IconShared, { fontSize: 16 }) }) }), isSigned == 1 && _jsx("div", { style: { position: 'absolute', bottom: '-4px', right: '-7px' }, children: _jsx(TMTooltip, { content: "Documento firmato", children: _jsx(IconSignature, { fontSize: 28 }) }) })
|
|
60
|
+
), children: [icon, isLexProt == 1 && _jsx("div", { style: { position: 'absolute', left: '-7px', top: isShared ? undefined : '2px' }, children: _jsx(TMTooltip, { content: "Protezione LEX", children: _jsx(IconLexProtLock, { color: 'blue', fontSize: 13 }) }) }), isShared == 1 && _jsx("div", { style: { position: 'absolute', top: '-7px', left: '-5px' }, children: _jsx(TMTooltip, { content: "Documento condiviso", children: _jsx(IconShared, { fontSize: 16 }) }) }), isSigned == 1 && _jsx("div", { style: { position: 'absolute', bottom: '-4px', right: '-7px' }, children: _jsx(TMTooltip, { content: "Documento firmato", children: _jsx(IconSignature, { fontSize: 28 }) }) })] }));
|
|
63
61
|
};
|
|
64
62
|
export default TMDcmtIcon;
|
|
65
63
|
function IconLexProtLock(props) {
|
|
@@ -25,12 +25,10 @@ export declare const TMNothingToShow: ({ text, secondText, fileExt, icon }: {
|
|
|
25
25
|
secondText?: any;
|
|
26
26
|
fileExt?: string;
|
|
27
27
|
icon?: any;
|
|
28
|
-
}) =>
|
|
29
|
-
export declare const StyledHeaderIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
30
|
-
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
31
|
-
}, {
|
|
28
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const StyledHeaderIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color"> & {
|
|
32
30
|
$color: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color"> & {
|
|
32
|
+
$color: string;
|
|
33
|
+
}, never>>> & string;
|
|
34
|
+
export declare const StyledPanelStatusContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
@@ -9,7 +9,7 @@ import { TMColors } from '../../../utils/theme';
|
|
|
9
9
|
import ShowAlert from '../../base/TMAlert';
|
|
10
10
|
import TMButton from '../../base/TMButton';
|
|
11
11
|
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
12
|
-
import
|
|
12
|
+
import TMLayoutContainer from '../../base/TMLayout';
|
|
13
13
|
import { TMSaveFormButtonPrevious, TMSaveFormButtonNext } from '../../forms/TMSaveForm';
|
|
14
14
|
import { StyledAnimatedComponentOpacity } from '../../base/Styled';
|
|
15
15
|
import TMPanel from '../../base/TMPanel';
|
|
@@ -28,7 +28,7 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
|
|
|
28
28
|
const [isFromCache, setIsFromCache] = useState(false);
|
|
29
29
|
const [error, setError] = useState('');
|
|
30
30
|
const [isAbortError, setIsAbortError] = useState(false);
|
|
31
|
-
const {
|
|
31
|
+
const { getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache } = useDcmtOperations();
|
|
32
32
|
const isBasketMode = !!(dcmtData?.btid !== undefined && dcmtData?.bid !== undefined && dcmtData?.bfid !== undefined);
|
|
33
33
|
const getCacheKey = () => {
|
|
34
34
|
if (!dcmtData)
|
|
@@ -80,6 +80,8 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
|
|
|
80
80
|
setLastLoadedDid(currentCacheKey);
|
|
81
81
|
}, [dcmtData?.tid, dcmtData?.did, isVisible, hasLoadedDataOnce, lastLoadedDid]);
|
|
82
82
|
const loadBasketFile = async () => {
|
|
83
|
+
// Il recupero dal basket non passa da useDcmtOperations: ha il suo AbortController.
|
|
84
|
+
const abortController = new AbortController();
|
|
83
85
|
try {
|
|
84
86
|
// Check cache first
|
|
85
87
|
if (dcmtsFileCachePreview.has(cacheKey)) {
|
|
@@ -187,7 +189,7 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
|
|
|
187
189
|
{ icon: _jsx(IconCloseCircle, {}), name: SDKUI_Localizator.RemoveFromCache, onClick: () => { removeDcmtsFileCache(cacheKey); setIsFromCache(false); } },
|
|
188
190
|
{ icon: _jsx(IconClear, {}), name: SDKUI_Localizator.ClearCache, onClick: () => { clearDcmtsFileCache(); setIsFromCache(false); } },
|
|
189
191
|
], [cacheKey, removeDcmtsFileCache, clearDcmtsFileCache, setIsFromCache]);
|
|
190
|
-
return (_jsx(
|
|
192
|
+
return (_jsx(TMLayoutContainer, { direction: 'vertical', children: _jsx(TMPanel, { padding: '0', title: titleHandler(), onClose: onClosePanel, onBack: onBack, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, toolbar: _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [onPrev && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), onNext && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(StyledHeaderIcon, { $color: TMColors.primaryColor, children: _jsx(ContextMenu, { items: cacheMenuItems, trigger: "left", children: _jsx(IconMenuVertical, {}) }) }), _jsx(StyledHeaderIcon, { onClick: reOpenDcmt, $color: TMColors.primaryColor, children: _jsx(TMTooltip, { content: SDKUI_Localizator.ReopenDocument, children: _jsx(IconRefresh, {}) }) })] }), children: error
|
|
191
193
|
? _jsx(ErrorContent, { error: error, isAbortError: isAbortError, onRetry: reOpenDcmt })
|
|
192
194
|
: renderedPreview(dcmtData?.tid, dcmtData?.did, dcmtData?.fileExt, dcmtData?.fileSize, dcmtData?.fileCount, extensionHandler(dcmtData?.fileExt), showPreview, isResizingActive, () => { isBasketMode ? loadBasketFile() : loadDocumentWithCache(); setShowPreview(true); }, dcmtBlob, isBasketMode) }) }));
|
|
193
195
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { FormModes, TaskContext } from "../../../ts";
|
|
3
2
|
import { HomeBlogPost, TaskDescriptor } from "@topconsultnpm/sdk-ts";
|
|
4
3
|
interface TMDcmtTasksProps {
|
|
@@ -13,5 +12,5 @@ interface TMDcmtTasksProps {
|
|
|
13
12
|
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
14
13
|
onBack?: () => void;
|
|
15
14
|
}
|
|
16
|
-
declare const TMDcmtTasks: (props: TMDcmtTasksProps) =>
|
|
15
|
+
declare const TMDcmtTasks: (props: TMDcmtTasksProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
16
|
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.Element;
|
|
5
|
+
declare const TMDragDropOverlay: (props: TMDragDropOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default TMDragDropOverlay;
|
|
@@ -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;
|
|
@@ -22,6 +22,8 @@ interface ITMMasterDetailDcmtsProps extends DeviceContextProps {
|
|
|
22
22
|
onNext?: () => void;
|
|
23
23
|
onPrev?: () => void;
|
|
24
24
|
onBack?: () => void;
|
|
25
|
+
/** Invocato quando il calcolo iniziale delle correlazioni è finito */
|
|
26
|
+
onFirstLoadCompleted?: () => void;
|
|
25
27
|
appendMasterDcmts?: (tid: number | undefined, did: number | undefined) => void;
|
|
26
28
|
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
27
29
|
onRefreshAfterAddDcmtToFavs?: () => void;
|