@topconsultnpm/sdkui-react 6.21.0-dev4.9 → 6.21.0-dev5.10

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.
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { MetadataDescriptor } from '@topconsultnpm/sdk-ts';
2
3
  import { DcmtInfo } from '../../../ts';
3
4
  import { DocumentDownloadSettings, FileNamingMode } from '../../../helper';
4
5
  import { IRelatedDcmt } from './TMMasterDetailDcmts';
@@ -32,9 +33,9 @@ export declare const fileExists: (dirHandle: FileSystemDirectoryHandle, fileName
32
33
  export declare const generateUniqueFileName: (dirHandle: FileSystemDirectoryHandle, originalName: string) => Promise<string>;
33
34
  /** Recupera il nome leggibile del tipo documento (cache) */
34
35
  export declare const getTypeName: (tid: number | undefined) => Promise<string>;
35
- /** Formatta un valore convertendo le date in formato dd-MM-yyyy [HH-mm-ss] */
36
- export declare const formatMetadataValue: (value: string) => string;
37
- /** Recupera i metadati filtrati (primi 5 con mid > 100 e valore presente), concatenati con separatorChar */
36
+ /** Formatta un valore convertendo le date secondo il formato specificato in MetadataDescriptor.format */
37
+ export declare const formatMetadataValue: (value: string, md?: MetadataDescriptor) => string;
38
+ /** Recupera i metadati filtrati usando buildDcmtDisplayName, concatenati con separatorChar */
38
39
  export declare const getFilteredMetadata: (tid: number, did: number, separatorChar: string) => Promise<string | null>;
39
40
  /** Opzioni di naming necessarie per generare il nome del file di destinazione */
40
41
  export interface IFileNamingOptions {
@@ -1,5 +1,5 @@
1
- import { DcmtTypeListCacheService, LayoutModes, SDK_Globals } from '@topconsultnpm/sdk-ts';
2
- import { searchResultToMetadataValues, DocumentDownloadSettings, getFullFileExtension } from '../../../helper';
1
+ import { DcmtTypeListCacheService, LayoutModes, MetadataDataTypes, MetadataFormats, SDK_Globals } from '@topconsultnpm/sdk-ts';
2
+ import { searchResultToMetadataValues, DocumentDownloadSettings, getFullFileExtension, buildDcmtDisplayName } from '../../../helper';
3
3
  import { TMColors } from '../../../utils/theme';
4
4
  /** Numero minimo di file PDF necessari per poterli unire in un unico documento. */
5
5
  export const MIN_PDF_FOR_MERGE = 2;
@@ -82,7 +82,7 @@ export const sanitizeFileName = (fileName, fallbackName, maxLength = 255) => {
82
82
  const illegalCharsRegex = /[<>:"/\\|?*]/g;
83
83
  const controlCharsRegex = /[\x00-\x1F\x7F]/g;
84
84
  let sanitized = fileName
85
- .replace(illegalCharsRegex, '_')
85
+ .replace(illegalCharsRegex, '-')
86
86
  .replace(controlCharsRegex, '')
87
87
  .trim();
88
88
  sanitized = sanitized.replace(/[. ]+$/, '');
@@ -146,27 +146,40 @@ export const getTypeName = async (tid) => {
146
146
  const foundDtd = typeList.find(dtd => dtd.id?.toString() === tid?.toString());
147
147
  return foundDtd?.name ?? String(tid);
148
148
  };
149
- /** Formatta un valore convertendo le date in formato dd-MM-yyyy [HH-mm-ss] */
150
- export const formatMetadataValue = (value) => {
149
+ /** Formatta un valore convertendo le date secondo il formato specificato in MetadataDescriptor.format */
150
+ export const formatMetadataValue = (value, md) => {
151
+ // Formatta come data solo se il MetadataDescriptor indica tipo DateTime
152
+ if (md?.dataType !== MetadataDataTypes.DateTime) {
153
+ return value;
154
+ }
151
155
  const date = new Date(value);
152
- if (!isNaN(date.getTime())) {
153
- const day = date.getDate().toString().padStart(2, '0');
154
- const month = (date.getMonth() + 1).toString().padStart(2, '0');
155
- const year = date.getFullYear();
156
- const hours = date.getHours();
157
- const minutes = date.getMinutes();
158
- const seconds = date.getSeconds();
159
- if (hours !== 0 || minutes !== 0 || seconds !== 0) {
160
- const hh = hours.toString().padStart(2, '0');
161
- const mm = minutes.toString().padStart(2, '0');
162
- const ss = seconds.toString().padStart(2, '0');
163
- return `${day}-${month}-${year} ${hh}-${mm}-${ss}`;
164
- }
165
- return `${day}-${month}-${year}`;
156
+ if (isNaN(date.getTime())) {
157
+ return value;
158
+ }
159
+ const format = md.format?.format;
160
+ const formatCulture = md.format?.formatCulture ?? window.navigator.language;
161
+ switch (format) {
162
+ case MetadataFormats.ShortDate:
163
+ return date.toLocaleString(formatCulture, formatCulture === "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit" } : { dateStyle: 'short' });
164
+ case MetadataFormats.ShortTime:
165
+ return date.toLocaleString(formatCulture, { timeStyle: 'short' });
166
+ case MetadataFormats.ShortDateLongTime:
167
+ return date.toLocaleString(formatCulture, formatCulture === "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit", hour: '2-digit', minute: '2-digit', second: '2-digit' } : { dateStyle: 'short', timeStyle: 'medium' }).replace(',', '');
168
+ case MetadataFormats.ShortDateShortTime:
169
+ return date.toLocaleString(formatCulture, formatCulture === "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit", hour: '2-digit', minute: '2-digit' } : { dateStyle: 'short', timeStyle: 'short' }).replace(',', '');
170
+ case MetadataFormats.LongDate:
171
+ return date.toLocaleString(formatCulture, { weekday: "long", year: "numeric", month: "long", day: "numeric" });
172
+ case MetadataFormats.LongTime:
173
+ return date.toLocaleString(formatCulture, { timeStyle: 'medium' });
174
+ case MetadataFormats.LongDateLongTime:
175
+ return date.toLocaleString(formatCulture, { weekday: "long", year: "numeric", month: "long", day: "numeric", hour: '2-digit', minute: '2-digit', second: '2-digit' });
176
+ case MetadataFormats.LongDateShortTime:
177
+ return date.toLocaleString(formatCulture, { weekday: "long", year: "numeric", month: "long", day: "numeric", hour: '2-digit', minute: '2-digit' });
178
+ default:
179
+ return date.toLocaleString(formatCulture, formatCulture === "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit" } : { dateStyle: 'short' });
166
180
  }
167
- return value;
168
181
  };
169
- /** Recupera i metadati filtrati (primi 5 con mid > 100 e valore presente), concatenati con separatorChar */
182
+ /** Recupera i metadati filtrati usando buildDcmtDisplayName, concatenati con separatorChar */
170
183
  export const getFilteredMetadata = async (tid, did, separatorChar) => {
171
184
  const metadata = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(tid, did, true);
172
185
  if (!metadata)
@@ -177,8 +190,18 @@ export const getFilteredMetadata = async (tid, did, separatorChar) => {
177
190
  const dtdWithMetadata = await DcmtTypeListCacheService.GetWithNotGrantedAsync(tid, did, metadata);
178
191
  const mdList = dtdWithMetadata?.metadata ?? [];
179
192
  const metadataList = searchResultToMetadataValues(tid, dtdResult, rows, mids, mdList, LayoutModes.Update);
180
- return metadataList
181
- .reduce((acc, md) => acc.length < 5 && md.mid && md.mid > 100 && md.value ? [...acc, formatMetadataValue(md.value)] : acc, [])
193
+ // Converte l'array di MetadataValueDescriptorEx in DcmtMetadataMap per buildDcmtDisplayName
194
+ const metadataMap = Object.fromEntries(metadataList.filter(mvd => mvd.md?.name).map(mvd => [mvd.md.name, { md: mvd.md, value: mvd.value }]));
195
+ // Usa buildDcmtDisplayName per ricavare i nomi dei metadati da visualizzare
196
+ const displayKeys = buildDcmtDisplayName(metadataMap);
197
+ if (displayKeys.length === 0)
198
+ return null;
199
+ return displayKeys
200
+ .map(key => {
201
+ const entry = metadataMap[key];
202
+ return entry?.value ? formatMetadataValue(String(entry.value), entry.md) : null;
203
+ })
204
+ .filter(Boolean)
182
205
  .join(separatorChar);
183
206
  };
184
207
  /** Genera il nome file di destinazione in base alle impostazioni di naming */
@@ -17,11 +17,15 @@ export const isMetadataOnlyDcmt = (fileExt, fileCount) => {
17
17
  * @param showTMRelationViewer - Se true, usa selectedItemsRelationViewer, altrimenti selectedDcmtInfos
18
18
  */
19
19
  export const getMergePdfSelectionStats = (selectedDcmtInfos, selectedItemsFull, selectedItemsRelationViewer, showTMRelationViewer) => {
20
- // Mappa per lookup veloce di FILECOUNT da selectedItemsFull (usato solo per isMetadataOnly)
21
- const fileCountMap = new Map(selectedItemsFull.map(d => [`${d.TID}_${d.DID}`, d.FILECOUNT]));
22
- // Pre-calcolo delle informazioni sui documenti selezionati
23
- const docs = showTMRelationViewer
24
- ? selectedItemsRelationViewer
20
+ /**
21
+ * Pre-calcola info documenti selezionati in base alla sorgente dati:
22
+ * - RelationViewer (showTMRelationViewer=true): usa IRelatedDcmt con itemsCount/fileExt
23
+ * - Griglia documenti (showTMRelationViewer=false): usa DcmtInfo + lookup FILECOUNT da selectedItemsFull
24
+ */
25
+ let docs;
26
+ if (showTMRelationViewer) {
27
+ // Sorgente: RelationViewer - itemsCount e fileExt disponibili direttamente su IRelatedDcmt
28
+ docs = selectedItemsRelationViewer
25
29
  .filter(i => i.isDcmt)
26
30
  .map(i => {
27
31
  const ext = i.fileExt ?? undefined;
@@ -30,21 +34,25 @@ export const getMergePdfSelectionStats = (selectedDcmtInfos, selectedItemsFull,
30
34
  ext,
31
35
  isPdf: isPdfExt(ext),
32
36
  isConvertible: isConvertibleToPdfExt(ext),
33
- isMetadataOnly: isMetadataOnlyDcmt(ext, null)
37
+ isMetadataOnly: isMetadataOnlyDcmt(ext, i.fileCount)
34
38
  };
35
- })
36
- : selectedDcmtInfos.map(d => {
39
+ });
40
+ }
41
+ else {
42
+ // Sorgente: Griglia documenti - FILECOUNT richiede lookup da selectedItemsFull
43
+ const fileCountMap = new Map(selectedItemsFull.map(d => [`${d.TID}_${d.DID}`, d.FILECOUNT]));
44
+ docs = selectedDcmtInfos.map(d => {
37
45
  const ext = d.FILEEXT ?? undefined;
38
46
  const key = `${d.TID}_${d.DID}`;
39
- const fileCount = fileCountMap.get(key);
40
47
  return {
41
48
  key,
42
49
  ext,
43
50
  isPdf: isPdfExt(ext),
44
51
  isConvertible: isConvertibleToPdfExt(ext),
45
- isMetadataOnly: isMetadataOnlyDcmt(ext, fileCount)
52
+ isMetadataOnly: isMetadataOnlyDcmt(ext, fileCountMap.get(key))
46
53
  };
47
54
  });
55
+ }
48
56
  // Elementi convertibili: file con estensione convertibile (esclusi documenti di soli metadati)
49
57
  const convertibleSelectedItems = docs
50
58
  .filter(i => i.isConvertible && !i.isMetadataOnly)
@@ -68,7 +76,9 @@ export const getMergePdfSelectionStats = (selectedDcmtInfos, selectedItemsFull,
68
76
  metadataOnlySelectedItems,
69
77
  hasMetadataOnlySelected: metadataOnlySelectedItems.length > 0,
70
78
  mergeableSelectedCount,
71
- hasEnoughPdfForMerge: mergeableSelectedCount >= MIN_PDF_FOR_MERGE,
79
+ // Merge possibile se: >= 2 file unibili OPPURE >= 1 file convertibile/metadata-only (verrà trasformato in PDF)
80
+ hasEnoughPdfForMerge: mergeableSelectedCount >= MIN_PDF_FOR_MERGE ||
81
+ (mergeableSelectedCount >= 1 && (convertibleSelectedItems.length > 0 || metadataOnlySelectedItems.length > 0)),
72
82
  };
73
83
  };
74
84
  // LAZY LOADING pdf-lib
@@ -3,7 +3,8 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
3
3
  import styled from 'styled-components';
4
4
  import { LoadIndicator } from 'devextreme-react';
5
5
  import { AppModules, DataColumnTypes, DataListViewModes, DcmtTypeListCacheService, LayoutCacheService, LayoutModes, MetadataDataDomains, MetadataFormats, SDK_Globals, SystemMIDsAsNumber, UserListCacheService, } from '@topconsultnpm/sdk-ts';
6
- import { deepCompare, generateUniqueColumnKeys, genUniqueId, getSearchToolbarVisibility, IconBoard, IconDcmtTypeSys, IconDelete, IconMenuVertical, IconPlatform, IconRefresh, IconSearchCheck, IconShow, isApprovalWorkflowView, isSign4TopEnabled, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, SDKUI_Globals, SDKUI_Localizator } from '../../../helper';
6
+ import { deepCompare, generateUniqueColumnKeys, genUniqueId, getSearchToolbarVisibility, IconAll, IconBoard, IconDcmtTypeSys, IconDelete, IconMenuVertical, IconPlatform, IconRefresh, IconSearchCheck, IconShow, isApprovalWorkflowView, isSign4TopEnabled, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, SDKUI_Globals, SDKUI_Localizator } from '../../../helper';
7
+ import { CounterItemKey } from '../../base/TMCounterContainer';
7
8
  import { getDcmtCicoStatus } from '../../../helper/checkinCheckoutManager';
8
9
  import { DcmtOperationTypes, SearchResultContext, } from '../../../ts';
9
10
  import { Gutters } from '../../../utils/theme';
@@ -656,7 +657,7 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, }) => {
656
657
  && !openS4TViewer
657
658
  && !showTodoDcmtForm);
658
659
  }, [showToppyForApprove, showToppyDraggableHelpCenter, selectedDocs, showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, editPdfForm, openS4TViewer, showTodoDcmtForm]);
659
- const searchResutlToolbar = _jsxs(_Fragment, { children: [(dcmtsReturned != dcmtsFound) && _jsx("p", { style: { textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${dcmtsReturned}/${dcmtsFound} restituiti` }), context === SearchResultContext.FAVORITES_AND_RECENTS &&
660
+ const searchResutlToolbar = _jsxs(_Fragment, { children: [context === SearchResultContext.FAVORITES_AND_RECENTS &&
660
661
  _jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsyncDatagrid }), _jsx(TMContextMenu, { items: operationItems, trigger: "left", children: _jsx(IconMenuVertical, { color: 'white', cursor: 'pointer' }) })] });
661
662
  const tmSearchResult = useMemo(() => (!searchResults || searchResults.length <= 0)
662
663
  ? _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), showNoDcmtFoundMessage && _jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoDcmtFound }), openAddDocumentForm && _jsx("div", { style: { marginTop: "10px" }, children: _jsx(TMButton, { fontSize: "15px", icon: _jsx("i", { className: 'dx-icon-share' }), caption: SDKUI_Localizator.Share, onClick: openAddDocumentForm }) })] })
@@ -664,7 +665,7 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, }) => {
664
665
  _jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs("div", { ref: floatingBarContainerRef, style: { position: 'relative', height: '100%', width: '100%' }, children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && deviceType !== DeviceType.MOBILE, start: showSelector ? deviceType !== DeviceType.MOBILE ? ['30%', '70%'] : splitterSize : ['0%', '100%'], children: [showSelector ?
665
666
  _jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, selectedSearchResult: selectedSearchResult, autoSelectFirst: !isMobile || currentSearchResults.length === 1, onSelectionChanged: onSearchResultSelectionChanged }) })
666
667
  :
667
- _jsx(_Fragment, {}), _jsx(TMLayoutItem, { children: _jsx(TMSearchResultGrid, { openInOffice: openInOffice, fromDTD: fromDTD, operationItems: operationItems, allUsers: allUsers, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, showExportForm: showExportForm, onFocusedItemChanged: handleFocusedItemChangedFromGrid, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync({ inputDcmts, downloadType, downloadMode, onFileDownloaded: onFileOpened, confirmAttachments }), lastUpdateSearchTime: lastUpdateSearchTime, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], onSelectionChanged: (items) => { setSelectedItems(items); }, onDblClick: () => openFormHandler(LayoutModes.Update), showSearchTMDatagrid: showSearchTMDatagrid, onVisibleItemChanged: setVisibleItems, updateDataColumnsFromDataGrid: updateDataColumnsFromDataGrid, updateDataSourceFromDataGrid: updateDataSourceFromDataGrid, updateSelectedRowKeysFromDataGrid: updateSelectedRowKeysFromDataGrid, disableAutoFocus: autoFocusFirstRow === false && isFirstAutoFocusRef.current }) })] }), renderFloatingBar] }), _jsx(TMToppyDraggableHelpCenter, { usePortal: toppyHelpCenterUsePortal, isVisible: isToppyHelpCenterVisible, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { dtd: fromDTD, deviceType: deviceType, onApprove: () => {
668
+ _jsx(_Fragment, {}), _jsx(TMLayoutItem, { children: _jsx(TMSearchResultGrid, { openInOffice: openInOffice, fromDTD: fromDTD, operationItems: operationItems, allUsers: allUsers, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, showExportForm: showExportForm, onFocusedItemChanged: handleFocusedItemChangedFromGrid, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync({ inputDcmts, downloadType, downloadMode, onFileDownloaded: onFileOpened, confirmAttachments }), lastUpdateSearchTime: lastUpdateSearchTime, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], onSelectionChanged: (items) => { setSelectedItems(items); }, onDblClick: () => openFormHandler(LayoutModes.Update), showSearchTMDatagrid: showSearchTMDatagrid, onVisibleItemChanged: setVisibleItems, updateDataColumnsFromDataGrid: updateDataColumnsFromDataGrid, updateDataSourceFromDataGrid: updateDataSourceFromDataGrid, updateSelectedRowKeysFromDataGrid: updateSelectedRowKeysFromDataGrid, disableAutoFocus: autoFocusFirstRow === false && isFirstAutoFocusRef.current, dcmtsReturned: dcmtsReturned, dcmtsFound: dcmtsFound }) })] }), renderFloatingBar] }), _jsx(TMToppyDraggableHelpCenter, { usePortal: toppyHelpCenterUsePortal, isVisible: isToppyHelpCenterVisible, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { dtd: fromDTD, deviceType: deviceType, onApprove: () => {
668
669
  updateShowApprovePopup(true);
669
670
  }, onSignApprove: () => {
670
671
  handleSignApprove();
@@ -855,7 +856,7 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, }) => {
855
856
  _jsxs(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmSearchResult', children: [_jsx(PanelDisabledStateHandler, { isBoardDisabled: isBoardDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar })] }) }) }) }), renderDcmtOperations] }));
856
857
  };
857
858
  export default TMSearchResult;
858
- const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, inputFocusedItem, allowMultipleSelection = true, showExportForm = false, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, onSelectionChanged, onDblClick, showSearchTMDatagrid, updateDataColumnsFromDataGrid, updateDataSourceFromDataGrid, updateSelectedRowKeysFromDataGrid, disableAutoFocus = false }) => {
859
+ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, inputFocusedItem, allowMultipleSelection = true, showExportForm = false, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, onSelectionChanged, onDblClick, showSearchTMDatagrid, updateDataColumnsFromDataGrid, updateDataSourceFromDataGrid, updateSelectedRowKeysFromDataGrid, disableAutoFocus = false, dcmtsReturned, dcmtsFound }) => {
859
860
  const [dataSource, setDataSource] = useState();
860
861
  const [columns, setColumns] = useState([]);
861
862
  const [selectedRowKeys, setSelectedRowKeys] = useState([]);
@@ -1267,7 +1268,21 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
1267
1268
  setVisibleItems(visibleData);
1268
1269
  }, []);
1269
1270
  useEffect(() => { onVisibleItemChanged?.(visibleItems); }, [visibleItems]);
1270
- return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [!isDataGridReady && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: '10px' }, children: [_jsx(LoadIndicator, { height: 60, width: 60 }), _jsx("div", { children: SDKUI_Localizator.Loading })] })), isDataGridReady && _jsx(TMDataGrid, { ref: dataGridRef, id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: disableAutoFocus ? undefined : Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearchTMDatagrid, showFilterPanel: true, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: pageSize, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, showHeaderColumnChooser: true, onKeyDown: onKeyDown, customContextMenuItems: operationItems, counterConfig: { show: true } })] });
1271
+ return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [!isDataGridReady && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: '10px' }, children: [_jsx(LoadIndicator, { height: 60, width: 60 }), _jsx("div", { children: SDKUI_Localizator.Loading })] })), isDataGridReady && _jsx(TMDataGrid, { ref: dataGridRef, id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: disableAutoFocus ? undefined : Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearchTMDatagrid, showFilterPanel: true, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: pageSize, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, showHeaderColumnChooser: true, onKeyDown: onKeyDown, customContextMenuItems: operationItems, counterConfig: {
1272
+ show: true,
1273
+ items: dcmtsReturned !== undefined && dcmtsFound !== undefined
1274
+ ? new Map([
1275
+ [CounterItemKey.allItems, {
1276
+ key: CounterItemKey.allItems,
1277
+ show: true,
1278
+ caption: `${dcmtsReturned} restituiti su ${dcmtsFound} trovati`,
1279
+ value: `${dcmtsReturned}/${dcmtsFound}`,
1280
+ icon: _jsx(IconAll, {}),
1281
+ order: -1
1282
+ }]
1283
+ ])
1284
+ : undefined
1285
+ } })] });
1271
1286
  };
1272
1287
  //#region TMSearchResultSelector
1273
1288
  const StyledItemTemplate = styled.div `
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
- import { IconDcmtType, IconDcmtTypeOnlyMetadata, IconLocked, IconView, isCreateCertificateEnabled, isPdfEditorEnabled, isSign4TopEnabled, LocalizeArchiveConstraints, LocalizeParametricFilterTypes, SDKUI_Localizator, TMImageLibrary } from '../../helper';
3
+ import { getDTDDisplayNameInfo, IconDcmtType, IconDcmtTypeOnlyMetadata, IconLocked, IconView, isCreateCertificateEnabled, isPdfEditorEnabled, isSign4TopEnabled, LocalizeArchiveConstraints, LocalizeParametricFilterTypes, SDKUI_Localizator, TMImageLibrary } from '../../helper';
4
4
  import { AccessLevels, AccessLevelsEx, ArchiveConstraints, DcmtTypeListCacheService, OwnershipLevels, ParametricFilterTypes, SDK_Globals, SDK_Localizator, TemplateTIDs } from '@topconsultnpm/sdk-ts';
5
5
  import TMSpinner from '../base/TMSpinner';
6
6
  import { StyledDivHorizontal, StyledTooltipContainer, StyledTooltipItem, StyledTooltipSeparatorItem } from '../base/Styled';
@@ -309,6 +309,18 @@ export default TMTidViewer;
309
309
  export const cellRenderTID = (data, noneSelectionText) => {
310
310
  return (_jsx(TMTidViewer, { tid: data.value, noneSelectionText: noneSelectionText }));
311
311
  };
312
+ /** Componente per mostrare il metodo di visualizzazione del nome documento (carica i metadati dalla cache se necessario) */
313
+ const TMDisplayNameMethodItem = ({ dtd }) => {
314
+ const [displayNameMethod, setDisplayNameMethod] = useState('...');
315
+ useEffect(() => {
316
+ const fetchDisplayNameMethod = async () => {
317
+ const method = await getDTDDisplayNameInfo(dtd);
318
+ setDisplayNameMethod(method);
319
+ };
320
+ fetchDisplayNameMethod();
321
+ }, [dtd]);
322
+ return _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.DisplayNameMethod}: ${displayNameMethod}` });
323
+ };
312
324
  export const renderDTDTooltipContent = (dtd) => {
313
325
  const mapAccessLevelToLocalizedString = (level) => {
314
326
  if (level === undefined || level === null)
@@ -343,5 +355,5 @@ export const renderDTDTooltipContent = (dtd) => {
343
355
  isPdfEditorEnabled(dtd.widgets) ? 'PDFEditor' : null,
344
356
  ].filter(Boolean);
345
357
  return (_jsxs(_Fragment, { children: [_jsx(StyledTooltipSeparatorItem, {}), enabledWidgets.length > 0 && (_jsxs(StyledTooltipItem, { children: ["Widgets: ", enabledWidgets.join(', ')] })), enabledWidgets.length === 0 && (_jsxs(StyledTooltipItem, { children: ["Widgets: ", SDKUI_Localizator.No] }))] }));
346
- })() : (_jsxs(_Fragment, { children: [_jsx(StyledTooltipSeparatorItem, {}), _jsxs(StyledTooltipItem, { children: ["Widgets: ", SDKUI_Localizator.No] })] }))] })] }));
358
+ })() : (_jsxs(_Fragment, { children: [_jsx(StyledTooltipSeparatorItem, {}), _jsxs(StyledTooltipItem, { children: ["Widgets: ", SDKUI_Localizator.No] })] })), _jsx(StyledTooltipSeparatorItem, {}), _jsx(TMDisplayNameMethodItem, { dtd: dtd })] })] }));
347
359
  };
@@ -84,6 +84,7 @@ export declare class SearchSettings {
84
84
  height: string;
85
85
  };
86
86
  };
87
+ relationExpandLevel: number;
87
88
  }
88
89
  export declare class FloatingMenuBarSettings {
89
90
  orientation?: 'horizontal' | 'vertical';
@@ -122,6 +122,7 @@ export class SearchSettings {
122
122
  this.maxDcmtsToBeReturned = DEFAULT_MAX_DCMTS_TO_BE_RETURNED;
123
123
  this.floatingMenuBar = new FloatingMenuBarSettings();
124
124
  this.panelLayout = {};
125
+ this.relationExpandLevel = 4; // Livello di espansione predefinito per le correlazioni
125
126
  }
126
127
  }
127
128
  export class FloatingMenuBarSettings {
@@ -110,7 +110,9 @@ export declare class SDKUI_Localizator {
110
110
  static get Close(): "Ausgang" | "Close" | "Salida" | "Sortie" | "Saída" | "Chiudi";
111
111
  static get Closed(): "Geschlossen" | "Closed" | "Cerrada" | "Fermée" | "Fechada" | "Chiusa";
112
112
  static get CloseTask(): string;
113
+ static get Collapse(): "Reduzieren" | "Collapse" | "Contraer" | "Réduire" | "Recolher" | "Comprimi";
113
114
  static get CollapseAll(): "Alle reduzieren" | "Collapse all" | "Contraer todo" | "Tout réduire" | "Recolher tudo" | "Comprimi tutto";
115
+ static get CollapseTree(): "Gesamten Baum reduzieren" | "Collapse entire tree" | "Contraer todo el árbol" | "Réduire tout l'arbre" | "Recolher toda a árvore" | "Comprimi tutto l'albero";
114
116
  static get Columns_All_Hide(): "Alle Spalten ausblenden" | "Hide all columns" | "Ocultar todas las columnas" | "Masquer toutes les colonnes" | "Ocultar todas as colunas" | "Nascondi tutte le colonne";
115
117
  static get Columns_All_Show(): "Alle Spalten anzeigen" | "Show all columns" | "Mostrar todas las columnas" | "Afficher toutes les colonnes" | "Mostrar todas as colunas" | "Visualizza tutte le colonne";
116
118
  static get Comment(): string;
@@ -202,7 +204,11 @@ export declare class SDKUI_Localizator {
202
204
  static get DiagramItemTypes_Exit(): "Salida" | "Sortie" | "Saída" | "Beenden" | "Exit" | "Uscita";
203
205
  static get DiagramItemTypes_End(): "Ende" | "End" | "Fin" | "Fim" | "Fine";
204
206
  static get Disabled(): "Deaktiviert" | "Disabled" | "Deshabilitado" | "Désactivé" | "Desabilitado" | "Disabilitato";
207
+ static get DisableMultipleSelection(): string;
205
208
  static get DisplayFormat(): string;
209
+ static get DisplayNameMethod(): string;
210
+ static get DisplayNameMethod_Abstract(): string;
211
+ static get DisplayNameMethod_Top5(): string;
206
212
  static get DistinctValues(): "Unterschiedliche Werte" | "Distinct values" | "Valores distintos" | "Valeurs distinctes" | "Valori distinti";
207
213
  static get DocumentArchivedSuccessfully(): "Dokument erfolgreich archiviert" | "Document archived successfully" | "Documento archivado con éxito" | "Document archivé avec succès" | "Documento arquivado com sucesso" | "Documento archiviato con successo";
208
214
  static get DocumentAttachedSuccessfullyToEmail(): "Dokument erfolgreich zur E-Mail hinzugefügt." | "Document attached successfully to the email." | "Documento adjuntado exitosamente al correo electrónico." | "Document joint avec succès à l'e-mail." | "Documento anexado com sucesso ao e-mail." | "Documento allegato con successo all'email.";
@@ -211,6 +217,10 @@ export declare class SDKUI_Localizator {
211
217
  static get DocumentOpenedSuccessfully(): "Dokument erfolgreich geöffnet" | "Document opened successfully" | "Documento abierto con éxito" | "Document ouvert avec succès" | "Documento aberto com sucesso" | "Documento aperto con successo";
212
218
  static get Document(): "Dokument" | "Document" | "Documento";
213
219
  static get Documents(): string;
220
+ static get DocumentsNotAvailableOrNoCorrelations(): string;
221
+ static get NoMasterDocumentsAvailable(): string;
222
+ static get NoRelatedDocumentsToDisplay(): string;
223
+ static get NoRelationsAvailable(): string;
214
224
  static get DocumentOperations(): string;
215
225
  static get DocumentTypeNameAndDID(): string;
216
226
  static get DocumentTypeNameAndCustomMetadata(): string;
@@ -247,6 +257,7 @@ export declare class SDKUI_Localizator {
247
257
  static get EmailIsNotValid(): "Dies ist keine gültige e-mail Adresse" | "This is not a valid email address" | "Esta no es una dirección de correo electrónico válida." | "Cette adresse email n'est pas valide" | "Este não é um endereço de e-mail válido" | "Questo non è un indirizzo e-mail valido";
248
258
  static get EndDateMatchesToday(): "Das Ablaufdatum entspricht dem heutigen Datum" | "The expiration date matches today's date" | "La fecha de vencimiento coincide con la fecha de hoy" | "La date d'expiration correspond à la date d'aujourd'hui" | "A data de expiração coincide com a data de hoje" | "La data di scadenza coincide con la data odierna";
249
259
  static get EndDateSetForTomorrow(): "Das Ablaufdatum ist für morgen festgelegt" | "The expiration date is set for tomorrow" | "La fecha de vencimiento está fijada para mañana" | "La date d'expiration est fixée pour demain" | "A data de expiração está marcada para amanhã" | "La data di scadenza è imminente (ovvero fissata per domani)";
260
+ static get EnableMultipleSelection(): string;
250
261
  static get Endpoint(): "Zugangspunkt" | "Endpoint" | "Punto de acceso" | "Point d'entrée" | "Ponto de acesso" | "Punto di accesso";
251
262
  static get EnterNameForAccess(): "Geben Sie einen Namen für den Zugriff ein" | "Enter a name for access" | "Introduzca un nombre para el acceso" | "Entrez un nom pour l'accès" | "Insira um nome para o acesso" | "Inserire un nome per l'accesso";
252
263
  static get EnterValue(): "Geben Sie einen Wert ein" | "Enter a value" | "Introducir un valor" | "Entrez une valeur" | "Digite um valor" | "Inserire un valore";
@@ -267,6 +278,17 @@ export declare class SDKUI_Localizator {
267
278
  static get ExtractedOn(): "Ausgezogen am" | "Extracted on" | "Extraído el" | "Extrait le" | "Extraído em" | "Estratto il";
268
279
  static get EvaluateResult(): "Bewerten Sie das Ergebnis" | "Evaluate result" | "Valorar el resultado" | "Évalue les résultats" | "Avalia os resultados" | "Valuta il risultato";
269
280
  static get ExpandAll(): "Alle erweitern" | "Expand all" | "Expandir todo" | "Tout développer" | "Expandir tudo" | "Espandi tutto";
281
+ static get ExpandLevels(): "Erweitern ({{0}} Ebenen)" | "Expand ({{0}} levels)" | "Expandir ({{0}} niveles)" | "Développer ({{0}} niveaux)" | "Expandir ({{0}} níveis)" | "Espandi ({{0}} livelli)";
282
+ static get ExpandAllLevels(): "Erweitern (alle Ebenen)" | "Expand (all levels)" | "Expandir (todos los niveles)" | "Développer (tous les niveaux)" | "Expandir (todos os níveis)" | "Espandi (tutti i livelli)";
283
+ static get CtrlClickToReloadAll(): "Strg+Klick = alles neu laden" | "Ctrl+click = reload all" | "Ctrl+clic = recargar todo" | "Ctrl+clic = tout recharger" | "Ctrl+clique = recarregar tudo" | "Ctrl+click = ricarica tutto";
284
+ static get ExpandComplete(): "Erweiterung abgeschlossen" | "Expand complete" | "Expansión completada" | "Expansion terminée" | "Expansão concluída" | "Espansione completata";
285
+ static get ExpandToLevel(): "Erweitern bis Ebene {{0}}" | "Expand to level {{0}}" | "Expandir hasta el nivel {{0}}" | "Développer jusqu'au niveau {{0}}" | "Expandir até o nível {{0}}" | "Espandi fino al livello {{0}}";
286
+ static get ExpansionLevel(): "Erweiterungsebene" | "Expansion level" | "Nivel de expansión" | "Niveau d'expansion" | "Nível de expansão" | "Livello di espansione";
287
+ static get ExpansionLevelSettings(): "Erweiterungsebene Einstellungen" | "Expansion level settings" | "Configuración del nivel de expansión" | "Paramètres du niveau d'expansion" | "Configurações do nível de expansão" | "Impostazioni livello espansione";
288
+ static get ExpansionSettings(): "Erweiterungseinstellungen" | "Expansion settings" | "Configuración de expansión" | "Paramètres d'expansion" | "Configurações de expansão" | "Impostazioni espansione";
289
+ static get ExpansionInProgress(): "Erweiterung läuft..." | "Expansion in progress..." | "Expansión en curso..." | "Expansion en cours..." | "Expansão em andamento..." | "Espansione in corso...";
290
+ static get FullReloadInProgress(): "Vollständiges Neuladen läuft..." | "Full reload in progress..." | "Recarga completa en curso..." | "Rechargement complet en cours..." | "Recarregamento completo em andamento..." | "Ricaricamento completo in corso...";
291
+ static get ExpansionProgress(): "Erweiterung {{0}} von {{1}}..." | "Expansion {{0}} of {{1}}..." | "Expansión {{0}} de {{1}}..." | "Expansion {{0}} sur {{1}}..." | "Expansão {{0}} de {{1}}..." | "Espansione {{0}} di {{1}}...";
270
292
  static get Expected(): "Erwartet" | "Expected" | "Esperado" | "Attendu" | "Atteso";
271
293
  static get Expiration(): "Ablaufdatum" | "Expiration" | "Fecha de expiración" | "Date d'expiration" | "Data de expiração" | "Scadenza";
272
294
  static get ExpirationDate(): "Ablaufdatum" | "Expiration date" | "Fecha de vencimiento" | "Date d'échéance" | "Data de validade" | "Data di scadenza";
@@ -377,6 +399,7 @@ export declare class SDKUI_Localizator {
377
399
  static get Grids(): string;
378
400
  static get Hide_CompleteName(): "Vollständigen Namen ausblenden" | "Hide full name" | "Ocultar nombre completo" | "Masquer le nom complet" | "Ocultar nome completo" | "Nascondi nome completo";
379
401
  static get HideAll(): "Alle ausblenden" | "Hide all" | "Ocultar todo" | "Masquer tout" | "Ocultar tudo" | "Nascondi tutti";
402
+ static get HideDetailsWithZeroDocs(): string;
380
403
  static get HideFloatingBar(): string;
381
404
  static get HideFilters(): string;
382
405
  static get HideLeftPanel(): "Linkes Panel ausblenden" | "Hide left panel" | "Ocultar panel izquierdo" | "Masquer le panneau de gauche" | "Ocultar painel esquerdo" | "Nascondi il pannello sinistro";
@@ -416,7 +439,10 @@ export declare class SDKUI_Localizator {
416
439
  static get List(): "Liste" | "List" | "Lista";
417
440
  static get List_Hide(): "Liste ausblenden" | "Hide list" | "Ocultar lista" | "Masquer la liste" | "Nascondi la lista";
418
441
  static get List_Show(): "liste anzeigen" | "Show list" | "Ver lista" | "Afficher la liste" | "Visualizza la lista";
442
+ static get Levels(): "Ebenen" | "Levels" | "Niveles" | "Niveaux" | "Níveis" | "Livelli";
419
443
  static get Loading(): "Laden" | "Loading" | "Carga" | "Chargement" | "Caricamento";
444
+ static get LoadingDetailDocuments(): "Laden der Detaildokumente" | "Loading detail documents" | "Cargando documentos de detalle" | "Chargement des documents de détail" | "Carregando documentos de detalhe" | "Caricamento documenti dettaglio";
445
+ static get LoadingMasterDocuments(): "Laden der Masterdokumente" | "Loading master documents" | "Cargando documentos maestros" | "Chargement des documents maîtres" | "Carregando documentos mestres" | "Caricamento documenti master";
420
446
  static get Localization(): "Lokalisierung" | "Localization" | "Localización" | "Localisation" | "Localização" | "Localizzazione";
421
447
  static get LoadingWorkGroups(): string;
422
448
  static get LoadingParticipants(): string;
@@ -689,6 +715,7 @@ export declare class SDKUI_Localizator {
689
715
  static get Seconds(): "Sekunden" | "Seconds" | "Segundos" | "Secondes" | "Segundas" | "Secondi";
690
716
  static get Select(): "Wählen Sie Ihre" | "Select" | "Seleccionar" | "Sélectionne" | "Selecione" | "Seleziona";
691
717
  static get SelectAnOperationBetween(): "Wählen Sie eine Operation zwischen" | "Select an operation between" | "Selecciona una operación entre" | "Sélectionnez une opération entre" | "Selecione uma operação entre" | "Seleziona un'operazione tra";
718
+ static get SelectDocumentToViewSearchResults(): "Wählen Sie ein Dokument aus, um die Details anzuzeigen" | "Select a document to view details" | "Selecciona un documento para ver los detalles" | "Sélectionnez un document pour afficher les détails" | "Selecione um documento para visualizar os detalhes" | "Seleziona un documento per visualizzare i dettagli";
692
719
  static get SelectArchiveToStart(): "Klicken Sie auf Archivieren, um zu beginnen." | "Click on Archive button to start." | "Haz clic en el botón Archivar para comenzar." | "Cliquez sur le bouton Archiver pour commencer." | "Clique no botão Arquivar para iniciar." | "Clicca sul pulsante Archivia per iniziare.";
693
720
  static get SelectAttachToStart(): "Sie können Dateien zu Ihrer E-Mail hinzufügen, klicken Sie auf Anhängen, um zu beginnen." | "You can attach files to your email, click on Attach button to start." | "Puedes adjuntar archivos a tu correo electrónico, haz clic en el botón Adjuntar para comenzar." | "Vous pouvez joindre des fichiers à votre e-mail, cliquez sur le bouton Joindre pour commencer." | "Você pode anexar arquivos ao seu e-mail, clique no botão Anexar para iniciar." | "Puoi allegare file alla tua email, clicca sul pulsante Allega per iniziare.";
694
721
  static get SelectFromAttachments(): "Aus Anhängen auswählen" | "Select from attachments" | "Seleccionar de archivos adjuntos" | "Sélectionner parmi les pièces jointes" | "Selecionar dos anexos" | "Seleziona dagli allegati";
@@ -727,6 +754,7 @@ export declare class SDKUI_Localizator {
727
754
  static get ShowLess(): "Weniger anzeigen" | "Show less" | "Mostrar menos" | "Afficher moins" | "Mostra meno";
728
755
  static get Show_CompleteName(): "Vollständigen Namen anzeigen" | "View full name" | "Mostrar nombre completo" | "Afficher le nom complet" | "Mostrar nome completo" | "Visualizza nome completo";
729
756
  static get ShowDetails(): "Details anzeigen" | "Show details" | "Mostrar detalles" | "Afficher les détails" | "Mostrar detalhes" | "Mostra dettagli";
757
+ static get ShowDetailsWithZeroDocs(): string;
730
758
  static get ShowFilters(): string;
731
759
  static get ShowFormattingOptions(): "Formatierungsoptionen anzeigen" | "Show formatting options" | "Mostrar opciones de formato" | "Afficher les options de formatage" | "Mostrar opções de formatação" | "Mostra opzioni di formattazione";
732
760
  static get ShowHideMetadataSystemDesc(): "Anzeigen oder Verbergen von Methadaten des Dokumententypsystems" | "Shows/hides system metadata of selected document type" | "Ver u ocultar los metadatos de sistema del tipo de documento" | "Visualise ou cache les métadonnées de système du type de document" | "Mostra ou oculta o tipo de documento de metadados do sistema" | "Visualizza o nasconde i metadati di sistema del tipo documento";