@topconsultnpm/sdkui-react 6.20.0-test1 → 6.21.0-dev1.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.
Files changed (125) hide show
  1. package/lib/components/NewComponents/ContextMenu/styles.d.ts +3 -1
  2. package/lib/components/NewComponents/ContextMenu/styles.js +7 -5
  3. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +7 -1
  4. package/lib/components/base/Styled.d.ts +4 -1
  5. package/lib/components/base/Styled.js +11 -3
  6. package/lib/components/base/TMPanel.js +6 -4
  7. package/lib/components/base/TMPopUp.js +4 -0
  8. package/lib/components/base/TMTreeView.d.ts +3 -1
  9. package/lib/components/base/TMTreeView.js +68 -21
  10. package/lib/components/base/TMWaitPanel.js +6 -5
  11. package/lib/components/choosers/TMDataListItemChooser.js +1 -1
  12. package/lib/components/choosers/TMDataListItemEditor.d.ts +11 -0
  13. package/lib/components/choosers/TMDataListItemEditor.js +130 -0
  14. package/lib/components/choosers/TMDataListItemFields.d.ts +11 -0
  15. package/lib/components/choosers/TMDataListItemFields.js +61 -0
  16. package/lib/components/choosers/TMDataListItemPicker.d.ts +2 -0
  17. package/lib/components/choosers/TMDataListItemPicker.js +182 -18
  18. package/lib/components/choosers/TMDynDataListItemChooser.js +11 -6
  19. package/lib/components/choosers/TMImageIDChooser.d.ts +16 -0
  20. package/lib/components/choosers/TMImageIDChooser.js +53 -0
  21. package/lib/components/choosers/TMMetadataChooser.js +1 -1
  22. package/lib/components/choosers/TMUserChooser.js +1 -1
  23. package/lib/components/editors/TMDateBox.js +1 -1
  24. package/lib/components/editors/TMHtmlEditor.js +1 -1
  25. package/lib/components/editors/TMLocalizedTextBox.d.ts +1 -0
  26. package/lib/components/editors/TMLocalizedTextBox.js +3 -3
  27. package/lib/components/editors/TMMetadataValues.js +203 -41
  28. package/lib/components/editors/TMTextArea.d.ts +1 -0
  29. package/lib/components/editors/TMTextArea.js +6 -6
  30. package/lib/components/editors/TMTextBox.js +9 -10
  31. package/lib/components/features/archive/TMArchive.d.ts +3 -1
  32. package/lib/components/features/archive/TMArchive.js +31 -44
  33. package/lib/components/features/blog/TMBlogCommentForm.d.ts +3 -0
  34. package/lib/components/features/blog/TMBlogCommentForm.js +42 -36
  35. package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -0
  36. package/lib/components/features/documents/TMDcmtBlog.js +2 -1
  37. package/lib/components/features/documents/TMDcmtForm.d.ts +44 -34
  38. package/lib/components/features/documents/TMDcmtForm.js +365 -563
  39. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +34 -0
  40. package/lib/components/features/documents/TMDcmtFormActionButtons.js +124 -0
  41. package/lib/components/features/documents/TMDcmtPreview.js +66 -13
  42. package/lib/components/features/documents/TMDcmtTasks.d.ts +3 -1
  43. package/lib/components/features/documents/TMDcmtTasks.js +2 -2
  44. package/lib/components/features/documents/TMFileUploader.d.ts +5 -0
  45. package/lib/components/features/documents/TMFileUploader.js +28 -6
  46. package/lib/components/features/documents/TMMasterDetailDcmts.js +31 -85
  47. package/lib/components/features/documents/TMRelationViewer.d.ts +7 -1
  48. package/lib/components/features/documents/TMRelationViewer.js +497 -111
  49. package/lib/components/features/search/TMSearch.d.ts +2 -2
  50. package/lib/components/features/search/TMSearch.js +3 -3
  51. package/lib/components/features/search/TMSearchQueryPanel.js +6 -6
  52. package/lib/components/features/search/TMSearchResult.d.ts +28 -25
  53. package/lib/components/features/search/TMSearchResult.js +445 -562
  54. package/lib/components/features/search/TMSignatureInfoContent.js +10 -6
  55. package/lib/components/features/search/TMTreeSelector.js +1 -1
  56. package/lib/components/features/tasks/TMTaskForm.d.ts +3 -1
  57. package/lib/components/features/tasks/TMTaskForm.js +61 -193
  58. package/lib/components/features/tasks/TMTaskFormUtils.d.ts +80 -0
  59. package/lib/components/features/tasks/TMTaskFormUtils.js +559 -0
  60. package/lib/components/features/tasks/TMTasksUtils.d.ts +3 -1
  61. package/lib/components/features/tasks/TMTasksUtils.js +46 -16
  62. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +0 -7
  63. package/lib/components/features/tasks/TMTasksUtilsView.js +7 -14
  64. package/lib/components/features/tasks/TMTasksView.js +5 -3
  65. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +20 -3
  66. package/lib/components/features/workflow/TMWorkflowPopup.js +21 -109
  67. package/lib/components/features/workflow/diagram/ConnectionComponent.d.ts +1 -0
  68. package/lib/components/features/workflow/diagram/ConnectionComponent.js +6 -2
  69. package/lib/components/features/workflow/diagram/DiagramItemForm.d.ts +2 -0
  70. package/lib/components/features/workflow/diagram/DiagramItemForm.js +32 -25
  71. package/lib/components/features/workflow/diagram/RecipientList.d.ts +3 -1
  72. package/lib/components/features/workflow/diagram/RecipientList.js +13 -9
  73. package/lib/components/features/workflow/diagram/WFDiagram.js +102 -5
  74. package/lib/components/features/workflow/diagram/workflowHelpers.js +31 -19
  75. package/lib/components/forms/Login/TMLoginForm.js +1 -1
  76. package/lib/components/forms/TMSaveForm.js +61 -13
  77. package/lib/components/grids/TMBlogsPost.js +8 -8
  78. package/lib/components/grids/TMBlogsPostUtils.js +2 -2
  79. package/lib/components/grids/TMRecentsManager.js +1 -1
  80. package/lib/components/index.d.ts +2 -0
  81. package/lib/components/index.js +2 -0
  82. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +3 -2
  83. package/lib/components/pages/TMPage.js +4 -0
  84. package/lib/components/query/TMQueryEditor.d.ts +1 -0
  85. package/lib/components/query/TMQueryEditor.js +3 -3
  86. package/lib/components/viewers/TMMidViewer.js +2 -1
  87. package/lib/components/viewers/TMTidViewer.js +7 -3
  88. package/lib/helper/Enum_Localizator.js +5 -0
  89. package/lib/helper/GlobalStyles.js +3 -0
  90. package/lib/helper/SDKUI_Globals.d.ts +12 -0
  91. package/lib/helper/SDKUI_Globals.js +21 -1
  92. package/lib/helper/SDKUI_Localizator.d.ts +31 -7
  93. package/lib/helper/SDKUI_Localizator.js +286 -46
  94. package/lib/helper/TMIcons.d.ts +2 -1
  95. package/lib/helper/TMIcons.js +4 -1
  96. package/lib/helper/TMUtils.d.ts +33 -41
  97. package/lib/helper/TMUtils.js +157 -170
  98. package/lib/helper/checkinCheckoutManager.js +6 -2
  99. package/lib/helper/helpers.d.ts +6 -2
  100. package/lib/helper/helpers.js +24 -8
  101. package/lib/helper/index.d.ts +1 -0
  102. package/lib/helper/index.js +1 -0
  103. package/lib/helper/queryHelper.js +1 -1
  104. package/lib/hooks/useBetaFeatures.d.ts +1 -0
  105. package/lib/hooks/useBetaFeatures.js +41 -0
  106. package/lib/hooks/useCheckInOutOperations.d.ts +7 -6
  107. package/lib/hooks/useCheckInOutOperations.js +9 -16
  108. package/lib/hooks/useDataUserIdItem.js +2 -2
  109. package/lib/hooks/useDcmtOperations.d.ts +3 -2
  110. package/lib/hooks/useDcmtOperations.js +16 -4
  111. package/lib/hooks/useDocumentOperations.d.ts +139 -0
  112. package/lib/hooks/useDocumentOperations.js +1275 -0
  113. package/lib/hooks/useRelatedDocuments.d.ts +1 -1
  114. package/lib/hooks/useRelatedDocuments.js +64 -42
  115. package/lib/index.d.ts +1 -0
  116. package/lib/index.js +1 -0
  117. package/lib/services/platform_services.d.ts +1 -1
  118. package/lib/services/platform_services.js +4 -0
  119. package/lib/ts/types.d.ts +5 -1
  120. package/lib/ts/types.js +1 -0
  121. package/package.json +55 -55
  122. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +0 -11
  123. package/lib/components/features/search/TMSearchResultsMenuItems.js +0 -770
  124. package/lib/components/features/search/TMSignSettingsForm.d.ts +0 -9
  125. package/lib/components/features/search/TMSignSettingsForm.js +0 -621
@@ -3,12 +3,11 @@ import { cicoDownloadFilesCallback, dcmtsFileCachePreview, getCicoDownloadFileNa
3
3
  import { ButtonNames, ShowAlert, TMMessageBoxManager, TMResultManager } from '../components';
4
4
  import { ResultTypes, SDK_Globals } from '@topconsultnpm/sdk-ts';
5
5
  let abortController = new AbortController();
6
- export const useCheckInOutOperations = () => {
6
+ export const useCheckInOutOperations = (props) => {
7
+ const { onRefreshPreview } = props;
7
8
  const [showHistory, setShowHistory] = useState(false);
8
9
  // State to manage show history selected file
9
10
  const [showCheckoutInformationForm, setShowCheckoutInformationForm] = useState(false);
10
- // Stato per triggerare il refresh della preview dall'esterno
11
- const [refreshPreviewTrigger, setRefreshPreviewTrigger] = useState(0);
12
11
  // State to manage comment form
13
12
  const [commentFormState, setCommentFormState] = useState({
14
13
  removeAndEditAttachment: true,
@@ -39,9 +38,6 @@ export const useCheckInOutOperations = () => {
39
38
  const hideCheckoutInformationFormCallback = useCallback(() => {
40
39
  setShowCheckoutInformationForm(false);
41
40
  }, []);
42
- const triggerPreviewRefresh = useCallback(() => {
43
- setRefreshPreviewTrigger(prev => prev + 1);
44
- }, []);
45
41
  const hideCommentFormCallback = useCallback(() => {
46
42
  setCommentFormState(prev => ({ ...prev, show: false }));
47
43
  }, []);
@@ -60,7 +56,7 @@ export const useCheckInOutOperations = () => {
60
56
  ShowAlert({ message: err, mode: 'error', duration: 5000, title: SDKUI_Localizator.OperationResult });
61
57
  });
62
58
  };
63
- const handleCheckOutCallback = async (dcmt, checkout, filename, downloadDcmtsAsync, refreshMetadataAsync, refreshFocusedDataRowAsync) => {
59
+ const handleCheckOutCallback = async (dcmt, checkout, filename, downloadDcmtsAsync, onRefreshAsync) => {
64
60
  if (!dcmt)
65
61
  throw new Error("Document info is required");
66
62
  const title = checkout ? 'Check out' : SDKUI_Localizator.CancelCheckOut;
@@ -88,8 +84,7 @@ export const useCheckInOutOperations = () => {
88
84
  .then(async () => {
89
85
  await cicoDownloadFilesCallback([{ type: 'dcmtInfo', dcmtInfo: dcmt, originalFileName: filename }], true, downloadDcmtsAsync);
90
86
  result.push({ rowIndex: 1, id1: dcmt.TID, id2: dcmt.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
91
- await refreshMetadataAsync?.();
92
- await refreshFocusedDataRowAsync?.(dcmt.TID, dcmt.DID, true);
87
+ await onRefreshAsync?.(dcmt.TID, dcmt.DID, true);
93
88
  })
94
89
  .catch((error) => {
95
90
  result.push({ rowIndex: 1, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
@@ -102,8 +97,7 @@ export const useCheckInOutOperations = () => {
102
97
  result.push({ rowIndex: 1, id1: dcmt.TID, id2: dcmt.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
103
98
  // Remove the corresponding draft checkout item
104
99
  updateCicoCheckoutStorageItem({ TID: dcmt.TID.toString(), DID: dcmt.DID.toString(), checkoutFolder: "", checkoutName: "" }, "dcmtInfo", "remove");
105
- await refreshMetadataAsync?.();
106
- await refreshFocusedDataRowAsync?.(dcmt.TID, dcmt.DID, true);
100
+ await onRefreshAsync?.(dcmt.TID, dcmt.DID, true);
107
101
  })
108
102
  .catch((error) => {
109
103
  result.push({ rowIndex: 0, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
@@ -133,7 +127,7 @@ export const useCheckInOutOperations = () => {
133
127
  });
134
128
  }
135
129
  };
136
- const handleCheckInCallback = async (dcmt, refreshMetadataAsync, refreshFocusedDataRowAsync) => {
130
+ const handleCheckInCallback = async (dcmt, onRefreshAsync) => {
137
131
  if (!dcmt)
138
132
  throw new Error("Document info is required");
139
133
  // Create a new file input element
@@ -175,12 +169,12 @@ export const useCheckInOutOperations = () => {
175
169
  // Remove the corresponding draft checkout item
176
170
  updateCicoCheckoutStorageItem({ TID: dcmt.TID.toString(), DID: dcmt.DID.toString(), checkoutFolder: "", checkoutName: "" }, "dcmtInfo", "remove");
177
171
  result.push({ rowIndex: i, id1: dcmt.DID, id2: dcmt.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
178
- await refreshMetadataAsync?.();
179
- await refreshFocusedDataRowAsync?.(dcmt.TID, dcmt.DID, true);
172
+ await onRefreshAsync?.(dcmt.TID, dcmt.DID, true);
173
+ // remove file from preview cache to force refresh with the new checked-in file
180
174
  const cacheKey = `${dcmt.TID}-${dcmt.DID}`;
181
175
  if (dcmtsFileCachePreview.has(cacheKey))
182
176
  removeDcmtsFileCache(cacheKey);
183
- triggerPreviewRefresh();
177
+ await onRefreshPreview();
184
178
  triggerCommentOnFileAdd([dcmt.DID]);
185
179
  }
186
180
  }
@@ -212,7 +206,6 @@ export const useCheckInOutOperations = () => {
212
206
  copyCheckoutPathToClipboardCallback,
213
207
  handleCheckOutCallback,
214
208
  handleCheckInCallback,
215
- refreshPreviewTrigger,
216
209
  showCicoWaitPanel,
217
210
  cicoWaitPanelTitle,
218
211
  showCicoPrimaryProgress,
@@ -76,14 +76,14 @@ export const useDataUserIdItem = () => {
76
76
  return null;
77
77
  if (!userId)
78
78
  return null;
79
- return ud ? _jsx(TMUserIcon, { ud: ud }) : _jsx("div", { title: showTitile ? SDKUI_Localizator.ValueNotPresent : undefined, children: _jsx(IconWarning, { color: TMColors.warning }) });
79
+ return ud ? _jsx(TMUserIcon, { ud: ud }) : _jsx("span", { title: showTitile ? SDKUI_Localizator.ValueNotPresent : undefined, style: { display: 'inline-flex', alignItems: 'center' }, children: _jsx(IconWarning, { color: TMColors.warning }) });
80
80
  };
81
81
  const getDescription = () => {
82
82
  if (!userId)
83
83
  return undefined;
84
84
  return ud ? getCompleteUserName(ud.domain, ud.name) : userId.toString() ?? SDKUI_Localizator.NoneSelection;
85
85
  };
86
- return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '4px' }, children: [getIcon(), _jsx("span", { children: getDescription() })] }));
86
+ return (_jsxs("span", { style: { display: 'inline-flex', alignItems: 'center', gap: '4px', lineHeight: 1 }, children: [getIcon(), _jsx("span", { style: { lineHeight: 'normal' }, children: getDescription() })] }));
87
87
  }, [getUserItem, getCompleteUserName]);
88
88
  return {
89
89
  loadUsersAsync,
@@ -1,6 +1,6 @@
1
1
  import { RetrieveFileOptions, FileDescriptor } from '@topconsultnpm/sdk-ts';
2
2
  import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes } from '../ts';
3
- export declare function useDcmtOperations(): {
3
+ export interface UseDcmtOperationsReturn {
4
4
  abortController: AbortController;
5
5
  showWaitPanel: boolean;
6
6
  showPrimary: boolean;
@@ -21,4 +21,5 @@ export declare function useDcmtOperations(): {
21
21
  removeDcmtsFileCache: (key: string) => void;
22
22
  isDcmtFileInCache: (key: string) => boolean;
23
23
  runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>;
24
- };
24
+ }
25
+ export declare const useDcmtOperations: () => UseDcmtOperationsReturn;
@@ -8,7 +8,19 @@ import { useFileDialog } from './useInputDialog';
8
8
  import { isXMLFileExt } from '../helper/dcmtsHelper';
9
9
  import { ShowConfirm } from '../components/base/TMConfirm';
10
10
  let abortController = new AbortController();
11
- export function useDcmtOperations() {
11
+ const downloadCountMap = new Map();
12
+ const getDownloadFileName = (fileName) => {
13
+ const firstDot = fileName.indexOf('.');
14
+ const lastDot = fileName.lastIndexOf('.');
15
+ if (firstDot === -1 || firstDot === lastDot)
16
+ return fileName;
17
+ const count = downloadCountMap.get(fileName) ?? 0;
18
+ downloadCountMap.set(fileName, count + 1);
19
+ if (count === 0)
20
+ return fileName;
21
+ return `${fileName.slice(0, firstDot)}(${count})${fileName.slice(firstDot)}`;
22
+ };
23
+ export const useDcmtOperations = () => {
12
24
  const [showWaitPanel, setShowWaitPanel] = useState(false);
13
25
  const [waitPanelTitle, setWaitPanelTitle] = useState('');
14
26
  const [showPrimary, setShowPrimary] = useState(false);
@@ -96,8 +108,8 @@ export function useDcmtOperations() {
96
108
  else {
97
109
  const alink2 = document.createElement('a');
98
110
  alink2.href = fileURL;
99
- const downloadFileName = inputDcmts[i].fileName ?? (inputDcmts[i].FILEEXT ? `${inputDcmts[i].DID}.${inputDcmts[i].FILEEXT}` : file?.name);
100
- alink2.download = downloadFileName;
111
+ const baseFileName = inputDcmts[i].fileName ?? (inputDcmts[i].FILEEXT ? `${inputDcmts[i].DID}.${inputDcmts[i].FILEEXT}` : file?.name);
112
+ alink2.download = getDownloadFileName(baseFileName);
101
113
  alink2.target = "_blank";
102
114
  alink2.rel = "noreferrer";
103
115
  alink2.click();
@@ -483,4 +495,4 @@ export function useDcmtOperations() {
483
495
  abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary,
484
496
  downloadDcmtsAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache, runOperationAsync
485
497
  };
486
- }
498
+ };
@@ -0,0 +1,139 @@
1
+ import React, { RefObject } from "react";
2
+ import { DcmtTypeDescriptor, FileFormats, HomeBlogPost, LayoutDescriptor, LayoutModes, ObjectRef, SearchResultDescriptor, TaskDescriptor, UserDescriptor, WorkingGroupDescriptor } from "@topconsultnpm/sdk-ts";
3
+ import { IColumnProps } from "devextreme-react/cjs/data-grid";
4
+ import { TMContextMenuItemProps } from '../components/NewComponents/ContextMenu/types';
5
+ import { DcmtInfo, MetadataValueDescriptorEx, SearchResultContext, TaskContext } from "../ts";
6
+ import { UseCheckInOutOperationsReturn } from "./useCheckInOutOperations";
7
+ import { UseDcmtOperationsReturn } from "./useDcmtOperations";
8
+ import { UseRelatedDocumentsReturn } from "./useRelatedDocuments";
9
+ export interface DocumentDataProps {
10
+ dtd: DcmtTypeDescriptor | undefined;
11
+ selectedItems: Array<any>;
12
+ focusedItem: any;
13
+ currentSearchResults: Array<SearchResultDescriptor>;
14
+ currentMetadataValues: Array<MetadataValueDescriptorEx>;
15
+ allUsers?: Array<UserDescriptor>;
16
+ searchResult?: SearchResultDescriptor;
17
+ datagridUtility?: {
18
+ visibleItems?: any[];
19
+ onRefreshSearchAsyncDatagrid?: () => Promise<void>;
20
+ onRefreshDataRowsAsync?: (() => Promise<void>);
21
+ refreshFocusedDataRowAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>;
22
+ onRefreshBlogDatagrid?: () => Promise<void>;
23
+ onRefreshPreviewDatagrid?: () => Promise<void>;
24
+ refreshOperationsTrigger?: number;
25
+ onRefreshOperationsDatagrid?: () => Promise<void>;
26
+ };
27
+ dcmtUtility?: {
28
+ approvalVID?: number;
29
+ dcmtDataRowForCicoStatus?: Array<MetadataValueDescriptorEx> | any;
30
+ selectedDcmtSearchResultRelations?: SearchResultDescriptor;
31
+ dcmtTIDHasDetailRelations?: boolean;
32
+ dcmtTIDHasMasterRelations?: boolean;
33
+ updateCurrentDcmt?: () => Promise<void>;
34
+ onCloseDcmtForm?: () => void;
35
+ onRefreshBlogForm?: () => Promise<void>;
36
+ onRefreshPreviewForm?: () => Promise<void>;
37
+ taskFormDialogComponent?: React.ReactNode;
38
+ s4TViewerDialogComponent?: React.ReactNode;
39
+ };
40
+ }
41
+ export interface ExportDataProps {
42
+ dataColumns?: Array<IColumnProps>;
43
+ dataSource?: Array<any>;
44
+ selectedRowKeys?: Array<number>;
45
+ }
46
+ export interface UIConfigProps {
47
+ floatingBarContainerRef?: RefObject<HTMLElement | null>;
48
+ customButtonsLayout?: LayoutDescriptor;
49
+ workingGroupContext?: WorkingGroupDescriptor;
50
+ allowFloatingBar?: boolean;
51
+ enablePinIcons?: boolean;
52
+ openDcmtFormAsModal?: boolean;
53
+ showDcmtFormSidebar?: boolean;
54
+ allowRelations?: boolean;
55
+ openS4TViewer?: boolean;
56
+ editPdfForm?: boolean;
57
+ showTodoDcmtForm?: boolean;
58
+ showToppyDraggableHelpCenter?: boolean;
59
+ toppyHelpCenterUsePortal?: boolean;
60
+ inputDcmtFormLayoutMode?: LayoutModes;
61
+ }
62
+ export interface TasksProps {
63
+ allTasks?: Array<TaskDescriptor>;
64
+ getAllTasks?: () => Promise<void>;
65
+ deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
66
+ addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
67
+ editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
68
+ }
69
+ export interface OperationCallbacks {
70
+ onRefreshSearchAsync?: (() => Promise<void>);
71
+ onSavedAsyncCallback?: (tid: number | undefined, did: number | undefined, metadataResult?: SearchResultDescriptor | null) => Promise<void>;
72
+ onRefreshAfterAddDcmtToFavs?: () => void;
73
+ onWFOperationCompleted?: () => Promise<void>;
74
+ canNavigateHandler?: (dir: "next" | "prev") => boolean;
75
+ onNavigateHandler?: (dir: "next" | "prev") => void;
76
+ handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
77
+ handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
78
+ onReferenceClick?: (ref: ObjectRef) => void;
79
+ openAddDocumentForm?: () => void;
80
+ openCommentFormCallback?: ((documents: Array<DcmtInfo>) => void);
81
+ onFileOpened?: (blob: File | undefined) => void;
82
+ passToArchiveCallback?: (outputMids: Array<{
83
+ mid: number;
84
+ value: string;
85
+ }>, tid?: number) => void;
86
+ openWGsCopyMoveForm?: (mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void;
87
+ onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
88
+ onOpenPdfEditorRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
89
+ onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
90
+ openTaskFormHandler?: (onTaskCreated?: (task?: TaskDescriptor) => void) => void;
91
+ }
92
+ interface UseDocumentOperationsProps {
93
+ context: SearchResultContext;
94
+ documentData: DocumentDataProps;
95
+ uiConfig: UIConfigProps;
96
+ tasks: TasksProps;
97
+ callbacks: OperationCallbacks;
98
+ exportData?: ExportDataProps;
99
+ }
100
+ export interface UseDocumentOperationsResult {
101
+ operationItems: Array<TMContextMenuItemProps>;
102
+ renderFloatingBar: React.ReactNode;
103
+ renderDcmtOperations: React.ReactNode;
104
+ features: {
105
+ isOpenDcmtForm: boolean;
106
+ openFormHandler: (layoutMode: LayoutModes) => void;
107
+ dcmtFormLayoutMode: LayoutModes;
108
+ onDcmtFormOpenChange: (isOpen: boolean, layoutMode: LayoutModes) => void;
109
+ isOpenBatchUpdate: boolean;
110
+ isModifiedBatchUpdate: boolean;
111
+ updateBatchUpdateForm: (value: boolean) => void;
112
+ handleSignApprove: () => void;
113
+ showSearchTMDatagrid: boolean;
114
+ showExportForm: boolean;
115
+ checkoutInfo: UseCheckInOutOperationsReturn;
116
+ relatedDocumentsInfo: UseRelatedDocumentsReturn;
117
+ dcmtOperations: UseDcmtOperationsReturn;
118
+ toppyOperations: {
119
+ showApprovePopup: boolean;
120
+ showRejectPopup: boolean;
121
+ showReAssignPopup: boolean;
122
+ showMoreInfoPopup: boolean;
123
+ updateShowApprovePopup: (value: boolean) => void;
124
+ updateShowRejectPopup: (value: boolean) => void;
125
+ updateShowReAssignPopup: (value: boolean) => void;
126
+ updateShowMoreInfoPopup: (value: boolean) => void;
127
+ };
128
+ };
129
+ }
130
+ export interface ExportData {
131
+ dataColumns?: Array<IColumnProps>;
132
+ dataSource?: Array<any>;
133
+ selectedRowKeys?: Array<number>;
134
+ searchResult?: SearchResultDescriptor;
135
+ }
136
+ export declare const getSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => DcmtInfo[];
137
+ export declare const getAllFieldSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => any[];
138
+ export declare const useDocumentOperations: (props: UseDocumentOperationsProps) => UseDocumentOperationsResult;
139
+ export {};