@topconsultnpm/sdkui-react 6.21.0-dev2.34 → 6.21.0-dev2.35

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 (30) hide show
  1. package/lib/components/editors/TMTextBox.d.ts +0 -2
  2. package/lib/components/editors/TMTextBox.js +3 -3
  3. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +0 -4
  4. package/lib/components/features/documents/TMMasterDetailDcmts.js +5 -6
  5. package/lib/components/features/documents/TMRelationViewer.d.ts +0 -13
  6. package/lib/components/features/documents/TMRelationViewer.js +6 -75
  7. package/lib/components/features/search/TMSearch.d.ts +2 -2
  8. package/lib/components/features/search/TMSearch.js +2 -2
  9. package/lib/components/features/search/TMSearchResult.d.ts +2 -2
  10. package/lib/components/features/search/TMSearchResult.js +20 -4
  11. package/lib/helper/SDKUI_Globals.d.ts +0 -16
  12. package/lib/helper/SDKUI_Globals.js +1 -16
  13. package/lib/helper/TMUtils.d.ts +0 -19
  14. package/lib/helper/index.d.ts +0 -1
  15. package/lib/helper/index.js +0 -1
  16. package/lib/hooks/useDcmtOperations.d.ts +2 -8
  17. package/lib/hooks/useDcmtOperations.js +20 -29
  18. package/lib/hooks/useDocumentOperations.d.ts +0 -4
  19. package/lib/hooks/useDocumentOperations.js +7 -75
  20. package/package.json +1 -1
  21. package/lib/components/features/documents/TMCopyToFolderForm.d.ts +0 -16
  22. package/lib/components/features/documents/TMCopyToFolderForm.js +0 -306
  23. package/lib/components/features/documents/TMDownloadRelationViewerSection.d.ts +0 -15
  24. package/lib/components/features/documents/TMDownloadRelationViewerSection.js +0 -155
  25. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +0 -18
  26. package/lib/components/features/documents/TMMergeToPdfForm.js +0 -164
  27. package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +0 -53
  28. package/lib/components/features/documents/copyAndMergeDcmtsShared.js +0 -263
  29. package/lib/helper/ZipManager.d.ts +0 -56
  30. package/lib/helper/ZipManager.js +0 -104
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { ITMEditorBase } from '../base/TMEditorBase';
3
3
  export type TextBoxType = 'text' | 'email' | 'password' | 'number' | 'secureText';
4
4
  export interface ITMTextBox extends ITMEditorBase {
5
- autoComplete?: string;
6
5
  autoFocus?: boolean;
7
6
  formulaItems?: string[];
8
7
  maxValue?: number;
@@ -14,7 +13,6 @@ export interface ITMTextBox extends ITMEditorBase {
14
13
  value?: string | number;
15
14
  fromModal?: boolean;
16
15
  allowedPattern?: RegExp;
17
- onClick?: () => void;
18
16
  onValueChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
19
17
  onBlur?: (value: string | undefined) => void;
20
18
  }
@@ -34,7 +34,7 @@ const StyledTextBoxEditorButton = styled.div `
34
34
  border-bottom-color: ${TMColors.primary};
35
35
  }
36
36
  `;
37
- const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, precision, fromModal = false, scale, showClearButton, validationItems = [], label = '', readOnly = false, formulaItems = [], buttons = [], isModifiedWhen, placeHolder, elementStyle, width = '100%', maxValue, minValue, fontSize = FontSize.defaultFontSize, icon, labelPosition = 'left', value, disabled = false, type = 'text', onClick, onValueChanged, onBlur, borderRadius, allowedPattern }) => {
37
+ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = false, scale, showClearButton, validationItems = [], label = '', readOnly = false, formulaItems = [], buttons = [], isModifiedWhen, placeHolder, elementStyle, width = '100%', maxValue, minValue, fontSize = FontSize.defaultFontSize, icon, labelPosition = 'left', value, disabled = false, type = 'text', onValueChanged, onBlur, borderRadius, allowedPattern }) => {
38
38
  const [initialType, setInitialType] = useState(type);
39
39
  const [currentType, setCurrentType] = useState(type);
40
40
  const [currentValue, setCurrentValue] = useState(value);
@@ -277,13 +277,13 @@ const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, pre
277
277
  return 6 + (buttonCount * buttonWidth) + 8;
278
278
  }
279
279
  };
280
- return (_jsxs("div", { style: { width: '100%', height: 'fit-content', cursor: onClick ? 'pointer' : undefined }, id: `text-${id}`, onClick: onClick, children: [_jsx(StyledEditor, { ref: inputRef, onContextMenu: (e) => e.stopPropagation(), id: `text-${label}-${id}`, name: label, autoFocus: autoFocus, readOnly: readOnly, type: currentType, disabled: disabled, value: displayedValue, width: width || '100%', placeholder: placeHolder, maxLength: maxLength, autoComplete: autoComplete, spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
280
+ return (_jsxs("div", { style: { width: '100%', height: 'fit-content' }, id: `text-${id}`, children: [_jsx(StyledEditor, { ref: inputRef, onContextMenu: (e) => e.stopPropagation(), id: `text-${label}-${id}`, name: label, autoFocus: autoFocus, readOnly: readOnly, type: currentType, disabled: disabled, value: displayedValue, width: width || '100%', placeholder: placeHolder, maxLength: maxLength, autoComplete: 'off', spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
281
281
  onBlur?.(currentValue); }, onChange: handleInputChange, onKeyDown: (e) => {
282
282
  if (currentType === 'number') {
283
283
  if (!scale && (e.key == "." || e.key == ","))
284
284
  e.preventDefault();
285
285
  }
286
- }, "$isMobile": deviceType === DeviceType.MOBILE, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType, "$borderRadius": borderRadius, style: { paddingRight: `${calculateRightPadding()}px`, cursor: onClick ? 'pointer' : undefined } }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' &&
286
+ }, "$isMobile": deviceType === DeviceType.MOBILE, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType, "$borderRadius": borderRadius, style: { paddingRight: `${calculateRightPadding()}px` } }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' &&
287
287
  _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : '6px', top: label.length > 0 ? '20px' : '3px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
288
288
  _jsx(StyledTextBoxEditorButton, { onClick: () => {
289
289
  setShowFormulaItemsChooser(true);
@@ -1,10 +1,7 @@
1
1
  import React from 'react';
2
2
  import { HomeBlogPost, SearchResultDescriptor, TaskDescriptor } from '@topconsultnpm/sdk-ts';
3
- import { RelationTreeItem } from './TMRelationViewer';
4
- import { MergePdfManagerType } from '../../../helper';
5
3
  import { DcmtInfo, TaskContext, MetadataValueDescriptorEx } from '../../../ts';
6
4
  import { DeviceContextProps } from '../../base/TMDeviceProvider';
7
- export type IRelatedDcmt = RelationTreeItem;
8
5
  interface ITMMasterDetailDcmtsProps extends DeviceContextProps {
9
6
  allTasks?: Array<TaskDescriptor>;
10
7
  getAllTasks?: () => Promise<void>;
@@ -29,7 +26,6 @@ interface ITMMasterDetailDcmtsProps extends DeviceContextProps {
29
26
  openS4TViewer?: boolean;
30
27
  onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: (() => Promise<void>)) => void;
31
28
  onOpenPdfEditorRequest?: ((dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void);
32
- mergePdfManager?: MergePdfManagerType;
33
29
  datagridUtility?: {
34
30
  onRefreshSearchAsyncDatagrid?: () => Promise<void>;
35
31
  onRefreshDataRowsAsync?: (() => Promise<void>);
@@ -16,7 +16,7 @@ import TMDcmtForm from './TMDcmtForm';
16
16
  import { TMNothingToShow } from './TMDcmtPreview';
17
17
  import { Spinner, TMButton } from '../..';
18
18
  import { useDocumentOperations } from '../../../hooks/useDocumentOperations';
19
- 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, mergePdfManager }) => {
19
+ 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 }) => {
20
20
  const floatingBarContainerRef = useRef(null);
21
21
  const [focusedItem, setFocusedItem] = useState();
22
22
  const [selectedItems, setSelectedItems] = useState([]);
@@ -117,7 +117,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
117
117
  createTaskFromDocumentOrWorkItem();
118
118
  }
119
119
  };
120
- const { operationItems, renderFloatingBar, renderDcmtOperations, features, } = useDocumentOperations({
120
+ const { operationItems, renderFloatingBar, renderDcmtOperations, features } = useDocumentOperations({
121
121
  context: SearchResultContext.MASTER_DETAIL,
122
122
  documentData: {
123
123
  dtd: dtdFocused,
@@ -192,7 +192,6 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
192
192
  openTaskFormHandler,
193
193
  onRefreshAfterAddDcmtToFavs,
194
194
  },
195
- mergePdfManager: mergePdfManager
196
195
  });
197
196
  // Load dtdMaster when inputDcmts changes
198
197
  useEffect(() => {
@@ -286,7 +285,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
286
285
  position: contextMenuPosition,
287
286
  onClose: () => setContextMenuVisible(false)
288
287
  } })] }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged, handleNoRelationsFound, onItemContextMenu, contextMenuVisible, contextMenuPosition, refreshKey, focusedItemFormData]);
289
- 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, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onRefreshSearchResults: onRefreshAllPanels, mergePdfManager: mergePdfManager }), [focusedItem, deviceType, allTasks, handleNavigateToWGs, handleNavigateToDossiers, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshAfterAddDcmtToFavs, refreshKeyFormOrResult]);
288
+ 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, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onRefreshSearchResults: onRefreshAllPanels }), [focusedItem, deviceType, allTasks, handleNavigateToWGs, handleNavigateToDossiers, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshAfterAddDcmtToFavs, refreshKeyFormOrResult]);
290
289
  const initialPanelDimensions = {
291
290
  'tmTreeView': { width: '50%', height: '100%' },
292
291
  'tmFormOrResult': { width: '50%', height: '100%' },
@@ -405,11 +404,11 @@ const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurr
405
404
  }, [onItemContextMenu, handleFocusedItemChanged]);
406
405
  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, onNoRelationsFound: onNoRelationsFound, onItemContextMenu: onContextMenu, focusedItemFormData: focusedItemFormData }, refreshKey));
407
406
  };
408
- const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], mergePdfManager, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid, onRefreshSearchResults }) => {
407
+ const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid, onRefreshSearchResults }) => {
409
408
  const { setPanelVisibilityById } = useTMPanelManagerContext();
410
409
  return (_jsx(_Fragment, { children: focusedItem?.isDcmt ?
411
410
  _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, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.tid, focusedItem?.did), openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, datagridUtility: {
412
411
  onRefreshSearchAsyncDatagrid,
413
412
  } }, refreshKey) :
414
- _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, 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, mergePdfManager: mergePdfManager }, refreshKey) }));
413
+ _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, 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 }, refreshKey) }));
415
414
  };
@@ -50,8 +50,6 @@ export interface TMRelationViewerProps {
50
50
  onFocusedItemChanged?: (item: RelationTreeItem | null) => void;
51
51
  /** Callback when selected items change */
52
52
  onSelectedItemsChanged?: (items: RelationTreeItem[]) => void;
53
- /** Callback fired when the internal tree data changes, providing a flattened list of all items currently rendered */
54
- onAllItemsChanged?: (items: RelationTreeItem[]) => void;
55
53
  /** Callback when a document is double-clicked */
56
54
  onDocumentDoubleClick?: (tid: number, did: number, name?: string) => void;
57
55
  /** Custom item renderer (full control). Return undefined to use default renderer. */
@@ -111,17 +109,6 @@ export interface TMRelationViewerProps {
111
109
  * (used in master-detail context)
112
110
  */
113
111
  focusedItemFormData?: MetadataValueDescriptorEx[];
114
- /**
115
- * If true, shows a toolbar button to expand/collapse all tree nodes.
116
- * Default: false
117
- */
118
- showExpandAllButton?: boolean;
119
- /**
120
- * If true, all tree nodes are expanded by default on initial load.
121
- * If false (default), uses the standard initial expansion behavior
122
- * (root container + first document + first correlation folder).
123
- */
124
- defaultExpandAll?: boolean;
125
112
  }
126
113
  /**
127
114
  * Check if document type has detail relations
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
3
3
  import { DcmtTypeListCacheService, SDK_Globals, DataColumnTypes, MetadataFormats, SystemMIDs, MetadataDataDomains, RelationCacheService, RelationTypes, UserListCacheService } from "@topconsultnpm/sdk-ts";
4
- import { genUniqueId, IconFolder, IconBackhandIndexPointingRight, IconCircleInfo, getDcmtCicoStatus, IconChevronDown, IconChevronRight } from '../../../helper';
4
+ import { genUniqueId, IconFolder, IconBackhandIndexPointingRight, IconCircleInfo, getDcmtCicoStatus } from '../../../helper';
5
5
  import { TMColors } from '../../../utils/theme';
6
- import { StyledDivHorizontal, StyledBadge, StyledToolbarForm } from '../../base/Styled';
6
+ import { StyledDivHorizontal, StyledBadge } from '../../base/Styled';
7
7
  import TMTreeView from '../../base/TMTreeView';
8
8
  import { TMWaitPanel } from '../../base/TMWaitPanel';
9
9
  import TMDataListItemViewer from '../../viewers/TMDataListItemViewer';
@@ -136,14 +136,12 @@ export const searchResultToDataSource = async (searchResult, hideSysMetadata) =>
136
136
  }
137
137
  return output;
138
138
  };
139
- const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndicator = true, allowShowZeroDcmts = true, initialShowZeroDcmts = false, allowedTIDs, allowMultipleSelection = false, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onAllItemsChanged, onDocumentDoubleClick, customItemRender, customDocumentStyle, customMainContainerContent, customDocumentContent, showMetadataNames = false, maxDepthLevel = 2, invertMasterNavigation = true, additionalStaticItems, showMainDocument = true, labelMainContainer, onNoRelationsFound, onItemContextMenu, focusedItemFormData = [], showExpandAllButton = false, defaultExpandAll = false }) => {
139
+ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndicator = true, allowShowZeroDcmts = true, initialShowZeroDcmts = false, allowedTIDs, allowMultipleSelection = false, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onDocumentDoubleClick, customItemRender, customDocumentStyle, customMainContainerContent, customDocumentContent, showMetadataNames = false, maxDepthLevel = 2, invertMasterNavigation = true, additionalStaticItems, showMainDocument = true, labelMainContainer, onNoRelationsFound, onItemContextMenu, focusedItemFormData = [] }) => {
140
140
  // State
141
141
  const [dcmtTypes, setDcmtTypes] = useState([]);
142
142
  const [treeData, setTreeData] = useState([]);
143
143
  const [showZeroDcmts, setShowZeroDcmts] = useState(initialShowZeroDcmts);
144
144
  const [staticItemsState, setStaticItemsState] = useState([]);
145
- const [allExpanded, setAllExpanded] = useState(defaultExpandAll);
146
- const initialExpandAllAppliedRef = React.useRef(false);
147
145
  const [showWaitPanel, setShowWaitPanel] = useState(false);
148
146
  const [waitPanelTextPrimary, setWaitPanelTextPrimary] = useState('');
149
147
  const [waitPanelValuePrimary, setWaitPanelValuePrimary] = useState(0);
@@ -273,7 +271,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
273
271
  console.error('❌ Error loading detail documents:', error);
274
272
  }
275
273
  return items;
276
- }, [allowedTIDs]);
274
+ }, [allowedTIDs, focusedItemFormData, focusedItem?.dtd?.id]);
277
275
  /**
278
276
  * Recursively retrieve master documents
279
277
  */
@@ -736,24 +734,6 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
736
734
  // and may contain custom properties that would be lost by the spread operator
737
735
  return [...treeData, ...itemsToMerge];
738
736
  }, [treeData, additionalStaticItems, staticItemsState]);
739
- /**
740
- * Notify parent with a flattened list of all items whenever the merged tree data changes.
741
- */
742
- useEffect(() => {
743
- if (!onAllItemsChanged)
744
- return;
745
- const flatten = (items) => {
746
- const out = [];
747
- for (const it of items) {
748
- out.push(it);
749
- if (it.items && Array.isArray(it.items)) {
750
- out.push(...flatten(it.items));
751
- }
752
- }
753
- return out;
754
- };
755
- onAllItemsChanged(flatten(mergedTreeData));
756
- }, [mergedTreeData, onAllItemsChanged]);
757
737
  /**
758
738
  * Load data when inputs change
759
739
  */
@@ -1138,7 +1118,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
1138
1118
  }
1139
1119
  }
1140
1120
  return (_jsxs("div", { onDoubleClick: handleDoubleClick, style: documentStyle, children: [item.did && item.tid && showCurrentDcmtIndicator && inputDcmts?.some(d => d.DID === item.did && d.TID === item.tid) ? _jsx(IconBackhandIndexPointingRight, { fontSize: 22, overflow: 'visible' }) : _jsx(_Fragment, {}), item.values && (_jsx(TMDcmtIcon, { tid: item.values?.TID?.value, did: item.values?.DID?.value, fileExtension: item.values?.FILEEXT?.value, fileCount: item.values?.FILECOUNT?.value, isLexProt: item.values?.IsLexProt?.value, isMail: item.values?.ISMAIL?.value, isShared: item.values?.ISSHARED?.value, isSigned: item.values?.ISSIGNED?.value, downloadMode: 'openInNewWindow' })), checkoutStatusIcon, metadataContent] }));
1141
- }, [onDocumentDoubleClick, showCurrentDcmtIndicator, inputDcmts, customMainContainerContent, customDocumentStyle, customDocumentContent, showMetadataNames, showMainDocument, allUsers]);
1121
+ }, [onDocumentDoubleClick, showCurrentDcmtIndicator, inputDcmts, customMainContainerContent, customDocumentStyle, customDocumentContent, showMetadataNames, showMainDocument, focusedItemFormData, focusedItem?.dtd, allUsers]);
1142
1122
  /**
1143
1123
  * Wrapper renderer that handles custom rendering if provided
1144
1124
  */
@@ -1168,42 +1148,6 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
1168
1148
  const handleSelectedItemsChanged = useCallback((items) => {
1169
1149
  onSelectedItemsChanged?.(items);
1170
1150
  }, [onSelectedItemsChanged]);
1171
- /**
1172
- * Recursively set the `expanded` property on every node that has children loaded.
1173
- * Nodes without `items` are left untouched (will be loaded lazily on user click).
1174
- */
1175
- const setExpandedRecursively = useCallback((nodes, expanded) => {
1176
- if (!nodes || !Array.isArray(nodes))
1177
- return [];
1178
- return nodes.map(node => {
1179
- const hasChildren = Array.isArray(node.items) && node.items.length > 0;
1180
- const newItems = hasChildren ? setExpandedRecursively(node.items, expanded) : node.items;
1181
- // Only toggle expansion if the node is expandable (container/doc with children or marked expandible)
1182
- const canExpand = hasChildren || node.isExpandible;
1183
- return { ...node, expanded: canExpand ? expanded : node.expanded, items: newItems };
1184
- });
1185
- }, []);
1186
- const handleToggleExpandAll = useCallback(() => {
1187
- const next = !allExpanded;
1188
- setAllExpanded(next);
1189
- setTreeData(prev => setExpandedRecursively(prev, next));
1190
- setStaticItemsState(prev => setExpandedRecursively(prev, next));
1191
- userInteractedWithStaticItemsRef.current = true;
1192
- }, [allExpanded, setExpandedRecursively]);
1193
- /**
1194
- * Apply defaultExpandAll once on initial tree load.
1195
- */
1196
- useEffect(() => {
1197
- if (!defaultExpandAll)
1198
- return;
1199
- if (initialExpandAllAppliedRef.current)
1200
- return;
1201
- if (!treeData || treeData.length === 0)
1202
- return;
1203
- initialExpandAllAppliedRef.current = true;
1204
- setTreeData(prev => setExpandedRecursively(prev, true));
1205
- setStaticItemsState(prev => setExpandedRecursively(prev, true));
1206
- }, [defaultExpandAll, treeData, setExpandedRecursively]);
1207
1151
  /**
1208
1152
  * Handle data changed - separate static items from dynamic tree data
1209
1153
  */
@@ -1225,20 +1169,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
1225
1169
  return null;
1226
1170
  return _jsx("div", { style: { padding: '20px', textAlign: 'center', color: '#666' }, children: "Nessuna relazione disponibile." });
1227
1171
  }
1228
- return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', minHeight: 0, width: '100%' }, children: [showExpandAllButton && (_jsx(StyledToolbarForm, { style: { flexShrink: 0 }, children: _jsxs("button", { type: "button", onClick: handleToggleExpandAll, title: allExpanded ? 'Comprimi tutto' : 'Espandi tutto', style: {
1229
- display: 'inline-flex',
1230
- alignItems: 'center',
1231
- gap: '4px',
1232
- padding: '4px 8px',
1233
- fontSize: '0.8rem',
1234
- color: TMColors.primary,
1235
- background: 'transparent',
1236
- border: `1px solid ${TMColors.border_normal}`,
1237
- borderRadius: '4px',
1238
- cursor: 'pointer',
1239
- lineHeight: 1,
1240
- whiteSpace: 'nowrap'
1241
- }, children: [allExpanded ? _jsx(IconChevronRight, { fontSize: 14 }) : _jsx(IconChevronDown, { fontSize: 14 }), _jsx("span", { children: allExpanded ? 'Comprimi tutto' : 'Espandi tutto' })] }) })), _jsx("div", { style: { flex: 1, minHeight: 0, overflow: 'auto' }, children: _jsx(TMTreeView, { dataSource: mergedTreeData, itemRender: finalItemRender, calculateItemsForNode: calculateItemsForNode, onDataChanged: handleDataChanged, focusedItem: focusedItem, onFocusedItemChanged: handleFocusedItemChanged, allowMultipleSelection: allowMultipleSelection, selectedItems: selectedItems, itemsPerPage: 100, onSelectionChanged: handleSelectedItemsChanged, onItemContextMenu: onItemContextMenu }) }), showExpansionWaitPanel && (_jsx(TMWaitPanel, { title: isForMaster ? 'Caricamento documenti master' : 'Caricamento documenti dettaglio', showPrimary: true, textPrimary: expansionWaitPanelText, valuePrimary: expansionWaitPanelValue, maxValuePrimary: expansionWaitPanelMaxValue, isCancelable: true, abortController: expansionAbortController, onAbortClick: (abortController) => {
1172
+ return (_jsxs(_Fragment, { children: [_jsx(TMTreeView, { dataSource: mergedTreeData, itemRender: finalItemRender, calculateItemsForNode: calculateItemsForNode, onDataChanged: handleDataChanged, focusedItem: focusedItem, onFocusedItemChanged: handleFocusedItemChanged, allowMultipleSelection: allowMultipleSelection, selectedItems: selectedItems, itemsPerPage: 100, onSelectionChanged: handleSelectedItemsChanged, onItemContextMenu: onItemContextMenu }), showExpansionWaitPanel && (_jsx(TMWaitPanel, { title: isForMaster ? 'Caricamento documenti master' : 'Caricamento documenti dettaglio', showPrimary: true, textPrimary: expansionWaitPanelText, valuePrimary: expansionWaitPanelValue, maxValuePrimary: expansionWaitPanelMaxValue, isCancelable: true, abortController: expansionAbortController, onAbortClick: (abortController) => {
1242
1173
  setTimeout(() => {
1243
1174
  abortController?.abort();
1244
1175
  }, 100);
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { SavedQueryDescriptor, DcmtTypeDescriptor, TaskDescriptor, ObjectRef, HomeBlogPost } from '@topconsultnpm/sdk-ts';
3
- import { MergePdfManagerType } from '../../../helper';
4
3
  import { DcmtInfo, TaskContext } from '../../../ts';
5
4
  import { TMSearchResultFloatingActionConfig } from './TMSearchResultFloatingActionButton';
6
5
  interface ITMSearchProps {
@@ -41,7 +40,8 @@ interface ITMSearchProps {
41
40
  onCurrentTIDChangedCallback?: (tid: number | undefined) => void;
42
41
  onlyShowSearchQueryPanel?: boolean;
43
42
  onReferenceClick?: (ref: ObjectRef) => void;
44
- mergePdfManager?: MergePdfManagerType;
43
+ inputDID?: number;
44
+ formAutoOpen?: boolean;
45
45
  }
46
46
  declare const TMSearch: React.FunctionComponent<ITMSearchProps>;
47
47
  export default TMSearch;
@@ -20,7 +20,7 @@ var TMSearchViews;
20
20
  TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
21
21
  TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
22
22
  })(TMSearchViews || (TMSearchViews = {}));
23
- const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, showTodoDcmtForm, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, passToArchiveCallback, onCurrentTIDChangedCallback, onlyShowSearchQueryPanel, onReferenceClick, refreshFavoriteSavedQueries, mergePdfManager }) => {
23
+ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, showTodoDcmtForm, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, passToArchiveCallback, onCurrentTIDChangedCallback, onlyShowSearchQueryPanel, onReferenceClick, refreshFavoriteSavedQueries, inputDID, formAutoOpen }) => {
24
24
  const [allSQDs, setAllSQDs] = useState([]);
25
25
  const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
26
26
  const [currentSQD, setCurrentSQD] = useState();
@@ -266,7 +266,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
266
266
  toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
267
267
  }
268
268
  ], [tmTreeSelectorElement, showSearchResults, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs]);
269
- return (_jsxs(_Fragment, { children: [showSearchResults ? _jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true, minPanelSizePx: !isMobile ? 250 : 150 }) }) }) : tmSearchQueryPanelElement, showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onClose: () => { onlyShowSearchQueryPanel ? setShowSearchResults(false) : setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, openFileUploaderPdfEditor: openFileUploaderPdfEditor, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, mergePdfManager: mergePdfManager })] }));
269
+ return (_jsxs(_Fragment, { children: [showSearchResults ? _jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true, minPanelSizePx: !isMobile ? 250 : 150 }) }) }) : tmSearchQueryPanelElement, showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onClose: () => { onlyShowSearchQueryPanel ? setShowSearchResults(false) : setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, openFileUploaderPdfEditor: openFileUploaderPdfEditor, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, inputDID: inputDID, formAutoOpen: formAutoOpen })] }));
270
270
  };
271
271
  export default TMSearch;
272
272
  const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { DcmtTypeDescriptor, HomeBlogPost, ObjectRef, SearchResultDescriptor, TaskDescriptor, WorkingGroupDescriptor } from '@topconsultnpm/sdk-ts';
3
- import { MergePdfManagerType } from '../../../helper';
4
3
  import { DcmtInfo, SearchResultContext, TaskContext } from '../../../ts';
5
4
  import { TMSearchResultFloatingActionConfig } from './TMSearchResultFloatingActionButton';
6
5
  export declare const getSearchResultCountersSingleCategory: (searchResults: SearchResultDescriptor[]) => string;
@@ -12,6 +11,8 @@ interface ITMSearchResultProps {
12
11
  selectedSearchResultTID?: number;
13
12
  floatingActionConfig?: TMSearchResultFloatingActionConfig;
14
13
  workingGroupContext?: WorkingGroupDescriptor;
14
+ inputDID?: number;
15
+ formAutoOpen?: boolean;
15
16
  allowFloatingBar?: boolean;
16
17
  allowRelations?: boolean;
17
18
  isClosable?: boolean;
@@ -30,7 +31,6 @@ interface ITMSearchResultProps {
30
31
  showToppyDraggableHelpCenter?: boolean;
31
32
  toppyHelpCenterUsePortal?: boolean;
32
33
  showNoDcmtFoundMessage?: boolean;
33
- mergePdfManager?: MergePdfManagerType;
34
34
  onClose?: () => void;
35
35
  openInOffice?: (selectedDcmtsOrFocused: Array<DcmtInfo>) => Promise<void>;
36
36
  onWFOperationCompleted?: () => Promise<void>;
@@ -52,9 +52,9 @@ const orderByName = (array) => {
52
52
  };
53
53
  const TMSearchResult = ({
54
54
  // Data
55
- groupId, searchResults = [], context = SearchResultContext.METADATA_SEARCH, title, selectedSearchResultTID, floatingActionConfig, workingGroupContext = undefined,
55
+ groupId, searchResults = [], context = SearchResultContext.METADATA_SEARCH, title, selectedSearchResultTID, floatingActionConfig, workingGroupContext = undefined, inputDID,
56
56
  // Boolean flags to enable/disable features
57
- isVisible = true, allowRelations = true, openDcmtFormAsModal = false, showSearchResultSidebar = true, showDcmtFormSidebar = true, showSelector = false, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, disableAccordionIfSingleCategory = false, editPdfForm = false, openS4TViewer = false, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, showNoDcmtFoundMessage = true, enablePinIcons = true, mergePdfManager,
57
+ formAutoOpen, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, showSearchResultSidebar = true, showDcmtFormSidebar = true, showSelector = false, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, disableAccordionIfSingleCategory = false, editPdfForm = false, openS4TViewer = false, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, showNoDcmtFoundMessage = true, enablePinIcons = true,
58
58
  // Callbacks (optional)
59
59
  openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsyncDatagrid, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, passToArchiveCallback, onReferenceClick,
60
60
  // Tasks
@@ -291,7 +291,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
291
291
  createTaskFromDocumentOrWorkItem();
292
292
  }
293
293
  };
294
- const { operationItems, renderFloatingBar, renderDcmtOperations, features, } = useDocumentOperations({
294
+ const { operationItems, renderFloatingBar, renderDcmtOperations, features } = useDocumentOperations({
295
295
  context: context,
296
296
  documentData: {
297
297
  dtd: fromDTD,
@@ -361,7 +361,6 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
361
361
  onTaskCreateRequest,
362
362
  openTaskFormHandler,
363
363
  },
364
- mergePdfManager,
365
364
  });
366
365
  const { isOpenDcmtForm, openFormHandler, dcmtFormLayoutMode, onDcmtFormOpenChange, showSearchTMDatagrid, showExportForm, isOpenBatchUpdate, isModifiedBatchUpdate, updateBatchUpdateForm, closeDcmtFormHandler, handleSignApprove, checkoutInfo: { showCicoWaitPanel, cicoWaitPanelTitle, showCicoPrimaryProgress, cicoPrimaryProgressText, cicoPrimaryProgressValue, cicoPrimaryProgressMax, }, dcmtOperations: { abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync, }, relatedDocumentsInfo: { isOpenDetails, isOpenMaster, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability, }, toppyOperations: { showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, updateShowApprovePopup, updateShowRejectPopup, updateShowReAssignPopup, updateShowMoreInfoPopup } } = features;
367
366
  const deviceType = useDeviceType();
@@ -419,6 +418,23 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
419
418
  // Se esiste almeno una riga, seleziona la prima
420
419
  setFocusedItem(newDataSource && newDataSource.length > 0 ? newDataSource[0] : undefined);
421
420
  }, [selectedSearchResult, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability]);
421
+ // Quando inputDID è fornito e i dati della griglia sono pronti, seleziona il documento corrispondente
422
+ useEffect(() => {
423
+ if (!inputDID || visibleItems.length === 0)
424
+ return;
425
+ const targetItem = visibleItems.find((item) => item.DID == inputDID);
426
+ if (targetItem && focusedItem?.DID != inputDID) {
427
+ setFocusedItem(targetItem);
428
+ }
429
+ }, [inputDID, visibleItems]);
430
+ // Quando inputDID e formAutoOpen sono forniti, apri automaticamente il form del documento
431
+ useEffect(() => {
432
+ if (!inputDID || !formAutoOpen)
433
+ return;
434
+ if (focusedItem?.DID != inputDID)
435
+ return;
436
+ openFormHandler(LayoutModes.Update);
437
+ }, [inputDID, formAutoOpen, focusedItem]);
422
438
  useEffect(() => {
423
439
  if (!focusedItem)
424
440
  return;
@@ -1,20 +1,5 @@
1
1
  import { InvoiceRetrieveFormats, ObjectClasses, OrderRetrieveFormats } from "@topconsultnpm/sdk-ts";
2
2
  import { CheckoutInfo } from "./checkinCheckoutManager";
3
- export type FileNamingMode = 'onlyDid' | 'documentTypeAndDid' | 'documentTypeAndCustomMetadata' | 'onlyCustomMetadata';
4
- export type FileExistsMode = 'overwrite' | 'skip' | 'rename';
5
- export declare class DocumentDownloadSettings {
6
- exportMode: 'copy' | 'zip';
7
- destinationFolder: string;
8
- zipFileName: string;
9
- zipPassword: string;
10
- fileNamingMode: FileNamingMode;
11
- separatorChar: string;
12
- invoiceFormat: InvoiceRetrieveFormats;
13
- orderFormat: OrderRetrieveFormats;
14
- fileExistsMode: FileExistsMode;
15
- removeSignature: boolean;
16
- pdfFileName: string;
17
- }
18
3
  export declare const dcmtsFileCacheDownload: Map<string, File>;
19
4
  export declare const dcmtsFileCachePreview: Map<string, File>;
20
5
  export declare const CACHE_SIZE_LIMIT = 10;
@@ -37,7 +22,6 @@ export declare class UserSettings {
37
22
  wgDraftCheckoutInfo: CheckoutInfo[];
38
23
  dcmtCheckoutInfo: CheckoutInfo[];
39
24
  defaultCheckInOutFolder: string;
40
- documentDownloadSettings: DocumentDownloadSettings;
41
25
  constructor(skipCssUpdate?: boolean);
42
26
  /** Load settings from local storage or other sources */
43
27
  static LoadSettings(userID: number | undefined, archiveID: string | undefined): UserSettings;
@@ -1,20 +1,6 @@
1
1
  import { InvoiceRetrieveFormats, LocalStorageService, OrderRetrieveFormats } from "@topconsultnpm/sdk-ts";
2
2
  import { FontSize } from "../utils/theme";
3
- export class DocumentDownloadSettings {
4
- constructor() {
5
- this.exportMode = 'copy';
6
- this.destinationFolder = 'Download';
7
- this.zipFileName = '';
8
- this.zipPassword = '';
9
- this.fileNamingMode = 'documentTypeAndDid';
10
- this.separatorChar = '_';
11
- this.invoiceFormat = InvoiceRetrieveFormats.ASW_HTML;
12
- this.orderFormat = OrderRetrieveFormats.NSO_HTML;
13
- this.fileExistsMode = 'overwrite';
14
- this.removeSignature = false;
15
- this.pdfFileName = '';
16
- }
17
- }
3
+ // import { LandingPages } from "./helpers";
18
4
  export const dcmtsFileCacheDownload = new Map();
19
5
  export const dcmtsFileCachePreview = new Map();
20
6
  export const CACHE_SIZE_LIMIT = 10;
@@ -38,7 +24,6 @@ export class UserSettings {
38
24
  this.wgDraftCheckoutInfo = [];
39
25
  this.dcmtCheckoutInfo = [];
40
26
  this.defaultCheckInOutFolder = DEFAULT_CHECK_IN_OUT_FOLDER;
41
- this.documentDownloadSettings = new DocumentDownloadSettings();
42
27
  this.themeSettings = new ThemeSettings(skipCssUpdate);
43
28
  }
44
29
  /** Load settings from local storage or other sources */
@@ -53,23 +53,4 @@ type DcmtFormToolbarVisibility = {
53
53
  tmDcmtTasks: boolean;
54
54
  };
55
55
  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
56
  export {};
@@ -15,4 +15,3 @@ export * from './GlobalStyles';
15
15
  export * from './checkinCheckoutManager';
16
16
  export * from './workItemsHelper';
17
17
  export * from './devextremeCustomMessages';
18
- export * from './ZipManager';
@@ -15,4 +15,3 @@ export * from './GlobalStyles';
15
15
  export * from './checkinCheckoutManager';
16
16
  export * from './workItemsHelper';
17
17
  export * from './devextremeCustomMessages';
18
- export * from './ZipManager';
@@ -1,11 +1,5 @@
1
- import { RetrieveFileOptions, DcmtOpers, FileDescriptor, GeneralRetrieveFormats, InvoiceRetrieveFormats, OrderRetrieveFormats } from '@topconsultnpm/sdk-ts';
1
+ import { RetrieveFileOptions, FileDescriptor } from '@topconsultnpm/sdk-ts';
2
2
  import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes } from '../ts';
3
- export interface RetrieveFormatOptions {
4
- retrieveReason?: DcmtOpers;
5
- generalRetrieveFormat?: GeneralRetrieveFormats;
6
- invoiceRetrieveFormat?: InvoiceRetrieveFormats;
7
- orderRetrieveFormat?: OrderRetrieveFormats;
8
- }
9
3
  export interface UseDcmtOperationsReturn {
10
4
  abortController: AbortController;
11
5
  showWaitPanel: boolean;
@@ -18,7 +12,7 @@ export interface UseDcmtOperationsReturn {
18
12
  waitPanelTextSecondary: string;
19
13
  waitPanelValueSecondary: number;
20
14
  waitPanelMaxValueSecondary: number;
21
- 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) => Promise<void>;
15
+ downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType?: DownloadTypes, downloadMode?: DownloadModes, onFileDownloaded?: (dcmtFile: File) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>;
22
16
  getDcmtFileAsync: (inputDcmt: DcmtInfo | undefined, rfo: RetrieveFileOptions, operationTitle: string, keepWaitPanelPrimary: boolean, bypassCache?: boolean) => Promise<{
23
17
  file: File | undefined;
24
18
  isFromCache: boolean;