@topconsultnpm/sdkui-react 6.21.0-t2 → 6.21.0-t4

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 (165) hide show
  1. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +28 -2
  2. package/lib/components/NewComponents/ContextMenu/styles.d.ts +4 -4
  3. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +6 -6
  4. package/lib/components/base/Styled.d.ts +1 -1
  5. package/lib/components/base/TMAreaManager.js +11 -0
  6. package/lib/components/base/TMCounterBar.d.ts +2 -2
  7. package/lib/components/base/TMCounterContainer.d.ts +2 -1
  8. package/lib/components/base/TMCustomButton.d.ts +1 -1
  9. package/lib/components/base/TMDataGrid.js +12 -2
  10. package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
  11. package/lib/components/base/TMDataGridExportForm.js +19 -8
  12. package/lib/components/base/TMFileManager.d.ts +2 -1
  13. package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
  14. package/lib/components/base/TMFileManagerDataGridView.js +4 -4
  15. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
  16. package/lib/components/base/TMFileManagerThumbnailItems.js +3 -3
  17. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
  18. package/lib/components/base/TMFileManagerUtils.d.ts +7 -0
  19. package/lib/components/base/TMFileManagerUtils.js +14 -1
  20. package/lib/components/base/TMLayout.d.ts +4 -4
  21. package/lib/components/base/TMList.d.ts +2 -1
  22. package/lib/components/base/TMListView.d.ts +1 -1
  23. package/lib/components/base/TMModal.js +2 -2
  24. package/lib/components/base/TMPopUp.d.ts +1 -0
  25. package/lib/components/base/TMPopUp.js +59 -2
  26. package/lib/components/base/TMSpinner.d.ts +5 -2
  27. package/lib/components/base/TMSpinner.js +33 -6
  28. package/lib/components/base/TMTab.d.ts +4 -3
  29. package/lib/components/base/TMTooltip.d.ts +1 -1
  30. package/lib/components/base/TMTreeView.d.ts +16 -13
  31. package/lib/components/base/TMTreeView.js +242 -79
  32. package/lib/components/base/TMUserAvatar.d.ts +2 -1
  33. package/lib/components/base/TMVilViewer.d.ts +2 -1
  34. package/lib/components/base/TMWaitPanel.d.ts +5 -2
  35. package/lib/components/base/TMWaitPanel.js +8 -6
  36. package/lib/components/choosers/TMDistinctValues.js +1 -1
  37. package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
  38. package/lib/components/choosers/TMDynDataListItemChooser.js +6 -1
  39. package/lib/components/choosers/TMGroupChooser.js +1 -1
  40. package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
  41. package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
  42. package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
  43. package/lib/components/choosers/TMUserChooser.d.ts +2 -2
  44. package/lib/components/editors/TMEditorStyled.d.ts +6 -6
  45. package/lib/components/editors/TMFormulaEditor.d.ts +2 -1
  46. package/lib/components/editors/TMFormulaEditor.js +98 -49
  47. package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
  48. package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
  49. package/lib/components/editors/TMMetadataEditor.js +6 -2
  50. package/lib/components/editors/TMMetadataValues.js +23 -6
  51. package/lib/components/editors/TMTextBox.d.ts +1 -0
  52. package/lib/components/editors/TMTextBox.js +2 -1
  53. package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
  54. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
  55. package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
  56. package/lib/components/features/blog/TMBlogCommentForm.js +5 -2
  57. package/lib/components/features/documents/TMCopyToFolderForm.js +46 -24
  58. package/lib/components/features/documents/TMDcmtForm.d.ts +2 -0
  59. package/lib/components/features/documents/TMDcmtForm.js +21 -10
  60. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
  61. package/lib/components/features/documents/TMDcmtIcon.d.ts +4 -1
  62. package/lib/components/features/documents/TMDcmtIcon.js +6 -33
  63. package/lib/components/features/documents/TMDcmtPreview.d.ts +1 -1
  64. package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
  65. package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
  66. package/lib/components/features/documents/TMFileUploader.js +1 -1
  67. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -2
  68. package/lib/components/features/documents/TMMasterDetailDcmts.js +55 -16
  69. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -3
  70. package/lib/components/features/documents/TMMergeToPdfForm.js +115 -56
  71. package/lib/components/features/documents/TMRelationViewer.d.ts +12 -10
  72. package/lib/components/features/documents/TMRelationViewer.js +405 -95
  73. package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +4 -16
  74. package/lib/components/features/documents/copyAndMergeDcmtsShared.js +47 -61
  75. package/lib/components/features/documents/mergePdfUtils.d.ts +52 -0
  76. package/lib/components/features/documents/mergePdfUtils.js +268 -0
  77. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
  78. package/lib/components/features/search/TMMetadataOutputForm.d.ts +18 -0
  79. package/lib/components/features/search/TMMetadataOutputForm.js +225 -0
  80. package/lib/components/features/search/TMMetadataSorterForm.d.ts +18 -0
  81. package/lib/components/features/search/TMMetadataSorterForm.js +243 -0
  82. package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
  83. package/lib/components/features/search/TMSearch.d.ts +2 -2
  84. package/lib/components/features/search/TMSearch.js +2 -2
  85. package/lib/components/features/search/TMSearchQueryEditor.js +14 -8
  86. package/lib/components/features/search/TMSearchQueryPanel.js +249 -58
  87. package/lib/components/features/search/TMSearchResult.d.ts +3 -2
  88. package/lib/components/features/search/TMSearchResult.js +94 -25
  89. package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
  90. package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
  91. package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
  92. package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
  93. package/lib/components/features/search/metadataFormHelper.d.ts +16 -0
  94. package/lib/components/features/search/metadataFormHelper.js +77 -0
  95. package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
  96. package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
  97. package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
  98. package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
  99. package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
  100. package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
  101. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
  102. package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
  103. package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
  104. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
  105. package/lib/components/forms/Login/Chooser.d.ts +2 -2
  106. package/lib/components/forms/Login/TMLoginForm.js +15 -3
  107. package/lib/components/forms/TMChooserForm.d.ts +2 -1
  108. package/lib/components/forms/TMSaveForm.d.ts +4 -4
  109. package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
  110. package/lib/components/grids/TMBlogAttachments.js +2 -2
  111. package/lib/components/grids/TMBlogHeader.d.ts +1 -1
  112. package/lib/components/grids/TMBlogsPost.d.ts +1 -1
  113. package/lib/components/grids/TMBlogsPost.js +5 -3
  114. package/lib/components/grids/TMBlogsPostUtils.d.ts +10 -9
  115. package/lib/components/grids/TMBlogsPostUtils.js +3 -1
  116. package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
  117. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +2 -1
  118. package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
  119. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +1 -1
  120. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
  121. package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
  122. package/lib/components/pages/TMPage.d.ts +1 -1
  123. package/lib/components/settings/SettingsAppearance.d.ts +2 -1
  124. package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
  125. package/lib/components/sidebar/TMHeader.d.ts +3 -3
  126. package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
  127. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
  128. package/lib/components/viewers/TMMidViewer.d.ts +2 -2
  129. package/lib/components/viewers/TMTidViewer.d.ts +2 -2
  130. package/lib/components/viewers/TMTidViewer.js +14 -2
  131. package/lib/components/wizard/TMWizard.d.ts +1 -0
  132. package/lib/components/wizard/TMWizard.js +5 -3
  133. package/lib/helper/Enum_Localizator.js +2 -0
  134. package/lib/helper/MergePdfManager.d.ts +45 -0
  135. package/lib/helper/MergePdfManager.js +148 -0
  136. package/lib/helper/SDKUI_Globals.d.ts +1 -0
  137. package/lib/helper/SDKUI_Globals.js +3 -1
  138. package/lib/helper/SDKUI_Localizator.d.ts +40 -0
  139. package/lib/helper/SDKUI_Localizator.js +412 -12
  140. package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
  141. package/lib/helper/TMIcons.d.ts +278 -278
  142. package/lib/helper/TMPdfViewer.d.ts +2 -1
  143. package/lib/helper/TMToppyMessage.d.ts +2 -2
  144. package/lib/helper/TMUtils.d.ts +57 -21
  145. package/lib/helper/TMUtils.js +159 -1
  146. package/lib/helper/certificateImportHelper.d.ts +43 -0
  147. package/lib/helper/certificateImportHelper.js +403 -0
  148. package/lib/helper/checkinCheckoutManager.d.ts +4 -3
  149. package/lib/helper/checkinCheckoutManager.js +29 -11
  150. package/lib/helper/helpers.d.ts +3 -2
  151. package/lib/helper/helpers.js +10 -0
  152. package/lib/helper/index.d.ts +1 -0
  153. package/lib/helper/index.js +1 -0
  154. package/lib/hooks/useCheckInOutOperations.d.ts +4 -3
  155. package/lib/hooks/useDataUserIdItem.js +1 -1
  156. package/lib/hooks/useDcmtOperations.d.ts +20 -2
  157. package/lib/hooks/useDcmtOperations.js +244 -25
  158. package/lib/hooks/useDocumentOperations.d.ts +2 -2
  159. package/lib/hooks/useDocumentOperations.js +52 -13
  160. package/lib/hooks/useInputDialog.d.ts +2 -1
  161. package/lib/hooks/useRelatedDocuments.js +4 -4
  162. package/lib/services/platform_services.d.ts +7 -6
  163. package/lib/ts/types.d.ts +3 -1
  164. package/lib/ts/types.js +2 -0
  165. package/package.json +15 -7
@@ -1,8 +1,9 @@
1
+ import React from "react";
1
2
  interface TMPdfViewerProps {
2
3
  pdfBlob: Blob;
3
4
  title?: string;
4
5
  isResizingActive?: boolean;
5
6
  enableFitToWidth?: boolean;
6
7
  }
7
- declare const TMPdfViewer: (props: TMPdfViewerProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const TMPdfViewer: (props: TMPdfViewerProps) => React.JSX.Element;
8
9
  export default TMPdfViewer;
@@ -1,8 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  interface TMToppyMessageProps {
3
3
  message: ReactNode;
4
4
  titleTooltip?: string;
5
5
  maxWidth?: string;
6
6
  }
7
- declare const TMToppyMessage: (props: TMToppyMessageProps) => import("react/jsx-runtime").JSX.Element;
7
+ declare const TMToppyMessage: (props: TMToppyMessageProps) => React.JSX.Element;
8
8
  export default TMToppyMessage;
@@ -1,7 +1,30 @@
1
1
  import React from 'react';
2
2
  import { FileItem } from '../components';
3
- import { AppModules, DataColumnDescriptor, DcmtTypeDescriptor, PdGs, SearchResultDescriptor } from '@topconsultnpm/sdk-ts';
4
- export declare const getFileIcon: (fileExtension: string | undefined, fileCount: number | undefined, tooltipContent?: JSX.Element | string) => import("react/jsx-runtime").JSX.Element;
3
+ import { AppModules, DataColumnDescriptor, DcmtTypeDescriptor, MetadataDescriptor, PdGs, SearchResultDescriptor } from '@topconsultnpm/sdk-ts';
4
+ /**
5
+ * Estensioni di firma/marca temporale note che possono avvolgere altre estensioni.
6
+ * Es: file.pdf.p7m, file.xml.p7m, file.docx.p7m, file.xml.p7m.ts
7
+ */
8
+ export declare const SIGNATURE_EXTENSIONS: Set<string>;
9
+ /**
10
+ * Estrae l'estensione completa da un nome file, gestendo estensioni composite
11
+ * a più livelli come .PDF.P7M, .XML.P7M.TS, etc.
12
+ *
13
+ * Esempi:
14
+ * - "documento.pdf" -> ".pdf"
15
+ * - "DCMT_123.PDF.P7M" -> ".PDF.P7M"
16
+ * - "fattura.xml.p7m" -> ".xml.p7m"
17
+ * - "example.XML.P7M.TS" -> ".XML.P7M.TS"
18
+ * - "file.tar.gz" -> ".gz" (tar.gz non è gestito come firma)
19
+ * - "file" -> ""
20
+ */
21
+ export declare const getFullFileExtension: (fileName: string, depth?: number) => string;
22
+ /**
23
+ * Estrae l'estensione base da un'estensione che può includere firme digitali.
24
+ * Es: pdf.p7m.tsd → pdf, pdf.p7m → pdf, pdf → pdf
25
+ */
26
+ export declare const getBaseExtension: (ext: string) => string;
27
+ export declare const getFileIcon: (fileExtension: string | undefined, fileCount: number | undefined, tooltipContent?: JSX.Element | string) => React.JSX.Element;
5
28
  export declare function formatBytes(bytes: number | undefined, decimalPlaces?: number): string;
6
29
  export interface RowData {
7
30
  [key: string]: string | number | null;
@@ -53,24 +76,37 @@ type DcmtFormToolbarVisibility = {
53
76
  tmDcmtTasks: boolean;
54
77
  };
55
78
  export declare const getDcmtFormToolbarVisibility: (appModuleID: AppModules) => DcmtFormToolbarVisibility;
56
- export type MergePdfManagerType = {
57
- merge: (files: File[], options?: {
58
- onProgress?: (current: number, total: number, file: File) => void;
59
- }) => Promise<{
60
- bytes: Uint8Array;
61
- blob: Blob;
62
- pageCount: number;
63
- }>;
64
- mergeToFile: (files: File[], fileName?: string, options?: {
65
- onProgress?: (current: number, total: number, file: File) => void;
66
- }) => Promise<File>;
67
- mergeAndDownload: (files: File[], fileName?: string, options?: {
68
- onProgress?: (current: number, total: number, file: File) => void;
69
- }) => Promise<{
70
- bytes: Uint8Array;
71
- blob: Blob;
72
- pageCount: number;
73
- }>;
74
- };
75
79
  export declare const isConvertibleToPdfExt: (ext: string | undefined | null) => boolean;
80
+ /** Valore metadato con descrittore (da searchResultToDataSource) */
81
+ export interface DcmtMetadataValue {
82
+ md?: MetadataDescriptor;
83
+ value: any;
84
+ }
85
+ /** Documento con metadati indicizzati per nome */
86
+ export interface DcmtMetadataMap {
87
+ [key: string]: DcmtMetadataValue;
88
+ rowIndex?: any;
89
+ }
90
+ /**
91
+ * Restituisce le chiavi dei metadati da visualizzare come descrizione documento.
92
+ * Priorità: 1) SYS_Abstract 2) isSpecialSearchOutput=true 3) primi 5 metadati non di sistema
93
+ */
94
+ export declare const buildDcmtDisplayName: (obj: DcmtMetadataMap | null | undefined) => Array<string>;
95
+ /** Metodo utilizzato per determinare i metadati da visualizzare come descrizione documento */
96
+ export declare enum DcmtDisplayNameMethod {
97
+ /** Nessun metadato disponibile */
98
+ None = "None",
99
+ /** Campo SYS_Abstract presente */
100
+ SysAbstract = "SysAbstract",
101
+ /** Metadati con isSpecialSearchOutput = true */
102
+ SpecialSearchOutput = "SpecialSearchOutput",
103
+ /** Primi 5 metadati non di sistema con permesso canView */
104
+ FirstViewableMetadata = "FirstViewableMetadata"
105
+ }
106
+ /**
107
+ * Analizza un DcmtTypeDescriptor e restituisce la stringa descrittiva del metodo di visualizzazione.
108
+ * Priorità: 1) SYS_Abstract 2) isSpecialSearchOutput=true 3) primi 5 metadati non di sistema (default)
109
+ * Se i metadati non sono presenti nel dtd, li recupera dalla cache.
110
+ */
111
+ export declare const getDTDDisplayNameInfo: (dtd: DcmtTypeDescriptor | undefined) => Promise<string>;
76
112
  export {};
@@ -2,8 +2,63 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled from "styled-components";
3
3
  import { TMTooltip } from '../components';
4
4
  import { IconCADossier, IconKey, IconMenuCAWorkingGroups } from './TMIcons';
5
- import { AppModules, DataListCacheService, LicenseModuleStatus, MetadataDataDomains, PdGs, SDK_Globals } from '@topconsultnpm/sdk-ts';
5
+ import { AccessLevels, AppModules, DataListCacheService, DcmtTypeListCacheService, LicenseModuleStatus, MetadataDataDomains, PdGs, SDK_Globals, SystemMIDs } from '@topconsultnpm/sdk-ts';
6
6
  import { SDKUI_Localizator } from './SDKUI_Localizator';
7
+ /**
8
+ * Estensioni di firma/marca temporale note che possono avvolgere altre estensioni.
9
+ * Es: file.pdf.p7m, file.xml.p7m, file.docx.p7m, file.xml.p7m.ts
10
+ */
11
+ export const SIGNATURE_EXTENSIONS = new Set(['p7m', 'p7s', 'm7m', 'tsd', 'tsr', 'ts']);
12
+ /** Profondità massima di ricorsione per la ricerca di estensioni composite */
13
+ const MAX_EXTENSION_DEPTH = 5;
14
+ /**
15
+ * Estrae l'estensione completa da un nome file, gestendo estensioni composite
16
+ * a più livelli come .PDF.P7M, .XML.P7M.TS, etc.
17
+ *
18
+ * Esempi:
19
+ * - "documento.pdf" -> ".pdf"
20
+ * - "DCMT_123.PDF.P7M" -> ".PDF.P7M"
21
+ * - "fattura.xml.p7m" -> ".xml.p7m"
22
+ * - "example.XML.P7M.TS" -> ".XML.P7M.TS"
23
+ * - "file.tar.gz" -> ".gz" (tar.gz non è gestito come firma)
24
+ * - "file" -> ""
25
+ */
26
+ export const getFullFileExtension = (fileName, depth = 0) => {
27
+ if (!fileName || depth > MAX_EXTENSION_DEPTH)
28
+ return '';
29
+ const lastDotIndex = fileName.lastIndexOf('.');
30
+ if (lastDotIndex <= 0)
31
+ return '';
32
+ const lastExtension = fileName.substring(lastDotIndex + 1).toLowerCase();
33
+ // Se l'ultima estensione è una firma/marca, cerca ricorsivamente le estensioni precedenti
34
+ if (SIGNATURE_EXTENSIONS.has(lastExtension)) {
35
+ const nameWithoutLastExt = fileName.substring(0, lastDotIndex);
36
+ const innerExtension = getFullFileExtension(nameWithoutLastExt, depth + 1);
37
+ if (innerExtension) {
38
+ // Concatena l'estensione interna con quella corrente
39
+ return innerExtension + fileName.substring(lastDotIndex);
40
+ }
41
+ }
42
+ // Estensione singola (o estensione base dopo le firme)
43
+ return fileName.substring(lastDotIndex);
44
+ };
45
+ /**
46
+ * Estrae l'estensione base da un'estensione che può includere firme digitali.
47
+ * Es: pdf.p7m.tsd → pdf, pdf.p7m → pdf, pdf → pdf
48
+ */
49
+ export const getBaseExtension = (ext) => {
50
+ if (!ext)
51
+ return '';
52
+ const parts = ext.toLowerCase().split('.');
53
+ // Trova la prima parte che non è un'estensione di firma
54
+ for (const part of parts) {
55
+ if (!SIGNATURE_EXTENSIONS.has(part)) {
56
+ return part;
57
+ }
58
+ }
59
+ // Se tutte sono firme, ritorna la prima
60
+ return parts[0] || '';
61
+ };
7
62
  const StyledIconFileContainer = styled.div `
8
63
  height: 22px;
9
64
  width: 18px;
@@ -375,3 +430,106 @@ export const isConvertibleToPdfExt = (ext) => {
375
430
  'eml', 'msg'
376
431
  ].includes(normalized);
377
432
  };
433
+ /**
434
+ * Restituisce le chiavi dei metadati da visualizzare come descrizione documento.
435
+ * Priorità: 1) SYS_Abstract 2) isSpecialSearchOutput=true 3) primi 5 metadati non di sistema
436
+ */
437
+ export const buildDcmtDisplayName = (obj) => {
438
+ try {
439
+ if (!obj)
440
+ return [];
441
+ const sysAbstractKey = Object.keys(obj).find(k => k.toUpperCase() === 'SYS_ABSTRACT');
442
+ if (sysAbstractKey) {
443
+ if (obj[sysAbstractKey]?.value) {
444
+ return [sysAbstractKey];
445
+ }
446
+ // SYS_Abstract esiste ma è vuoto: usa DID se presente, altrimenti continua con la logica standard
447
+ const didKey = Object.keys(obj).find(k => k.toUpperCase() === 'DID');
448
+ if (didKey && obj[didKey]?.value) {
449
+ return [didKey];
450
+ }
451
+ }
452
+ const keys = Object.keys(obj);
453
+ const sysMIDs = Object.values(SystemMIDs).map(o => o.toUpperCase());
454
+ const viewableMetadataKeys = keys.filter(k => obj?.[k]?.value &&
455
+ obj?.[k]?.md?.perm?.canView === AccessLevels.Yes &&
456
+ !sysMIDs.includes(k.toUpperCase()) &&
457
+ k !== "rowIndex" &&
458
+ k !== "ISLEXPROT");
459
+ // Metadati con isSpecialSearchOutput = true
460
+ const specialOutputKeys = viewableMetadataKeys.filter(k => obj?.[k]?.md?.isSpecialSearchOutput === true);
461
+ if (specialOutputKeys.length > 0) {
462
+ return specialOutputKeys;
463
+ }
464
+ if (viewableMetadataKeys.length > 0) {
465
+ return viewableMetadataKeys.slice(0, 5);
466
+ }
467
+ // Fallback: se tutti i metadati personalizzati sono vuoti, usa DID
468
+ const didKey = Object.keys(obj).find(k => k.toUpperCase() === 'DID');
469
+ if (didKey && obj[didKey]?.value) {
470
+ return [didKey];
471
+ }
472
+ return [];
473
+ }
474
+ catch (error) {
475
+ console.error('buildDcmtDisplayName error:', error);
476
+ return [];
477
+ }
478
+ };
479
+ /** Metodo utilizzato per determinare i metadati da visualizzare come descrizione documento */
480
+ export var DcmtDisplayNameMethod;
481
+ (function (DcmtDisplayNameMethod) {
482
+ /** Nessun metadato disponibile */
483
+ DcmtDisplayNameMethod["None"] = "None";
484
+ /** Campo SYS_Abstract presente */
485
+ DcmtDisplayNameMethod["SysAbstract"] = "SysAbstract";
486
+ /** Metadati con isSpecialSearchOutput = true */
487
+ DcmtDisplayNameMethod["SpecialSearchOutput"] = "SpecialSearchOutput";
488
+ /** Primi 5 metadati non di sistema con permesso canView */
489
+ DcmtDisplayNameMethod["FirstViewableMetadata"] = "FirstViewableMetadata";
490
+ })(DcmtDisplayNameMethod || (DcmtDisplayNameMethod = {}));
491
+ /**
492
+ * Analizza un DcmtTypeDescriptor e restituisce la stringa descrittiva del metodo di visualizzazione.
493
+ * Priorità: 1) SYS_Abstract 2) isSpecialSearchOutput=true 3) primi 5 metadati non di sistema (default)
494
+ * Se i metadati non sono presenti nel dtd, li recupera dalla cache.
495
+ */
496
+ export const getDTDDisplayNameInfo = async (dtd) => {
497
+ try {
498
+ if (!dtd) {
499
+ return SDKUI_Localizator.DisplayNameMethod_Top5;
500
+ }
501
+ // Recupera i metadati dalla cache se non presenti nel dtd
502
+ let metadata = dtd.metadata;
503
+ if (!metadata || metadata.length === 0) {
504
+ const cachedDtd = await DcmtTypeListCacheService.GetAsync(dtd.id);
505
+ metadata = cachedDtd?.metadata;
506
+ }
507
+ if (!metadata || metadata.length === 0) {
508
+ return SDKUI_Localizator.DisplayNameMethod_Top5;
509
+ }
510
+ const sysMIDs = Object.values(SystemMIDs).map(o => o.toUpperCase());
511
+ // 1) Cerca SYS_Abstract
512
+ const sysAbstract = metadata.find(md => md.name?.toUpperCase() === 'SYS_ABSTRACT');
513
+ if (sysAbstract) {
514
+ return SDKUI_Localizator.DisplayNameMethod_Abstract;
515
+ }
516
+ // Filtra metadati non di sistema con permesso canView
517
+ const viewableMetadata = metadata.filter(md => md.perm?.canView === AccessLevels.Yes &&
518
+ md.name &&
519
+ !sysMIDs.includes(md.name.toUpperCase()));
520
+ // 2) Cerca metadati con isSpecialSearchOutput = true
521
+ const specialOutputMetadata = viewableMetadata.filter(md => md.isSpecialSearchOutput === true);
522
+ if (specialOutputMetadata.length > 0) {
523
+ const metadataNames = specialOutputMetadata.map(md => md.nameLoc || md.name).filter(Boolean).join(', ');
524
+ const maxLength = 50;
525
+ const truncatedNames = metadataNames.length > maxLength ? metadataNames.substring(0, maxLength) + '...' : metadataNames;
526
+ return `${SDKUI_Localizator.Search_Special} (${truncatedNames})`;
527
+ }
528
+ // 3) Default: primi 5 metadati non di sistema
529
+ return SDKUI_Localizator.DisplayNameMethod_Top5;
530
+ }
531
+ catch (error) {
532
+ console.error('getDTDDisplayNameInfo error:', error);
533
+ return SDKUI_Localizator.DisplayNameMethod_Top5;
534
+ }
535
+ };
@@ -0,0 +1,43 @@
1
+ import { ResultTypes } from '@topconsultnpm/sdk-ts';
2
+ import { DcmtInfo } from '../ts';
3
+ export declare const S4T_USER_REGISTRY_MASTER: string;
4
+ export declare const S4T_CERTIFICATE_REGISTRY_DETAIL: string;
5
+ export interface IntesiCertificateData {
6
+ cid?: number;
7
+ alias?: string;
8
+ label?: string;
9
+ description?: any;
10
+ domain?: string;
11
+ providerName?: string;
12
+ providerDescription?: string;
13
+ loginAuth?: number;
14
+ creationDate?: any;
15
+ validFrom?: any;
16
+ validTo?: any;
17
+ certificateStatus?: any;
18
+ revokeDate?: any;
19
+ }
20
+ interface ImportResultInfo {
21
+ rowIndex: number;
22
+ id1: number;
23
+ id2: number;
24
+ resultType: typeof ResultTypes[keyof typeof ResultTypes];
25
+ description?: string;
26
+ }
27
+ /**
28
+ * Importa i certificati remoti per il documento corrente.
29
+ * Verifica se esistono già certificati nel sistema e li aggiorna o crea nuovi.
30
+ * Aggiorna il documento master con i metadati di elaborazione.
31
+ *
32
+ * @returns Array di ImportResultInfo con eventuali warning, o undefined se tutto ok
33
+ */
34
+ export declare const importCertificatesAsync: (inputDcmt: DcmtInfo, rowIndex: number, fetchRemoteCertificates: ((email: string) => Promise<Array<IntesiCertificateData>>) | undefined, abortSignal?: AbortSignal) => Promise<ImportResultInfo[] | undefined>;
35
+ export declare const archiveUserRegistryDocument: (abortSignal: AbortSignal, params: {
36
+ email: string;
37
+ fiscalCode: string;
38
+ phoneNumber: string;
39
+ name: string;
40
+ surname: string;
41
+ type: string;
42
+ }) => Promise<void>;
43
+ export {};