@topconsultnpm/sdkui-react 6.21.0-dev2.58 → 6.21.0-dev2.59
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.
|
@@ -13,7 +13,10 @@ export declare const dedupeByTidDid: (items: ReadonlyArray<IRelatedDcmt>) => Arr
|
|
|
13
13
|
/** Verifica se showDirectoryPicker è supportato (Chrome, Edge) */
|
|
14
14
|
export declare const isDirectoryPickerSupported: () => boolean;
|
|
15
15
|
/**
|
|
16
|
-
* Verifica se un'estensione (con o senza punto iniziale, case-insensitive) è "pdf"
|
|
16
|
+
* Verifica se un'estensione (con o senza punto iniziale, case-insensitive) è "pdf"
|
|
17
|
+
* o un PDF firmato (pdf.p7m, pdf.tsd, pdf.m7m).
|
|
18
|
+
* Questi formati firmati vengono trattati come PDF nativi perché con OriginalUnsigned
|
|
19
|
+
* il file viene restituito senza firma.
|
|
17
20
|
*/
|
|
18
21
|
export declare const isPdfExt: (ext: string | null | undefined) => boolean;
|
|
19
22
|
/**
|
|
@@ -50,13 +50,16 @@ export const isDirectoryPickerSupported = () => {
|
|
|
50
50
|
return 'showDirectoryPicker' in window;
|
|
51
51
|
};
|
|
52
52
|
/**
|
|
53
|
-
* Verifica se un'estensione (con o senza punto iniziale, case-insensitive) è "pdf"
|
|
53
|
+
* Verifica se un'estensione (con o senza punto iniziale, case-insensitive) è "pdf"
|
|
54
|
+
* o un PDF firmato (pdf.p7m, pdf.tsd, pdf.m7m).
|
|
55
|
+
* Questi formati firmati vengono trattati come PDF nativi perché con OriginalUnsigned
|
|
56
|
+
* il file viene restituito senza firma.
|
|
54
57
|
*/
|
|
55
58
|
export const isPdfExt = (ext) => {
|
|
56
59
|
if (!ext)
|
|
57
60
|
return false;
|
|
58
61
|
const normalized = ext.trim().toLowerCase().replace(/^\./, '');
|
|
59
|
-
return normalized === 'pdf';
|
|
62
|
+
return normalized === 'pdf' || normalized === 'pdf.p7m' || normalized === 'pdf.tsd' || normalized === 'pdf.m7m';
|
|
60
63
|
};
|
|
61
64
|
/**
|
|
62
65
|
* Estensioni di firma/marca temporale note che possono avvolgere altre estensioni.
|
package/lib/helper/TMUtils.js
CHANGED
|
@@ -367,7 +367,6 @@ export const isConvertibleToPdfExt = (ext) => {
|
|
|
367
367
|
.replace(/\.P7M/g, '').replace(/\.M7M/g, '').replace(/\.TSR/g, '').replace(/\.TSD/g, '').replace(/\.TS/g, '')
|
|
368
368
|
.toLowerCase().replace(/^\./, '').split('.').pop() ?? '';
|
|
369
369
|
return [
|
|
370
|
-
'pdf',
|
|
371
370
|
'doc', 'docx', 'dot', 'dotx', 'docm', 'dotm', 'odt', 'rtf', 'txt',
|
|
372
371
|
'csv', 'xls', 'xlsx',
|
|
373
372
|
'ppt', 'pptx', 'ppsx',
|
|
@@ -650,7 +650,9 @@ export const useDocumentOperations = (props) => {
|
|
|
650
650
|
// Take the first document (used for validation checks)
|
|
651
651
|
const firstDoc = selectedDcmtInfos?.[0];
|
|
652
652
|
// Check if the selected document is a PDF or can be converted to PDF by the backend
|
|
653
|
-
|
|
653
|
+
// Include signed PDFs (p7m, tsd, m7m) since generalRetrieveFormat is OriginalUnsigned
|
|
654
|
+
const fileExtLower = firstDoc?.FILEEXT?.toLowerCase();
|
|
655
|
+
const isPdf = fileExtLower === "pdf" || fileExtLower === "pdf.p7m" || fileExtLower === "pdf.tsd" || fileExtLower === "pdf.m7m";
|
|
654
656
|
const isConvertible = isConvertibleToPdfExt(firstDoc?.FILEEXT);
|
|
655
657
|
const canPrint = isPdf || isConvertible;
|
|
656
658
|
const executePrint = async () => {
|