@topconsultnpm/sdkui-react 6.20.0-dev1.13 → 6.20.0-dev1.130

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 (202) hide show
  1. package/lib/assets/Toppy-help-center.png +0 -0
  2. package/lib/assets/headergradient.svg +87 -0
  3. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +322 -30
  4. package/lib/components/NewComponents/ContextMenu/hooks.d.ts +8 -1
  5. package/lib/components/NewComponents/ContextMenu/hooks.js +80 -8
  6. package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
  7. package/lib/components/NewComponents/ContextMenu/index.js +2 -0
  8. package/lib/components/NewComponents/ContextMenu/styles.d.ts +9 -1
  9. package/lib/components/NewComponents/ContextMenu/styles.js +146 -47
  10. package/lib/components/NewComponents/ContextMenu/types.d.ts +22 -3
  11. package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
  12. package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
  13. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +620 -125
  14. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +25 -5
  15. package/lib/components/NewComponents/FloatingMenuBar/styles.js +215 -59
  16. package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +12 -3
  17. package/lib/components/base/TMAccordionNew.js +35 -14
  18. package/lib/components/base/TMButton.js +6 -0
  19. package/lib/components/base/TMClosableList.js +4 -0
  20. package/lib/components/base/TMCustomButton.js +61 -17
  21. package/lib/components/base/TMDataGrid.d.ts +7 -4
  22. package/lib/components/base/TMDataGrid.js +153 -11
  23. package/lib/components/base/TMDropDownMenu.js +21 -18
  24. package/lib/components/base/TMFileManager.d.ts +4 -3
  25. package/lib/components/base/TMFileManager.js +32 -24
  26. package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
  27. package/lib/components/base/TMFileManagerDataGridView.js +1 -11
  28. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
  29. package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
  30. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
  31. package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
  32. package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
  33. package/lib/components/base/TMListView.js +33 -15
  34. package/lib/components/base/TMPanel.d.ts +1 -1
  35. package/lib/components/base/TMPanel.js +4 -2
  36. package/lib/components/base/TMPopUp.js +6 -0
  37. package/lib/components/base/TMToolbarCard.js +2 -0
  38. package/lib/components/base/TMTreeView.d.ts +2 -1
  39. package/lib/components/base/TMTreeView.js +33 -26
  40. package/lib/components/choosers/TMDataListItemChooser.d.ts +2 -0
  41. package/lib/components/choosers/TMDataListItemChooser.js +8 -2
  42. package/lib/components/choosers/TMDcmtTypeChooser.d.ts +1 -0
  43. package/lib/components/choosers/TMDcmtTypeChooser.js +11 -3
  44. package/lib/components/choosers/TMDistinctValues.js +2 -2
  45. package/lib/components/choosers/TMDynDataListItemChooser.d.ts +2 -0
  46. package/lib/components/choosers/TMDynDataListItemChooser.js +8 -2
  47. package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
  48. package/lib/components/choosers/TMMetadataChooser.d.ts +2 -0
  49. package/lib/components/choosers/TMMetadataChooser.js +19 -4
  50. package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
  51. package/lib/components/choosers/TMUserChooser.d.ts +2 -5
  52. package/lib/components/choosers/TMUserChooser.js +33 -47
  53. package/lib/components/editors/TMCheckBox.js +2 -0
  54. package/lib/components/editors/TMDateBox.js +18 -9
  55. package/lib/components/editors/TMEditorStyled.js +7 -0
  56. package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
  57. package/lib/components/editors/TMLocalizedTextBox.js +16 -14
  58. package/lib/components/editors/TMMetadataEditor.d.ts +1 -0
  59. package/lib/components/editors/TMMetadataEditor.js +4 -4
  60. package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
  61. package/lib/components/editors/TMMetadataTextBox.js +92 -0
  62. package/lib/components/editors/TMMetadataValues.d.ts +2 -0
  63. package/lib/components/editors/TMMetadataValues.js +26 -8
  64. package/lib/components/editors/TMRadioButton.js +2 -0
  65. package/lib/components/editors/TMTextArea.js +18 -30
  66. package/lib/components/editors/TMTextBox.d.ts +1 -1
  67. package/lib/components/editors/TMTextBox.js +29 -4
  68. package/lib/components/editors/TMTextExpression.js +6 -91
  69. package/lib/components/features/archive/TMArchive.js +2 -2
  70. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
  71. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +462 -0
  72. package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
  73. package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
  74. package/lib/components/features/documents/TMDcmtBlog.js +1 -1
  75. package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
  76. package/lib/components/features/documents/TMDcmtForm.js +576 -292
  77. package/lib/components/features/documents/TMDcmtPreview.js +42 -155
  78. package/lib/components/features/documents/TMDcmtTasks.js +9 -9
  79. package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
  80. package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
  81. package/lib/components/features/documents/TMRelationViewer.js +2 -2
  82. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
  83. package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +2 -2
  84. package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
  85. package/lib/components/features/search/TMSearch.d.ts +3 -0
  86. package/lib/components/features/search/TMSearch.js +50 -11
  87. package/lib/components/features/search/TMSearchQueryEditor.d.ts +1 -0
  88. package/lib/components/features/search/TMSearchQueryEditor.js +10 -10
  89. package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
  90. package/lib/components/features/search/TMSearchQueryPanel.js +40 -25
  91. package/lib/components/features/search/TMSearchResult.d.ts +3 -0
  92. package/lib/components/features/search/TMSearchResult.js +370 -252
  93. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
  94. package/lib/components/features/search/TMSearchResultsMenuItems.js +227 -171
  95. package/lib/components/features/search/TMSignSettingsForm.js +1 -1
  96. package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
  97. package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
  98. package/lib/components/features/search/TMViewHistoryDcmt.js +47 -52
  99. package/lib/components/features/tasks/TMTaskForm.js +75 -25
  100. package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
  101. package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
  102. package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
  103. package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
  104. package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
  105. package/lib/components/features/tasks/TMTasksUtils.js +57 -37
  106. package/lib/components/features/tasks/TMTasksView.js +28 -19
  107. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
  108. package/lib/components/features/workflow/TMWorkflowPopup.js +140 -34
  109. package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
  110. package/lib/components/features/workflow/diagram/DiagramItemComponent.js +14 -7
  111. package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
  112. package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
  113. package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
  114. package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
  115. package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
  116. package/lib/components/forms/Login/LoginValidatorService.js +7 -2
  117. package/lib/components/forms/Login/TMLoginForm.js +35 -7
  118. package/lib/components/forms/TMChooserForm.js +1 -1
  119. package/lib/components/grids/TMBlogsPost.js +56 -31
  120. package/lib/components/grids/TMRecentsManager.js +20 -10
  121. package/lib/components/grids/TMValidationItemsList.js +6 -0
  122. package/lib/components/index.d.ts +6 -3
  123. package/lib/components/index.js +6 -3
  124. package/lib/components/layout/panelManager/TMPanelManagerContext.js +13 -5
  125. package/lib/components/query/TMQueryEditor.d.ts +6 -1
  126. package/lib/components/query/TMQueryEditor.js +105 -101
  127. package/lib/components/settings/SettingsAppearance.d.ts +2 -1
  128. package/lib/components/settings/SettingsAppearance.js +99 -30
  129. package/lib/components/sidebar/TMHeader.js +11 -7
  130. package/lib/components/sidebar/TMSidebar.d.ts +0 -1
  131. package/lib/components/sidebar/TMSidebar.js +16 -44
  132. package/lib/components/sidebar/TMSidebarItem.js +36 -17
  133. package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
  134. package/lib/components/viewers/TMDataListItemViewer.js +35 -71
  135. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
  136. package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
  137. package/lib/css/tm-sdkui.css +1 -1
  138. package/lib/helper/SDKUI_Globals.d.ts +22 -0
  139. package/lib/helper/SDKUI_Globals.js +10 -1
  140. package/lib/helper/SDKUI_Localizator.d.ts +21 -3
  141. package/lib/helper/SDKUI_Localizator.js +196 -10
  142. package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
  143. package/lib/helper/TMCommandsContextMenu.js +15 -4
  144. package/lib/helper/TMIcons.d.ts +4 -0
  145. package/lib/helper/TMIcons.js +13 -3
  146. package/lib/helper/TMPdfViewer.d.ts +8 -0
  147. package/lib/helper/TMPdfViewer.js +373 -0
  148. package/lib/helper/TMToppyMessage.js +4 -0
  149. package/lib/helper/checkinCheckoutManager.d.ts +31 -1
  150. package/lib/helper/checkinCheckoutManager.js +112 -30
  151. package/lib/helper/devextremeCustomMessages.d.ts +30 -0
  152. package/lib/helper/devextremeCustomMessages.js +30 -0
  153. package/lib/helper/helpers.d.ts +30 -2
  154. package/lib/helper/helpers.js +132 -4
  155. package/lib/helper/index.d.ts +2 -0
  156. package/lib/helper/index.js +2 -0
  157. package/lib/helper/queryHelper.d.ts +2 -2
  158. package/lib/helper/queryHelper.js +80 -24
  159. package/lib/helper/workItemsHelper.d.ts +6 -0
  160. package/lib/helper/workItemsHelper.js +230 -0
  161. package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
  162. package/lib/hooks/useCheckInOutOperations.js +223 -0
  163. package/lib/hooks/useDataListItem.d.ts +12 -0
  164. package/lib/hooks/useDataListItem.js +132 -0
  165. package/lib/hooks/useDataUserIdItem.d.ts +10 -0
  166. package/lib/hooks/useDataUserIdItem.js +96 -0
  167. package/lib/hooks/useFloatingBarPinnedItems.d.ts +11 -0
  168. package/lib/hooks/useFloatingBarPinnedItems.js +54 -0
  169. package/lib/hooks/useMetadataExpression.d.ts +19 -0
  170. package/lib/hooks/useMetadataExpression.js +99 -0
  171. package/lib/hooks/useSettingsFeedback.d.ts +11 -0
  172. package/lib/hooks/useSettingsFeedback.js +38 -0
  173. package/lib/hooks/useWorkflowApprove.d.ts +4 -0
  174. package/lib/hooks/useWorkflowApprove.js +14 -1
  175. package/lib/index.d.ts +1 -0
  176. package/lib/index.js +3 -2
  177. package/lib/services/platform_services.d.ts +3 -3
  178. package/lib/ts/types.d.ts +61 -1
  179. package/lib/utils/theme.d.ts +1 -1
  180. package/lib/utils/theme.js +1 -1
  181. package/package.json +6 -5
  182. package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
  183. package/lib/components/NewComponents/Notification/Notification.js +0 -60
  184. package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
  185. package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
  186. package/lib/components/NewComponents/Notification/index.d.ts +0 -2
  187. package/lib/components/NewComponents/Notification/index.js +0 -2
  188. package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
  189. package/lib/components/NewComponents/Notification/styles.js +0 -180
  190. package/lib/components/NewComponents/Notification/types.d.ts +0 -18
  191. package/lib/components/NewComponents/Notification/types.js +0 -1
  192. package/lib/components/base/TMContextMenu.d.ts +0 -25
  193. package/lib/components/base/TMContextMenu.js +0 -109
  194. package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
  195. package/lib/components/base/TMContextMenuOLD.js +0 -56
  196. package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
  197. package/lib/components/base/TMFloatingToolbar.js +0 -101
  198. package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
  199. package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
  200. package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
  201. package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
  202. package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
@@ -333,7 +333,7 @@ const TMSignSettingsForm = (props) => {
333
333
  fontWeight: 'bold',
334
334
  color: isModified ? MODIFIED_COLOR : '#777',
335
335
  transition: 'opacity 0.2s ease'
336
- }, onMouseEnter: (e) => { e.currentTarget.style.opacity = '0.9'; }, onMouseLeave: (e) => { e.currentTarget.style.opacity = '0.5'; }, children: "\u00D7" })] }));
336
+ }, onMouseEnter: (e) => { e.currentTarget.style.opacity = '0.9'; }, onMouseLeave: (e) => { e.currentTarget.style.opacity = '0.5'; }, children: _jsx("i", { className: "dx-icon-close" }) })] }));
337
337
  };
338
338
  const renderMultiSignerTag = (tagData) => {
339
339
  const handleRemoveTag = () => {
@@ -0,0 +1,6 @@
1
+ import { DcmtInfo } from "../../../ts";
2
+ interface TMSignatureInfoContentProps {
3
+ inputDcmt: DcmtInfo;
4
+ }
5
+ declare const TMSignatureInfoContent: (props: TMSignatureInfoContentProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ export default TMSignatureInfoContent;
@@ -0,0 +1,140 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from "react";
3
+ import { SDK_Globals } from "@topconsultnpm/sdk-ts";
4
+ import { IconCopy, getExceptionMessage } from "../../../helper";
5
+ import TMSpinner from "../../base/TMSpinner";
6
+ const TMSignatureInfoContent = (props) => {
7
+ const { inputDcmt } = props;
8
+ const [selectedHash, setSelectedHash] = useState('sha256');
9
+ const [signerInfo, setSignerInfo] = useState(undefined);
10
+ const [error, setError] = useState(undefined);
11
+ const [copiedHash, setCopiedHash] = useState(false);
12
+ useEffect(() => {
13
+ const fetchSignerInfo = async () => {
14
+ TMSpinner.show();
15
+ try {
16
+ const ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
17
+ if (!ue) {
18
+ setError("Sessione non disponibile");
19
+ TMSpinner.hide();
20
+ return;
21
+ }
22
+ ue.TID = inputDcmt.TID;
23
+ ue.DID = inputDcmt.DID;
24
+ const signerInfoDescriptor = await ue.GetSignersAsync();
25
+ if (!signerInfoDescriptor) {
26
+ setError("Informazioni di firma non disponibili");
27
+ TMSpinner.hide();
28
+ return;
29
+ }
30
+ setSignerInfo(signerInfoDescriptor);
31
+ setError(undefined);
32
+ TMSpinner.hide();
33
+ }
34
+ catch (err) {
35
+ setError(getExceptionMessage(err));
36
+ TMSpinner.hide();
37
+ }
38
+ };
39
+ fetchSignerInfo();
40
+ }, [inputDcmt]);
41
+ const hashButtonStyle = (isActive) => ({
42
+ padding: '8px 16px',
43
+ margin: '0 2px',
44
+ border: isActive ? '2px solid #0078d4' : '1px solid #ccc',
45
+ borderRadius: '6px',
46
+ background: isActive ? '#e6f2ff' : '#fff',
47
+ color: isActive ? '#0078d4' : '#333',
48
+ cursor: 'pointer',
49
+ fontSize: '13px',
50
+ fontWeight: isActive ? '600' : '400',
51
+ transition: 'all 0.2s ease',
52
+ outline: 'none',
53
+ userSelect: 'none',
54
+ whiteSpace: 'nowrap'
55
+ });
56
+ const getHashValue = () => {
57
+ switch (selectedHash) {
58
+ case 'sha256': return signerInfo?.shA256;
59
+ case 'sha1': return signerInfo?.shA1;
60
+ case 'sha256base64': return signerInfo?.shA256Base64;
61
+ }
62
+ };
63
+ const getHashLabel = () => {
64
+ switch (selectedHash) {
65
+ case 'sha256': return 'SHA-256';
66
+ case 'sha1': return 'SHA-1';
67
+ case 'sha256base64': return 'SHA-256 (Base64)';
68
+ }
69
+ };
70
+ const copyToClipboard = async () => {
71
+ const value = getHashValue();
72
+ if (value) {
73
+ try {
74
+ await navigator.clipboard.writeText(value);
75
+ setCopiedHash(true);
76
+ setTimeout(() => setCopiedHash(false), 2000);
77
+ }
78
+ catch (err) {
79
+ console.error('Failed to copy:', err);
80
+ }
81
+ }
82
+ };
83
+ if (error) {
84
+ return (_jsx("div", { style: {
85
+ padding: '20px',
86
+ textAlign: 'center',
87
+ color: '#d32f2f',
88
+ background: '#ffebee',
89
+ borderRadius: '8px'
90
+ }, children: error }));
91
+ }
92
+ if (!signerInfo) {
93
+ return null;
94
+ }
95
+ return (_jsxs("div", { style: { lineHeight: "1.5em", overflowY: "auto", maxHeight: "500px", paddingRight: "8px", boxSizing: "border-box", userSelect: 'text' }, children: [signerInfo.signers && signerInfo.signers.length > 0 ? (_jsxs("div", { children: [_jsxs("h4", { style: { margin: '0 0 12px 0', color: '#0078d4', fontSize: '16px' }, children: ["Firme digitali (", signerInfo.signers.length, ")"] }), signerInfo.signers.map((signer, idx) => (_jsxs("div", { style: {
96
+ border: "1px solid #d0d0d0",
97
+ borderRadius: "8px",
98
+ padding: "16px",
99
+ marginBottom: "12px",
100
+ background: "linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%)",
101
+ boxShadow: "0 2px 4px rgba(0,0,0,0.08)",
102
+ userSelect: 'text',
103
+ }, children: [_jsxs("h3", { style: { margin: "0 0 12px", color: "#0078d4", fontSize: '15px', fontWeight: '600' }, children: ["Firma ", signer.levelAndIndex] }), _jsxs("div", { style: {
104
+ display: 'grid',
105
+ gap: '10px',
106
+ fontSize: '13px'
107
+ }, children: [_jsxs("div", { children: [_jsx("strong", { style: { color: '#555' }, children: "Intestatario:" }), _jsx("div", { style: { marginTop: '4px', color: '#333' }, children: signer.info1 ?? '-' })] }), _jsxs("div", { children: [_jsx("strong", { style: { color: '#555' }, children: "Riferimento temporale:" }), _jsx("div", { style: { marginTop: '4px', color: '#333' }, children: signer.info2 ?? '-' })] }), _jsxs("div", { children: [_jsx("strong", { style: { color: '#555' }, children: "Dettagli:" }), _jsx("div", { style: { marginTop: '4px', color: '#333' }, children: signer.info3 ?? '-' })] })] })] }, idx)))] })) : (_jsx("div", { style: {
108
+ padding: '20px',
109
+ textAlign: 'center',
110
+ color: '#666',
111
+ background: '#f5f5f5',
112
+ borderRadius: '8px'
113
+ }, children: "Nessuna firma trovata" })), signerInfo.shA256 && (_jsxs("div", { style: {
114
+ marginBottom: '12px',
115
+ padding: '16px',
116
+ background: '#f5f5f5',
117
+ borderRadius: '8px',
118
+ border: '1px solid #e0e0e0'
119
+ }, children: [_jsxs("div", { style: { marginBottom: '12px', display: 'flex', gap: '4px', flexWrap: 'wrap' }, children: [signerInfo.shA256 && (_jsx("button", { onClick: () => setSelectedHash('sha256'), style: hashButtonStyle(selectedHash === 'sha256'), children: "SHA-256" })), signerInfo.shA1 && (_jsx("button", { onClick: () => setSelectedHash('sha1'), style: hashButtonStyle(selectedHash === 'sha1'), children: "SHA-1" })), signerInfo.shA256Base64 && (_jsx("button", { onClick: () => setSelectedHash('sha256base64'), style: hashButtonStyle(selectedHash === 'sha256base64'), children: "Base64" }))] }), _jsxs("div", { style: {
120
+ background: '#fff',
121
+ padding: '12px',
122
+ borderRadius: '6px',
123
+ wordBreak: 'break-all',
124
+ fontSize: '12px',
125
+ border: '1px solid #d0d0d0',
126
+ userSelect: 'text',
127
+ }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: '6px' }, children: [_jsxs("strong", { style: { color: '#0078d4', fontSize: '14px' }, children: [getHashLabel(), ":"] }), _jsxs("button", { onClick: copyToClipboard, style: {
128
+ background: copiedHash ? '#d4edda' : 'transparent',
129
+ border: 'none',
130
+ cursor: 'pointer',
131
+ padding: '4px 8px',
132
+ borderRadius: '4px',
133
+ display: 'flex',
134
+ alignItems: 'center',
135
+ gap: '4px',
136
+ transition: 'all 0.2s ease',
137
+ color: copiedHash ? '#155724' : '#666'
138
+ }, title: "Copia", children: [_jsx(IconCopy, { width: 16, height: 16 }), copiedHash && _jsx("span", { style: { fontSize: '11px' }, children: "Copiato" })] })] }), _jsx("div", { style: { color: '#333' }, children: getHashValue() })] })] }))] }));
139
+ };
140
+ export default TMSignatureInfoContent;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useState } from "react";
3
3
  import { DownloadTypes, FormModes } from "../../../ts/types";
4
- import { associateColumnsToRows, calcResponsiveSizes, formatBytes, getExceptionMessage, Globalization, SDKUI_Localizator } from "../../../helper";
4
+ import { associateColumnsToRows, calcResponsiveSizes, formatBytes, getExceptionMessage, getMoreInfoTasksForDocument, Globalization, SDKUI_Localizator } from "../../../helper";
5
5
  import TMModal from "../../base/TMModal";
6
6
  import { DeleteEngine, ResultTypes, SDK_Globals, UpdateEngineByID, UserListCacheService } from "@topconsultnpm/sdk-ts";
7
7
  import TMSpinner from "../../base/TMSpinner";
@@ -187,55 +187,50 @@ const TMViewHistoryDcmt = (props) => {
187
187
  const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", data.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", data.DID ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", data.TID ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", data.UpdaterDisplayName ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", data.Version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(Number(data.FileSize ?? 0))] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(data.CreationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(data.LastUpdateTime)] })] }));
188
188
  return _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center' }, children: _jsx(TMDcmtIcon, { tid: Number(data.TID), did: Number(data.DID), fileExtension: data.FileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }) });
189
189
  }, []);
190
- const onContextMenuPreparing = (e) => {
191
- if (e === undefined)
192
- return;
193
- if (e.target === 'content') {
194
- e.items = e.items || [];
195
- e.items = [
196
- {
197
- icon: "datafield",
198
- text: SDKUI_Localizator.OpenForm,
199
- disabled: focusedRowKey === undefined,
200
- onClick: () => setShowDcmtForm(true),
201
- },
202
- {
203
- icon: "download",
204
- text: 'Download',
205
- disabled: focusedRowKey === undefined,
206
- onClick: () => downloadFilesCallback(),
207
- },
208
- {
209
- icon: "trash",
210
- text: SDKUI_Localizator.Delete,
211
- disabled: focusedRowKey === undefined,
212
- onClick: deleteFilesCallback,
213
- beginGroup: true
214
- },
215
- {
216
- icon: showSearch ? "eyeclose" : "eyeopen",
217
- onClick: () => setShowSearch(prevShowSearch => !prevShowSearch),
218
- text: showSearch ? SDKUI_Localizator.HideSearch : SDKUI_Localizator.ShowSearch,
219
- visible: true,
220
- disabled: false,
221
- beginGroup: true
222
- },
223
- {
224
- icon: showId ? 'eyeclose' : 'eyeopen',
225
- onClick: () => setShowId(prevShowId => !prevShowId),
226
- text: showId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show,
227
- visible: true,
228
- disabled: false,
229
- },
230
- {
231
- icon: "refresh",
232
- text: SDKUI_Localizator.Refresh,
233
- disabled: false,
234
- onClick: loadData,
235
- },
236
- ];
237
- }
238
- };
190
+ const customContextMenuItems = useMemo(() => {
191
+ return [
192
+ {
193
+ icon: _jsx("span", { className: "dx-icon-datafield" }),
194
+ name: SDKUI_Localizator.OpenForm,
195
+ disabled: focusedRowKey === undefined,
196
+ onClick: () => setShowDcmtForm(true),
197
+ },
198
+ {
199
+ icon: _jsx("span", { className: "dx-icon-download" }),
200
+ name: 'Download',
201
+ disabled: focusedRowKey === undefined,
202
+ onClick: () => downloadFilesCallback(),
203
+ },
204
+ {
205
+ icon: _jsx("span", { className: "dx-icon-trash" }),
206
+ name: SDKUI_Localizator.Delete,
207
+ disabled: focusedRowKey === undefined,
208
+ onClick: deleteFilesCallback,
209
+ beginGroup: true
210
+ },
211
+ {
212
+ icon: _jsx("span", { className: showSearch ? "dx-icon-eyeclose" : "dx-icon-eyeopen" }),
213
+ onClick: () => setShowSearch(prevShowSearch => !prevShowSearch),
214
+ name: showSearch ? SDKUI_Localizator.HideSearch : SDKUI_Localizator.ShowSearch,
215
+ visible: true,
216
+ disabled: false,
217
+ beginGroup: true
218
+ },
219
+ {
220
+ icon: _jsx("span", { className: showId ? "dx-icon-eyeclose" : "dx-icon-eyeopen" }),
221
+ onClick: () => setShowId(prevShowId => !prevShowId),
222
+ name: showId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show,
223
+ visible: true,
224
+ disabled: false,
225
+ },
226
+ {
227
+ icon: _jsx("span", { className: "dx-icon-refresh" }),
228
+ name: SDKUI_Localizator.Refresh,
229
+ disabled: false,
230
+ onClick: async () => await loadData(),
231
+ },
232
+ ];
233
+ }, [focusedRowKey, showSearch, showId]);
239
234
  // Handler for double-click cell event
240
235
  const onCellDblClick = useCallback((e) => {
241
236
  if (e.column.dataField === "FileExt")
@@ -279,7 +274,7 @@ const TMViewHistoryDcmt = (props) => {
279
274
  { dataField: "LastUpdateTimeDisplay", caption: SDKUI_Localizator.LastUpdateTime },
280
275
  ]);
281
276
  }, [showId]);
282
- return _jsx(TMModal, { title: `${SDKUI_Localizator.SearchResult} \u2014 ${SDKUI_Localizator.History + ": " + (fromDTD.nameLoc ?? SDKUI_Localizator.Document) + " (DID:" + inputDcmt.DID})`, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '80%', '80%', '95%'), onClose: onClose, 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: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showLocalWaitPanel, showWaitPanelPrimary: showLocalPrimary, waitPanelTitle: waitLocalPanelTitle, waitPanelTextPrimary: waitLocalPanelTextPrimary, waitPanelValuePrimary: waitLocalPanelValuePrimary, waitPanelMaxValuePrimary: waitLocalPanelMaxValuePrimary, isCancelable: true, abortController: abortLocalController, children: [_jsx(TMDataGrid, { dataSource: dcmtHistory, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selection: selection, onContextMenuPreparing: onContextMenuPreparing, onFocusedRowChanged: onFocusedRowChanged, onCellDblClick: onCellDblClick, noDataText: SDKUI_Localizator.NoDataToDisplay, showSearchPanel: showSearch }), (showDcmtForm && selectedDcmt !== undefined) &&
283
- _jsx(TMDcmtForm, { TID: Number(selectedDcmt.TID), DID: Number(selectedDcmt.DID), formMode: FormModes.ReadOnly, isModal: true, widthModal: "95%", heightModal: "95%", titleModal: fromDTD.name ?? SDKUI_Localizator.SearchResult, allowNavigation: dcmtHistory.length > 0, itemIndex: selectedIndex + 1, count: dcmtHistory.length, onClose: () => { setShowDcmtForm(false); }, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback })] }) }) });
277
+ return _jsx(TMModal, { title: `${SDKUI_Localizator.SearchResult} \u2014 ${SDKUI_Localizator.History + ": " + (fromDTD.nameLoc ?? SDKUI_Localizator.Document) + " (DID:" + inputDcmt.DID})`, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '80%', '80%', '95%'), onClose: onClose, 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: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showLocalWaitPanel, showWaitPanelPrimary: showLocalPrimary, waitPanelTitle: waitLocalPanelTitle, waitPanelTextPrimary: waitLocalPanelTextPrimary, waitPanelValuePrimary: waitLocalPanelValuePrimary, waitPanelMaxValuePrimary: waitLocalPanelMaxValuePrimary, isCancelable: true, abortController: abortLocalController, children: [_jsx(TMDataGrid, { dataSource: dcmtHistory, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selection: selection, customContextMenuItems: customContextMenuItems, onFocusedRowChanged: onFocusedRowChanged, onCellDblClick: onCellDblClick, noDataText: SDKUI_Localizator.NoDataToDisplay, showSearchPanel: showSearch }), (showDcmtForm && selectedDcmt !== undefined) &&
278
+ _jsx(TMDcmtForm, { TID: Number(selectedDcmt.TID), DID: Number(selectedDcmt.DID), formMode: FormModes.ReadOnly, isModal: true, widthModal: "95%", heightModal: "95%", titleModal: fromDTD.name ?? SDKUI_Localizator.SearchResult, allowNavigation: dcmtHistory.length > 0, itemIndex: selectedIndex + 1, count: dcmtHistory.length, onClose: () => { setShowDcmtForm(false); }, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks ?? [], Number(selectedDcmt.TID), Number(selectedDcmt.DID)) })] }) }) });
284
279
  };
285
280
  export default TMViewHistoryDcmt;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useEffect, useRef, useState } from 'react';
2
+ import { useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { ObjectClasses, TaskDescriptor, Priorities, PdGs, SDK_Globals, UserListCacheService, SDK_Localizator, Task_States } from '@topconsultnpm/sdk-ts';
4
4
  import { areDifferentIDs, formatDate, getOriginLabel, getPriorityLocalizatorValue, getPriorityLocalizatorValues, getStatusLocalizatorValues, gotoPDGExtendedLabel, taskValidatorAsync } from './TMTasksUtils';
5
5
  import ScrollView from 'devextreme-react/scroll-view';
@@ -21,6 +21,7 @@ import TMDcmtForm from '../documents/TMDcmtForm';
21
21
  import styled from 'styled-components';
22
22
  import { TMColors } from '../../../utils/theme';
23
23
  import { renderContextBlock } from './TMTasksUtilsView';
24
+ import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
24
25
  const ResponseCommentWrapper = styled.div `
25
26
  position: relative;
26
27
  width: 100%;
@@ -105,6 +106,10 @@ const TMTaskForm = (props) => {
105
106
  };
106
107
  const { formData, setFormData, formDataOrig, validationItems, exception, saveDataAsync } = useSaveForm(formMode, id, sfo, validator, onSaved, onStatusChanged, customizeFormData);
107
108
  const containerRef = useRef(null);
109
+ // Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
110
+ const deviceType = useDeviceType();
111
+ // This avoids unnecessary re-renders by only recalculating when deviceType changes.
112
+ let isMobileDevice = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
108
113
  const [isMobile, setIsMobile] = useState(false);
109
114
  const [showDcmtForm, setShowDcmtForm] = useState(false);
110
115
  const mobileBreakpoint = 768;
@@ -325,6 +330,25 @@ const TMTaskForm = (props) => {
325
330
  await editTaskCallback(task);
326
331
  onClose?.();
327
332
  };
333
+ const handleNavigateToReference = (ref) => {
334
+ switch (ref.objClass) {
335
+ case ObjectClasses.Dossier:
336
+ if (ref.objID)
337
+ handleNavigateToDossiers(ref.objID);
338
+ else
339
+ console.log("Dossier reference missing objID");
340
+ break;
341
+ case ObjectClasses.WorkingGroup:
342
+ if (ref.objID)
343
+ handleNavigateToWGs(ref.objID);
344
+ else
345
+ console.log("Working Group reference missing objID");
346
+ break;
347
+ // Handle other object types as needed
348
+ default:
349
+ console.warn(`Unhandled object type: ${ref.objClass}`);
350
+ }
351
+ };
328
352
  return (_jsx("div", { style: { width: "100%", height: "100%", overflow: "auto" }, ref: containerRef, children: _jsx(TMSaveForm, { width: width, height: height, id: id, title: title, isModal: isModal, formMode: formMode, onSaveAsync: saveDataAsync, onClose: onCloseCallback, onUndo: onUndoCallback, exception: exception, isModified: calcIsModified(formData, formDataOrig), validationItems: validationItems, showBackButton: showBackButton, hasNavigation: (hasNavigation && formMode !== FormModes.Create), canNext: canNext(), onNext: onNextCallback, canPrev: canPrev(), onPrev: onPrevCallback, showToolbar: !(showDcmtForm && formData?.iD1 && formData?.iD2), children: _jsxs(_Fragment, { children: [_jsx(ScrollView, { direction: "vertical", useNative: true, height: "calc(100% - 35px)", children: _jsx("div", { style: { marginRight: "5px" }, children: _jsxs(TMLayoutContainer, { direction: 'vertical', gap: 2, children: [(formMode === FormModes.Update && areDifferentIDs(formDataOrig?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs("div", { style: { width: '100%', display: 'flex', alignItems: 'center', color: "#E29000" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.TaskAssignedMessage.replaceParams(formDataOrig?.fromName ?? '') })] }) }), taskContext?.workItem === undefined && (!areDifferentIDs(formData?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)
329
353
  && !areDifferentIDs(formData?.toID, SDK_Globals.tmSession?.SessionDescr?.userID))
330
354
  && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs("div", { style: { width: '100%', display: 'flex', alignItems: 'center', color: "#2559A5" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.PersonalTaskAssignmentMessage })] }) }), (!areDifferentIDs(formData?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)
@@ -355,29 +379,55 @@ const TMTaskForm = (props) => {
355
379
  width: '100%',
356
380
  gap: 16,
357
381
  padding: '8px 0'
358
- }, children: children })), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%' }, children: _jsx("div", { style: {
359
- display: 'flex',
360
- alignItems: 'center',
361
- marginTop: 12
362
- }, children: _jsx(TMTooltip, { content: formData.pdG !== PdGs.None ? gotoPDGExtendedLabel(true, formData.pdG, formData.iD1Name) : '', children: _jsxs("span", { onClick: () => formData.pdG !== PdGs.None ? gotoPDGExtendedLabelClickCallback() : null, style: {
363
- display: 'inline-flex',
364
- alignItems: 'center',
365
- lineHeight: 1,
366
- padding: '6px 10px',
367
- borderRadius: 8,
368
- backgroundColor: formData.pdG !== PdGs.None ? '#f5f5f7' : 'transparent',
369
- color: formData.pdG !== PdGs.None ? '#2559A5' : '#444',
370
- cursor: formData.pdG !== PdGs.None ? 'pointer' : 'default',
371
- fontWeight: 600,
372
- transition: 'all 0.25s ease',
373
- gap: 6
374
- }, onMouseEnter: e => {
375
- if (formData.pdG !== PdGs.None)
376
- e.currentTarget.style.backgroundColor = '#ebebef';
377
- }, onMouseLeave: e => {
378
- if (formData.pdG !== PdGs.None)
379
- e.currentTarget.style.backgroundColor = '#f5f5f7';
380
- }, children: [_jsx("span", { style: { display: 'flex', alignItems: 'center' }, children: getPdgsIconMap().get(formData.pdG) }), _jsx("span", { children: getOriginLabel(formData.pdG, formData.iD1Name) })] }) }) }) }) })), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%' }, children: _jsx(TMTextBox, { label: SDKUI_Localizator.Name, value: formData?.name ?? '', readOnly: fieldsReadOnly.name, autoFocus: true, maxLength: 100, isModifiedWhen: formData?.name !== formDataOrig?.name, onValueChanged: (e) => { setFormData({ ...formData ?? {}, name: e.target.value }); }, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.Name) }) }) }), _jsx("div", { style: { width: '100%' }, children: _jsx(TMTextArea, { label: SDKUI_Localizator.Description, value: formData?.description ?? '', maxLength: 200, readOnly: fieldsReadOnly.description, isModifiedWhen: formData?.description !== formDataOrig?.description, onValueChanged: (e) => { setFormData({ ...formData ?? {}, description: e.target.value }); }, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.Description), resize: false }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: (formMode === FormModes.Create || !areDifferentIDs(formDataOrig?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)) ?
382
+ }, children: children })), children: _jsx("div", { style: {
383
+ width: "100%",
384
+ display: 'flex',
385
+ alignItems: 'center',
386
+ justifyContent: 'center',
387
+ marginTop: 12
388
+ }, children: _jsxs("div", { onClick: () => formData.pdG !== PdGs.None ? gotoPDGExtendedLabelClickCallback() : null, style: {
389
+ backgroundColor: "#C2388B",
390
+ color: "#fff",
391
+ padding: "10px 16px",
392
+ borderRadius: "20px",
393
+ display: "flex",
394
+ alignItems: "center",
395
+ justifyContent: "space-between",
396
+ cursor: "pointer",
397
+ fontWeight: 500,
398
+ transition: "background-color 0.3s",
399
+ minWidth: "180px",
400
+ maxWidth: "100%",
401
+ flexWrap: "wrap",
402
+ gap: "8px",
403
+ }, onMouseEnter: e => {
404
+ if (formData.pdG !== PdGs.None)
405
+ e.currentTarget.style.backgroundColor = "#A12D78";
406
+ }, onMouseLeave: e => {
407
+ if (formData.pdG !== PdGs.None)
408
+ e.currentTarget.style.backgroundColor = "#C2388B";
409
+ }, children: [_jsxs("span", { style: {
410
+ flex: 1,
411
+ textAlign: "center",
412
+ gap: "6px",
413
+ display: "flex",
414
+ justifyContent: "center",
415
+ alignItems: "center",
416
+ }, children: [formData.pdG === PdGs.WG && _jsx("span", { children: SDKUI_Localizator.GoToWorkgroup }), formData.pdG === PdGs.CF && _jsx("span", { children: SDKUI_Localizator.GoToDossier }), formData.pdG === PdGs.DT && _jsx("span", { children: SDKUI_Localizator.GoToDocument }), (() => {
417
+ const originLabel = getOriginLabel(formData.pdG, formData.iD1Name);
418
+ if (!originLabel)
419
+ return null;
420
+ const maxLength = isMobileDevice ? 10 : 25;
421
+ const displayText = originLabel.length > maxLength
422
+ ? originLabel.slice(0, maxLength) + "..."
423
+ : originLabel;
424
+ return _jsxs("span", { children: ["\u201C", displayText, "\u201D"] });
425
+ })()] }), _jsx(TMTooltip, { content: _jsxs("div", { style: { textAlign: "left" }, children: [formData.pdG && (_jsxs(_Fragment, { children: [_jsxs("div", { style: {
426
+ display: "flex",
427
+ alignItems: "center",
428
+ gap: "6px",
429
+ fontWeight: 600,
430
+ }, children: [_jsx("span", { style: { display: "flex", alignItems: "center" }, children: getPdgsIconMap().get(formData.pdG) }), _jsx("span", { children: formData.pdG === PdGs.WG ? SDKUI_Localizator.WorkGroup : formData.pdG === PdGs.CF ? SDKUI_Localizator.Dossier : formData.pdG === PdGs.DT ? SDKUI_Localizator.Document : "" })] }), _jsx("hr", { style: { margin: "4px 0 8px 0" } })] })), formData.iD1 != null && formData.iD1 !== 0 && (_jsxs("div", { children: [_jsx("b", { children: "ID1" }), ": ", formData.iD1.toString()] })), formData.iD1Name && (_jsxs("div", { children: [_jsx("b", { children: "ID1NAME" }), ": ", formData.iD1Name.toString()] })), formData.iD2 != null && formData.iD2 !== 0 && (_jsxs("div", { children: [_jsx("b", { children: "ID2" }), ": ", formData.iD2.toString()] }))] }), children: _jsx("i", { className: "dx-icon-info", style: { fontSize: "1.3rem", flexShrink: 0 } }) })] }) }) })), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%' }, children: _jsx(TMTextBox, { label: SDKUI_Localizator.Name, value: formData?.name ?? '', readOnly: fieldsReadOnly.name, autoFocus: true, maxLength: 100, isModifiedWhen: formData?.name !== formDataOrig?.name, onValueChanged: (e) => { setFormData({ ...formData ?? {}, name: e.target.value }); }, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.Name) }) }) }), _jsx("div", { style: { width: '100%' }, children: _jsx(TMTextArea, { label: SDKUI_Localizator.Description, value: formData?.description ?? '', maxLength: 200, readOnly: fieldsReadOnly.description, isModifiedWhen: formData?.description !== formDataOrig?.description, onValueChanged: (e) => { setFormData({ ...formData ?? {}, description: e.target.value }); }, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.Description), resize: false }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: (formMode === FormModes.Create || !areDifferentIDs(formDataOrig?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)) ?
381
431
  _jsx("div", { id: "assignedToAnotherUserField", style: { width: isMobile ? '100%' : '50%' }, children: _jsx(TMUserChooser, { dataSource: usersList ?? undefined, allowShowAllUsers: !!taskContext?.dossier, allowMultipleSelection: false, label: SDKUI_Localizator.AssignedTo_Female, readOnly: fieldsReadOnly.assignedTO, values: formData?.toID ? [formData?.toID] : [], isModifiedWhen: formData?.toID !== formDataOrig?.toID, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.AssignedTo_Female), onValueChanged: (newValue) => {
382
432
  if (newValue === undefined)
383
433
  return;
@@ -387,6 +437,6 @@ const TMTaskForm = (props) => {
387
437
  : _jsx(TMTextBox, { label: SDKUI_Localizator.Priority, value: getPriorityLocalizatorValue(formData?.priority ?? Priorities.Low), readOnly: true }) })] }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs(_Fragment, { children: [_jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: !fieldsReadOnly.startDate ? _jsx(TMDateBox, { id: "start-date", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.StartDate, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.startTime, isModifiedWhen: formData?.startTime !== formDataOrig?.startTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorStartEndDate), onContentReady: handleStartTimeContentReady, onValueChange: (value) => { setFormData({ ...formData ?? {}, startTime: value }); }, showClearButton: true }) : _jsx(TMTextBox, { label: SDKUI_Localizator.StartDate, value: formData?.startTime ? formatDate(formData?.startTime) : '', readOnly: true }) }), _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: !fieldsReadOnly.startDate ? _jsx(TMDateBox, { id: "end-date", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.Expiration, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.endTime, isModifiedWhen: formData?.endTime !== formDataOrig?.endTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorStartEndDate || o.PropertyName === SDKUI_Localizator.ErrorEndRemDate), onContentReady: handleEndTimeContentReady, onValueChange: (value) => { setFormData({ ...formData ?? {}, endTime: value }); }, showClearButton: true, readOnly: fieldsReadOnly.endDate }) : _jsx(TMTextBox, { label: SDKUI_Localizator.Expiration, value: formData?.endTime ? formatDate(formData?.endTime) : '', readOnly: true }) })] }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 3 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: _jsx(TMDateBox, { id: "alert-time", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.Reminder, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.remTime ?? undefined, isModifiedWhen: formData?.remTime !== formDataOrig?.remTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorEndRemDate), onValueChange: (value) => { setFormData({ ...formData ?? {}, remTime: value }); }, showClearButton: true, readOnly: fieldsReadOnly.remTime }) }) }), (formData?.state && [Task_States.Completed, Task_States.Waiting, Task_States.Deferred].includes(formData?.state) ||
388
438
  (formData?.response ?? "") !== "") && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 3 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: _jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", "$isValid": true, value: formData?.response ?? '', onChange: onAnswerChange, "$isModifiedWhen": formData?.response !== formDataOrig?.response, disabled: (formData?.response ?? "") !== "" &&
389
439
  (formData?.state && ![Task_States.Completed, Task_States.Waiting, Task_States.Deferred].includes(formData?.state)) }), _jsxs(ResponseCommentLabel, { htmlFor: "responseId", children: [SDKUI_Localizator.Answer, _jsxs(TMTooltip, { content: SDKUI_Localizator.AnswerTooltip, children: [" ", _jsx("i", { className: 'dx-icon-info' }), " "] })] }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (formData?.response ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] }) }) })] }) }) }), (showDcmtForm && formData?.iD1 && formData?.iD2) &&
390
- _jsx(TMDcmtForm, { titleModal: formData.iD1Name ?? '-', isModal: true, TID: formData.iD1, DID: formData.iD2, allowButtonsRefs: true, taskMoreInfo: formData, onWFOperationCompleted: refreshWorkflowApprove, onTaskCompleted: onTaskCompleted, onClose: () => { setShowDcmtForm(false); }, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })] }) }) }));
440
+ _jsx(TMDcmtForm, { titleModal: formData.iD1Name ?? '-', isModal: true, TID: formData.iD1, DID: formData.iD2, allowButtonsRefs: true, moreInfoTasks: [formData], onWFOperationCompleted: refreshWorkflowApprove, onTaskCompleted: onTaskCompleted, onClose: () => { setShowDcmtForm(false); }, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference })] }) }) }));
391
441
  };
392
442
  export default TMTaskForm;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { TaskDescriptor } from "@topconsultnpm/sdk-ts";
3
3
  import { FormModes } from "../../../ts";
4
+ import { TMContextMenuItemProps } from "../../NewComponents/ContextMenu";
4
5
  interface TMTasksAgendaProps {
5
6
  id: string;
6
7
  showId: boolean;
@@ -12,6 +13,7 @@ interface TMTasksAgendaProps {
12
13
  setCurrentAgendaDate: React.Dispatch<React.SetStateAction<Date>>;
13
14
  openTaskForm: (formMode: FormModes, task?: TaskDescriptor) => void;
14
15
  handleFocusedRowChange: (row: TaskDescriptor | undefined) => void;
16
+ menuItems: TMContextMenuItemProps[];
15
17
  }
16
- declare const TMTasksAgenda: React.MemoExoticComponent<(props: TMTasksAgendaProps) => import("react/jsx-runtime").JSX.Element>;
18
+ declare const TMTasksAgenda: (props: TMTasksAgendaProps) => import("react/jsx-runtime").JSX.Element;
17
19
  export default TMTasksAgenda;
@@ -1,5 +1,5 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import React, { useCallback, useEffect, useState } from "react";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
3
  import ArrayStore from "devextreme/data/array_store";
4
4
  import Scheduler from "devextreme-react/scheduler";
5
5
  import { calculateNumberOfDays, highlightTaskText, priorityLegend, renderTaskIcons } from "./TMTasksUtilsView";
@@ -11,14 +11,31 @@ import { FormModes } from "../../../ts";
11
11
  import { SDKUI_Localizator } from "../../../helper";
12
12
  import TMCustomSearchBar from "../../../helper/TMCustomSearchBar";
13
13
  import TMTooltip from "../../base/TMTooltip";
14
- const TMTasksAgenda = React.memo((props) => {
14
+ import TMContextMenu from "../../NewComponents/ContextMenu/TMContextMenu";
15
+ const MemoizedScheduler = React.memo(({ dataSource, currentAgendaDate, appointmentRender, onAppointmentDblClick, onCurrentDateChange, onAppointmentContextMenu, onAppointmentClick }) => {
15
16
  const views = ['agenda'];
16
- const { id, showId, showSearch, visualizedTasks, fromCell, toCell, currentAgendaDate, setCurrentAgendaDate, openTaskForm, handleFocusedRowChange } = props;
17
+ return (_jsx(Scheduler, { id: "tasks-agenda", defaultCurrentView: "agenda", dataSource: dataSource, width: "100%", height: "100%", editing: false, views: views, currentDate: currentAgendaDate, appointmentRender: appointmentRender, onAppointmentDblClick: onAppointmentDblClick, onCurrentDateChange: onCurrentDateChange, onAppointmentContextMenu: onAppointmentContextMenu, onAppointmentClick: onAppointmentClick }));
18
+ });
19
+ const TMTasksAgenda = (props) => {
20
+ const { id, showId, showSearch, visualizedTasks, fromCell, toCell, currentAgendaDate, setCurrentAgendaDate, openTaskForm, handleFocusedRowChange, menuItems } = props;
17
21
  const [schedulerData, setSchedulerData] = useState([]);
18
22
  const [loading, setLoading] = useState(false);
19
23
  const [searchText, setSearchText] = useState('');
24
+ const [contextMenuVisible, setContextMenuVisible] = useState(false);
25
+ const [contextMenuPosition, setContextMenuPosition] = useState({ x: 0, y: 0 });
26
+ const prevTasksRef = useRef({ length: 0 });
20
27
  useEffect(() => {
21
- setSchedulerData(convertToSchedulerAppointments(visualizedTasks));
28
+ const currentSignature = {
29
+ length: visualizedTasks.length,
30
+ firstId: visualizedTasks[0]?.id,
31
+ lastId: visualizedTasks[visualizedTasks.length - 1]?.id
32
+ };
33
+ if (prevTasksRef.current.length !== currentSignature.length ||
34
+ prevTasksRef.current.firstId !== currentSignature.firstId ||
35
+ prevTasksRef.current.lastId !== currentSignature.lastId) {
36
+ prevTasksRef.current = currentSignature;
37
+ setSchedulerData(convertToSchedulerAppointments(visualizedTasks));
38
+ }
22
39
  }, [visualizedTasks]);
23
40
  useEffect(() => {
24
41
  let timeoutId;
@@ -74,13 +91,16 @@ const TMTasksAgenda = React.memo((props) => {
74
91
  if (e === undefined || e.event === undefined || e.appointmentData.id === undefined)
75
92
  return;
76
93
  e.event.preventDefault();
94
+ e.event.stopPropagation();
77
95
  const { id } = e.appointmentData;
78
- // Update the state with the new set of selected appointments
79
96
  const task = visualizedTasks.find(task => task.id === id);
80
97
  if (task) {
81
98
  handleFocusedRowChange(task);
82
99
  }
83
- }, []);
100
+ const event = e.event;
101
+ setContextMenuPosition({ x: event.clientX, y: event.clientY });
102
+ setContextMenuVisible(true);
103
+ }, [visualizedTasks, handleFocusedRowChange]);
84
104
  const onCurrentDateChange = useCallback((value) => {
85
105
  // Exit early if it's not a valid Date
86
106
  if (!(value instanceof Date) || isNaN(value.getTime())) {
@@ -101,7 +121,26 @@ const TMTasksAgenda = React.memo((props) => {
101
121
  openTaskForm(FormModes.Update, task);
102
122
  }
103
123
  }, [visualizedTasks]);
124
+ const handleWrapperContextMenu = useCallback((e) => {
125
+ handleFocusedRowChange(undefined);
126
+ setContextMenuPosition({ x: e.clientX, y: e.clientY });
127
+ setContextMenuVisible(true);
128
+ }, [handleFocusedRowChange]);
129
+ const handleCloseContextMenu = useCallback(() => {
130
+ setContextMenuVisible(false);
131
+ }, []);
132
+ const dataSourceRef = useRef(new ArrayStore({ key: `tasks-agenda-data`, data: schedulerData }));
133
+ const dataLengthRef = useRef(0);
134
+ if (dataLengthRef.current !== schedulerData.length) {
135
+ dataLengthRef.current = schedulerData.length;
136
+ dataSourceRef.current = new ArrayStore({ key: `tasks-agenda-data`, data: schedulerData });
137
+ }
138
+ const memoizedDataSource = useMemo(() => dataSourceRef.current, [schedulerData.length]);
104
139
  return _jsxs("div", { style: { height: "100%", width: "100%" }, children: [_jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', width: '100%', height: "48px" }, children: [_jsx("div", { style: { width: showSearch ? "160px" : "0", marginLeft: '10px' }, children: showSearch && (_jsx(TMCustomSearchBar, { initialValue: searchText, onSearchChange: (value) => setSearchText(value) })) }), _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: "default" }, children: _jsxs(TMTooltip, { content: priorityLegend(), children: [" ", SDKUI_Localizator.PriorityLegend] }) })] }), _jsx("div", { style: { height: "calc(100% - 48px)", width: "100%" }, children: loading ? _jsx("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", width: "100%" }, children: _jsx(LoadIndicator, {}) })
105
- : _jsx("div", { id: `tasks-agenda-wrapper-${id}`, style: { width: "100%", height: "100%" }, onContextMenu: () => { handleFocusedRowChange(undefined); }, onClick: () => { handleFocusedRowChange(undefined); }, children: _jsx(Scheduler, { id: "tasks-agenda", defaultCurrentView: "agenda", dataSource: new ArrayStore({ key: `tasks-agenda-data`, data: schedulerData }), width: "100%", height: "100%", editing: false, views: views, currentDate: currentAgendaDate, appointmentRender: appointmentRender, onAppointmentDblClick: handleAppointmentDblClick, onCurrentDateChange: onCurrentDateChange, onAppointmentContextMenu: onAppointmentContextMenu, onAppointmentClick: handleAppointmentClick }) }) })] });
106
- });
140
+ : _jsxs(_Fragment, { children: [_jsx(TMContextMenu, { items: menuItems, externalControl: {
141
+ visible: contextMenuVisible,
142
+ position: contextMenuPosition,
143
+ onClose: handleCloseContextMenu
144
+ } }), _jsx("div", { id: `tasks-agenda-wrapper-${id}`, style: { width: "100%", height: "100%" }, onContextMenu: handleWrapperContextMenu, children: _jsx(MemoizedScheduler, { dataSource: memoizedDataSource, currentAgendaDate: currentAgendaDate, appointmentRender: appointmentRender, onAppointmentDblClick: handleAppointmentDblClick, onCurrentDateChange: onCurrentDateChange, onAppointmentContextMenu: onAppointmentContextMenu, onAppointmentClick: handleAppointmentClick }) })] }) })] });
145
+ };
107
146
  export default TMTasksAgenda;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { TaskDescriptor } from "@topconsultnpm/sdk-ts";
3
3
  import { FormModes } from '../../../ts';
4
+ import { TMContextMenuItemProps } from '../../NewComponents/ContextMenu/types';
4
5
  interface TMTasksCalendarProps {
5
6
  id: string;
6
7
  visualizedTasks: Array<TaskDescriptor>;
@@ -16,6 +17,7 @@ interface TMTasksCalendarProps {
16
17
  setCalendarEndDate: React.Dispatch<React.SetStateAction<Date | undefined>>;
17
18
  focusedRowKey: number | undefined;
18
19
  handleFocusedRowChange: (row: TaskDescriptor | undefined) => void;
20
+ menuItems: TMContextMenuItemProps[];
19
21
  }
20
22
  declare const TMTasksCalendar: (props: TMTasksCalendarProps) => import("react/jsx-runtime").JSX.Element;
21
23
  export default TMTasksCalendar;