@topconsultnpm/sdkui-react 6.21.0-dev2.6 → 6.21.0-dev2.60

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 (82) hide show
  1. package/lib/components/base/TMAccordionNew.js +1 -0
  2. package/lib/components/base/TMAreaManager.js +19 -3
  3. package/lib/components/base/TMDataGrid.js +2 -2
  4. package/lib/components/base/TMModal.d.ts +1 -0
  5. package/lib/components/base/TMModal.js +2 -2
  6. package/lib/components/base/TMPanel.d.ts +7 -4
  7. package/lib/components/base/TMPanel.js +58 -26
  8. package/lib/components/base/TMTreeView.js +12 -2
  9. package/lib/components/base/TMWaitPanel.js +7 -4
  10. package/lib/components/choosers/TMDistinctValues.js +35 -21
  11. package/lib/components/choosers/TMUserChooser.d.ts +4 -0
  12. package/lib/components/choosers/TMUserChooser.js +7 -5
  13. package/lib/components/editors/TMFormulaEditor.d.ts +2 -0
  14. package/lib/components/editors/TMFormulaEditor.js +75 -21
  15. package/lib/components/editors/TMMetadataValues.js +2 -1
  16. package/lib/components/editors/TMRadioButton.js +7 -5
  17. package/lib/components/editors/TMTextBox.d.ts +2 -0
  18. package/lib/components/editors/TMTextBox.js +3 -3
  19. package/lib/components/features/archive/TMArchive.js +1 -1
  20. package/lib/components/features/documents/TMCopyToFolderForm.d.ts +24 -0
  21. package/lib/components/features/documents/TMCopyToFolderForm.js +379 -0
  22. package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
  23. package/lib/components/features/documents/TMDcmtForm.js +107 -29
  24. package/lib/components/features/documents/TMDcmtFormActionButtons.js +17 -2
  25. package/lib/components/features/documents/TMDcmtPreview.d.ts +1 -0
  26. package/lib/components/features/documents/TMDcmtPreview.js +2 -2
  27. package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -0
  28. package/lib/components/features/documents/TMDcmtTasks.js +2 -2
  29. package/lib/components/features/documents/TMDownloadRelationViewerSection.d.ts +23 -0
  30. package/lib/components/features/documents/TMDownloadRelationViewerSection.js +173 -0
  31. package/lib/components/features/documents/TMFileUploader.js +1 -1
  32. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +4 -0
  33. package/lib/components/features/documents/TMMasterDetailDcmts.js +29 -9
  34. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +26 -0
  35. package/lib/components/features/documents/TMMergeToPdfForm.js +293 -0
  36. package/lib/components/features/documents/TMRelationViewer.d.ts +13 -0
  37. package/lib/components/features/documents/TMRelationViewer.js +75 -6
  38. package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +71 -0
  39. package/lib/components/features/documents/copyAndMergeDcmtsShared.js +304 -0
  40. package/lib/components/features/search/SignatureParamsManager.d.ts +70 -0
  41. package/lib/components/features/search/SignatureParamsManager.js +145 -0
  42. package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
  43. package/lib/components/features/search/TMSavedQuerySelector.js +3 -2
  44. package/lib/components/features/search/TMSearch.d.ts +6 -1
  45. package/lib/components/features/search/TMSearch.js +16 -10
  46. package/lib/components/features/search/TMSearchQueryPanel.js +1 -1
  47. package/lib/components/features/search/TMSearchResult.d.ts +4 -0
  48. package/lib/components/features/search/TMSearchResult.js +118 -22
  49. package/lib/components/features/workflow/diagram/queryDescriptorParser.js +3 -6
  50. package/lib/components/forms/Login/TMLoginForm.d.ts +9 -0
  51. package/lib/components/forms/Login/TMLoginForm.js +61 -0
  52. package/lib/components/forms/TMResultDialog.d.ts +1 -1
  53. package/lib/components/forms/TMResultDialog.js +4 -2
  54. package/lib/components/grids/TMBlogAttachments.d.ts +1 -0
  55. package/lib/components/grids/TMBlogAttachments.js +38 -12
  56. package/lib/components/grids/TMBlogsPost.js +7 -1
  57. package/lib/components/grids/TMBlogsPostUtils.js +11 -17
  58. package/lib/components/index.d.ts +1 -0
  59. package/lib/components/index.js +1 -0
  60. package/lib/components/pages/TMPage.js +3 -1
  61. package/lib/components/query/TMQueryEditor.js +1 -1
  62. package/lib/components/viewers/TMTidViewer.js +1 -1
  63. package/lib/helper/SDKUI_Globals.d.ts +15 -0
  64. package/lib/helper/SDKUI_Globals.js +15 -1
  65. package/lib/helper/SDKUI_Localizator.d.ts +106 -2
  66. package/lib/helper/SDKUI_Localizator.js +1060 -12
  67. package/lib/helper/TMPdfViewer.js +25 -24
  68. package/lib/helper/TMUtils.d.ts +20 -0
  69. package/lib/helper/TMUtils.js +17 -0
  70. package/lib/helper/ZipManager.d.ts +56 -0
  71. package/lib/helper/ZipManager.js +127 -0
  72. package/lib/helper/index.d.ts +1 -0
  73. package/lib/helper/index.js +1 -0
  74. package/lib/hooks/useDataUserIdItem.js +6 -4
  75. package/lib/hooks/useDcmtOperations.d.ts +9 -2
  76. package/lib/hooks/useDcmtOperations.js +77 -34
  77. package/lib/hooks/useDocumentOperations.d.ts +5 -0
  78. package/lib/hooks/useDocumentOperations.js +238 -27
  79. package/lib/hooks/useForm.js +5 -2
  80. package/lib/hooks/useResizeObserver.d.ts +1 -1
  81. package/lib/hooks/useResizeObserver.js +16 -15
  82. package/package.json +3 -2
@@ -1,10 +1,10 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { SDK_Globals } from "@topconsultnpm/sdk-ts";
3
3
  import { getAttachmentInfo, lightenColor, removeFileExtension } from "./TMBlogsPostUtils";
4
4
  import TMDcmtIcon from "../features/documents/TMDcmtIcon";
5
5
  import { IconAttachment } from "../../helper";
6
6
  const TMBlogAttachments = (props) => {
7
- const { layoutMode, attachments, isSelected, searchText, dcmtTypeDescriptors, treeFs, draftLatestInfoMap, archivedDocumentMap, handleAttachmentFocus, openDcmtForm } = props;
7
+ const { layoutMode, attachments, isSelected, isLoading = false, searchText, dcmtTypeDescriptors, treeFs, draftLatestInfoMap, archivedDocumentMap, handleAttachmentFocus, openDcmtForm } = props;
8
8
  const handleMouseEnter = (e, blogPostAttachment, name, fileExt) => {
9
9
  e.currentTarget.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.15)';
10
10
  e.currentTarget.style.backgroundColor = isSelected ? lightenColor("#135596", 40) : '#cfcfcf';
@@ -24,7 +24,7 @@ const TMBlogAttachments = (props) => {
24
24
  };
25
25
  return _jsx("div", { style: { width: "100%", marginTop: "5px", overflow: "hidden" }, children: attachments.map((blogPostAttachment, index) => {
26
26
  const { name, nameElement, tooltipContent, fileExt, archivedDocumentsExist, draftExist } = getAttachmentInfo(blogPostAttachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText);
27
- return _jsx("div", { onDoubleClick: (e) => onDoubleClick(e, blogPostAttachment, name, fileExt), onMouseEnter: (e) => handleMouseEnter(e, blogPostAttachment, name, fileExt), onMouseLeave: (e) => handleMouseLeave(e), style: {
27
+ return _jsx("div", { onDoubleClick: (e) => !isLoading && onDoubleClick(e, blogPostAttachment, name, fileExt), onMouseEnter: (e) => !isLoading && handleMouseEnter(e, blogPostAttachment, name, fileExt), onMouseLeave: (e) => !isLoading && handleMouseLeave(e), style: {
28
28
  display: layoutMode === "extended" ? "inline-flex" : "flex",
29
29
  padding: '4px 8px',
30
30
  margin: '4px',
@@ -32,17 +32,43 @@ const TMBlogAttachments = (props) => {
32
32
  borderRadius: '8px',
33
33
  boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)',
34
34
  backgroundColor: isSelected ? "#135596" : "#ffffff",
35
- cursor: "pointer",
35
+ cursor: isLoading ? "default" : "pointer",
36
36
  fontSize: '0.9rem',
37
37
  color: isSelected ? "#ffffff" : "#000000",
38
- }, children: _jsxs("div", { style: { alignItems: 'center', display: 'flex', minWidth: 0 }, children: [(!archivedDocumentsExist && !draftExist) ?
39
- _jsx(IconAttachment, { style: { marginRight: "5px", flexShrink: 0 } }) :
40
- _jsx("div", { style: { marginRight: "10px", flexShrink: 0 }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }) }), _jsx("span", { title: layoutMode === 'compact' ? name + " (DID: " + blogPostAttachment.did + ")" : undefined, style: {
41
- whiteSpace: 'nowrap',
42
- overflow: 'hidden',
43
- textOverflow: 'ellipsis',
44
- minWidth: 0,
45
- }, children: nameElement })] }) }, blogPostAttachment.did + "_" + index);
38
+ }, children: _jsx("div", { style: { alignItems: 'center', display: 'flex', minWidth: 0 }, children: isLoading ? (_jsxs(_Fragment, { children: [_jsx("div", { style: {
39
+ width: '16px',
40
+ height: '16px',
41
+ marginRight: '8px',
42
+ border: '2px solid #ddd',
43
+ borderTop: `2px solid ${isSelected ? '#fff' : '#135596'}`,
44
+ borderRadius: '50%',
45
+ animation: 'spin 1s linear infinite',
46
+ flexShrink: 0,
47
+ } }), _jsx("span", { style: {
48
+ background: isSelected ? 'rgba(255,255,255,0.3)' : 'linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%)',
49
+ backgroundSize: '200% 100%',
50
+ animation: 'shimmer 1.5s infinite',
51
+ borderRadius: '4px',
52
+ width: '120px',
53
+ height: '14px',
54
+ display: 'inline-block',
55
+ } }), _jsx("style", { children: `
56
+ @keyframes spin {
57
+ 0% { transform: rotate(0deg); }
58
+ 100% { transform: rotate(360deg); }
59
+ }
60
+ @keyframes shimmer {
61
+ 0% { background-position: -200% 0; }
62
+ 100% { background-position: 200% 0; }
63
+ }
64
+ ` })] })) : (_jsxs(_Fragment, { children: [(!archivedDocumentsExist && !draftExist) ?
65
+ _jsx(IconAttachment, { style: { marginRight: "5px", flexShrink: 0 } }) :
66
+ _jsx("div", { style: { marginRight: "10px", flexShrink: 0 }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }) }), _jsx("span", { title: layoutMode === 'compact' ? name + " (DID: " + blogPostAttachment.did + ")" : undefined, style: {
67
+ whiteSpace: 'nowrap',
68
+ overflow: 'hidden',
69
+ textOverflow: 'ellipsis',
70
+ minWidth: 0,
71
+ }, children: nameElement })] })) }) }, blogPostAttachment.did + "_" + index);
46
72
  }) });
47
73
  };
48
74
  export default TMBlogAttachments;
@@ -48,6 +48,7 @@ const TMBlogsPost = (props) => {
48
48
  const [firstUnreadPost, setFirstUnreadPost] = useState(undefined);
49
49
  // State to manage the focused file
50
50
  const [dcmtTypeDescriptors, setDcmtTypeDescriptors] = useState(new Map());
51
+ const [descriptorsLoaded, setDescriptorsLoaded] = useState(false);
51
52
  const [currentHeader, setCurrentHeader] = useState(header);
52
53
  const [isHeaderHidden, setIsHeaderHidden] = useState(isHeaderFullyHidden(currentHeader));
53
54
  const [localShowId, setLocalShowId] = useState(false);
@@ -147,8 +148,13 @@ const TMBlogsPost = (props) => {
147
148
  useEffect(() => {
148
149
  (async () => {
149
150
  if (showExtendedAttachments) {
151
+ setDescriptorsLoaded(false);
150
152
  const descriptors = await getDcmtTypeDescriptor(posts);
151
153
  setDcmtTypeDescriptors(descriptors);
154
+ setDescriptorsLoaded(true);
155
+ }
156
+ else {
157
+ setDescriptorsLoaded(true);
152
158
  }
153
159
  const publishedBlogssLength = posts.filter(newsFeed => newsFeed.isSys !== 1 && newsFeed.isDel !== 1).length;
154
160
  const systemBlogsLength = posts.filter(newsFeed => newsFeed.isSys === 1).length;
@@ -679,7 +685,7 @@ const TMBlogsPost = (props) => {
679
685
  textDecoration: blogPost.isDel ? 'line-through' : 'none',
680
686
  boxShadow: isFocused ? "0 4px 12px rgba(19, 85, 150, 0.6)" : "none",
681
687
  cursor: 'pointer',
682
- }, children: [_jsx(BlogPostTitle, { displayMode: displayMode, layoutMode: layoutMode, blogPost: blogPost, isSelected: isSelected, isOwnComment: isOwnComment, searchText: searchText, isSys: isSys, isHomeBlogPost: isHomeBlogPost, showId: localShowId, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), isNew && _jsx(NewBadge, { layoutMode: layoutMode }), _jsx("div", { style: { fontSize: '1rem', color: "#000", marginTop: "10px", overflow: "hidden" }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0 && (_jsx(TMBlogAttachments, { attachments: blogPost.attachments, layoutMode: layoutMode, isSelected: isSelected, searchText: searchText, dcmtTypeDescriptors: dcmtTypeDescriptors, treeFs: treeFs, draftLatestInfoMap: draftLatestInfoMap, archivedDocumentMap: archivedDocumentMap, handleAttachmentFocus: handleFocusedAttachment, openDcmtForm: openDcmtForm }))] }, `${id}-blogpost-${blogPost.id}`) })] }, "blog-post-wrapper-" + id + "-" + blogPost.id);
688
+ }, children: [_jsx(BlogPostTitle, { displayMode: displayMode, layoutMode: layoutMode, blogPost: blogPost, isSelected: isSelected, isOwnComment: isOwnComment, searchText: searchText, isSys: isSys, isHomeBlogPost: isHomeBlogPost, showId: localShowId, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), isNew && _jsx(NewBadge, { layoutMode: layoutMode }), _jsx("div", { style: { fontSize: '1rem', color: "#000", marginTop: "10px", overflow: "hidden" }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0 && (_jsx(TMBlogAttachments, { attachments: blogPost.attachments, layoutMode: layoutMode, isSelected: isSelected, isLoading: !descriptorsLoaded, searchText: searchText, dcmtTypeDescriptors: dcmtTypeDescriptors, treeFs: treeFs, draftLatestInfoMap: draftLatestInfoMap, archivedDocumentMap: archivedDocumentMap, handleAttachmentFocus: handleFocusedAttachment, openDcmtForm: openDcmtForm }))] }, `${id}-blogpost-${blogPost.id}`) })] }, "blog-post-wrapper-" + id + "-" + blogPost.id);
683
689
  }), _jsx("div", { ref: bottomRef })] }), _jsx(TMContextMenu, { items: menuItems, target: `#${id}-blogs-wrapper`, externalControl: {
684
690
  visible: menuVisible,
685
691
  position: menuPosition,
@@ -142,27 +142,21 @@ export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archiv
142
142
  return { name, nameElement, tooltipContent, folderId, fileExt, draftExist, archivedDocumentsExist };
143
143
  };
144
144
  export const getDcmtTypeDescriptor = async (blogPosts) => {
145
- // Create a Map to store tid as key and DcmtTypeDescriptor as value
146
145
  const dcmtTypeMap = new Map();
147
- // Collect unique tids first to avoid duplicate HTTP calls
148
- const uniqueTids = new Set();
149
- for (const blogPost of blogPosts) {
150
- if (blogPost.attachments) {
151
- for (const attachment of blogPost.attachments) {
152
- if (attachment.tid) {
153
- uniqueTids.add(attachment.tid);
154
- }
155
- }
146
+ // Collect unique tid-did pairs to avoid duplicate HTTP calls
147
+ const tidDidMap = new Map();
148
+ for (const { tid, did } of blogPosts.flatMap(bp => bp.attachments ?? [])) {
149
+ if (tid !== undefined && !tidDidMap.has(tid)) {
150
+ tidDidMap.set(tid, did);
156
151
  }
157
152
  }
158
- // Fetch all descriptors in parallel instead of sequentially
159
- const promises = Array.from(uniqueTids).map(async (tid) => {
160
- const dcmtTypeDescriptor = await DcmtTypeListCacheService.GetAsync(tid, true);
161
- if (dcmtTypeDescriptor) {
162
- dcmtTypeMap.set(tid, dcmtTypeDescriptor);
153
+ // Fetch all descriptors in parallel
154
+ await Promise.all(Array.from(tidDidMap.entries()).map(async ([tid, did]) => {
155
+ const descriptor = await DcmtTypeListCacheService.GetWithNotGrantedAsync(tid, did);
156
+ if (descriptor) {
157
+ dcmtTypeMap.set(tid, descriptor);
163
158
  }
164
- });
165
- await Promise.all(promises);
159
+ }));
166
160
  return dcmtTypeMap;
167
161
  };
168
162
  export const BlogPostHomeHeader = (header, classId, isSelected, searchText, headerClickCallback) => {
@@ -71,6 +71,7 @@ export * from './features/documents/TMRelationViewer';
71
71
  export * from './features/archive/TMArchive';
72
72
  export * from './features/search/TMSearch';
73
73
  export * from './features/search/TMSearchResult';
74
+ export * from './features/search/SignatureParamsManager';
74
75
  export { default as TMTaskForm } from './features/tasks/TMTaskForm';
75
76
  export { default as TMTasksAgenda } from './features/tasks/TMTasksAgenda';
76
77
  export { default as TMTasksCalendar } from './features/tasks/TMTasksCalendar';
@@ -81,6 +81,7 @@ export * from './features/archive/TMArchive';
81
81
  //search
82
82
  export * from './features/search/TMSearch';
83
83
  export * from './features/search/TMSearchResult';
84
+ export * from './features/search/SignatureParamsManager';
84
85
  // tasks
85
86
  export { default as TMTaskForm } from './features/tasks/TMTaskForm';
86
87
  export { default as TMTasksAgenda } from './features/tasks/TMTasksAgenda';
@@ -188,8 +188,10 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
188
188
  onStatusChanged: (isModified) => { setSelectionListDisabled((formMode == FormModes.Create || formMode == FormModes.Duplicate) ? true : isModified); },
189
189
  onSaved: async (newItem) => {
190
190
  try {
191
+ console.log('Saved item', newItem);
191
192
  const currentItems = items.map((job) => job);
192
193
  const index = currentItems.findIndex((o) => o.id == newItem.id);
194
+ console.log('index', index);
193
195
  if (index >= 0)
194
196
  currentItems[index] = newItem;
195
197
  else
@@ -221,6 +223,6 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
221
223
  _jsx(TMLayoutItem, { children: selectedItems.length == 1 || formMode == FormModes.Create || formMode == FormModes.Duplicate ?
222
224
  _jsx(TMToolbarCard, { onBack: deviceType === DeviceType.MOBILE ? () => setShowList(true) : undefined, title: calcSaveFormTitle(objName, formMode, selectedItems.length == 0 ? -1 : selectedItems[0].id, detailTitlePathKeys), children: getDetailFormWithProps() })
223
225
  :
224
- _jsx(MultipleSelectionManager, {}) })] }) }));
226
+ selectedItems.length > 0 ? _jsx(MultipleSelectionManager, {}) : _jsx(_Fragment, {}) })] }) }));
225
227
  };
226
228
  export default TMPage;
@@ -733,7 +733,7 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
733
733
  }
734
734
  };
735
735
  // #endregion
736
- return (_jsxs(_Fragment, { children: [_jsxs(TMApplyForm, { isModal: false, formMode: formMode, isModified: calcIsModified(formData, formDataOrig), exception: exception, validationItems: validationItems, hasNavigation: false, customToolbarElements: _jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Search, color: 'tertiary', icon: _jsx(IconSearch, {}), disabled: errorsCount > 0, onClick: async () => await onSearchAsync(formData) }), _jsx(TMQueryCountButton, { qd: { ...formData }, lastparams: lastQdParams, onLastQueryParamsChanged: (params) => { setLastQdParams(params); }, disabled: errorsCount > 0, showSpinner: true }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: "Passa ad archiviazione", icon: _jsx(IconArchiveDoc, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Passa ad archiviazione", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: "Vai a risultato", icon: _jsx(IconArrowRight, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Vai a risultato", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } })] }), showToolbar: showToolbar, showApply: showApply, showUndo: showUndo, showBack: showBack, onApply: () => applyData(), onClose: () => onClose?.(), onUndo: () => setFormData(formDataOrig), children: [_jsxs(Accordion, { elementAttr: { class: 'tm-query-dx-accordion' }, height: height, multiple: true, collapsible: true, repaintChangesOnly: true, deferRendering: false, animationDuration: 0, onContentReady: (e) => {
736
+ return (_jsxs(_Fragment, { children: [_jsxs(TMApplyForm, { isModal: false, formMode: formMode, isModified: calcIsModified(formData, formDataOrig), exception: exception, validationItems: validationItems, hasNavigation: false, customToolbarElements: _jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Search, color: 'tertiary', icon: _jsx(IconSearch, {}), disabled: errorsCount > 0, onClick: async () => await onSearchAsync(formData) }), _jsx(TMQueryCountButton, { qd: { ...formData }, lastparams: lastQdParams, onLastQueryParamsChanged: (params) => { setLastQdParams(params); }, disabled: errorsCount > 0, showSpinner: true }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: SDKUI_Localizator.PassToArchive, icon: _jsx(IconArchiveDoc, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Passa ad archiviazione", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: "Vai a risultato", icon: _jsx(IconArrowRight, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Vai a risultato", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } })] }), showToolbar: showToolbar, showApply: showApply, showUndo: showUndo, showBack: showBack, onApply: () => applyData(), onClose: () => onClose?.(), onUndo: () => setFormData(formDataOrig), children: [_jsxs(Accordion, { elementAttr: { class: 'tm-query-dx-accordion' }, height: height, multiple: true, collapsible: true, repaintChangesOnly: true, deferRendering: false, animationDuration: 0, onContentReady: (e) => {
737
737
  let items = e.component.option("items");
738
738
  if (items && items.length > 0) {
739
739
  for (let i = 0; i < items.length; i++) {
@@ -332,7 +332,7 @@ export const renderDTDTooltipContent = (dtd) => {
332
332
  : _jsxs(StyledTooltipContainer, { children: [_jsx(StyledTooltipItem, { children: `${SDK_Globals.useLocalizedName ? dtd.nameLoc : dtd.name} (${dtd.isView ? 'VID' : 'TID'}: ${dtd.id}, RootTID: ${dtd.rootTID ?? 0})` }), dtd.description && _jsx(StyledTooltipItem, { children: dtd.description }), _jsx(StyledTooltipSeparatorItem, {}), dtd.customData2 === "NOTGRANTED"
333
333
  ? _jsx(StyledTooltipItem, { style: { fontWeight: 600 }, children: 'Tipo documento NON autorizzato' })
334
334
  :
335
- _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ArchiveConstraint}: ${LocalizeArchiveConstraints(dtd.archiveConstraint)}` }), dtd.isView && dtd.parametricFilterType != ParametricFilterTypes.None && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ParametricFilter}: ${LocalizeParametricFilterTypes(dtd.parametricFilterType)}` }), dtd.isView && dtd.withCheckOption && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ViewWithCheckOption}: ${SDKUI_Localizator.Yes}` }), dtd.isLexProt && dtd.isLexProt > 0 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes}` }), dtd.isFreeSearchable && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Free}: ${SDKUI_Localizator.Yes}` }), dtd.templateTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Template}: ${dtd.templateTID}` }), dtd.traceTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Tracing}: ${SDKUI_Localizator.Yes} - ${dtd.templateTID == TemplateTIDs.Trace_DcmtType ? SDKUI_Localizator.Destination : SDKUI_Localizator.Source} ${dtd.traceTID < 0 ? SDKUI_Localizator.Disabled : ''}` }), dtd.wfAppr && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.WorkflowApproval}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.BlogCase}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${dtd.cico ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}` }), dtd.perm ?
335
+ _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ArchiveConstraint}: ${LocalizeArchiveConstraints(dtd.archiveConstraint)}` }), dtd.isView && dtd.parametricFilterType != ParametricFilterTypes.None && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ParametricFilter}: ${LocalizeParametricFilterTypes(dtd.parametricFilterType)}` }), dtd.isView && dtd.withCheckOption && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ViewWithCheckOption}: ${SDKUI_Localizator.Yes}` }), dtd.isLexProt && dtd.isLexProt > 0 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes}` }), dtd.isFreeSearchable && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Free}: ${SDKUI_Localizator.Yes}` }), dtd.templateTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Template}: ${dtd.templateTID}` }), dtd.traceTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Tracing}: ${SDKUI_Localizator.Yes} - ${dtd.templateTID == TemplateTIDs.Trace_DcmtType ? SDKUI_Localizator.Destination : SDKUI_Localizator.Source} ${dtd.traceTID < 0 ? SDKUI_Localizator.Disabled : ''}` }), dtd.wfAppr && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.WorkflowApproval}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.BlogCase}: ${dtd.hasBlog ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${dtd.cico ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}` }), dtd.perm ?
336
336
  _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${mapAccessLevelToLocalizedString(dtd.perm.canArchive)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${mapAccessLevelToLocalizedString(dtd.perm.canView)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${mapAccessLevelToLocalizedString(dtd.perm.canSearch)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${mapAccessLevelToLocalizedString(dtd.perm.canUpdate)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${mapAccessLevelToLocalizedString(dtd.perm.canRetrieveFile)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${mapAccessLevelToLocalizedString(dtd.perm.canSubstFile)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${mapAccessLevelToLocalizedString(dtd.perm.canLogicalDelete)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${mapAccessLevelToLocalizedString(dtd.perm.canPhysicalDelete)}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${mapAccessLevelToLocalizedString(dtd.perm.canReadBlog)}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${mapAccessLevelToLocalizedString(dtd.perm.canWriteBlog)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${mapAccessLevelToLocalizedString(dtd.perm.canCICO)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${mapAccessLevelToLocalizedString(dtd.perm.canDelChron)}` })] })
337
337
  : dtd.ownershipLevel == OwnershipLevels.DirectOwner || dtd.ownershipLevel == OwnershipLevels.IndirectOwner ?
338
338
  _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${SDKUI_Localizator.Yes}` })] })
@@ -1,5 +1,19 @@
1
1
  import { InvoiceRetrieveFormats, ObjectClasses, OrderRetrieveFormats } from "@topconsultnpm/sdk-ts";
2
2
  import { CheckoutInfo } from "./checkinCheckoutManager";
3
+ export type FileNamingMode = 'onlyDid' | 'documentTypeAndDid' | 'documentTypeAndCustomMetadata' | 'onlyCustomMetadata';
4
+ export type FileExistsMode = 'overwrite' | 'skip' | 'rename';
5
+ export declare class DocumentDownloadSettings {
6
+ exportMode: 'copy' | 'zip';
7
+ destinationFolder: string;
8
+ zipFileName: string;
9
+ zipPassword: string;
10
+ fileNamingMode: FileNamingMode;
11
+ separatorChar: string;
12
+ invoiceFormat: InvoiceRetrieveFormats;
13
+ orderFormat: OrderRetrieveFormats;
14
+ fileExistsMode: FileExistsMode;
15
+ removeSignature: boolean;
16
+ }
3
17
  export declare const dcmtsFileCacheDownload: Map<string, File>;
4
18
  export declare const dcmtsFileCachePreview: Map<string, File>;
5
19
  export declare const CACHE_SIZE_LIMIT = 10;
@@ -22,6 +36,7 @@ export declare class UserSettings {
22
36
  wgDraftCheckoutInfo: CheckoutInfo[];
23
37
  dcmtCheckoutInfo: CheckoutInfo[];
24
38
  defaultCheckInOutFolder: string;
39
+ documentDownloadSettings: DocumentDownloadSettings;
25
40
  constructor(skipCssUpdate?: boolean);
26
41
  /** Load settings from local storage or other sources */
27
42
  static LoadSettings(userID: number | undefined, archiveID: string | undefined): UserSettings;
@@ -1,6 +1,19 @@
1
1
  import { InvoiceRetrieveFormats, LocalStorageService, OrderRetrieveFormats } from "@topconsultnpm/sdk-ts";
2
2
  import { FontSize } from "../utils/theme";
3
- // import { LandingPages } from "./helpers";
3
+ export class DocumentDownloadSettings {
4
+ constructor() {
5
+ this.exportMode = 'copy';
6
+ this.destinationFolder = 'Download';
7
+ this.zipFileName = '';
8
+ this.zipPassword = '';
9
+ this.fileNamingMode = 'documentTypeAndDid';
10
+ this.separatorChar = '_';
11
+ this.invoiceFormat = InvoiceRetrieveFormats.ASW_HTML;
12
+ this.orderFormat = OrderRetrieveFormats.NSO_HTML;
13
+ this.fileExistsMode = 'overwrite';
14
+ this.removeSignature = false;
15
+ }
16
+ }
4
17
  export const dcmtsFileCacheDownload = new Map();
5
18
  export const dcmtsFileCachePreview = new Map();
6
19
  export const CACHE_SIZE_LIMIT = 10;
@@ -24,6 +37,7 @@ export class UserSettings {
24
37
  this.wgDraftCheckoutInfo = [];
25
38
  this.dcmtCheckoutInfo = [];
26
39
  this.defaultCheckInOutFolder = DEFAULT_CHECK_IN_OUT_FOLDER;
40
+ this.documentDownloadSettings = new DocumentDownloadSettings();
27
41
  this.themeSettings = new ThemeSettings(skipCssUpdate);
28
42
  }
29
43
  /** Load settings from local storage or other sources */