@topconsultnpm/sdkui-react 6.21.0-t3 → 6.21.0-t5

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 (51) hide show
  1. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +23 -18
  2. package/lib/components/base/TMPopUp.js +3 -3
  3. package/lib/components/base/TMTreeView.d.ts +16 -13
  4. package/lib/components/base/TMTreeView.js +230 -64
  5. package/lib/components/choosers/TMDistinctValues.js +1 -1
  6. package/lib/components/editors/TMTextBox.d.ts +1 -0
  7. package/lib/components/editors/TMTextBox.js +2 -1
  8. package/lib/components/features/documents/TMDcmtForm.d.ts +2 -0
  9. package/lib/components/features/documents/TMDcmtForm.js +2 -1
  10. package/lib/components/features/documents/TMDcmtIcon.d.ts +3 -1
  11. package/lib/components/features/documents/TMDcmtIcon.js +5 -32
  12. package/lib/components/features/documents/TMFileUploader.js +1 -1
  13. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
  14. package/lib/components/features/documents/TMMasterDetailDcmts.js +169 -14
  15. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -1
  16. package/lib/components/features/documents/TMMergeToPdfForm.js +95 -49
  17. package/lib/components/features/documents/TMRelationViewer.d.ts +15 -10
  18. package/lib/components/features/documents/TMRelationViewer.js +533 -179
  19. package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +4 -3
  20. package/lib/components/features/documents/copyAndMergeDcmtsShared.js +46 -23
  21. package/lib/components/features/documents/mergePdfUtils.d.ts +52 -0
  22. package/lib/components/features/documents/mergePdfUtils.js +278 -0
  23. package/lib/components/features/search/TMSearch.d.ts +2 -0
  24. package/lib/components/features/search/TMSearch.js +2 -2
  25. package/lib/components/features/search/TMSearchResult.d.ts +2 -0
  26. package/lib/components/features/search/TMSearchResult.js +58 -9
  27. package/lib/components/features/workflow/diagram/xmlParser.js +2 -1
  28. package/lib/components/viewers/TMTidViewer.js +14 -2
  29. package/lib/helper/Enum_Localizator.js +1 -0
  30. package/lib/helper/SDKUI_Globals.d.ts +1 -0
  31. package/lib/helper/SDKUI_Globals.js +1 -0
  32. package/lib/helper/SDKUI_Localizator.d.ts +34 -0
  33. package/lib/helper/SDKUI_Localizator.js +352 -12
  34. package/lib/helper/TMIcons.d.ts +1 -0
  35. package/lib/helper/TMIcons.js +3 -0
  36. package/lib/helper/TMUtils.d.ts +33 -1
  37. package/lib/helper/TMUtils.js +104 -1
  38. package/lib/helper/certificateImportHelper.d.ts +43 -0
  39. package/lib/helper/certificateImportHelper.js +403 -0
  40. package/lib/helper/helpers.d.ts +3 -0
  41. package/lib/helper/helpers.js +29 -1
  42. package/lib/helper/index.d.ts +1 -0
  43. package/lib/helper/index.js +1 -0
  44. package/lib/hooks/useDcmtOperations.d.ts +2 -1
  45. package/lib/hooks/useDcmtOperations.js +10 -2
  46. package/lib/hooks/useDocumentOperations.d.ts +2 -0
  47. package/lib/hooks/useDocumentOperations.js +28 -6
  48. package/lib/services/platform_services.d.ts +1 -1
  49. package/lib/ts/types.d.ts +2 -1
  50. package/lib/ts/types.js +1 -0
  51. package/package.json +3 -4
@@ -1,5 +1,6 @@
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';
3
4
  import styled from 'styled-components';
4
5
  import { getFileIcon } from '../../../helper';
5
6
  import TMTooltip from '../../base/TMTooltip';
@@ -15,7 +16,7 @@ const StyledCellRenderDcmtIcon = styled.div `
15
16
  overflow: visible;
16
17
  position: relative;
17
18
  `;
18
- const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode = "none", tooltipContent, openInOffice, onDownloadDcmtsAsync }) => {
19
+ const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode = "none", tooltipContent, openInOffice, onDownloadDcmtsAsync, usePortal = false }) => {
19
20
  const { downloadDcmtsAsync, showWaitPanel, waitPanelTitle, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, abortController } = useDcmtOperations();
20
21
  const deviceType = useDeviceType();
21
22
  let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
@@ -56,43 +57,15 @@ const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isS
56
57
  }, ...(deviceType === DeviceType.MOBILE
57
58
  ? { onClick: handleDownloadAction } // Su mobile, un singolo click sull'icona avvia il download
58
59
  : { onDoubleClick: handleDownloadAction } // Su desktop, un doppio click sull'icona avvia il download
59
- ), 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 }) }) }), showWaitPanel &&
60
- _jsx(TMWaitPanel, { title: waitPanelTitle, showSecondary: showSecondary, textSecondary: waitPanelTextSecondary, valueSecondary: waitPanelValueSecondary, maxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, onAbortClick: (abortController) => { setTimeout(() => { abortController?.abort(); }, 1000); } })] }));
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 }) }) }), showWaitPanel && (usePortal ? createPortal(_jsx(TMWaitPanel, { title: waitPanelTitle, showSecondary: showSecondary, textSecondary: waitPanelTextSecondary, valueSecondary: waitPanelValueSecondary, maxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, onAbortClick: (abortController) => { setTimeout(() => { abortController?.abort(); }, 1000); }, useHighZIndex: true }), document.body) : (_jsx(TMWaitPanel, { title: waitPanelTitle, showSecondary: showSecondary, textSecondary: waitPanelTextSecondary, valueSecondary: waitPanelValueSecondary, maxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, onAbortClick: (abortController) => { setTimeout(() => { abortController?.abort(); }, 1000); } })))] }));
61
61
  };
62
62
  export default TMDcmtIcon;
63
63
  function IconLexProtLock(props) {
64
- return (_jsxs("svg", { viewBox: "0 0 512 512", height: "1em", width: "1em", ...props, children: [_jsx("path", { fill: "#455A64", d: "M256,0c-76.544,0.094-138.573,62.122-138.667,138.667V224c0,5.891,4.776,10.667,10.667,10.667h42.667\r\n c5.891,0,10.667-4.776,10.667-10.667v-85.333C181.333,97.429,214.763,64,256,64s74.667,33.429,74.667,74.667V224\r\n c0,5.891,4.776,10.667,10.667,10.667H384c5.891,0,10.667-4.776,10.667-10.667v-85.333C394.573,62.122,332.544,0.094,256,0z" }), _jsx("path", { fill: "#FFC107", d: "M128,213.333h256c29.455,0,53.333,23.878,53.333,53.333v192C437.333,488.122,413.455,512,384,512H128\r\n c-29.455,0-53.333-23.878-53.333-53.333v-192C74.667,237.211,98.545,213.333,128,213.333z" }), _jsx("path", { fill: "#455A64", d: "M309.333,330.667c0.124-29.455-23.653-53.434-53.108-53.558\r\n c-29.455-0.124-53.434,23.653-53.558,53.108c-0.086,20.36,11.427,38.992,29.674,48.023l-8.235,57.6\r\n c-0.825,5.833,3.235,11.23,9.068,12.055c0.494,0.07,0.993,0.105,1.492,0.105h42.667c5.891,0.06,10.715-4.667,10.774-10.558\r\n c0.005-0.543-0.03-1.086-0.108-1.623l-8.235-57.6C297.788,369.199,309.216,350.82,309.333,330.667z" }), _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " })] })
65
- // <svg
66
- // viewBox="0 0 24 24"
67
- // fill="currentColor"
68
- // height="1em"
69
- // width="1em"
70
- // {...props}
71
- // >
72
- // <path d="M12 2C9.243 2 7 4.243 7 7v3H6a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2v-8a2 2 0 00-2-2h-1V7c0-2.757-2.243-5-5-5zM9 7c0-1.654 1.346-3 3-3s3 1.346 3 3v3H9V7zm4 10.723V20h-2v-2.277a1.993 1.993 0 01.567-3.677A2.001 2.001 0 0114 16a1.99 1.99 0 01-1 1.723z" />
73
- // </svg>
74
- );
64
+ return (_jsxs("svg", { viewBox: "0 0 512 512", height: "1em", width: "1em", ...props, children: [_jsx("path", { fill: "#455A64", d: "M256,0c-76.544,0.094-138.573,62.122-138.667,138.667V224c0,5.891,4.776,10.667,10.667,10.667h42.667\r\n c5.891,0,10.667-4.776,10.667-10.667v-85.333C181.333,97.429,214.763,64,256,64s74.667,33.429,74.667,74.667V224\r\n c0,5.891,4.776,10.667,10.667,10.667H384c5.891,0,10.667-4.776,10.667-10.667v-85.333C394.573,62.122,332.544,0.094,256,0z" }), _jsx("path", { fill: "#FFC107", d: "M128,213.333h256c29.455,0,53.333,23.878,53.333,53.333v192C437.333,488.122,413.455,512,384,512H128\r\n c-29.455,0-53.333-23.878-53.333-53.333v-192C74.667,237.211,98.545,213.333,128,213.333z" }), _jsx("path", { fill: "#455A64", d: "M309.333,330.667c0.124-29.455-23.653-53.434-53.108-53.558\r\n c-29.455-0.124-53.434,23.653-53.558,53.108c-0.086,20.36,11.427,38.992,29.674,48.023l-8.235,57.6\r\n c-0.825,5.833,3.235,11.23,9.068,12.055c0.494,0.07,0.993,0.105,1.492,0.105h42.667c5.891,0.06,10.715-4.667,10.774-10.558\r\n c0.005-0.543-0.03-1.086-0.108-1.623l-8.235-57.6C297.788,369.199,309.216,350.82,309.333,330.667z" }), _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " }), " ", _jsx("g", { children: " " })] }));
75
65
  }
76
66
  function IconShared(props) {
77
67
  return (_jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", height: "1em", width: "1em", ...props, children: _jsx("path", { d: "M11 9V5l7 7-7 7v-4.1c-5 0-8.5 1.6-11 5.1 1-5 4-10 11-11m6-1V5l7 7-7 7v-3l4-4-4-4z" }) }));
78
68
  }
79
69
  function IconSignature(props) {
80
- return (
81
- // <svg viewBox="0 0 128 128" fill="currentColor"
82
- // height="1em"
83
- // width="1em"
84
- // {...props}>
85
- // <g><path d="m128 82.7c0-.3-.1-.6-.2-.8l-6.4-10.9c-2.2-3.7-4.8-7.1-7.9-10.2l-39.8-39.8c-2.7-2.7-7-2.7-9.7 0s-2.7 7 0 9.7l39.8 39.8c3.1 3.1 6.5 5.7 10.2 7.9l8.3 4.8c-.3.2-.7.5-1 .7-1.4 1-2.9 2-4.3 3.1-1.2.9-2.3 1.9-3.3 2.9-2.5 2.2-4.8 4.3-7.8 5.6-3.5 1.5-8.9 2.2-12.6-.9-.7-.6-1.4-1.4-2.2-2.2-2-2.2-4.3-4.7-7.8-4.6-2.9.1-4.9 2-6.7 3.7-.8.8-1.6 1.5-2.4 2-1 .6-2.1.9-3.2.9 1.9-3.5 2.5-7.1 1.7-10.5-.6-2.4-3.1-8.7-7.7-8.5-1.8.1-3.3 1-4.3 2.6-2.2 3.5-1.4 9.7-.4 12.2 1 2.4 2.6 4.4 4.5 5.9-3.9 4.3-9.6 7.4-15.9 8.6-6.4 1.2-12.9-.7-18.2-4.8 4.7-2 9.1-5.2 12.7-9.4 5.7-6.8 8-14.5 6.1-21.1-1.2-4.1-3.8-7.2-7.8-8.9-4.7-2-10.7-1.6-15.6 1.1-11.1 6.1-12.2 20.3-6.8 30.6 1.1 2.1 2.3 4 3.7 5.7-.5.1-1 .1-1.4.1-4.5.1-8.3-1.4-11.4-4.7-9.8-10.2-7-27.9 1.1-38.5 8.4-11 23.5-14.9 35.1-9.1 1 .5 2.2.1 2.7-.9s.1-2.2-.9-2.7c-13.2-6.6-30.4-2.2-40 10.2-9.2 12-12.2 32-.9 43.7 3.9 4 8.9 6.1 14.4 5.9 1.5 0 3-.3 4.5-.6 5.3 4.9 11.9 7.7 18.7 7.7 1.5 0 3-.1 4.6-.4 7.7-1.4 14.4-5.2 18.9-10.6 2.7.8 5.4.4 7.8-1.1 1.1-.7 2.1-1.6 3-2.5 1.4-1.4 2.7-2.5 4-2.6 1.6 0 2.8 1.2 4.7 3.3.8.9 1.6 1.8 2.6 2.6 4.2 3.5 10.8 4.1 16.8 1.5 3.6-1.6 6.3-4 8.9-6.3 1-.9 2.1-1.9 3.2-2.7 1.3-1 2.6-1.9 4-2.9 1.2-.8 2.5-1.7 3.7-2.6.7-.6 1-1.3.9-2zm-12-7.8c-3.4-2-6.5-4.4-9.4-7.2l-39.8-39.8c-1.1-1.1-1.1-2.9 0-4 .6-.6 1.3-.8 2-.8s1.5.3 2 .8l39.8 39.8c2.8 2.8 5.3 6 7.2 9.4l2.7 4.6zm-93.1 15.4c-4.5-8.5-3.8-20.3 5.2-25.2 2.2-1.2 4.8-1.8 7.3-1.8 1.7 0 3.4.3 4.9.9 1.9.8 4.4 2.6 5.5 6.3 2.1 7.6-3 14.7-5.3 17.4-3.5 4.2-8.2 7.4-12.9 9-1.9-2-3.4-4.2-4.7-6.6zm44.3 2.6c-1.4-1-2.5-2.5-3.2-4.2-.7-1.8-1.2-6.5.1-8.6.3-.5.6-.7 1.1-.7 1.2 0 3 3 3.5 5.4.8 3.2-.3 6.1-1.5 8.1z"></path></g>
86
- // </svg>
87
- _jsx("svg", { height: "1em", viewBox: "0 0 450 450", width: "1em", fill: "currentColor", ...props, children: _jsx("g", { children: _jsx("g", { children: _jsxs("g", { clipRule: "evenodd", fill: "rgb(0,0,0)", fillRule: "evenodd", children: [_jsx("path", { d: "m366.6 67.8 1.1-4c.4-1.5.6-3 .6-4.5 0-8.1-5.5-15.2-13.3-17.3-9.5-2.5-19.3 3.2-21.8 12.8l-20.4 77.9 34.6 9z" }), _jsx("path", { d: "m234.9 198.9h148.6v35.7h-148.6z", transform: "matrix(.253 -.968 .968 .253 21.311 461.088)" }), _jsx("path", { d: "m292.8 316 8.4 2.2 4.5-17.3-34.6-9.1-4.5 17.4 8.3 2.2z" }), _jsx("path", { d: "m275.3 319.7-12.7 14.7 5.4 40.3 24.4-32.5-3.9-19.1zm6.5 23.3c-.8 2.9-3.7 4.6-6.6 3.9s-4.6-3.7-3.9-6.6 3.7-4.6 6.6-3.9 4.6 3.7 3.9 6.6z" }), _jsx("path", { d: "m395.6 71.5-20.3-5.5-2 7.7 16.5 4.4-24.8 95c-.6 2.1.7 4.3 2.8 4.8.3.1.7.1 1 .1 1.8 0 3.4-1.2 3.8-3l25.8-98.8c.6-2-.7-4.2-2.8-4.7z" }), _jsx("path", { d: "" }), _jsx("path", { d: "m243.4 379.8c-1.8-1.2-4.3-.8-5.5 1.1-9.6 14.1-29.9 19.6-45.3 12.2-.5-.2-.9-.5-1.4-.7-3.5-1.8-7.9-4-12.8-2.7-2.7.7-4.7 2.3-6.5 3.6-1.5 1.2-2.8 2.2-3.9 2.2-2 .1-4-3-5-5.9-.2-.5-.4-1-.5-1.5-1.4-4.1-3.1-9.1-7.8-11.8-5.8-3.3-12.9-.9-17.4 3-2.4 2-4.2 4.4-6 6.7-1.2 1.5-2.3 2.9-3.4 4.1-7.5 7.9-20.3 10-30.2 5.6 7.6-6.9 13-15.5 15.4-24.9s1-21.1-7.8-25.8c-4.5-2.4-9.9-2.4-15.2.2-4.4 2.2-8.4 5.9-10.9 10.3-3.9 7-5.1 15.4-3.3 23.8 1.4 6.3 4.3 12 8.4 16.5-8.4 4.9-18.2 7.3-27.8 6.1-2.2-.3-4.2 1.2-4.5 3.4s1.2 4.2 3.4 4.5c2.1.3 4.1.4 6.2.4 10 0 20.1-3.1 29.1-9 6.1 3.7 13.5 5.4 21.1 4.7 8.5-.8 16.3-4.4 21.8-10.2 1.5-1.5 2.7-3.1 3.9-4.7 1.6-2.1 3.1-4 4.9-5.6 2.4-2 6-3.4 8.3-2.1 2.1 1.2 3.1 4.2 4.2 7.5.2.5.4 1.1.6 1.6 2.5 7 7.1 11.1 12.4 11.1h.6c3.6-.2 6.2-2.2 8.3-3.9 1.3-1 2.5-2 3.6-2.2 2-.5 4.5.8 7.2 2.1.5.3 1 .5 1.5.7 5.7 2.7 11.9 4 18.2 4 14.4 0 29-6.9 37.1-18.9 1.3-1.8.9-4.3-1-5.5zm-152.6 11.3c-8.1-8-10.4-21.8-4.8-31.7 2.5-4.5 7.5-8.2 12-8.2 1.2 0 2.3.3 3.4.8 5 2.7 5.5 10.6 3.9 16.8-2.2 8.7-7.5 16.5-14.5 22.3z" })] }) }) }) })
88
- // <svg
89
- // viewBox="0 0 24 24"
90
- // fill="currentColor"
91
- // height="1em"
92
- // width="1em"
93
- // {...props}
94
- // >
95
- // <path d="M22 22H2v-2h20v2M2.26 16.83L5.09 14l-2.83-2.83 1.41-1.41 2.83 2.83 2.83-2.83 1.41 1.41L7.91 14l2.83 2.83-1.41 1.41-2.83-2.83-2.83 2.83-1.41-1.41z" />
96
- // </svg>
97
- );
70
+ return (_jsx("svg", { height: "1em", viewBox: "0 0 450 450", width: "1em", fill: "currentColor", ...props, children: _jsx("g", { children: _jsx("g", { children: _jsxs("g", { clipRule: "evenodd", fill: "rgb(0,0,0)", fillRule: "evenodd", children: [_jsx("path", { d: "m366.6 67.8 1.1-4c.4-1.5.6-3 .6-4.5 0-8.1-5.5-15.2-13.3-17.3-9.5-2.5-19.3 3.2-21.8 12.8l-20.4 77.9 34.6 9z" }), _jsx("path", { d: "m234.9 198.9h148.6v35.7h-148.6z", transform: "matrix(.253 -.968 .968 .253 21.311 461.088)" }), _jsx("path", { d: "m292.8 316 8.4 2.2 4.5-17.3-34.6-9.1-4.5 17.4 8.3 2.2z" }), _jsx("path", { d: "m275.3 319.7-12.7 14.7 5.4 40.3 24.4-32.5-3.9-19.1zm6.5 23.3c-.8 2.9-3.7 4.6-6.6 3.9s-4.6-3.7-3.9-6.6 3.7-4.6 6.6-3.9 4.6 3.7 3.9 6.6z" }), _jsx("path", { d: "m395.6 71.5-20.3-5.5-2 7.7 16.5 4.4-24.8 95c-.6 2.1.7 4.3 2.8 4.8.3.1.7.1 1 .1 1.8 0 3.4-1.2 3.8-3l25.8-98.8c.6-2-.7-4.2-2.8-4.7z" }), _jsx("path", { d: "" }), _jsx("path", { d: "m243.4 379.8c-1.8-1.2-4.3-.8-5.5 1.1-9.6 14.1-29.9 19.6-45.3 12.2-.5-.2-.9-.5-1.4-.7-3.5-1.8-7.9-4-12.8-2.7-2.7.7-4.7 2.3-6.5 3.6-1.5 1.2-2.8 2.2-3.9 2.2-2 .1-4-3-5-5.9-.2-.5-.4-1-.5-1.5-1.4-4.1-3.1-9.1-7.8-11.8-5.8-3.3-12.9-.9-17.4 3-2.4 2-4.2 4.4-6 6.7-1.2 1.5-2.3 2.9-3.4 4.1-7.5 7.9-20.3 10-30.2 5.6 7.6-6.9 13-15.5 15.4-24.9s1-21.1-7.8-25.8c-4.5-2.4-9.9-2.4-15.2.2-4.4 2.2-8.4 5.9-10.9 10.3-3.9 7-5.1 15.4-3.3 23.8 1.4 6.3 4.3 12 8.4 16.5-8.4 4.9-18.2 7.3-27.8 6.1-2.2-.3-4.2 1.2-4.5 3.4s1.2 4.2 3.4 4.5c2.1.3 4.1.4 6.2.4 10 0 20.1-3.1 29.1-9 6.1 3.7 13.5 5.4 21.1 4.7 8.5-.8 16.3-4.4 21.8-10.2 1.5-1.5 2.7-3.1 3.9-4.7 1.6-2.1 3.1-4 4.9-5.6 2.4-2 6-3.4 8.3-2.1 2.1 1.2 3.1 4.2 4.2 7.5.2.5.4 1.1.6 1.6 2.5 7 7.1 11.1 12.4 11.1h.6c3.6-.2 6.2-2.2 8.3-3.9 1.3-1 2.5-2 3.6-2.2 2-.5 4.5.8 7.2 2.1.5.3 1 .5 1.5.7 5.7 2.7 11.9 4 18.2 4 14.4 0 29-6.9 37.1-18.9 1.3-1.8.9-4.3-1-5.5zm-152.6 11.3c-8.1-8-10.4-21.8-4.8-31.7 2.5-4.5 7.5-8.2 12-8.2 1.2 0 2.3.3 3.4.8 5 2.7 5.5 10.6 3.9 16.8-2.2 8.7-7.5 16.5-14.5 22.3z" })] }) }) }) }));
98
71
  }
@@ -99,7 +99,7 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
99
99
  let content = !uploadedFile ?
100
100
  _jsxs("div", { style: { display: 'flex', gap: 10, width: '100%', height: '100%' }, children: [_jsx(HiddenInput, { id: "fileInput", type: "file", onChange: handleInputChange }), _jsxs(UploadContainer, { ref: uploaderRef, tabIndex: 0, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, style: { backgroundColor: dragOver ? '#76b1e6' : 'white' }, onDoubleClick: browseHandler, "$isRequired": isRequired, children: [_jsxs("div", { style: { display: 'flex', gap: '10px', flexDirection: 'column', position: 'absolute', right: 5, top: 5 }, children: [_jsx(TMButton, { btnStyle: 'icon', caption: 'Sfoglia', color: isRequired && !uploadedFile ? 'error' : 'primary', onClick: browseHandler, icon: _jsx(IconFolderOpen, { fontSize: 22 }) }), showScannerIcon && isScannerLicenseConfigured() && onScanRequest && _jsx(TMButton, { btnStyle: 'icon', caption: 'Scanner', color: 'primary', onClick: () => { onScanRequest((file) => { onFileUpload?.(file); }); }, icon: _jsx(IconScanner, { fontSize: 22 }) }), showScannerIcon && isScannerLicenseConfigured() && !onScanRequest && _jsx(TMButton, { btnStyle: 'icon', caption: 'Scanner', color: 'primary', onClick: () => { ShowAlert({ message: SDKUI_Localizator.ScanFeatureUnavailableInThisContext, mode: 'info', duration: 3000, title: 'Scanner' }); }, icon: _jsx(IconScanner, { fontSize: 22 }) })] }), _jsx("p", { style: { fontSize: '1.2rem', fontWeight: 'bold' }, children: deviceType === DeviceType.MOBILE ? SDKUI_Localizator.ClickToBrowseFile : SDKUI_Localizator.DragOrDoubleClickToBrowseFile }), isRequired && _jsxs("p", { style: { fontWeight: 'bold' }, children: [" ", SDKUI_Localizator.RequiredField, " "] })] })] }) :
101
101
  _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 10, width: '100%', height: '100%' }, children: [_jsxs("div", { style: { backgroundColor: 'white', padding: '5px 10px', borderRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'space-between', color: TMColors.primaryColor }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 5 }, children: [_jsx("p", { children: "File name:" }), _jsxs("div", { style: { fontWeight: 'bold' }, children: [fileName, " ", _jsxs("span", { children: [" ", ` (${formatBytes(fileSize)})`, " "] })] })] }), uploadedFile && _jsx(TMButton, { btnStyle: 'icon', color: 'error', caption: 'Pulisci', onClick: () => clearFile(true), icon: _jsx(IconClear, { fontSize: 22 }) })] }), extensionHandler(fileExt) === FileExtensionHandler.READY_TO_SHOW ? _jsx(TMFileViewer, { fileBlob: uploadedFile, isResizingActive: isResizingActive }) :
102
- _jsx("div", { style: { backgroundColor: '#f6dbdb', padding: '5px 10px', borderRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'space-between', color: TMColors.error }, children: _jsxs("div", { children: [" ", 'Anteprima non disponibile.', fileExt && _jsx("b", { children: ` (*.${fileExt})` })] }) })] });
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] }));
104
104
  const toolbar = useMemo(() => {
105
105
  return (_jsxs(_Fragment, { children: [(isPdfEditorAvailable(fromDTD, fileExt) && openFileUploaderPdfEditor) && (_jsx(TMCommandsContextMenu, { target: "#TMPanel-FileUploader-Commands-Header", menuItems: [
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { HomeBlogPost, SearchResultDescriptor, TaskDescriptor } from '@topconsultnpm/sdk-ts';
3
3
  import { RelationTreeItem } from './TMRelationViewer';
4
+ import { IntesiCertificateData } from '../../../helper';
4
5
  import { DcmtInfo, TaskContext, MetadataValueDescriptorEx } from '../../../ts';
5
6
  import { DeviceContextProps } from '../../base/TMDeviceProvider';
6
7
  export type IRelatedDcmt = RelationTreeItem;
@@ -28,6 +29,7 @@ interface ITMMasterDetailDcmtsProps extends DeviceContextProps {
28
29
  openS4TViewer?: boolean;
29
30
  onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: (() => Promise<void>)) => void;
30
31
  onOpenPdfEditorRequest?: ((dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void);
32
+ fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>;
31
33
  datagridUtility?: {
32
34
  onRefreshSearchAsyncDatagrid?: () => Promise<void>;
33
35
  onRefreshDataRowsAsync?: (() => Promise<void>);
@@ -7,16 +7,19 @@ import { IconMultipleSelection, IconCheckFile, IconDetailDcmts, SDKUI_Localizato
7
7
  import { FormModes, SearchResultContext } from '../../../ts';
8
8
  import { TMColors } from '../../../utils/theme';
9
9
  import ShowAlert from '../../base/TMAlert';
10
- import { DeviceType } from '../../base/TMDeviceProvider';
10
+ import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
11
11
  import { TMSaveFormButtonPrevious, TMSaveFormButtonNext } from '../../forms/TMSaveForm';
12
12
  import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
13
13
  import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
14
14
  import TMSearchResult from '../search/TMSearchResult';
15
15
  import TMDcmtForm from './TMDcmtForm';
16
16
  import { TMNothingToShow } from './TMDcmtPreview';
17
- import { Spinner, TMButton } from '../..';
17
+ import { TMButton, TMLayoutWaitingContainer } from '../..';
18
18
  import { useDocumentOperations } from '../../../hooks/useDocumentOperations';
19
- const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, appendMasterDcmts, onTaskCreateRequest, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, datagridUtility, dcmtUtility, }) => {
19
+ import TMToppyMessage from '../../../helper/TMToppyMessage';
20
+ import TMPanel from '../../base/TMPanel';
21
+ import sixLogo from '../../../assets/six.png';
22
+ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, appendMasterDcmts, onTaskCreateRequest, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, datagridUtility, dcmtUtility, fetchRemoteCertificates }) => {
20
23
  const floatingBarContainerRef = useRef(null);
21
24
  const [focusedItem, setFocusedItem] = useState();
22
25
  const [selectedItems, setSelectedItems] = useState([]);
@@ -27,6 +30,12 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
27
30
  const [isCheckingFirstLoad, setIsCheckingFirstLoad] = useState(true);
28
31
  const [contextMenuVisible, setContextMenuVisible] = useState(false);
29
32
  const [contextMenuPosition, setContextMenuPosition] = useState({ x: 0, y: 0 });
33
+ // Track if TMRelationViewer is loading (used to disable context menu during loading)
34
+ const [isRelationViewerLoading, setIsRelationViewerLoading] = useState(false);
35
+ // Track if loading has ever been TRUE (to distinguish initial false from post-load false)
36
+ const hasLoadingBeenTrueRef = useRef(false);
37
+ // Track the previous loading state to detect transitions
38
+ const prevIsRelationViewerLoadingRef = useRef(false);
30
39
  const [dtdFocused, setDtdFocused] = useState();
31
40
  const [refreshKey, setRefreshKey] = useState(0);
32
41
  // Separate refresh key for TMFormOrResultWrapper only (doesn't affect tmTreeView)
@@ -35,6 +44,21 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
35
44
  const [focusedItemFormData, setFocusedItemFormData] = useState([]);
36
45
  // Trigger operationItems refresh (after file substitution, etc.)
37
46
  const [refreshOperationsTrigger, setRefreshOperationsTrigger] = useState(0);
47
+ // Safety net: when TMRelationViewer finishes loading (transition from TRUE to FALSE),
48
+ // hide the spinner regardless of whether a document was focused or not.
49
+ // This handles edge cases where no document gets isRoot=true.
50
+ useEffect(() => {
51
+ const prevLoading = prevIsRelationViewerLoadingRef.current;
52
+ prevIsRelationViewerLoadingRef.current = isRelationViewerLoading;
53
+ if (isRelationViewerLoading) {
54
+ // Loading started - mark that we've seen a true state
55
+ hasLoadingBeenTrueRef.current = true;
56
+ }
57
+ else if (prevLoading && hasLoadingBeenTrueRef.current && isCheckingFirstLoad) {
58
+ // Transition from TRUE to FALSE (loading completed) - hide spinner
59
+ setIsCheckingFirstLoad(false);
60
+ }
61
+ }, [isRelationViewerLoading, isCheckingFirstLoad]);
38
62
  // Increments trigger counter to force operationItems to re-calculate
39
63
  const onRefreshOperationsDatagrid = useCallback(async () => {
40
64
  setRefreshOperationsTrigger(prev => prev + 1);
@@ -145,6 +169,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
145
169
  currentSearchResults: [],
146
170
  currentMetadataValues: [],
147
171
  allUsers: [],
172
+ fetchRemoteCertificates,
148
173
  // searchResult: selectedSearchResult,
149
174
  datagridUtility: {
150
175
  visibleItems: [],
@@ -212,6 +237,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
212
237
  onRefreshAfterAddDcmtToFavs,
213
238
  },
214
239
  });
240
+ const { dcmtOperations: { abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, }, } = features;
215
241
  // Load dtdMaster when inputDcmts changes
216
242
  useEffect(() => {
217
243
  const loadDtdMaster = async () => {
@@ -252,6 +278,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
252
278
  useEffect(() => {
253
279
  if (noRelationsOnFirstLoad) {
254
280
  setNoRelationsOnFirstLoad(false);
281
+ setIsCheckingFirstLoad(false); // Hide spinner before navigating back
255
282
  ShowAlert({
256
283
  message: SDKUI_Localizator.RelatedDcmtsNotFound,
257
284
  title: SDKUI_Localizator.RelationsNotFound,
@@ -264,14 +291,14 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
264
291
  const commandsMenuItems = [
265
292
  {
266
293
  icon: _jsx(IconMultipleSelection, { color: allowMultipleSelection ? TMColors.tertiary : TMColors.text_normal }),
267
- name: "Selezione multipla",
294
+ name: allowMultipleSelection ? SDKUI_Localizator.DisableMultipleSelection : SDKUI_Localizator.EnableMultipleSelection,
268
295
  onClick: () => {
269
296
  setAllowMultipleSelection(prev => !prev);
270
297
  }
271
298
  },
272
299
  {
273
- icon: _jsx(IconCheckFile, {}),
274
- name: "Consenti dettagli con 0 documenti",
300
+ icon: _jsx(IconCheckFile, { color: showZeroDcmts ? TMColors.tertiary : TMColors.text_normal }),
301
+ name: showZeroDcmts ? SDKUI_Localizator.HideDetailsWithZeroDocs : SDKUI_Localizator.ShowDetailsWithZeroDocs,
275
302
  onClick: () => {
276
303
  setShowZeroDcmts(prev => !prev);
277
304
  }
@@ -293,17 +320,22 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
293
320
  _jsx(TMNothingToShow, { text: getTitle(), secondText: SDKUI_Localizator.NoDataToDisplay, icon: isForMaster ? _jsx(IconDetailDcmts, { fontSize: 96, transform: 'scale(-1, 1)' }) : _jsx(IconDetailDcmts, { fontSize: 96 }) })
294
321
  :
295
322
  _jsxs("div", { ref: floatingBarContainerRef, style: { width: "100%", height: "100%" }, onContextMenu: (e) => {
323
+ // Disable context menu when loading
324
+ if (isRelationViewerLoading) {
325
+ e.preventDefault();
326
+ return;
327
+ }
296
328
  // Mostra context menu anche sullo spazio bianco (quando non si clicca su un item)
297
329
  e.preventDefault();
298
330
  setContextMenuPosition({ x: e.clientX, y: e.clientY });
299
331
  setContextMenuVisible(true);
300
332
  }, children: [_jsx(TMRelationViewerWrapper, { refreshKey: refreshKey, inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, showZeroDcmts: showZeroDcmts,
301
333
  // customItemRender={customItemRender}
302
- allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged, onNoRelationsFound: handleNoRelationsFound, onItemContextMenu: onItemContextMenu, focusedItemFormData: focusedItemFormData }), _jsx(TMContextMenu, { items: operationItems, externalControl: {
334
+ allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged, onNoRelationsFound: handleNoRelationsFound, onItemContextMenu: isRelationViewerLoading ? undefined : onItemContextMenu, focusedItemFormData: focusedItemFormData, onLoadingStateChanged: setIsRelationViewerLoading }), _jsx(TMContextMenu, { items: operationItems, externalControl: {
303
335
  visible: contextMenuVisible,
304
336
  position: contextMenuPosition,
305
337
  onClose: () => setContextMenuVisible(false)
306
- } })] }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged, handleNoRelationsFound, onItemContextMenu, contextMenuVisible, contextMenuPosition, refreshKey, focusedItemFormData]);
338
+ } })] }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged, handleNoRelationsFound, onItemContextMenu, contextMenuVisible, contextMenuPosition, refreshKey, focusedItemFormData, isRelationViewerLoading]);
307
339
  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]);
308
340
  const initialPanelDimensions = {
309
341
  'tmTreeView': { width: '50%', height: '100%' },
@@ -381,7 +413,10 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
381
413
  toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: false, orderNumber: 2, isActive: allInitialPanelVisibility['tmFormOrResult'] }
382
414
  }
383
415
  ], [tmTreeView, tmFormOrResult, focusedItem?.isDcmt, dtdMaster]);
384
- return (_jsxs("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: [isCheckingFirstLoad && (_jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: true })), _jsxs("div", { style: isCheckingFirstLoad ? { position: 'absolute', width: 0, height: 0, overflow: 'hidden', opacity: 0, pointerEvents: 'none' } : { width: '100%', height: '100%' }, children: [_jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }), renderDcmtOperations, renderFloatingBar] })] }));
416
+ return (_jsxs("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: [isCheckingFirstLoad && (_jsx(TMLoadingOverlay, { onCancel: () => {
417
+ setIsCheckingFirstLoad(false);
418
+ onBack?.();
419
+ } })), _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] })] }));
385
420
  };
386
421
  export default TMMasterDetailDcmts;
387
422
  /**
@@ -390,8 +425,37 @@ export default TMMasterDetailDcmts;
390
425
  * - Panel visibility toggling
391
426
  * - Focus delay handling
392
427
  */
393
- const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu, focusedItemFormData }) => {
428
+ const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu, focusedItemFormData, onLoadingStateChanged }) => {
394
429
  const { setPanelVisibilityById, setToolbarButtonVisibility } = useTMPanelManagerContext();
430
+ // Monitor device type changes to restore panel visibility when switching from mobile to desktop
431
+ const deviceType = useDeviceType();
432
+ const prevDeviceTypeRef = useRef(deviceType);
433
+ // Restore panel visibility when switching from mobile to desktop
434
+ useEffect(() => {
435
+ const prevDeviceType = prevDeviceTypeRef.current;
436
+ prevDeviceTypeRef.current = deviceType;
437
+ // When switching from mobile to desktop, restore panel visibility based on current focused item
438
+ if (prevDeviceType === DeviceType.MOBILE && deviceType !== DeviceType.MOBILE) {
439
+ // Small delay to let the panel manager complete its internal state update
440
+ setTimeout(() => {
441
+ // Force tmFormOrResult panel to be visible
442
+ setPanelVisibilityById('tmFormOrResult', true);
443
+ // Restore child panel visibility based on focused item
444
+ if (focusedItem?.isDcmt) {
445
+ setPanelVisibilityById('tmSearchResult', false);
446
+ setPanelVisibilityById('tmDcmtForm', true);
447
+ setToolbarButtonVisibility('tmSearchResult', false);
448
+ setToolbarButtonVisibility('tmDcmtForm', true);
449
+ }
450
+ else {
451
+ setPanelVisibilityById('tmSearchResult', true);
452
+ setPanelVisibilityById('tmDcmtForm', false);
453
+ setToolbarButtonVisibility('tmSearchResult', true);
454
+ setToolbarButtonVisibility('tmDcmtForm', false);
455
+ }
456
+ }, 50);
457
+ }
458
+ }, [deviceType, focusedItem, setPanelVisibilityById, setToolbarButtonVisibility]);
395
459
  // Handle focused item changes with panel visibility management
396
460
  const handleFocusedItemChanged = useCallback((item) => {
397
461
  onFocusedItemChanged?.(item);
@@ -421,13 +485,104 @@ const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurr
421
485
  onItemContextMenu?.(item, e);
422
486
  }, 100);
423
487
  }, [onItemContextMenu, handleFocusedItemChanged]);
424
- 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 }, refreshKey));
488
+ 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 }, refreshKey));
425
489
  };
426
- const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid, onRefreshSearchResults, handleNavigateToReference }) => {
490
+ const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid, onRefreshSearchResults, handleNavigateToReference, fetchRemoteCertificates }) => {
427
491
  const { setPanelVisibilityById } = useTMPanelManagerContext();
428
492
  return (_jsx(_Fragment, { children: focusedItem?.isDcmt ?
429
493
  _jsx(TMDcmtForm, { groupId: 'tmFormOrResult', TID: focusedItem?.tid, DID: focusedItem.did, allowButtonsRefs: true, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: false, onClose: () => { setPanelVisibilityById('tmTreeView', true); }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.tid, focusedItem?.did), openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, datagridUtility: {
430
494
  onRefreshSearchAsyncDatagrid,
431
- } }, refreshKey) :
432
- _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 }, refreshKey) }));
495
+ }, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey) :
496
+ 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)) }));
497
+ };
498
+ const TMLoadingOverlay = ({ onCancel, description, cancelText }) => {
499
+ return (_jsx("div", { style: {
500
+ position: 'absolute',
501
+ top: 0,
502
+ left: 0,
503
+ width: '100%',
504
+ height: '100%',
505
+ backgroundColor: 'rgba(248, 250, 252, 0.92)',
506
+ zIndex: 1000,
507
+ display: 'flex',
508
+ justifyContent: 'center',
509
+ alignItems: 'center',
510
+ }, children: _jsxs("div", { style: {
511
+ display: 'flex',
512
+ flexDirection: 'column',
513
+ alignItems: 'center',
514
+ gap: '16px',
515
+ padding: '24px 32px',
516
+ background: '#fcfcfc',
517
+ borderRadius: '8px',
518
+ boxShadow: '0 4px 16px rgba(0, 0, 0, 0.1)',
519
+ }, children: [_jsxs("div", { style: { position: 'relative', width: '80px', height: '80px' }, children: [_jsx("img", { style: {
520
+ position: 'absolute',
521
+ top: '50%',
522
+ left: '50%',
523
+ transform: 'translate(-54%, -54%)'
524
+ }, src: sixLogo, width: 35, alt: "" }), _jsx("style", { children: `
525
+ @keyframes tmSpinnerRotate {
526
+ 0% { transform: rotate(0deg); }
527
+ 100% { transform: rotate(360deg); }
528
+ }
529
+ .tm-spinner-animation {
530
+ display: inline-block;
531
+ width: 80px;
532
+ height: 80px;
533
+ position: absolute;
534
+ top: 50%;
535
+ left: 50%;
536
+ transform: translate(-50%, -50%);
537
+ }
538
+ .tm-spinner-animation div {
539
+ animation: tmSpinnerRotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
540
+ transform-origin: 40px 40px;
541
+ }
542
+ .tm-spinner-animation div:after {
543
+ content: " ";
544
+ display: block;
545
+ position: absolute;
546
+ width: 7px;
547
+ height: 7px;
548
+ border-radius: 50%;
549
+ background: #0c448e;
550
+ margin: -4px 0 0 -4px;
551
+ }
552
+ .tm-spinner-animation div:nth-child(1) { animation-delay: -0.036s; }
553
+ .tm-spinner-animation div:nth-child(1):after { top: 63px; left: 63px; background: #f7a51f; }
554
+ .tm-spinner-animation div:nth-child(2) { animation-delay: -0.072s; }
555
+ .tm-spinner-animation div:nth-child(2):after { top: 68px; left: 56px; background: #f7a51f; }
556
+ .tm-spinner-animation div:nth-child(3) { animation-delay: -0.108s; }
557
+ .tm-spinner-animation div:nth-child(3):after { top: 71px; left: 48px; background: #d3237b; }
558
+ .tm-spinner-animation div:nth-child(4) { animation-delay: -0.144s; }
559
+ .tm-spinner-animation div:nth-child(4):after { top: 72px; left: 40px; background: #d3237b; }
560
+ .tm-spinner-animation div:nth-child(5) { animation-delay: -0.18s; }
561
+ .tm-spinner-animation div:nth-child(5):after { top: 71px; left: 32px; background: #d12a1c; }
562
+ .tm-spinner-animation div:nth-child(6) { animation-delay: -0.216s; }
563
+ .tm-spinner-animation div:nth-child(6):after { top: 68px; left: 24px; background: #d12a1c; }
564
+ .tm-spinner-animation div:nth-child(7) { animation-delay: -0.252s; }
565
+ .tm-spinner-animation div:nth-child(7):after { top: 63px; left: 17px; background: #782b7d; }
566
+ .tm-spinner-animation div:nth-child(8) { animation-delay: -0.288s; }
567
+ .tm-spinner-animation div:nth-child(8):after { top: 56px; left: 12px; background: #782b7d; }
568
+ ` }), _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 }), onCancel && (_jsx("button", { onClick: onCancel, style: {
569
+ marginTop: '4px',
570
+ padding: '8px 24px',
571
+ fontSize: '13px',
572
+ fontWeight: 500,
573
+ color: '#64748b',
574
+ background: 'transparent',
575
+ border: '1.5px solid #cbd5e1',
576
+ borderRadius: '6px',
577
+ cursor: 'pointer',
578
+ transition: 'all 0.2s ease',
579
+ }, onMouseEnter: (e) => {
580
+ e.currentTarget.style.background = '#f1f5f9';
581
+ e.currentTarget.style.borderColor = '#94a3b8';
582
+ e.currentTarget.style.color = '#475569';
583
+ }, onMouseLeave: (e) => {
584
+ e.currentTarget.style.background = 'transparent';
585
+ e.currentTarget.style.borderColor = '#cbd5e1';
586
+ e.currentTarget.style.color = '#64748b';
587
+ }, children: cancelText ?? SDKUI_Localizator.Cancel }))] }) }));
433
588
  };
@@ -5,6 +5,7 @@ import { TMCopyToFolderMode } from '../../../hooks/useDocumentOperations';
5
5
  interface ITMMergeToPdfFormProps {
6
6
  mode: TMCopyToFolderMode;
7
7
  selectedDcmtInfos: Array<DcmtInfo>;
8
+ selectedItemsFull: Array<any>;
8
9
  onClose: () => void;
9
10
  showTMRelationViewer: boolean;
10
11
  allTasks?: Array<TaskDescriptor>;
@@ -20,5 +21,5 @@ interface ITMMergeToPdfFormProps {
20
21
  * Condivide TMDownloadRelationViewerSection e gli helper in copyAndMergeDcmtsShared
21
22
  * con TMCopyToFolderForm.
22
23
  */
23
- declare const TMMergeToPdfForm: React.FC<ITMMergeToPdfFormProps>;
24
+ declare const TMMergeToPdfForm: (props: ITMMergeToPdfFormProps) => React.JSX.Element;
24
25
  export default TMMergeToPdfForm;