@topconsultnpm/sdkui-react 6.21.0-dev4.9 → 6.21.0-dev5.2
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.
- package/lib/components/base/TMTreeView.d.ts +16 -13
- package/lib/components/base/TMTreeView.js +230 -64
- package/lib/components/features/documents/TMDcmtIcon.d.ts +3 -1
- package/lib/components/features/documents/TMDcmtIcon.js +5 -32
- package/lib/components/features/documents/TMFileUploader.js +1 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.js +50 -11
- package/lib/components/features/documents/TMRelationViewer.d.ts +12 -10
- package/lib/components/features/documents/TMRelationViewer.js +400 -96
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +4 -3
- package/lib/components/features/documents/copyAndMergeDcmtsShared.js +47 -23
- package/lib/components/features/search/TMSearchResult.js +20 -5
- package/lib/components/viewers/TMTidViewer.js +14 -2
- package/lib/helper/SDKUI_Globals.d.ts +1 -0
- package/lib/helper/SDKUI_Globals.js +1 -0
- package/lib/helper/SDKUI_Localizator.d.ts +28 -0
- package/lib/helper/SDKUI_Localizator.js +280 -0
- package/lib/helper/TMUtils.d.ts +33 -1
- package/lib/helper/TMUtils.js +104 -1
- package/lib/helper/helpers.js +9 -0
- package/package.json +3 -4
|
@@ -7,15 +7,17 @@ import { IconMultipleSelection, IconCheckFile, IconDetailDcmts, SDKUI_Localizato
|
|
|
7
7
|
import { FormModes, SearchResultContext } from '../../../ts';
|
|
8
8
|
import { TMColors } from '../../../utils/theme';
|
|
9
9
|
import ShowAlert from '../../base/TMAlert';
|
|
10
|
-
import { DeviceType } from '../../base/TMDeviceProvider';
|
|
10
|
+
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
11
11
|
import { TMSaveFormButtonPrevious, TMSaveFormButtonNext } from '../../forms/TMSaveForm';
|
|
12
12
|
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
13
13
|
import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
14
14
|
import TMSearchResult from '../search/TMSearchResult';
|
|
15
15
|
import TMDcmtForm from './TMDcmtForm';
|
|
16
16
|
import { TMNothingToShow } from './TMDcmtPreview';
|
|
17
|
-
import { Spinner, TMButton } from '../..';
|
|
17
|
+
import { Spinner, TMButton, TMLayoutWaitingContainer } from '../..';
|
|
18
18
|
import { useDocumentOperations } from '../../../hooks/useDocumentOperations';
|
|
19
|
+
import TMToppyMessage from '../../../helper/TMToppyMessage';
|
|
20
|
+
import TMPanel from '../../base/TMPanel';
|
|
19
21
|
const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, appendMasterDcmts, onTaskCreateRequest, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, datagridUtility, dcmtUtility, fetchRemoteCertificates }) => {
|
|
20
22
|
const floatingBarContainerRef = useRef(null);
|
|
21
23
|
const [focusedItem, setFocusedItem] = useState();
|
|
@@ -27,6 +29,8 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
27
29
|
const [isCheckingFirstLoad, setIsCheckingFirstLoad] = useState(true);
|
|
28
30
|
const [contextMenuVisible, setContextMenuVisible] = useState(false);
|
|
29
31
|
const [contextMenuPosition, setContextMenuPosition] = useState({ x: 0, y: 0 });
|
|
32
|
+
// Track if TMRelationViewer is loading (used to disable context menu during loading)
|
|
33
|
+
const [isRelationViewerLoading, setIsRelationViewerLoading] = useState(false);
|
|
30
34
|
const [dtdFocused, setDtdFocused] = useState();
|
|
31
35
|
const [refreshKey, setRefreshKey] = useState(0);
|
|
32
36
|
// Separate refresh key for TMFormOrResultWrapper only (doesn't affect tmTreeView)
|
|
@@ -213,6 +217,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
213
217
|
onRefreshAfterAddDcmtToFavs,
|
|
214
218
|
},
|
|
215
219
|
});
|
|
220
|
+
const { dcmtOperations: { abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, }, } = features;
|
|
216
221
|
// Load dtdMaster when inputDcmts changes
|
|
217
222
|
useEffect(() => {
|
|
218
223
|
const loadDtdMaster = async () => {
|
|
@@ -265,14 +270,14 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
265
270
|
const commandsMenuItems = [
|
|
266
271
|
{
|
|
267
272
|
icon: _jsx(IconMultipleSelection, { color: allowMultipleSelection ? TMColors.tertiary : TMColors.text_normal }),
|
|
268
|
-
name:
|
|
273
|
+
name: allowMultipleSelection ? SDKUI_Localizator.DisableMultipleSelection : SDKUI_Localizator.EnableMultipleSelection,
|
|
269
274
|
onClick: () => {
|
|
270
275
|
setAllowMultipleSelection(prev => !prev);
|
|
271
276
|
}
|
|
272
277
|
},
|
|
273
278
|
{
|
|
274
|
-
icon: _jsx(IconCheckFile, {}),
|
|
275
|
-
name:
|
|
279
|
+
icon: _jsx(IconCheckFile, { color: showZeroDcmts ? TMColors.tertiary : TMColors.text_normal }),
|
|
280
|
+
name: showZeroDcmts ? SDKUI_Localizator.HideDetailsWithZeroDocs : SDKUI_Localizator.ShowDetailsWithZeroDocs,
|
|
276
281
|
onClick: () => {
|
|
277
282
|
setShowZeroDcmts(prev => !prev);
|
|
278
283
|
}
|
|
@@ -294,17 +299,22 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
294
299
|
_jsx(TMNothingToShow, { text: getTitle(), secondText: SDKUI_Localizator.NoDataToDisplay, icon: isForMaster ? _jsx(IconDetailDcmts, { fontSize: 96, transform: 'scale(-1, 1)' }) : _jsx(IconDetailDcmts, { fontSize: 96 }) })
|
|
295
300
|
:
|
|
296
301
|
_jsxs("div", { ref: floatingBarContainerRef, style: { width: "100%", height: "100%" }, onContextMenu: (e) => {
|
|
302
|
+
// Disable context menu when loading
|
|
303
|
+
if (isRelationViewerLoading) {
|
|
304
|
+
e.preventDefault();
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
297
307
|
// Mostra context menu anche sullo spazio bianco (quando non si clicca su un item)
|
|
298
308
|
e.preventDefault();
|
|
299
309
|
setContextMenuPosition({ x: e.clientX, y: e.clientY });
|
|
300
310
|
setContextMenuVisible(true);
|
|
301
311
|
}, children: [_jsx(TMRelationViewerWrapper, { refreshKey: refreshKey, inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, showZeroDcmts: showZeroDcmts,
|
|
302
312
|
// customItemRender={customItemRender}
|
|
303
|
-
allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged, onNoRelationsFound: handleNoRelationsFound, onItemContextMenu: onItemContextMenu, focusedItemFormData: focusedItemFormData }), _jsx(TMContextMenu, { items: operationItems, externalControl: {
|
|
313
|
+
allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged, onNoRelationsFound: handleNoRelationsFound, onItemContextMenu: isRelationViewerLoading ? undefined : onItemContextMenu, focusedItemFormData: focusedItemFormData, onLoadingStateChanged: setIsRelationViewerLoading }), _jsx(TMContextMenu, { items: operationItems, externalControl: {
|
|
304
314
|
visible: contextMenuVisible,
|
|
305
315
|
position: contextMenuPosition,
|
|
306
316
|
onClose: () => setContextMenuVisible(false)
|
|
307
|
-
} })] }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged, handleNoRelationsFound, onItemContextMenu, contextMenuVisible, contextMenuPosition, refreshKey, focusedItemFormData]);
|
|
317
|
+
} })] }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged, handleNoRelationsFound, onItemContextMenu, contextMenuVisible, contextMenuPosition, refreshKey, focusedItemFormData, isRelationViewerLoading]);
|
|
308
318
|
const tmFormOrResult = useMemo(() => _jsx(TMFormOrResultWrapper, { refreshKey: refreshKeyFormOrResult, deviceType: deviceType, focusedItem: focusedItem, onTaskCreateRequest: onTaskCreateRequest, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, handleNavigateToReference: handleNavigateToReference, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onRefreshSearchResults: onRefreshAllPanels }), [focusedItem, deviceType, allTasks, handleNavigateToWGs, handleNavigateToDossiers, handleNavigateToReference, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshAfterAddDcmtToFavs, refreshKeyFormOrResult]);
|
|
309
319
|
const initialPanelDimensions = {
|
|
310
320
|
'tmTreeView': { width: '50%', height: '100%' },
|
|
@@ -382,7 +392,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
382
392
|
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: false, orderNumber: 2, isActive: allInitialPanelVisibility['tmFormOrResult'] }
|
|
383
393
|
}
|
|
384
394
|
], [tmTreeView, tmFormOrResult, focusedItem?.isDcmt, dtdMaster]);
|
|
385
|
-
return (_jsxs("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: [isCheckingFirstLoad && (_jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: true })), _jsxs("div", { style: isCheckingFirstLoad ? { position: 'absolute', width: 0, height: 0, overflow: 'hidden', opacity: 0, pointerEvents: 'none' } : { width: '100%', height: '100%' }, children: [_jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }), renderDcmtOperations, renderFloatingBar] })] }));
|
|
395
|
+
return (_jsxs("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: [isCheckingFirstLoad && (_jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: true })), _jsxs("div", { style: isCheckingFirstLoad ? { position: 'absolute', width: 0, height: 0, overflow: 'hidden', opacity: 0, pointerEvents: 'none' } : { width: '100%', height: '100%' }, children: [_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), renderDcmtOperations, renderFloatingBar] })] }));
|
|
386
396
|
};
|
|
387
397
|
export default TMMasterDetailDcmts;
|
|
388
398
|
/**
|
|
@@ -391,8 +401,37 @@ export default TMMasterDetailDcmts;
|
|
|
391
401
|
* - Panel visibility toggling
|
|
392
402
|
* - Focus delay handling
|
|
393
403
|
*/
|
|
394
|
-
const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu, focusedItemFormData }) => {
|
|
404
|
+
const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu, focusedItemFormData, onLoadingStateChanged }) => {
|
|
395
405
|
const { setPanelVisibilityById, setToolbarButtonVisibility } = useTMPanelManagerContext();
|
|
406
|
+
// Monitor device type changes to restore panel visibility when switching from mobile to desktop
|
|
407
|
+
const deviceType = useDeviceType();
|
|
408
|
+
const prevDeviceTypeRef = useRef(deviceType);
|
|
409
|
+
// Restore panel visibility when switching from mobile to desktop
|
|
410
|
+
useEffect(() => {
|
|
411
|
+
const prevDeviceType = prevDeviceTypeRef.current;
|
|
412
|
+
prevDeviceTypeRef.current = deviceType;
|
|
413
|
+
// When switching from mobile to desktop, restore panel visibility based on current focused item
|
|
414
|
+
if (prevDeviceType === DeviceType.MOBILE && deviceType !== DeviceType.MOBILE) {
|
|
415
|
+
// Small delay to let the panel manager complete its internal state update
|
|
416
|
+
setTimeout(() => {
|
|
417
|
+
// Force tmFormOrResult panel to be visible
|
|
418
|
+
setPanelVisibilityById('tmFormOrResult', true);
|
|
419
|
+
// Restore child panel visibility based on focused item
|
|
420
|
+
if (focusedItem?.isDcmt) {
|
|
421
|
+
setPanelVisibilityById('tmSearchResult', false);
|
|
422
|
+
setPanelVisibilityById('tmDcmtForm', true);
|
|
423
|
+
setToolbarButtonVisibility('tmSearchResult', false);
|
|
424
|
+
setToolbarButtonVisibility('tmDcmtForm', true);
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
setPanelVisibilityById('tmSearchResult', true);
|
|
428
|
+
setPanelVisibilityById('tmDcmtForm', false);
|
|
429
|
+
setToolbarButtonVisibility('tmSearchResult', true);
|
|
430
|
+
setToolbarButtonVisibility('tmDcmtForm', false);
|
|
431
|
+
}
|
|
432
|
+
}, 50);
|
|
433
|
+
}
|
|
434
|
+
}, [deviceType, focusedItem, setPanelVisibilityById, setToolbarButtonVisibility]);
|
|
396
435
|
// Handle focused item changes with panel visibility management
|
|
397
436
|
const handleFocusedItemChanged = useCallback((item) => {
|
|
398
437
|
onFocusedItemChanged?.(item);
|
|
@@ -422,7 +461,7 @@ const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurr
|
|
|
422
461
|
onItemContextMenu?.(item, e);
|
|
423
462
|
}, 100);
|
|
424
463
|
}, [onItemContextMenu, handleFocusedItemChanged]);
|
|
425
|
-
return (_jsx(TMRelationViewer, { inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, initialShowZeroDcmts: showZeroDcmts, customItemRender: customItemRender, allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: onSelectedItemsChanged, maxDepthLevel: 1, invertMasterNavigation: false, showExpandAllButton: true, onNoRelationsFound: onNoRelationsFound, onItemContextMenu: onContextMenu, focusedItemFormData: focusedItemFormData }, refreshKey));
|
|
464
|
+
return (_jsx(TMRelationViewer, { inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, initialShowZeroDcmts: showZeroDcmts, customItemRender: customItemRender, allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: onSelectedItemsChanged, maxDepthLevel: 1, invertMasterNavigation: false, showExpandAllButton: true, onNoRelationsFound: onNoRelationsFound, onItemContextMenu: onContextMenu, focusedItemFormData: focusedItemFormData, onLoadingStateChanged: onLoadingStateChanged }, refreshKey));
|
|
426
465
|
};
|
|
427
466
|
const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid, onRefreshSearchResults, handleNavigateToReference, fetchRemoteCertificates }) => {
|
|
428
467
|
const { setPanelVisibilityById } = useTMPanelManagerContext();
|
|
@@ -430,5 +469,5 @@ const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCrea
|
|
|
430
469
|
_jsx(TMDcmtForm, { groupId: 'tmFormOrResult', TID: focusedItem?.tid, DID: focusedItem.did, allowButtonsRefs: true, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: false, onClose: () => { setPanelVisibilityById('tmTreeView', true); }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.tid, focusedItem?.did), openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, datagridUtility: {
|
|
431
470
|
onRefreshSearchAsyncDatagrid,
|
|
432
471
|
}, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey) :
|
|
433
|
-
_jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, showDcmtFormSidebar: false, autoFocusFirstRow: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setPanelVisibilityById('tmTreeView', true); }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, enablePinIcons: false, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, showBackButton: false, onRefreshSearchAsyncDatagrid: onRefreshSearchResults, onReferenceClick: handleNavigateToReference, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey) }));
|
|
472
|
+
focusedItem?.searchResult === undefined ? (_jsx(TMPanel, { title: SDKUI_Localizator.SearchResult, children: _jsx(TMToppyMessage, { message: SDKUI_Localizator.SelectDocumentToViewSearchResults }) })) : (_jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, showDcmtFormSidebar: false, autoFocusFirstRow: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setPanelVisibilityById('tmTreeView', true); }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, enablePinIcons: false, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, showBackButton: false, onRefreshSearchAsyncDatagrid: onRefreshSearchResults, onReferenceClick: handleNavigateToReference, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey)) }));
|
|
434
473
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DcmtTypeDescriptor, SearchResultDescriptor, DataColumnDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { DcmtMetadataMap } from '../../../helper';
|
|
3
4
|
import { DcmtInfo, MetadataValueDescriptorEx } from '../../../ts';
|
|
4
5
|
import { ITMTreeItem } from '../../base/TMTreeView';
|
|
5
6
|
/**
|
|
@@ -19,7 +20,7 @@ export interface RelationTreeItem extends ITMTreeItem {
|
|
|
19
20
|
isSeparator?: boolean;
|
|
20
21
|
isInfoMessage?: boolean;
|
|
21
22
|
isLogDel?: number;
|
|
22
|
-
values?:
|
|
23
|
+
values?: DcmtMetadataMap;
|
|
23
24
|
searchResult?: SearchResultDescriptor[];
|
|
24
25
|
itemsCount?: number;
|
|
25
26
|
fileExt?: string;
|
|
@@ -72,7 +73,10 @@ export interface TMRelationViewerProps {
|
|
|
72
73
|
* Value rendering respects DataDomain (uses TMDataListItemViewer for lists, TMDataUserIdItemViewer for users, etc.)
|
|
73
74
|
*/
|
|
74
75
|
showMetadataNames?: boolean;
|
|
75
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Maximum depth level for recursive loading (default: 2).
|
|
78
|
+
* Use 0 for unlimited depth (expand as much as possible).
|
|
79
|
+
*/
|
|
76
80
|
maxDepthLevel?: number;
|
|
77
81
|
/**
|
|
78
82
|
* If true (default), when isForMaster=true shows: detail doc → master docs as children (inverted navigation)
|
|
@@ -122,6 +126,11 @@ export interface TMRelationViewerProps {
|
|
|
122
126
|
* (root container + first document + first correlation folder).
|
|
123
127
|
*/
|
|
124
128
|
defaultExpandAll?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Callback invoked when loading state changes.
|
|
131
|
+
* Useful to disable interactions (like context menu) during loading.
|
|
132
|
+
*/
|
|
133
|
+
onLoadingStateChanged?: (isLoading: boolean) => void;
|
|
125
134
|
}
|
|
126
135
|
/**
|
|
127
136
|
* Check if document type has detail relations
|
|
@@ -131,14 +140,6 @@ export declare const hasDetailRelations: (mTID: number | undefined) => Promise<b
|
|
|
131
140
|
* Check if document type has master relations
|
|
132
141
|
*/
|
|
133
142
|
export declare const hasMasterRelations: (dTID: number | undefined) => Promise<boolean>;
|
|
134
|
-
/**
|
|
135
|
-
* Get metadata keys excluding system metadata
|
|
136
|
-
*/
|
|
137
|
-
export declare const getMetadataKeys: (obj: any) => string[];
|
|
138
|
-
/**
|
|
139
|
-
* Get display value keys for a document (max 5, prioritize SYS_Abstract)
|
|
140
|
-
*/
|
|
141
|
-
export declare const getDcmtDisplayValue: (obj: any) => string[];
|
|
142
143
|
/**
|
|
143
144
|
* Get display value formatted by column type
|
|
144
145
|
*/
|
|
@@ -147,5 +148,6 @@ export declare const getDisplayValueByColumn: (col: DataColumnDescriptor | undef
|
|
|
147
148
|
* Convert SearchResultDescriptor to structured data source with metadata
|
|
148
149
|
*/
|
|
149
150
|
export declare const searchResultToDataSource: (searchResult: SearchResultDescriptor | undefined, hideSysMetadata?: boolean) => Promise<any[]>;
|
|
151
|
+
export declare const DEFAULT_RELATION_EXPAND_LEVEL = 4;
|
|
150
152
|
declare const TMRelationViewer: React.FC<TMRelationViewerProps>;
|
|
151
153
|
export default TMRelationViewer;
|