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

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 (151) hide show
  1. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +22 -1
  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 +1 -1
  31. package/lib/components/base/TMTreeView.js +12 -15
  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/TMDynDataListItemChooser.d.ts +1 -1
  37. package/lib/components/choosers/TMDynDataListItemChooser.js +6 -1
  38. package/lib/components/choosers/TMGroupChooser.js +1 -1
  39. package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
  40. package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
  41. package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
  42. package/lib/components/choosers/TMUserChooser.d.ts +2 -2
  43. package/lib/components/editors/TMEditorStyled.d.ts +6 -6
  44. package/lib/components/editors/TMFormulaEditor.d.ts +2 -1
  45. package/lib/components/editors/TMFormulaEditor.js +98 -49
  46. package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
  47. package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
  48. package/lib/components/editors/TMMetadataEditor.js +6 -2
  49. package/lib/components/editors/TMMetadataValues.js +23 -6
  50. package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
  51. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
  52. package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
  53. package/lib/components/features/blog/TMBlogCommentForm.js +5 -2
  54. package/lib/components/features/documents/TMCopyToFolderForm.js +46 -24
  55. package/lib/components/features/documents/TMDcmtForm.js +19 -9
  56. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
  57. package/lib/components/features/documents/TMDcmtIcon.d.ts +2 -1
  58. package/lib/components/features/documents/TMDcmtIcon.js +1 -1
  59. package/lib/components/features/documents/TMDcmtPreview.d.ts +1 -1
  60. package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
  61. package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
  62. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +0 -2
  63. package/lib/components/features/documents/TMMasterDetailDcmts.js +4 -5
  64. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +0 -2
  65. package/lib/components/features/documents/TMMergeToPdfForm.js +26 -10
  66. package/lib/components/features/documents/TMRelationViewer.js +8 -3
  67. package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +0 -13
  68. package/lib/components/features/documents/copyAndMergeDcmtsShared.js +1 -39
  69. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
  70. package/lib/components/features/search/TMMetadataOutputForm.d.ts +18 -0
  71. package/lib/components/features/search/TMMetadataOutputForm.js +225 -0
  72. package/lib/components/features/search/TMMetadataSorterForm.d.ts +18 -0
  73. package/lib/components/features/search/TMMetadataSorterForm.js +243 -0
  74. package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
  75. package/lib/components/features/search/TMSearch.d.ts +0 -2
  76. package/lib/components/features/search/TMSearch.js +2 -2
  77. package/lib/components/features/search/TMSearchQueryEditor.js +14 -8
  78. package/lib/components/features/search/TMSearchQueryPanel.js +249 -58
  79. package/lib/components/features/search/TMSearchResult.d.ts +1 -2
  80. package/lib/components/features/search/TMSearchResult.js +40 -20
  81. package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
  82. package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
  83. package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
  84. package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
  85. package/lib/components/features/search/metadataFormHelper.d.ts +16 -0
  86. package/lib/components/features/search/metadataFormHelper.js +77 -0
  87. package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
  88. package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
  89. package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
  90. package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
  91. package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
  92. package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
  93. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
  94. package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
  95. package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
  96. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
  97. package/lib/components/forms/Login/Chooser.d.ts +2 -2
  98. package/lib/components/forms/Login/TMLoginForm.js +15 -3
  99. package/lib/components/forms/TMChooserForm.d.ts +2 -1
  100. package/lib/components/forms/TMSaveForm.d.ts +4 -4
  101. package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
  102. package/lib/components/grids/TMBlogAttachments.js +2 -2
  103. package/lib/components/grids/TMBlogHeader.d.ts +1 -1
  104. package/lib/components/grids/TMBlogsPost.d.ts +1 -1
  105. package/lib/components/grids/TMBlogsPost.js +5 -3
  106. package/lib/components/grids/TMBlogsPostUtils.d.ts +10 -9
  107. package/lib/components/grids/TMBlogsPostUtils.js +3 -1
  108. package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
  109. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +2 -1
  110. package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
  111. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +1 -1
  112. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
  113. package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
  114. package/lib/components/pages/TMPage.d.ts +1 -1
  115. package/lib/components/settings/SettingsAppearance.d.ts +2 -1
  116. package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
  117. package/lib/components/sidebar/TMHeader.d.ts +3 -3
  118. package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
  119. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
  120. package/lib/components/viewers/TMMidViewer.d.ts +2 -2
  121. package/lib/components/viewers/TMTidViewer.d.ts +2 -2
  122. package/lib/components/wizard/TMWizard.d.ts +1 -0
  123. package/lib/components/wizard/TMWizard.js +5 -3
  124. package/lib/helper/Enum_Localizator.js +1 -0
  125. package/lib/helper/MergePdfManager.d.ts +45 -0
  126. package/lib/helper/MergePdfManager.js +148 -0
  127. package/lib/helper/SDKUI_Globals.js +2 -1
  128. package/lib/helper/SDKUI_Localizator.d.ts +6 -0
  129. package/lib/helper/SDKUI_Localizator.js +60 -0
  130. package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
  131. package/lib/helper/TMIcons.d.ts +278 -278
  132. package/lib/helper/TMPdfViewer.d.ts +2 -1
  133. package/lib/helper/TMToppyMessage.d.ts +2 -2
  134. package/lib/helper/TMUtils.d.ts +24 -20
  135. package/lib/helper/TMUtils.js +55 -0
  136. package/lib/helper/checkinCheckoutManager.d.ts +4 -3
  137. package/lib/helper/checkinCheckoutManager.js +29 -11
  138. package/lib/helper/helpers.d.ts +3 -2
  139. package/lib/helper/helpers.js +1 -0
  140. package/lib/hooks/useCheckInOutOperations.d.ts +4 -3
  141. package/lib/hooks/useDataUserIdItem.js +1 -1
  142. package/lib/hooks/useDcmtOperations.d.ts +18 -1
  143. package/lib/hooks/useDcmtOperations.js +235 -24
  144. package/lib/hooks/useDocumentOperations.d.ts +0 -2
  145. package/lib/hooks/useDocumentOperations.js +27 -10
  146. package/lib/hooks/useInputDialog.d.ts +2 -1
  147. package/lib/hooks/useRelatedDocuments.js +4 -4
  148. package/lib/services/platform_services.d.ts +7 -6
  149. package/lib/ts/types.d.ts +2 -1
  150. package/lib/ts/types.js +1 -0
  151. package/package.json +14 -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
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;
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,5 @@ 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;
76
80
  export {};
@@ -4,6 +4,61 @@ import { TMTooltip } from '../components';
4
4
  import { IconCADossier, IconKey, IconMenuCAWorkingGroups } from './TMIcons';
5
5
  import { AppModules, DataListCacheService, LicenseModuleStatus, MetadataDataDomains, PdGs, SDK_Globals } 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;
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
- import { AccessLevels, DcmtTypeDescriptor, FileDescriptor, UserDescriptor } from "@topconsultnpm/sdk-ts";
3
- import { DcmtInfo, DownloadModes, DownloadTypes } from "../ts/types";
2
+ import { AccessLevels, DcmtTypeDescriptor, UserDescriptor } from "@topconsultnpm/sdk-ts";
3
+ import { DcmtInfo } from "../ts/types";
4
4
  import { FileItem } from "../components";
5
+ import { DownloadDcmtsAsyncParams } from "../hooks/useDcmtOperations";
5
6
  /**
6
7
  * Check-in/Check-out Manager
7
8
  * Questo modulo gestisce tutte le operazioni di check-in e check-out
@@ -42,7 +43,7 @@ export type DownloadSource = {
42
43
  originalFileName: string;
43
44
  };
44
45
  export declare const getCicoDownloadFileName: (source: DownloadSource, checkout: boolean, withTimestampAndExt: boolean) => string;
45
- export declare const cicoDownloadFilesCallback: (sources: Array<DownloadSource>, checkout: boolean, downloadDcmtsAsync: (inputDcmts: Array<DcmtInfo> | undefined, downloadType?: DownloadTypes, downloadMode?: DownloadModes, onFileDownloaded?: (dcmtFile: File) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>) => Promise<void>;
46
+ export declare const cicoDownloadFilesCallback: (sources: Array<DownloadSource>, checkout: boolean, downloadDcmtsAsync: (params: DownloadDcmtsAsyncParams) => Promise<void>) => Promise<void>;
46
47
  export declare const updateCicoCheckoutStorageItem: (item: CheckoutInfo, type: "fileItem" | "dcmtInfo", action?: "addOrUpdate" | "remove") => void;
47
48
  export declare const validateCicoFileName: (source: DownloadSource, fileName: string, checkoutDate?: string | null) => FileNameValidation;
48
49
  type ValidationResult = {
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { AccessLevels, CICO_MetadataNames, SDK_Globals, SystemMIDsAsNumber } from "@topconsultnpm/sdk-ts";
3
3
  import TMTooltip from "../components/base/TMTooltip";
4
4
  import { dcmtsFileCachePreview, Globalization, removeDcmtsFileCache, SDKUI_Globals, SDKUI_Localizator } from "./index";
5
+ import { getBaseExtension, getFullFileExtension } from "./TMUtils";
5
6
  import { DownloadTypes } from "../ts/types";
6
7
  const findCheckOutUserName = (users, checkoutUserId) => {
7
8
  let checkOutUser = users.find(user => user.id === checkoutUserId);
@@ -74,7 +75,7 @@ export const cicoDownloadFilesCallback = async (sources, checkout, downloadDcmts
74
75
  }
75
76
  });
76
77
  if (files.length > 0) {
77
- await downloadDcmtsAsync(files, DownloadTypes.Dcmt, "download");
78
+ await downloadDcmtsAsync({ inputDcmts: files, downloadType: DownloadTypes.Dcmt, downloadMode: "download", skipConfirmation: true, useInputFileName: true });
78
79
  }
79
80
  };
80
81
  export const updateCicoCheckoutStorageItem = (item, type, action = "addOrUpdate") => {
@@ -128,13 +129,22 @@ export const validateCicoFileName = (source, fileName, checkoutDate) => {
128
129
  did = DID;
129
130
  ext = FILEEXT;
130
131
  }
131
- // Ensure originalName has the extension
132
- const normalizedExt = ext?.toLowerCase() ?? '';
133
- const name = baseName.toLowerCase().endsWith(`.${normalizedExt}`) ? baseName : `${baseName}.${normalizedExt}`;
132
+ // Ensure originalName has the extension (use base extension for comparison)
133
+ const sourceBaseExt = getBaseExtension(ext ?? '');
134
+ const name = baseName.toLowerCase().endsWith(`.${sourceBaseExt}`) ? baseName : `${baseName}.${sourceBaseExt}`;
134
135
  let fileNameToValidate = fileName;
135
- const fileExtensionCheck = fileNameToValidate.split('.').pop() ?? '';
136
- // Remove extension part
137
- fileNameToValidate = fileNameToValidate.slice(0, -fileExtensionCheck.length - 1);
136
+ // Estrai l'estensione completa (incluse eventuali firme digitali ricorsive es. pdf.p7m.tsd)
137
+ const fullExtension = getFullFileExtension(fileNameToValidate);
138
+ let fileExtensionCheck;
139
+ if (fullExtension) {
140
+ // Rimuovi l'estensione completa dal nome
141
+ fileNameToValidate = fileNameToValidate.slice(0, -fullExtension.length);
142
+ // L'estensione base è la prima parte (es. da ".pdf.p7m.tsd" prendi "pdf")
143
+ fileExtensionCheck = fullExtension.substring(1).split('.')[0];
144
+ }
145
+ else {
146
+ fileExtensionCheck = '';
147
+ }
138
148
  // Check and remove 'checkout~' prefix if present
139
149
  const hasCheckoutPrefix = fileNameToValidate.startsWith('checkout~');
140
150
  if (hasCheckoutPrefix) {
@@ -159,7 +169,7 @@ export const validateCicoFileName = (source, fileName, checkoutDate) => {
159
169
  const isValidDid = didCheck ? did.toString() === parseInt(didCheck, 10).toString() : false;
160
170
  const isValidTid = tidCheck ? tid.toString() === parseInt(tidCheck, 10).toString() : false;
161
171
  const isValidArchive = archiveCheck ? archiveCheck === archiveID : false;
162
- const isValidExt = ext ? ext.toLowerCase() === fileExtensionCheck.toLowerCase() : false;
172
+ const isValidExt = sourceBaseExt ? sourceBaseExt === fileExtensionCheck.toLowerCase() : false;
163
173
  // First phase validation result
164
174
  const isFirstPhaseValid = !!(isValidName && isValidArchive && isValidDid && isValidTid && isValidExt);
165
175
  // Second phase: validate checkoutDate timestamp (only if first phase passed and checkoutDate is a valid string)
@@ -177,11 +187,11 @@ export const validateCicoFileName = (source, fileName, checkoutDate) => {
177
187
  else {
178
188
  const pad = (n) => n.toString().padStart(2, '0');
179
189
  const expectedTimestamp = `${dt.getFullYear()}${pad(dt.getMonth() + 1)}${pad(dt.getDate())}${pad(dt.getHours())}${pad(dt.getMinutes())}${pad(dt.getSeconds())}`;
180
- isSecondPhaseValid = timestampCheck === expectedTimestamp;
181
190
  // Format dates for display: readable date + (raw timestamp)
182
191
  const expectedDisplayDate = Globalization.getDateTimeDisplayValue(dt);
183
192
  // Parse timestampCheck to readable format (YYYYMMDDHHmmss -> Date)
184
193
  let currentDisplayDate = timestampCheck;
194
+ let parsedDate = null;
185
195
  if (timestampCheck && timestampCheck.length === 14) {
186
196
  const year = parseInt(timestampCheck.substring(0, 4), 10);
187
197
  const month = parseInt(timestampCheck.substring(4, 6), 10) - 1;
@@ -189,9 +199,17 @@ export const validateCicoFileName = (source, fileName, checkoutDate) => {
189
199
  const hours = parseInt(timestampCheck.substring(8, 10), 10);
190
200
  const minutes = parseInt(timestampCheck.substring(10, 12), 10);
191
201
  const seconds = parseInt(timestampCheck.substring(12, 14), 10);
192
- const parsedDate = new Date(year, month, day, hours, minutes, seconds);
202
+ parsedDate = new Date(year, month, day, hours, minutes, seconds);
193
203
  currentDisplayDate = Globalization.getDateTimeDisplayValue(parsedDate);
194
204
  }
205
+ // Validate with ±10 seconds tolerance
206
+ if (parsedDate && !isNaN(parsedDate.getTime())) {
207
+ const diffInSeconds = Math.abs((dt.getTime() - parsedDate.getTime()) / 1000);
208
+ isSecondPhaseValid = diffInSeconds <= 10;
209
+ }
210
+ else {
211
+ isSecondPhaseValid = timestampCheck === expectedTimestamp;
212
+ }
195
213
  checkoutDateValidation = {
196
214
  expected: `${expectedDisplayDate} (${expectedTimestamp})`,
197
215
  current: `${currentDisplayDate} (${timestampCheck})`,
@@ -229,7 +247,7 @@ export const validateCicoFileName = (source, fileName, checkoutDate) => {
229
247
  isValid: isValidTid
230
248
  },
231
249
  fileExtension: {
232
- expected: ext?.toLowerCase(),
250
+ expected: sourceBaseExt,
233
251
  current: fileExtensionCheck.toLowerCase(),
234
252
  isValid: isValidExt
235
253
  },
@@ -52,7 +52,7 @@ export { openApps, calcResponsiveDirection, calcResponsiveSizes, taskModalSizes,
52
52
  export declare function moduleVersion(module: moduleTypes): string;
53
53
  export declare function buildtype(module: moduleTypes): string;
54
54
  export declare const highlightText: (text: string, searchValue: string) => JSX.Element;
55
- export declare const renderHighlightedText: (text: string, searchText: string, isSelected: boolean) => string | (string | import("react/jsx-runtime").JSX.Element)[];
55
+ export declare const renderHighlightedText: (text: string, searchText: string, isSelected: boolean) => string | (string | import("react").JSX.Element)[];
56
56
  export declare function versionAndBuildtypeInfo(module: moduleTypes): string;
57
57
  export declare const getListMaxItems: (deviceType: DeviceType | undefined) => number;
58
58
  export declare const svgToString: (icon: React.ReactElement) => string;
@@ -72,7 +72,8 @@ export declare enum LandingPages {
72
72
  AREA_MANAGER = "areaManager",
73
73
  NOTIFICATIONS = "notifications",
74
74
  ACTIVITIES = "activities",
75
- WORKFLOW_CTRL = "workflowCtrl"
75
+ WORKFLOW_CTRL = "workflowCtrl",
76
+ CASEFLOW = "caseflow"
76
77
  }
77
78
  export declare function getExceptionMessage(ex: any): string;
78
79
  export declare function getContrastColor(inputColor: string): {
@@ -747,6 +747,7 @@ export var LandingPages;
747
747
  LandingPages["NOTIFICATIONS"] = "notifications";
748
748
  LandingPages["ACTIVITIES"] = "activities";
749
749
  LandingPages["WORKFLOW_CTRL"] = "workflowCtrl";
750
+ LandingPages["CASEFLOW"] = "caseflow";
750
751
  })(LandingPages || (LandingPages = {}));
751
752
  // #endregion
752
753
  // #region Exception
@@ -1,5 +1,6 @@
1
- import { DcmtInfo, DownloadModes, DownloadTypes } from '../ts';
2
- import { FileDescriptor, SearchResultDescriptor } from '@topconsultnpm/sdk-ts';
1
+ import { DcmtInfo } from '../ts';
2
+ import { SearchResultDescriptor } from '@topconsultnpm/sdk-ts';
3
+ import { DownloadDcmtsAsyncParams } from './useDcmtOperations';
3
4
  export interface UseCheckInOutOperationsProps {
4
5
  onRefreshPreview: () => Promise<void>;
5
6
  }
@@ -17,7 +18,7 @@ export interface UseCheckInOutOperationsReturn {
17
18
  };
18
19
  hideCommentFormCallback: () => void;
19
20
  copyCheckoutPathToClipboardCallback: (dcmt: DcmtInfo, filename: string) => void;
20
- handleCheckOutCallback: (dcmt: DcmtInfo, checkout: boolean, filename: string, downloadDcmtsAsync: (inputDcmts: Array<DcmtInfo> | undefined, downloadType?: DownloadTypes, downloadMode?: DownloadModes, onFileDownloaded?: (dcmtFile: File) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>, onRefreshAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
21
+ handleCheckOutCallback: (dcmt: DcmtInfo, checkout: boolean, filename: string, downloadDcmtsAsync: (params: DownloadDcmtsAsyncParams) => Promise<void>, onRefreshAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
21
22
  handleCheckInCallback: (dcmt: DcmtInfo, checkoutDate?: string | null, onRefreshAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
22
23
  showCicoWaitPanel: boolean;
23
24
  cicoWaitPanelTitle: string;
@@ -74,7 +74,7 @@ export const useDataUserIdItem = () => {
74
74
  const getIcon = () => {
75
75
  if (!showIcon)
76
76
  return null;
77
- if (userId === undefined)
77
+ if (userId === undefined || userId === null)
78
78
  return null;
79
79
  return ud ? _jsx(TMUserIcon, { ud: ud }) : _jsx("span", { title: showTitile ? SDKUI_Localizator.ValueNotPresent : undefined, style: { display: 'inline-flex', alignItems: 'center' }, children: _jsx(IconWarning, { color: TMColors.warning }) });
80
80
  };
@@ -7,6 +7,23 @@ export interface RetrieveFormatOptions {
7
7
  invoiceRetrieveFormat?: InvoiceRetrieveFormats;
8
8
  orderRetrieveFormat?: OrderRetrieveFormats;
9
9
  }
10
+ export interface DownloadDcmtsAsyncParams {
11
+ inputDcmts: DcmtInfo[] | undefined;
12
+ downloadType?: DownloadTypes;
13
+ downloadMode?: DownloadModes;
14
+ onFileDownloaded?: (dcmtFile: File, dcmtInfo: DcmtInfo) => void | Promise<void>;
15
+ confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>;
16
+ skipConfirmation?: boolean;
17
+ retrieveOptions?: RetrieveFormatOptions;
18
+ useCache?: boolean;
19
+ showSuccessAlert?: boolean;
20
+ /**
21
+ * Controlla la priorità del nome file per il download:
22
+ * - true: usa il fileName da inputDcmts (dcmtInfo.fileName) come priorità
23
+ * - false (default): usa il nome file recuperato dal backend (file.name) come priorità
24
+ */
25
+ useInputFileName?: boolean;
26
+ }
10
27
  export interface UseDcmtOperationsReturn {
11
28
  abortController: AbortController;
12
29
  showWaitPanel: boolean;
@@ -19,7 +36,7 @@ export interface UseDcmtOperationsReturn {
19
36
  waitPanelTextSecondary: string;
20
37
  waitPanelValueSecondary: number;
21
38
  waitPanelMaxValueSecondary: number;
22
- downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType?: DownloadTypes, downloadMode?: DownloadModes, onFileDownloaded?: (dcmtFile: File, dcmtInfo: DcmtInfo) => void | Promise<void>, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean, retrieveOptions?: RetrieveFormatOptions, useCache?: boolean, showSuccessAlert?: boolean) => Promise<void>;
39
+ downloadDcmtsAsync: (params: DownloadDcmtsAsyncParams) => Promise<void>;
23
40
  getDcmtFileAsync: (inputDcmt: DcmtInfo | undefined, rfo: RetrieveFileOptions, operationTitle: string, keepWaitPanelPrimary: boolean, bypassCache?: boolean) => Promise<{
24
41
  file: File | undefined;
25
42
  isFromCache: boolean;