@topconsultnpm/sdkui-react 6.22.0-dev2.9 → 6.22.0-dev3.3

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 (232) hide show
  1. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +3 -3
  2. package/lib/components/NewComponents/ContextMenu/hooks.d.ts +1 -1
  3. package/lib/components/NewComponents/ContextMenu/styles.d.ts +14 -14
  4. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
  5. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +31 -31
  6. package/lib/components/base/Styled.d.ts +4 -4
  7. package/lib/components/base/TMAccordionNew.js +7 -7
  8. package/lib/components/base/TMAlert.d.ts +32 -32
  9. package/lib/components/base/TMAreaManager.js +1 -1
  10. package/lib/components/base/TMButton.js +4 -4
  11. package/lib/components/base/TMClosableList.js +3 -3
  12. package/lib/components/base/TMCustomButton.js +1 -1
  13. package/lib/components/base/TMDataGrid.d.ts +4 -0
  14. package/lib/components/base/TMDataGrid.js +290 -10
  15. package/lib/components/base/TMDropDownMenu.js +1 -1
  16. package/lib/components/base/TMEditorBase.d.ts +2 -0
  17. package/lib/components/base/TMFileManager.js +5 -3
  18. package/lib/components/base/TMFileManagerDataGridView.js +12 -3
  19. package/lib/components/base/TMFileManagerThumbnailItems.js +20 -10
  20. package/lib/components/base/TMFileManagerUtils.d.ts +4 -2
  21. package/lib/components/base/TMFileManagerUtils.js +37 -1
  22. package/lib/components/base/TMLayout.d.ts +2 -2
  23. package/lib/components/base/TMLayout.js +3 -3
  24. package/lib/components/base/TMList.js +1 -1
  25. package/lib/components/base/TMListView.js +3 -3
  26. package/lib/components/base/TMModal.d.ts +11 -0
  27. package/lib/components/base/TMModal.js +47 -13
  28. package/lib/components/base/TMPanel.d.ts +6 -0
  29. package/lib/components/base/TMPanel.js +141 -28
  30. package/lib/components/base/TMPopUp.js +5 -2
  31. package/lib/components/base/TMResizableMenu.js +2 -2
  32. package/lib/components/base/TMRightSidebar.js +1 -1
  33. package/lib/components/base/TMShowAllOrMaxItemsButton.js +1 -1
  34. package/lib/components/base/TMSpinner.js +2 -2
  35. package/lib/components/base/TMTab.js +2 -2
  36. package/lib/components/base/TMToggleButton.js +2 -2
  37. package/lib/components/base/TMToolbarCard.js +3 -3
  38. package/lib/components/base/TMTooltip.d.ts +2 -1
  39. package/lib/components/base/TMTooltip.js +24 -8
  40. package/lib/components/base/TMTreeView.js +110 -69
  41. package/lib/components/base/TMWaitPanel.js +2 -2
  42. package/lib/components/choosers/TMCultureIDPicker.js +2 -2
  43. package/lib/components/choosers/TMDataListItemChooser.js +1 -1
  44. package/lib/components/choosers/TMDataListItemPicker.js +2 -2
  45. package/lib/components/choosers/TMDcmtTypeChooser.js +5 -4
  46. package/lib/components/choosers/TMDiskChooser.js +1 -1
  47. package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
  48. package/lib/components/choosers/TMDistinctValues.js +157 -141
  49. package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
  50. package/lib/components/choosers/TMImageIDChooser.js +1 -1
  51. package/lib/components/choosers/TMMetadataChooser.js +3 -3
  52. package/lib/components/choosers/TMQuickSearchInfo.d.ts +12 -0
  53. package/lib/components/choosers/TMQuickSearchInfo.js +279 -0
  54. package/lib/components/choosers/TMQuickSearchSettingsForm.d.ts +16 -0
  55. package/lib/components/choosers/TMQuickSearchSettingsForm.js +94 -0
  56. package/lib/components/choosers/TMRelationChooser.js +1 -1
  57. package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
  58. package/lib/components/choosers/TMSelectedValuesSummary.js +89 -0
  59. package/lib/components/choosers/TMUserChooser.js +1 -1
  60. package/lib/components/editors/TMCheckBox.js +1 -1
  61. package/lib/components/editors/TMDropDown.d.ts +3 -0
  62. package/lib/components/editors/TMDropDown.js +197 -5
  63. package/lib/components/editors/TMEditorStyled.d.ts +10 -10
  64. package/lib/components/editors/TMFormulaEditor.js +1 -1
  65. package/lib/components/editors/TMHtmlContentDisplay.js +1 -1
  66. package/lib/components/editors/TMLocalizedTextBox.js +1 -1
  67. package/lib/components/editors/TMMetadataValues.js +2 -2
  68. package/lib/components/editors/TMRadioButton.js +2 -2
  69. package/lib/components/editors/TMSummary.js +3 -3
  70. package/lib/components/editors/TMTextArea.js +3 -3
  71. package/lib/components/editors/TMTextBox.js +3 -3
  72. package/lib/components/editors/TMTextExpression.js +1 -1
  73. package/lib/components/features/archive/TMArchive.js +17 -3
  74. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
  75. package/lib/components/features/assistant/TMToppySpeechBubble.js +1 -1
  76. package/lib/components/features/documents/TMBatchUpdateForm.js +20 -6
  77. package/lib/components/features/documents/TMDcmtBlog.d.ts +3 -0
  78. package/lib/components/features/documents/TMDcmtBlog.js +4 -4
  79. package/lib/components/features/documents/TMDcmtForm.d.ts +7 -0
  80. package/lib/components/features/documents/TMDcmtForm.js +180 -53
  81. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +11 -0
  82. package/lib/components/features/documents/TMDcmtFormActionButtons.js +79 -9
  83. package/lib/components/features/documents/TMDcmtIcon.js +5 -3
  84. package/lib/components/features/documents/TMDcmtPreview.js +12 -8
  85. package/lib/components/features/documents/TMDownloadRelationViewerSection.js +1 -1
  86. package/lib/components/features/documents/TMFileUploader.js +3 -3
  87. package/lib/components/features/documents/TMMasterDetailDcmts.js +96 -34
  88. package/lib/components/features/documents/TMMasterInfoFields.d.ts +19 -0
  89. package/lib/components/features/documents/TMMasterInfoFields.js +184 -0
  90. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
  91. package/lib/components/features/documents/TMMergeToPdfForm.js +30 -5
  92. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +45 -0
  93. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +323 -0
  94. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +370 -0
  95. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +283 -0
  96. package/lib/components/features/documents/TMRelationViewer.d.ts +14 -1
  97. package/lib/components/features/documents/TMRelationViewer.js +71 -22
  98. package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +1 -1
  99. package/lib/components/features/search/TMMetadataOutputForm.js +1 -1
  100. package/lib/components/features/search/TMMetadataSorterForm.js +1 -1
  101. package/lib/components/features/search/TMSavedQuerySelector.js +2 -2
  102. package/lib/components/features/search/TMSearch.js +78 -12
  103. package/lib/components/features/search/TMSearchQueryEditor.js +7 -5
  104. package/lib/components/features/search/TMSearchQueryPanel.d.ts +4 -0
  105. package/lib/components/features/search/TMSearchQueryPanel.js +142 -68
  106. package/lib/components/features/search/TMSearchResult.d.ts +16 -0
  107. package/lib/components/features/search/TMSearchResult.js +431 -110
  108. package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
  109. package/lib/components/features/search/TMTreeSelector.js +109 -64
  110. package/lib/components/features/tasks/TMTaskForm.js +1 -1
  111. package/lib/components/features/tasks/TMTaskFormUtils.js +3 -3
  112. package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
  113. package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
  114. package/lib/components/features/tasks/TMTasksHeader.js +1 -1
  115. package/lib/components/features/tasks/TMTasksUtilsView.js +1 -1
  116. package/lib/components/features/tasks/TMTasksView.js +4 -4
  117. package/lib/components/features/wg/TMWGsCopyMoveForm.js +1 -1
  118. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +10 -0
  119. package/lib/components/features/workflow/TMWorkflowPopup.js +9 -5
  120. package/lib/components/features/workflow/diagram/ConnectionComponent.js +3 -3
  121. package/lib/components/features/workflow/diagram/DiagramItemComponent.js +3 -3
  122. package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
  123. package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +1 -1
  124. package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
  125. package/lib/components/features/workflow/diagram/WFDiagram.js +4 -4
  126. package/lib/components/forms/Login/Menu.js +1 -1
  127. package/lib/components/forms/Login/OTPReader.js +1 -1
  128. package/lib/components/forms/Login/PasswordStrengthChecker.js +1 -1
  129. package/lib/components/forms/Login/RapidAccessLogin.js +2 -2
  130. package/lib/components/forms/Login/RecoverPasswordFlow.js +2 -2
  131. package/lib/components/forms/Login/SelectBox.js +1 -1
  132. package/lib/components/forms/Login/StepIndicator.js +1 -1
  133. package/lib/components/forms/Login/TMLoginForm.js +7 -7
  134. package/lib/components/forms/Login/TextBox.js +1 -1
  135. package/lib/components/forms/TMApplyForm.js +3 -3
  136. package/lib/components/forms/TMChooserForm.js +1 -1
  137. package/lib/components/forms/TMSaveForm.js +3 -3
  138. package/lib/components/grids/TMBlogAttachments.js +14 -3
  139. package/lib/components/grids/TMBlogHeader.js +5 -1
  140. package/lib/components/grids/TMBlogsPost.d.ts +2 -0
  141. package/lib/components/grids/TMBlogsPost.js +31 -4
  142. package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
  143. package/lib/components/grids/TMBlogsPostUtils.js +15 -4
  144. package/lib/components/grids/TMRecentsManager.js +4 -4
  145. package/lib/components/grids/TMValidationItemsList.js +1 -1
  146. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
  147. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +25 -15
  148. package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
  149. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +2 -2
  150. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
  151. package/lib/components/layout/panelManager/TMPanelWrapper.js +3 -3
  152. package/lib/components/layout/panelManager/types.d.ts +3 -0
  153. package/lib/components/layout/panelManager/utils.js +13 -11
  154. package/lib/components/pages/TMPage.js +1 -1
  155. package/lib/components/query/TMQueryCountButton.js +1 -1
  156. package/lib/components/query/TMQueryEditor.js +7 -7
  157. package/lib/components/sidebar/TMCommandsPanel.js +1 -1
  158. package/lib/components/sidebar/TMHeader.js +36 -26
  159. package/lib/components/sidebar/TMSidebar.js +1 -1
  160. package/lib/components/sidebar/TMSidebarItem.js +1 -1
  161. package/lib/components/viewers/TMMidViewer.js +6 -3
  162. package/lib/components/viewers/TMTidViewer.js +89 -28
  163. package/lib/components/wizard/TMStepIndicator.js +3 -3
  164. package/lib/css/tm-sdkui.css +1 -1
  165. package/lib/devextreme-license.d.ts +1 -0
  166. package/lib/devextreme-license.js +3 -0
  167. package/lib/helper/Enum_Localizator.d.ts +4 -4
  168. package/lib/helper/Globalization.d.ts +1 -1
  169. package/lib/helper/SDKUI_Globals.d.ts +110 -0
  170. package/lib/helper/SDKUI_Globals.js +151 -0
  171. package/lib/helper/SDKUI_Localizator.d.ts +731 -687
  172. package/lib/helper/SDKUI_Localizator.js +440 -0
  173. package/lib/helper/TMAppUpdatedModal.d.ts +1 -0
  174. package/lib/helper/TMAppUpdatedModal.js +134 -0
  175. package/lib/helper/TMIcons.d.ts +1 -0
  176. package/lib/helper/TMIcons.js +4 -3
  177. package/lib/helper/TMPdfViewer.js +1 -1
  178. package/lib/helper/TMToppyMessage.js +1 -1
  179. package/lib/helper/TMUtils.d.ts +13 -0
  180. package/lib/helper/TMUtils.js +25 -3
  181. package/lib/helper/checkinCheckoutManager.d.ts +1 -1
  182. package/lib/helper/checkinCheckoutManager.js +1 -1
  183. package/lib/helper/dataGridSearchHelper.d.ts +28 -0
  184. package/lib/helper/dataGridSearchHelper.js +51 -0
  185. package/lib/helper/dcmtsHelper.d.ts +20 -0
  186. package/lib/helper/dcmtsHelper.js +58 -1
  187. package/lib/helper/helpers.d.ts +12 -1
  188. package/lib/helper/helpers.js +27 -3
  189. package/lib/helper/index.d.ts +2 -0
  190. package/lib/helper/index.js +2 -0
  191. package/lib/helper/queryHelper.d.ts +6 -1
  192. package/lib/helper/queryHelper.js +8 -3
  193. package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
  194. package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
  195. package/lib/hooks/useArchiveListForm.d.ts +39 -0
  196. package/lib/hooks/useArchiveListForm.js +46 -0
  197. package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
  198. package/lib/hooks/useCaseFlowApprove.js +157 -0
  199. package/lib/hooks/useDataUserIdItem.d.ts +1 -0
  200. package/lib/hooks/useDataUserIdItem.js +1 -0
  201. package/lib/hooks/useDocumentOperations.d.ts +4 -0
  202. package/lib/hooks/useDocumentOperations.js +53 -11
  203. package/lib/hooks/useInputDialog.js +1 -1
  204. package/lib/hooks/useMultiMasterDetailDcmts.d.ts +113 -0
  205. package/lib/hooks/useMultiMasterDetailDcmts.js +760 -0
  206. package/lib/hooks/useQueryParametersDialog.js +1 -1
  207. package/lib/hooks/useRelatedDocuments.d.ts +1 -0
  208. package/lib/hooks/useRelatedDocuments.js +22 -27
  209. package/lib/hooks/useShowDossiersV5.d.ts +12 -0
  210. package/lib/hooks/useShowDossiersV5.js +37 -0
  211. package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
  212. package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
  213. package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
  214. package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
  215. package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
  216. package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
  217. package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
  218. package/lib/hooks/useTMDistinctValuesSource.js +105 -0
  219. package/lib/index.d.ts +2 -0
  220. package/lib/index.js +5 -2
  221. package/lib/services/caseflow/CaseFlowService.d.ts +247 -0
  222. package/lib/services/caseflow/CaseFlowService.js +720 -0
  223. package/lib/services/caseflow/CaseFlowTemplateCacheService.d.ts +28 -0
  224. package/lib/services/caseflow/CaseFlowTemplateCacheService.js +121 -0
  225. package/lib/services/caseflow/caseFlowNameCache.d.ts +32 -0
  226. package/lib/services/caseflow/caseFlowNameCache.js +116 -0
  227. package/lib/services/caseflow/caseFlowWorkItemUtils.d.ts +61 -0
  228. package/lib/services/caseflow/caseFlowWorkItemUtils.js +113 -0
  229. package/lib/services/index.d.ts +4 -0
  230. package/lib/services/index.js +4 -0
  231. package/lib/services/platform_services.d.ts +4 -4
  232. package/package.json +71 -68
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
3
  import { SDK_Globals, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats } from "@topconsultnpm/sdk-ts";
4
4
  import { IconCopy, IconDownload, IconWarning, IconCheck, getExceptionMessage, SDKUI_Localizator, IconCircleInfo, IconRefresh } from "../../../helper";
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useState } from 'react';
2
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { DcmtTypeListCacheService, LayoutModes, SDK_Localizator, TreeCacheService, TreeItemTypes } from '@topconsultnpm/sdk-ts';
4
4
  import { TreeList, Column, Scrolling, Selection } from 'devextreme-react/tree-list';
5
5
  import { DropDownBox } from 'devextreme-react';
@@ -13,6 +13,15 @@ import { TMColors } from '../../../utils/theme';
13
13
  import styled from 'styled-components';
14
14
  import { useOutsideClick } from '../../../hooks/useOutsideClick';
15
15
  import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
16
+ const TMTreeDcmtTypeCell = ({ tid, isMobile }) => {
17
+ const [dtd, setDtd] = useState();
18
+ const loadDTD = useCallback(async () => {
19
+ if (isMobile || dtd || !tid)
20
+ return;
21
+ setDtd(await DcmtTypeListCacheService.GetAsync(tid));
22
+ }, [isMobile, dtd, tid]);
23
+ return (_jsxs(StyledTreeDcmtTypeRow, { onMouseEnter: loadDTD, children: [_jsx("span", { style: { cursor: 'pointer', flex: 1, minWidth: 0 }, children: _jsx(TMTidViewer, { tid: tid, showIcon: false }) }), !isMobile && (_jsx("span", { className: 'info-icon', children: _jsx(TMDcmtTypeTooltip, { dtd: dtd, children: _jsx(IconInfo, { color: TMColors.info }) }) }))] }));
24
+ };
16
25
  const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelectedTIDChanged, onClosePanel, allowMaximize = true, onMaximizePanel }) => {
17
26
  const [trees, setTrees] = useState([]);
18
27
  const [treeItems, setTreeItems] = useState([]);
@@ -22,80 +31,76 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
22
31
  const [selectedRowKeys, setSelectedRowKeys] = useState([]);
23
32
  // State hook to store the currently focused row key, initially set to undefined
24
33
  const [focusedRowKey, setFocusedRowKey] = useState(undefined);
34
+ // Elemento selezionato nell'albero: dopo un refresh va riproposto se esiste ancora
35
+ const [selectedTreeItemKey, setSelectedTreeItemKey] = useState(undefined);
36
+ const selectedTreeItemKeys = useMemo(() => selectedTreeItemKey !== undefined ? [selectedTreeItemKey] : [], [selectedTreeItemKey]);
25
37
  const [isGridBoxOpened, setIsGridBoxOpened] = useState(false);
26
38
  const [defaultTreeId, setDefaultTreeId] = useState(-1);
27
39
  const deviceType = useDeviceType();
28
40
  const isMobile = deviceType === DeviceType.MOBILE;
29
41
  const panelRef = useOutsideClick(() => setInfoDTD(undefined));
30
- // useEffect(() => {
31
- // if (treeItems.length > 0 && treeItems[0].id) {
32
- // setSelectedRowKeys([treeItems[0].id])
33
- // }
34
- // }, [treeItems])
35
- useEffect(() => {
36
- const setResultCache = (result) => {
37
- if (result && result.length > 0) {
38
- setTrees(result);
39
- let defaultTree = SDKUI_Globals.userSettings.searchSettings.defaultTree;
40
- let initialTreeId;
41
- let treeToSelect;
42
- if (defaultTree > 0) {
43
- initialTreeId = defaultTree;
44
- treeToSelect = result.find(o => o.id == defaultTree);
45
- }
46
- else {
47
- initialTreeId = result[0]?.id ?? 0;
48
- treeToSelect = result[0];
49
- }
50
- setSelectedTreeId(initialTreeId);
51
- if (treeToSelect?.id) {
52
- setSelectedRowKeys([treeToSelect.id]);
53
- }
42
+ // Tiene traccia dell'albero selezionato senza far dipendere loadTreesAsync da selectedTreeId:
43
+ // così il refresh può riproporre la selezione corrente senza ricaricare a ogni cambio di albero
44
+ const selectedTreeIdRef = useRef(selectedTreeId);
45
+ useEffect(() => { selectedTreeIdRef.current = selectedTreeId; }, [selectedTreeId]);
46
+ // Carica tutti gli alberi del contesto corrente (ricerca o archiviazione).
47
+ // Con forceRefresh la cache viene invalidata, altrimenti GetAll* restituirebbe gli alberi già in memoria.
48
+ const loadTreesAsync = useCallback(async (forceRefresh = false) => {
49
+ const isSearchContext = layoutMode == LayoutModes.Update;
50
+ if (forceRefresh) {
51
+ if (isSearchContext)
52
+ TreeCacheService.RemoveAllSearch();
53
+ else
54
+ TreeCacheService.RemoveAllArchive();
55
+ }
56
+ const result = isSearchContext
57
+ ? await TreeCacheService.GetAllSearchAsync()
58
+ : await TreeCacheService.GetAllArchiveAsync();
59
+ if (!result || result.length === 0) {
60
+ // Sul refresh gli alberi possono essere spariti lato server: allinea anche lo stato vuoto
61
+ if (forceRefresh) {
62
+ setTrees([]);
63
+ setSelectedTreeId(0);
64
+ setSelectedRowKeys([]);
54
65
  }
55
- };
56
- if (layoutMode == LayoutModes.Update) {
57
- TreeCacheService.GetAllSearchAsync().then((result) => { setResultCache(result); });
66
+ return;
67
+ }
68
+ setTrees(result);
69
+ // Dopo un refresh mantiene l'albero corrente, se ancora presente
70
+ const currentTreeId = selectedTreeIdRef.current;
71
+ if (forceRefresh && result.some(o => o.id == currentTreeId)) {
72
+ setSelectedTreeId(currentTreeId);
73
+ setSelectedRowKeys([currentTreeId]);
74
+ return;
75
+ }
76
+ let defaultTree = SDKUI_Globals.userSettings.searchSettings.defaultTree;
77
+ let initialTreeId;
78
+ let treeToSelect;
79
+ if (defaultTree > 0) {
80
+ initialTreeId = defaultTree;
81
+ treeToSelect = result.find(o => o.id == defaultTree);
58
82
  }
59
83
  else {
60
- TreeCacheService.GetAllArchiveAsync().then((result) => { setResultCache(result); });
84
+ initialTreeId = result[0]?.id ?? 0;
85
+ treeToSelect = result[0];
86
+ }
87
+ setSelectedTreeId(initialTreeId);
88
+ if (treeToSelect?.id) {
89
+ setSelectedRowKeys([treeToSelect.id]);
61
90
  }
62
91
  }, [layoutMode]);
92
+ useEffect(() => { loadTreesAsync(); }, [loadTreesAsync]);
63
93
  useEffect(() => {
64
94
  let newTreeItems = trees.find(o => o.id == selectedTreeId)?.items ?? [];
65
95
  setTreeItems(newTreeItems);
96
+ // Mantiene la selezione dopo il refresh solo se l'elemento e' ancora presente (al cambio albero si azzera)
97
+ setSelectedTreeItemKey(prev => prev !== undefined && newTreeItems.some(o => o.id == prev) ? prev : undefined);
66
98
  }, [selectedTreeId, trees]);
67
99
  const renderCell = useCallback((data) => {
68
100
  const treeItem = data.data;
69
- const [showInfo, setShowInfo] = useState(false);
70
101
  // Documento (DcmtType)
71
102
  if (treeItem.type === TreeItemTypes.DcmtType) {
72
- return (_jsxs(StyledDivHorizontal, { style: {
73
- alignItems: 'center',
74
- minWidth: 0,
75
- width: '100%',
76
- gap: 2,
77
- position: 'relative'
78
- }, onMouseEnter: async () => {
79
- if (!isMobile) {
80
- setShowInfo(true);
81
- let dtd = await DcmtTypeListCacheService.GetAsync(treeItem.tid);
82
- setInfoDTD(dtd);
83
- }
84
- }, onMouseLeave: () => {
85
- if (!isMobile) {
86
- setShowInfo(false);
87
- setInfoDTD(undefined);
88
- }
89
- }, children: [_jsx("span", { style: { cursor: 'pointer', flex: 1, minWidth: 0 }, children: _jsx(TMTidViewer, { tid: treeItem.tid, showIcon: false }) }), !isMobile && (_jsx("span", { style: {
90
- opacity: showInfo ? 1 : 0,
91
- transition: 'opacity 0.2s',
92
- pointerEvents: showInfo ? 'auto' : 'none',
93
- cursor: 'pointer',
94
- display: 'flex',
95
- alignItems: 'center',
96
- marginLeft: 'auto',
97
- zIndex: 2
98
- }, children: _jsx(TMDcmtTypeTooltip, { dtd: infoDTD, children: _jsx(IconInfo, { color: TMColors.info }) }) }))] }));
103
+ return _jsx(TMTreeDcmtTypeCell, { tid: treeItem.tid, isMobile: isMobile });
99
104
  }
100
105
  // Folder (altri tipi)
101
106
  return (_jsxs(StyledDivHorizontal, { style: { gap: 5, alignItems: 'center', minWidth: 0 }, children: [_jsx("span", { style: {
@@ -113,7 +118,7 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
113
118
  whiteSpace: 'nowrap',
114
119
  flex: 1,
115
120
  }, children: treeItem.nameLoc })] }));
116
- }, [isMobile, infoDTD, setInfoDTD]);
121
+ }, [isMobile]);
117
122
  // Handles selection change in the data grid
118
123
  const onSelectionChanged = useCallback((e) => {
119
124
  const selectedKeys = e.component.getSelectedRowKeys() ?? [];
@@ -126,6 +131,16 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
126
131
  setSelectedRowKeys(selectedKeys);
127
132
  setIsGridBoxOpened(false);
128
133
  }, []);
134
+ // Handles click on a tree row in the trees data grid: clicking the already selected tree
135
+ // does not raise onSelectionChanged, so the drop down must be closed here as well
136
+ const onRowClickTrees = useCallback((e) => {
137
+ const tree = e.data;
138
+ if (tree?.id === undefined)
139
+ return;
140
+ setSelectedTreeId(tree.id);
141
+ setSelectedRowKeys([tree.id]);
142
+ setIsGridBoxOpened(false);
143
+ }, []);
129
144
  // Handles focus change in the data grid
130
145
  const onFocusedRowChanged = useCallback((e) => {
131
146
  setFocusedRowKey(e.row?.key);
@@ -161,7 +176,18 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
161
176
  }
162
177
  }
163
178
  }, []);
164
- return (_jsx(TMPanel, { title: SDK_Localizator.Trees, isVisible: isVisible, totalItems: trees.length, onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, toolbar: _jsx(TMButton, { btnStyle: 'icon', caption: defaultTreeId == selectedTreeId ? SDKUI_Localizator.TreeRemoveDefault : SDKUI_Localizator.SetAsDefault, icon: defaultTreeId == selectedTreeId ? _jsx(IconStarRemove, { color: 'rgb(243, 114, 92)' }) : _jsx(IconStar, { color: 'rgb(248, 215, 117)' }), onClick: () => {
179
+ // Callback function to handle click events on a tree view row.
180
+ const onRowClickTreeView = useCallback((e) => {
181
+ const treeItem = e.data;
182
+ if (treeItem?.type === TreeItemTypes.DcmtType) {
183
+ onSelectedTIDChanged?.(treeItem.tid, selectedTreeId);
184
+ }
185
+ }, [onSelectedTIDChanged, selectedTreeId]);
186
+ // La selezione la decide il widget (click, ctrl+click che deseleziona, barra spaziatrice): qui si allinea solo lo stato
187
+ const onSelectionChangedTreeView = useCallback((e) => {
188
+ setSelectedTreeItemKey(e.selectedRowKeys?.[0]);
189
+ }, []);
190
+ return (_jsx(TMPanel, { title: SDK_Localizator.Trees, isVisible: isVisible, totalItems: trees.length, onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, onRefresh: () => loadTreesAsync(true), toolbar: _jsx(TMButton, { btnStyle: 'icon', caption: defaultTreeId == selectedTreeId ? SDKUI_Localizator.TreeRemoveDefault : SDKUI_Localizator.SetAsDefault, icon: defaultTreeId == selectedTreeId ? _jsx(IconStarRemove, { color: 'rgb(243, 114, 92)' }) : _jsx(IconStar, { color: 'rgb(248, 215, 117)' }), onClick: () => {
165
191
  if (defaultTreeId == selectedTreeId) {
166
192
  if (layoutMode == LayoutModes.Update)
167
193
  SDKUI_Globals.userSettings.searchSettings.defaultTree = -1;
@@ -193,14 +219,33 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
193
219
  }, value: selectedTreeId, opened: isGridBoxOpened, valueExpr: "id", displayExpr: "nameLoc", deferRendering: false, dataSource: trees, onValueChanged: syncDataGridSelection, onOptionChanged: onGridBoxOpened, style: { height: 30, padding: '5px' }, children: _jsx(TMDataGrid, { height: "100%", width: "100%", dataSource: trees, dataColumns: [
194
220
  { dataField: 'nameLoc', caption: SDKUI_Localizator.Name, width: 'auto' },
195
221
  { dataField: 'description', caption: SDKUI_Localizator.Description, width: 'auto' },
196
- ], selection: { mode: 'single', showCheckBoxesMode: "none" }, showHeaderFilter: false, selectedRowKeys: selectedRowKeys, onSelectionChanged: onSelectionChanged, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged }) }) }), _jsxs(StyledTreeListWrapper, { children: [_jsxs(TreeList, { height: "100%", dataSource: treeItems, showRowLines: false, showColumnLines: false, showBorders: false, columnAutoWidth: false, keyExpr: "id", parentIdExpr: "parentID", dataStructure: "plain", showColumnHeaders: false, onContentReady: (e) => e.component.clearSelection(), onCellDblClick: onCellDblClickTreeView, onSelectionChanged: (e) => {
197
- if (e.selectedRowsData[0] && e.selectedRowsData[0].type == TreeItemTypes.DcmtType) {
198
- onSelectedTIDChanged?.(e.selectedRowsData[0].tid, selectedTreeId);
199
- }
200
- }, children: [_jsx(Column, { dataField: "nameLoc", caption: SDKUI_Localizator.Name, cellRender: renderCell, width: "100%" }), _jsx(Scrolling, { mode: "virtual", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Selection, { mode: "single" })] }), _jsxs(StyledOffCanvasPanel, { ref: panelRef, "$isOpen": isMobile && infoDTD !== undefined, children: [_jsxs(StyledDivHorizontal, { style: { gap: 10, padding: '10px 8px', width: '100%', alignItems: 'center' }, children: [_jsx("p", { style: { fontSize: '1.1rem', fontWeight: 'bold' }, children: `${SDKUI_Localizator.DcmtType} - ${SDKUI_Localizator.About}` }), _jsx(IconCloseOutline, { style: { marginLeft: 'auto', cursor: 'pointer' }, onClick: () => setInfoDTD(undefined) })] }), renderDTDTooltipContent(infoDTD)] })] })] })
222
+ ], selection: { mode: 'single', showCheckBoxesMode: "none" }, showHeaderFilter: false, selectedRowKeys: selectedRowKeys, onSelectionChanged: onSelectionChanged, onRowClick: onRowClickTrees, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged }) }) }), _jsxs(StyledTreeListWrapper, { children: [_jsxs(TreeList, { height: "100%", dataSource: treeItems, showRowLines: false, showColumnLines: false, showBorders: false, columnAutoWidth: false, keyExpr: "id", parentIdExpr: "parentID", dataStructure: "plain", showColumnHeaders: false, selectedRowKeys: selectedTreeItemKeys, onSelectionChanged: onSelectionChangedTreeView, onCellDblClick: onCellDblClickTreeView, onRowClick: onRowClickTreeView, children: [_jsx(Column, { dataField: "nameLoc", caption: SDKUI_Localizator.Name, cellRender: renderCell, width: "100%" }), _jsx(Scrolling, { mode: "virtual", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Selection, { mode: "single" })] }), _jsxs(StyledOffCanvasPanel, { ref: panelRef, $isOpen: isMobile && infoDTD !== undefined, children: [_jsxs(StyledDivHorizontal, { style: { gap: 10, padding: '10px 8px', width: '100%', alignItems: 'center' }, children: [_jsx("p", { style: { fontSize: '1.1rem', fontWeight: 'bold' }, children: `${SDKUI_Localizator.DcmtType} - ${SDKUI_Localizator.About}` }), _jsx(IconCloseOutline, { style: { marginLeft: 'auto', cursor: 'pointer' }, onClick: () => setInfoDTD(undefined) })] }), renderDTDTooltipContent(infoDTD)] })] })] })
201
223
  : _jsx("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', fontSize: '1.5rem' }, children: SDKUI_Localizator.TreesNoAvailable }) }));
202
224
  };
203
225
  export default TMTreeSelector;
226
+ const StyledTreeDcmtTypeRow = styled(StyledDivHorizontal) `
227
+ align-items: center;
228
+ min-width: 0;
229
+ width: 100%;
230
+ gap: 2px;
231
+ position: relative;
232
+
233
+ .info-icon {
234
+ display: flex;
235
+ align-items: center;
236
+ margin-left: auto;
237
+ z-index: 2;
238
+ cursor: pointer;
239
+ opacity: 0;
240
+ pointer-events: none;
241
+ transition: opacity 0.2s;
242
+ }
243
+
244
+ &:hover .info-icon {
245
+ opacity: 1;
246
+ pointer-events: auto;
247
+ }
248
+ `;
204
249
  const StyledTreeListWrapper = styled.div `
205
250
  width: 100%;
206
251
  height: 100%;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef, useState } from 'react';
3
3
  import { ObjectClasses, TaskDescriptor, PdGs, UserListCacheService, SDK_Localizator } from '@topconsultnpm/sdk-ts';
4
4
  import { gotoPDGExtendedLabel, taskValidatorAsync } from './TMTasksUtils';
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useCallback, useEffect, useMemo, useState } from "react";
3
3
  import { PdGs, Priorities, SDK_Globals, Task_States } from "@topconsultnpm/sdk-ts";
4
4
  import { FormModes } from "../../../ts";
@@ -358,7 +358,7 @@ const TaskFormResponseComment = (props) => {
358
358
  }, children: currentResponse && currentResponse.length > 0
359
359
  ? _jsx(TMHtmlContentDisplay, { markup: currentResponse ?? '-', isSelected: false })
360
360
  : _jsx("span", { style: { color: '#6c757d', fontStyle: 'italic' }, children: SDKUI_Localizator.NoAnswerProvided }) }) }))] })
361
- : (_jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", "$isValid": true, value: currentResponse ?? '', onChange: onAnswerChange ? onAnswerChange : undefined }), _jsx(ResponseCommentLabel, { htmlFor: "responseId", children: SDKUI_Localizator.Answer }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (currentResponse ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] })) }));
361
+ : (_jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", $isValid: true, value: currentResponse ?? '', onChange: onAnswerChange ? onAnswerChange : undefined }), _jsx(ResponseCommentLabel, { htmlFor: "responseId", children: SDKUI_Localizator.Answer }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (currentResponse ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] })) }));
362
362
  };
363
363
  // Stile comune per i container dei campi
364
364
  const fieldContainerStyle = { width: '100%' };
@@ -423,7 +423,7 @@ export const RenderTaskFormStateField = (props) => {
423
423
  // Non renderizzare nulla finché i dati non sono pronti
424
424
  if (!formDataOrig)
425
425
  return null;
426
- return (_jsx("div", { style: { width: '100%', marginTop: 15 }, children: _jsxs(FloatingLabelFieldCard, { "$isModifiedWhen": formDataOrig?.state !== formData?.state, style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: [_jsx(FloatingFieldLabel, { "$isModifiedWhen": formDataOrig?.state !== formData?.state, children: SDKUI_Localizator.StatusAndAnswer }), _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', width: '100%' }, children: [_jsx(StatusFieldLabel, { children: _jsxs(StatusValue, { "$isModifiedWhen": formDataOrig?.state !== formData?.state, children: [_jsx("span", { style: { display: 'flex', alignItems: 'center' }, children: taskStateIconMap(20).get(formData?.state ?? Task_States.None) }), getStatusLocalizatorValue(formData?.state ?? Task_States.None)] }) }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [showModifyButton && (_jsxs("div", { onClick: () => handleShowChangeStateForm(true), style: {
426
+ return (_jsx("div", { style: { width: '100%', marginTop: 15 }, children: _jsxs(FloatingLabelFieldCard, { $isModifiedWhen: formDataOrig?.state !== formData?.state, style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: [_jsx(FloatingFieldLabel, { $isModifiedWhen: formDataOrig?.state !== formData?.state, children: SDKUI_Localizator.StatusAndAnswer }), _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', width: '100%' }, children: [_jsx(StatusFieldLabel, { children: _jsxs(StatusValue, { $isModifiedWhen: formDataOrig?.state !== formData?.state, children: [_jsx("span", { style: { display: 'flex', alignItems: 'center' }, children: taskStateIconMap(20).get(formData?.state ?? Task_States.None) }), getStatusLocalizatorValue(formData?.state ?? Task_States.None)] }) }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [showModifyButton && (_jsxs("div", { onClick: () => handleShowChangeStateForm(true), style: {
427
427
  backgroundColor: "#d17800",
428
428
  color: "#fff",
429
429
  padding: "10px 16px",
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
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";
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import ArrayStore from 'devextreme/data/array_store';
3
3
  import { useCallback, useEffect, useRef, useState } from 'react';
4
4
  import { Priorities, Task_States } from "@topconsultnpm/sdk-ts";
@@ -28,7 +28,7 @@ const TMTasksHeader = (props) => {
28
28
  const isValidKey = (key) => {
29
29
  return key !== FilterCategoryId.AllStates && key !== FilterCategoryId.AllPriorities;
30
30
  };
31
- return (_jsx(StyledListHeader, { ref: containerRef, "$color": color ?? 'black', "$height": height ?? '100%', onContextMenu: handleContextMenu, children: _jsx(ScrollView, { width: "100%", height: "100%", direction: "horizontal", useNative: true, children: _jsxs(StyledViewChangerContainer, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.SelectViewMode, showEvent: "mouseenter", hideEvent: "mouseleave", position: "top", children: _jsx(TMDropDown, { elementStyle: { minWidth: "120px", width: "120px", height: "29px" }, dataSource: [
31
+ return (_jsx(StyledListHeader, { ref: containerRef, $color: color ?? 'black', $height: height ?? '100%', onContextMenu: handleContextMenu, children: _jsx(ScrollView, { width: "100%", height: "100%", direction: "horizontal", useNative: true, children: _jsxs(StyledViewChangerContainer, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.SelectViewMode, showEvent: "mouseenter", hideEvent: "mouseleave", position: "top", children: _jsx(TMDropDown, { elementStyle: { minWidth: "120px", width: "120px", height: "29px" }, dataSource: [
32
32
  { value: TaskView.AGENDA_TASK, display: "Agenda", icon: 'clock' },
33
33
  { value: TaskView.CALENDAR_TASK, display: SDKUI_Localizator.Calendar, icon: 'event' },
34
34
  { value: TaskView.LIST_TASK, display: SDKUI_Localizator.List, icon: 'fields' },
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { PdGs, Priorities, SDK_Globals, Task_States } from '@topconsultnpm/sdk-ts';
4
4
  import { Extended_Task_States, FilterCategoryId, filterTreeTask, gotoPDGExtendedLabel, prioritiesResourceData, taskIsExpiringSoon } from "./TMTasksUtils";
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useState } from "react";
3
3
  import { AssignedTab, checkIfNew, createTasksMenuItems, getHeaderPriorityFilterConfig, getHeaderStatusFilterConfig, getMondayOfCurrentWeek, getNewTaskCount, getStatusLocalizatorValue, isTaskAssignedToAnotherUser, LIGTH_CYAN, LIGTH_RED_ORGANGE, TaskView, TEXT_NOT_SELECTED_COLOR } from "./TMTasksUtils";
4
4
  import { TabPanel, Item } from 'devextreme-react/tab-panel';
@@ -539,13 +539,13 @@ const TMTasksView = (props) => {
539
539
  return _jsx("div", { style: { width: '100%', height: '100%', display: 'flex', flexDirection: 'column', overflow: "auto" }, children: _jsx("div", { style: { width: "100%", height: "100%" }, children: _jsx(TMTasksCalendar, { id: id, visualizedTasks: fromOrToDataSource, showId: showId, fromCell: fromCell, toCell: toCell, showSearch: showSearch, currentCalendarDate: currentCalendarDate, setCurrentCalendarDate: setCurrentCalendarDate, openTaskForm: openTaskFormCallback, onDeleteCallback: onDeleteCallback, setCalendarStartDate: setCalendarStartDate, setCalendarEndDate: setCalendarEndDate, focusedRowKey: focusedRowKey, handleFocusedRowChange: handleFocusedRowChange, menuItems: menuItems }) }) });
540
540
  };
541
541
  return _jsxs("div", { style: { width: '100%', height: '100%' }, onContextMenu: (e) => e.preventDefault(), children: [_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: _jsxs(TabPanel, { width: "100%", height: "100%", animationEnabled: false, swipeEnabled: false, loop: false, showNavButtons: true, repaintChangesOnly: true, stylingMode: "primary", iconPosition: 'start', tabsPosition: 'top', selectedIndex: activeTabIndex, onSelectedIndexChange: onSelectedIndexChange, id: "task-centered-tab-title", children: [_jsx(Item, { title: SDKUI_Localizator.AssignedToMe, icon: "user", tabRender: (params) => {
542
- return _jsxs(StyledTabItem, { "$isSelected": activeTabIndex === AssignedTab.AssignedToMe, children: [_jsxs(TMTooltip, { content: SDKUI_Localizator.AssignedToMe, children: [_jsx("i", { className: `dx-icon-${params.icon}` }), "\u00A0", params.title, " ", (assignedToMeCount > 0) ? `(${assignedToMeCount})` : ''] }), newTaskCount > 0 && (_jsx(TMTooltip, { content: SDKUI_Localizator.NewAssignedActivitiesNumber + ": " + newTaskCount, children: _jsx(TMCountBadge, { children: newTaskCount }) }))] });
542
+ return _jsxs(StyledTabItem, { $isSelected: activeTabIndex === AssignedTab.AssignedToMe, children: [_jsxs(TMTooltip, { content: SDKUI_Localizator.AssignedToMe, children: [_jsx("i", { className: `dx-icon-${params.icon}` }), "\u00A0", params.title, " ", (assignedToMeCount > 0) ? `(${assignedToMeCount})` : ''] }), newTaskCount > 0 && (_jsx(TMTooltip, { content: SDKUI_Localizator.NewAssignedActivitiesNumber + ": " + newTaskCount, children: _jsx(TMCountBadge, { children: newTaskCount }) }))] });
543
543
  }, render: () => activeTabIndex === AssignedTab.AssignedToMe ?
544
544
  _jsxs(_Fragment, { children: [activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, true, false), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, true, false), activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, true, false)] }) : '' }), _jsx(Item, { title: SDKUI_Localizator.AssignedByMe, icon: "login", tabRender: (params) => {
545
- return _jsx(StyledTabItem, { "$isSelected": activeTabIndex === AssignedTab.AssignedByMe, children: _jsxs(TMTooltip, { content: SDKUI_Localizator.AssignedByMe, children: [_jsx("i", { className: `dx-icon-${params.icon}` }), "\u00A0", params.title, " ", (assignedByMeCount > 0) ? `(${assignedByMeCount})` : ''] }) });
545
+ return _jsx(StyledTabItem, { $isSelected: activeTabIndex === AssignedTab.AssignedByMe, children: _jsxs(TMTooltip, { content: SDKUI_Localizator.AssignedByMe, children: [_jsx("i", { className: `dx-icon-${params.icon}` }), "\u00A0", params.title, " ", (assignedByMeCount > 0) ? `(${assignedByMeCount})` : ''] }) });
546
546
  }, render: () => activeTabIndex === AssignedTab.AssignedByMe ?
547
547
  _jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, false, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, false, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, false, true)] }) : '' }), _jsx(Item, { title: SDKUI_Localizator.AllFemale, icon: "fields", tabRender: (params) => {
548
- return _jsxs(StyledTabItem, { "$isSelected": activeTabIndex === AssignedTab.All, children: [_jsxs(TMTooltip, { content: SDKUI_Localizator.AllFemale, children: [_jsx("i", { className: `dx-icon-${params.icon}` }), "\u00A0", params.title, " ", (allTasksFilteredCount > 0) ? `(${allTasksFilteredCount})` : ''] }), newTaskCount > 0 && (_jsx(TMTooltip, { content: SDKUI_Localizator.NewAssignedActivitiesNumber + ": " + newTaskCount, children: _jsx(TMCountBadge, { children: newTaskCount }) }))] });
548
+ return _jsxs(StyledTabItem, { $isSelected: activeTabIndex === AssignedTab.All, children: [_jsxs(TMTooltip, { content: SDKUI_Localizator.AllFemale, children: [_jsx("i", { className: `dx-icon-${params.icon}` }), "\u00A0", params.title, " ", (allTasksFilteredCount > 0) ? `(${allTasksFilteredCount})` : ''] }), newTaskCount > 0 && (_jsx(TMTooltip, { content: SDKUI_Localizator.NewAssignedActivitiesNumber + ": " + newTaskCount, children: _jsx(TMCountBadge, { children: newTaskCount }) }))] });
549
549
  }, render: () => activeTabIndex === AssignedTab.All ?
550
550
  _jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, true, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, true, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, true, true)] }) : '' })] }) }), showTaskForm && _jsx(TMTaskForm, { id: currentTask?.id ?? -1, width: taskModalSizes(deviceType, formMode ?? FormModes.Create).width, height: taskModalSizes(deviceType, formMode ?? FormModes.Create).height, title: isContextualCreate ? SDKUI_Localizator.ContextualTask : SDKUI_Localizator.Widget_Activities, isModal: true, formMode: formMode ?? FormModes.Create, visualizedTasks: visualizedTasks, currentTask: currentTask, setCurrentTask: setCurrentTask, isContextualCreate: isContextualCreate, selectedRowKeys: selectedRowKeys, handleFocusedRowKeyChange: handleFocusedRowChange, taskContext: taskContext, usersList: usersList, onStatusChanged: () => { }, onClose: closeTaskFormCallback, onCancel: closeTaskFormCallback, showBackButton: false, onSaved: onSavedCallback, startDate: calendarStartDate, endDate: calendarEndDate, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGsWrapper, handleNavigateToDossiers: handleNavigateToDossiersWrapper }), _jsx("button", { style: {
551
551
  position: 'absolute',
@@ -434,6 +434,6 @@ export const TMStepNavigator = (props) => {
434
434
  return (_jsx("div", { style: { display: 'flex', justifyContent: 'center' }, children: _jsx("div", { style: { display: 'flex', alignItems: 'center', backgroundColor: '#f9f9f9', padding: '6px 16px', borderRadius: '999px', boxShadow: '0 1px 4px rgba(0, 0, 0, 0.05)' }, children: steps.map((step, index) => {
435
435
  const isPastStep = index < currentStep;
436
436
  const isCurrent = currentStep === index;
437
- return _jsxs("div", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx(StepSpan, { "$isCurrent": isCurrent, "$isPast": isPastStep, onClick: isPastStep ? () => onStepChange(index) : undefined, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center' }, children: [_jsx("span", { children: step.title }), step.subtitle && _jsxs("span", { style: { fontSize: '0.90em', fontStyle: "italic" }, children: ["\"", step.subtitle, "\""] })] }) }), index < steps.length - 1 && (_jsx("span", { style: { margin: '0 8px', color: '#ddd' }, children: _jsx("i", { className: 'dx-icon-greater' }) }))] }, step.id);
437
+ return _jsxs("div", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx(StepSpan, { $isCurrent: isCurrent, $isPast: isPastStep, onClick: isPastStep ? () => onStepChange(index) : undefined, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center' }, children: [_jsx("span", { children: step.title }), step.subtitle && _jsxs("span", { style: { fontSize: '0.90em', fontStyle: "italic" }, children: ["\"", step.subtitle, "\""] })] }) }), index < steps.length - 1 && (_jsx("span", { style: { margin: '0 8px', color: '#ddd' }, children: _jsx("i", { className: 'dx-icon-greater' }) }))] }, step.id);
438
438
  }) }) }));
439
439
  };
@@ -3,6 +3,16 @@ import { DeviceType } from "../../base/TMDeviceProvider";
3
3
  import { WorkItemDetail } from "../../../ts";
4
4
  interface IWorkflowOperationButtonsProps {
5
5
  dtd: DcmtTypeDescriptor | undefined;
6
+ /**
7
+ * Forza la forma dei pulsanti: `true` = flusso di FIRMA (Firma e approva),
8
+ * `false` = flusso di APPROVAZIONE. Se omesso si deduce dal tipo documento
9
+ * (widget Sign4Top), che è il comportamento del workflow.
10
+ *
11
+ * Serve a chi conosce la natura dell'attività meglio del tipo documento: un
12
+ * work item di sola approvazione su un tipo ABILITATO alla firma non deve
13
+ * mostrare "Firma e approva".
14
+ */
15
+ signFlow?: boolean;
6
16
  approveDisable?: boolean;
7
17
  signApproveDisable?: boolean;
8
18
  rejectDisable?: boolean;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from "react";
3
3
  import { ResultTypes, SDK_Globals, UserListCacheService, ValidationItem, WFEvents, WorkflowCacheService } from '@topconsultnpm/sdk-ts';
4
4
  import styled from "styled-components";
@@ -53,16 +53,20 @@ const StyledHorizontalContainer = styled.div `
53
53
  /* align-items: flex-end; */
54
54
  `;
55
55
  export const WorkFlowOperationButtons = (props) => {
56
- const { dtd = undefined, deviceType = DeviceType.DESKTOP, approveDisable = false, signApproveDisable = false, rejectDisable = false, reassignDisable = false, infoDisable = false, onApprove, onSignApprove, onReject, onReAssign, onMoreInfo, } = props;
56
+ const { dtd = undefined, signFlow = undefined, deviceType = DeviceType.DESKTOP, approveDisable = false, signApproveDisable = false, rejectDisable = false, reassignDisable = false, infoDisable = false, onApprove, onSignApprove, onReject, onReAssign, onMoreInfo, } = props;
57
57
  const isMobile = deviceType === DeviceType.MOBILE;
58
- // Calcola direttamente se è un workflow di firma per evitare flickering durante il render
58
+ // Calcola direttamente se è un workflow di firma per evitare flickering durante il render.
59
+ // `signFlow`, se fornito, ha la precedenza: chi lo passa conosce la natura
60
+ // dell'attività (es. categoria del work item) meglio del tipo documento.
59
61
  const isSignWorkflow = useMemo(() => {
62
+ if (signFlow !== undefined)
63
+ return signFlow;
60
64
  if (dtd && dtd.widgets && dtd.widgets.length > 0) {
61
65
  return isSign4TopEnabled(dtd.widgets);
62
66
  }
63
67
  return false;
64
- }, [dtd]);
65
- return (_jsx(StyledWorkFlowOperationButtonsContainer, { "$isMobile": isMobile, children: isSignWorkflow ? (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconSignaturePencil, {}), caption: SDKUI_Localizator.SignatureAndApprove, width: "160px", disabled: signApproveDisable, onClick: () => !signApproveDisable && onSignApprove?.(), onMouseDown: e => e.stopPropagation(), advancedColor: "#1a9a49", color: "success" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), onMouseDown: e => e.stopPropagation(), advancedColor: TMColors.error, color: "error" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), onMouseDown: e => e.stopPropagation(), advancedColor: TMColors.info, color: "info" })] })) : (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconApply, {}), caption: SDKUI_Localizator.Approve, disabled: approveDisable, onClick: () => !approveDisable && onApprove?.(), advancedColor: "#1a9a49", color: "success" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), advancedColor: TMColors.error, color: "error" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconUser, { fontSize: 16 }), caption: SDKUI_Localizator.Reassign, disabled: reassignDisable, onClick: () => !reassignDisable && onReAssign?.(), advancedColor: TMColors.tertiary, color: "tertiary" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), advancedColor: TMColors.info, color: "info" })] })) }));
68
+ }, [dtd, signFlow]);
69
+ return (_jsx(StyledWorkFlowOperationButtonsContainer, { $isMobile: isMobile, children: isSignWorkflow ? (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconSignaturePencil, {}), caption: SDKUI_Localizator.SignatureAndApprove, width: "160px", disabled: signApproveDisable, onClick: () => !signApproveDisable && onSignApprove?.(), onMouseDown: e => e.stopPropagation(), advancedColor: "#1a9a49", color: "success" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), onMouseDown: e => e.stopPropagation(), advancedColor: TMColors.error, color: "error" }), onMoreInfo && (_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), onMouseDown: e => e.stopPropagation(), advancedColor: TMColors.info, color: "info" }))] })) : (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconApply, {}), caption: SDKUI_Localizator.Approve, disabled: approveDisable, onClick: () => !approveDisable && onApprove?.(), advancedColor: "#1a9a49", color: "success" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), advancedColor: TMColors.error, color: "error" }), onReAssign && (_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconUser, { fontSize: 16 }), caption: SDKUI_Localizator.Reassign, disabled: reassignDisable, onClick: () => !reassignDisable && onReAssign?.(), advancedColor: TMColors.tertiary, color: "tertiary" })), onMoreInfo && (_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), advancedColor: TMColors.info, color: "info" }))] })) }));
66
70
  };
67
71
  export const WorkFlowApproveRejectPopUp = ({ TID = 0, DID = 0, deviceType = DeviceType.DESKTOP, isReject, selectedItems = [], onClose, onCompleted }) => {
68
72
  const { refreshWorkflowApprove } = useWorkflowApprove();
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useCallback } from 'react';
3
3
  import { ArrowSymbol } from './interfaces';
4
4
  import styled, { css } from 'styled-components';
@@ -56,7 +56,7 @@ const ConnectionComponent = ({ connection, isSelected, sourcePoint, sinkPoint, i
56
56
  default:
57
57
  return null;
58
58
  }
59
- return _jsx(StyledArrow, { d: pathData, "$color": connectionColor });
59
+ return _jsx(StyledArrow, { d: pathData, $color: connectionColor });
60
60
  }, [connectionColor]);
61
61
  // Calcola la trasformazione per posizionare e ruotare la freccia
62
62
  const calculateArrowTransform = useCallback((isSink) => {
@@ -86,7 +86,7 @@ const ConnectionComponent = ({ connection, isSelected, sourcePoint, sinkPoint, i
86
86
  event.stopPropagation();
87
87
  onContextMenu?.(connection.ID, event);
88
88
  }, [onContextMenu, connection.ID]);
89
- return (_jsxs("g", { children: [_jsx(StyledPathHitArea, { d: connection.PathGeometry, onClick: (e) => onClick(connection.ID, e), onDoubleClick: handleDoubleClick, onContextMenu: handleContextMenu }), _jsx(StyledPath, { d: connection.PathGeometry, "$isSelected": isSelected, "$isTemporary": isTemporary, "$outputStatus": connection.OutputStatus, onClick: (e) => onClick(connection.ID, e), onDoubleClick: handleDoubleClick, onContextMenu: handleContextMenu }), connection.SinkArrowSymbol !== ArrowSymbol.None && (_jsxs("g", { transform: calculateArrowTransform(true), children: [renderArrow(connection.SinkArrowSymbol, 0), " "] })), connection.SourceArrowSymbol !== ArrowSymbol.None && (_jsx("g", { transform: calculateArrowTransform(false) + ' rotate(180)', children: renderArrow(connection.SourceArrowSymbol, 0) })), isSelected && (_jsxs(_Fragment, { children: [_jsx(StyledSquareConnector, { "$color": connectionColor, x: sourcePoint.x - 5, y: sourcePoint.y - 5, width: 10, height: 10 }), _jsx(StyledSquareConnector, { "$color": connectionColor, x: sinkPoint.x - 5, y: sinkPoint.y - 5, width: 10, height: 10, cursor: 'move', onMouseDown: (e) => {
89
+ return (_jsxs("g", { children: [_jsx(StyledPathHitArea, { d: connection.PathGeometry, onClick: (e) => onClick(connection.ID, e), onDoubleClick: handleDoubleClick, onContextMenu: handleContextMenu }), _jsx(StyledPath, { d: connection.PathGeometry, $isSelected: isSelected, $isTemporary: isTemporary, $outputStatus: connection.OutputStatus, onClick: (e) => onClick(connection.ID, e), onDoubleClick: handleDoubleClick, onContextMenu: handleContextMenu }), connection.SinkArrowSymbol !== ArrowSymbol.None && (_jsxs("g", { transform: calculateArrowTransform(true), children: [renderArrow(connection.SinkArrowSymbol, 0), " "] })), connection.SourceArrowSymbol !== ArrowSymbol.None && (_jsx("g", { transform: calculateArrowTransform(false) + ' rotate(180)', children: renderArrow(connection.SourceArrowSymbol, 0) })), isSelected && (_jsxs(_Fragment, { children: [_jsx(StyledSquareConnector, { $color: connectionColor, x: sourcePoint.x - 5, y: sourcePoint.y - 5, width: 10, height: 10 }), _jsx(StyledSquareConnector, { $color: connectionColor, x: sinkPoint.x - 5, y: sinkPoint.y - 5, width: 10, height: 10, cursor: 'move', onMouseDown: (e) => {
90
90
  e.stopPropagation(); // Impedisce la propagazione dell'evento a elementi sottostanti
91
91
  onConnectionEndpointMouseDown?.(connection.ID, 'sink', e);
92
92
  } })] }))] }));
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useState, useCallback, useRef, useEffect, useMemo } from 'react';
3
3
  import { DiagramItemTypes } from './interfaces';
4
4
  import styled, { keyframes, css } from 'styled-components';
@@ -230,7 +230,7 @@ const DiagramItemComponent = ({ wf, item, isSelected, isCurrent, readOnly, allow
230
230
  onDoubleClick?.(item.ID);
231
231
  }, [onDoubleClick, item.ID]);
232
232
  const renderContent = () => {
233
- const renderConnectorWithHitArea = (cx, cy, connectorName) => (_jsxs(_Fragment, { children: [_jsx(Connector, { cx: cx, cy: cy, r: 4, "$isVisible": isHovered && !readOnly, "$isReadOnly": readOnly }), _jsx(ConnectorHitArea, { cx: cx, cy: cy, r: 15, "$isVisible": isHovered && !readOnly, "$isReadOnly": readOnly, "data-is-connector": "true", onMouseDown: (e) => {
233
+ const renderConnectorWithHitArea = (cx, cy, connectorName) => (_jsxs(_Fragment, { children: [_jsx(Connector, { cx: cx, cy: cy, r: 4, $isVisible: isHovered && !readOnly, $isReadOnly: readOnly }), _jsx(ConnectorHitArea, { cx: cx, cy: cy, r: 15, $isVisible: isHovered && !readOnly, $isReadOnly: readOnly, "data-is-connector": "true", onMouseDown: (e) => {
234
234
  if (readOnly)
235
235
  return;
236
236
  e.stopPropagation();
@@ -266,6 +266,6 @@ const DiagramItemComponent = ({ wf, item, isSelected, isCurrent, readOnly, allow
266
266
  }
267
267
  return (_jsxs(_Fragment, { children: [isTruncated && _jsx("title", { children: item.ItemName }), backgroundColor && (_jsx("rect", { x: "-5", y: "-5", width: calculatedWidth + 10, height: calculatedHeight + 10, rx: "12", ry: "12", fill: backgroundColor, opacity: "0.4", style: { filter: 'blur(3px)' } })), _jsx("rect", { x: "0", y: "0", width: calculatedWidth, height: calculatedHeight, className: "item-main-shape", fill: "transparent" }), _jsx("g", { transform: `translate(${svgX}, ${svgY})`, children: _jsx(DiagramItemSvgContent, { itemType: item.Type, width: iconRenderWidth, height: iconRenderHeight, statusData: statusData }) }), textLines.length > 0 && (_jsx("text", { ref: textRef, x: calculatedWidth / 2, dominantBaseline: "central", className: "item-text", children: textLines.map((line, index) => (_jsx("tspan", { x: calculatedWidth / 2, dy: index === 0 ? PADDING_TOP + SVG_ICON_SIZE + SPACING_SVG_TEXT : FONT_SIZE + 1, children: line }, index))) })), connectors] }));
268
268
  };
269
- return (_jsx(StyledDiagramItem, { ref: diagramItemRef, transform: `translate(${currentPosition.x}, ${currentPosition.y})`, "$isSelected": isSelected, "$itemType": item.Type, "$isDragging": isDragging, "$isHovered": isHovered, "$isReadOnly": readOnly, "$allowItemClick": allowItemClick, onMouseDown: handleMouseDown, onClick: handleItemClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onDoubleClick: handleDoubleClick, children: _jsx(AnimatingGroup, { "$isCurrent": isCurrent, children: renderContent() }) }));
269
+ return (_jsx(StyledDiagramItem, { ref: diagramItemRef, transform: `translate(${currentPosition.x}, ${currentPosition.y})`, $isSelected: isSelected, $itemType: item.Type, $isDragging: isDragging, $isHovered: isHovered, $isReadOnly: readOnly, $allowItemClick: allowItemClick, onMouseDown: handleMouseDown, onClick: handleItemClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onDoubleClick: handleDoubleClick, children: _jsx(AnimatingGroup, { $isCurrent: isCurrent, children: renderContent() }) }));
270
270
  };
271
271
  export default React.memo(DiagramItemComponent);
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useState } from 'react'; // Importa useState
3
3
  import TMModal from '../../../base/TMModal';
4
4
  import { DiagramItemTypes } from './interfaces';
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { DiagramItemTypes } from './interfaces'; // Assicurati che il percorso sia corretto
3
3
  import styled from 'styled-components';
4
4
  import { TMImageLibrary } from '../../../../helper';
@@ -199,7 +199,7 @@ const RecipientList = ({ recipients, title, tid, qd, maxRecipients, validationIt
199
199
  document.removeEventListener('keydown', handleKeyPress);
200
200
  };
201
201
  }, [handleKeyPress]);
202
- return (_jsxs(RecipientsColumn, { children: [_jsxs(HeaderContainer, { children: [_jsx("p", { style: { fontWeight: 600 }, children: title }), _jsx(TMButton, { btnStyle: 'icon', caption: SDKUI_Localizator.AddRecipient, icon: _jsx(IconAdd, {}), onClick: handleAddClick, disabled: isMaxReached }), uiState.isMenuOpen && !isMaxReached && renderFloatingMenu()] }), _jsx(TMVilViewer, { vil: validationItems }), _jsx("div", { style: { height: '150px', overflowY: 'auto', gap: '5px', display: 'flex', flexDirection: 'column' }, children: recipients.map((recipient, index) => (_jsxs(RecipientItem, { "$isSelected": uiState.selectedRecipientIndex === index, onClick: () => handleRecipientClick(index), tabIndex: 0, children: [_jsx("span", { style: { display: 'flex', alignItems: 'center', flexShrink: 0 }, children: _jsx(IconDelete, { color: '#c00', cursor: 'pointer', onClick: (e) => {
202
+ return (_jsxs(RecipientsColumn, { children: [_jsxs(HeaderContainer, { children: [_jsx("p", { style: { fontWeight: 600 }, children: title }), _jsx(TMButton, { btnStyle: 'icon', caption: SDKUI_Localizator.AddRecipient, icon: _jsx(IconAdd, {}), onClick: handleAddClick, disabled: isMaxReached }), uiState.isMenuOpen && !isMaxReached && renderFloatingMenu()] }), _jsx(TMVilViewer, { vil: validationItems }), _jsx("div", { style: { height: '150px', overflowY: 'auto', gap: '5px', display: 'flex', flexDirection: 'column' }, children: recipients.map((recipient, index) => (_jsxs(RecipientItem, { $isSelected: uiState.selectedRecipientIndex === index, onClick: () => handleRecipientClick(index), tabIndex: 0, children: [_jsx("span", { style: { display: 'flex', alignItems: 'center', flexShrink: 0 }, children: _jsx(IconDelete, { color: '#c00', cursor: 'pointer', onClick: (e) => {
203
203
  e.stopPropagation();
204
204
  onRemove(recipient);
205
205
  setUiState(prevState => ({ ...prevState, selectedRecipientIndex: null }));
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useCallback, useRef, useMemo, useLayoutEffect } from 'react';
3
3
  import { DiagramItemTypes, ArrowSymbol } from './interfaces';
4
4
  import { parseWfDiagramXml, serializeWfDiagramToXml } from './xmlParser';
@@ -1925,13 +1925,13 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
1925
1925
  { icon: _jsx(IconZoomIn, {}), name: SDKUI_Localizator.ZoomIn, disabled: isAutoZoomEnabled, onClick: () => { handleZoomIn(); }, id: 'zoom-in', isPinned: true },
1926
1926
  { icon: _jsx(IconZoomOut, {}), name: SDKUI_Localizator.ZoomOut, disabled: isAutoZoomEnabled, onClick: () => { handleZoomOut(); }, id: 'zoom-out', isPinned: true },
1927
1927
  { icon: _jsx(IconZoomAuto, {}), name: 'AutoZoom', onClick: () => { handleToggleAutoZoom(); }, id: 'zoom-auto', isPinned: true, isToggle: isAutoZoomEnabled },
1928
- { icon: _jsx(_Fragment, {}), name: 'Zoom Level', onClick: () => { }, id: 'zoom-level', isPinned: true, staticItem: _jsx(ZoomLevelText, { "$isFloating": isToolbarFloating, "$isCollapsed": isToolbarCollapsed, children: formattedZoomLevel }) }
1928
+ { icon: _jsx(_Fragment, {}), name: 'Zoom Level', onClick: () => { }, id: 'zoom-level', isPinned: true, staticItem: _jsx(ZoomLevelText, { $isFloating: isToolbarFloating, $isCollapsed: isToolbarCollapsed, children: formattedZoomLevel }) }
1929
1929
  ], isConstrained: true }) :
1930
- _jsxs(ToolbarContainer, { "$isCollapsed": isToolbarCollapsed, "$isFloating": isToolbarFloating, "$isToolboxVisible": isToolboxVisible, "$isReadOnly": isReadOnly, children: [allowEdit && _jsx(ButtonGroup, { "$isFloating": isToolbarFloating, children: _jsxs("button", { onClick: toggleReadOnlyMode, title: isReadOnly ? SDKUI_Localizator.Design : SDKUI_Localizator.ReadOnly, children: [isReadOnly ? _jsx(IconPencil, {}) : _jsx(IconLock, {}), !isToolbarCollapsed && _jsx("span", { children: isReadOnly ? SDKUI_Localizator.Design : SDKUI_Localizator.ReadOnly })] }) }), allowEdit && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [!isReadOnly && _jsxs("button", { onClick: handleToggleToolboxVisibility, title: SDKUI_Localizator.ShowToolbox, children: [_jsx(IconFlowChart, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ShowToolboxToggle })] }), _jsxs("button", { onClick: toggleFullScreenMode, title: SDKUI_Localizator.ShowFullScreen, children: [isFullScreen ? _jsx(IconWindowMinimize, {}) : _jsx(IconWindowMaximize, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ShowFullScreen })] })] }), _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleZoomIn, title: SDKUI_Localizator.ZoomIn, disabled: isAutoZoomEnabled, children: [_jsx(IconZoomIn, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ZoomIn })] }), _jsxs("button", { onClick: handleZoomOut, title: SDKUI_Localizator.ZoomOut, disabled: isAutoZoomEnabled, children: [_jsx(IconZoomOut, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ZoomOut })] }), _jsxs("button", { onClick: handleToggleAutoZoom, title: "AutoZoom", style: { backgroundColor: isAutoZoomEnabled ? '#66b3ff' : undefined }, children: [_jsx(IconZoomAuto, {}), !isToolbarCollapsed && _jsx("span", { children: "AutoZoom" })] }), _jsx(ZoomLevelText, { "$isFloating": isToolbarFloating, "$isCollapsed": isToolbarCollapsed, children: formattedZoomLevel })] }), !isReadOnly && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleUndo, disabled: historyIndex === 0, title: SDKUI_Localizator.Undo, children: [_jsx(IconUndo, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Undo })] }), _jsxs("button", { onClick: handleRedo, disabled: historyIndex === wfDiagramHistory.length - 1, title: SDKUI_Localizator.Redo, children: [_jsx(IconUndo, { style: { transform: 'scaleX(-1)' } }), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Redo })] }), _jsxs("button", { onClick: handleRestore, title: SDKUI_Localizator.Restore, children: [_jsx(IconRestore, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Restore })] }), _jsxs("button", { onClick: handleNew, title: SDKUI_Localizator.DiagramNew, disabled: isReadOnly, children: [_jsx(IconNew, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.DiagramNew })] }), _jsxs("button", { onClick: handleExportDiagram, disabled: isReadOnly || !wfDiagram, title: SDKUI_Localizator.Export, children: [_jsx(IconExport, {}), _jsx("span", { children: SDKUI_Localizator.Export })] }), _jsxs("button", { onClick: handleImportDiagramClick, disabled: isReadOnly, title: SDKUI_Localizator.Import, children: [_jsx(IconImport, {}), _jsx("span", { children: SDKUI_Localizator.Import })] })] }), !isReadOnly && _jsx(ButtonGroup, { "$isFloating": isToolbarFloating, children: _jsxs("button", { onClick: handleAutoAdjust, title: SDKUI_Localizator.AutoAdjust, children: [_jsx(IconAdjust, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.AutoAdjust })] }) }), !isReadOnly && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleCopy, disabled: selectedItems.size === 0, title: SDKUI_Localizator.Copy, children: [_jsx(IconCopy, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Copy })] }), _jsxs("button", { onClick: handleCut, disabled: selectedItems.size === 0, title: SDKUI_Localizator.Cut, children: [_jsx(IconCut, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Cut })] }), _jsxs("button", { onClick: handlePaste, disabled: copiedItems.length === 0 && copiedConnections.length === 0, title: SDKUI_Localizator.Paste, children: [_jsx(IconPaste, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Paste })] })] }), allowEdit && _jsxs("button", { onClick: handleToggleToolbarMode, title: isToolbarFloating ? SDKUI_Localizator.ToolbarDock : SDKUI_Localizator.ToolbarFloat, children: [isToolbarFloating ? _jsx(IconPin, {}) : _jsx(IconUnpin, {}), !isToolbarCollapsed && !isToolbarFloating && _jsx("span", { children: SDKUI_Localizator.ToggleMode })] }), !isToolbarFloating && _jsx(ToolbarToggle, { onClick: () => setIsToolbarCollapsed(!isToolbarCollapsed), title: isToolbarCollapsed ? SDKUI_Localizator.ToolbarExpand : SDKUI_Localizator.ToolbarCollapse, children: isToolbarCollapsed ? _jsx(IconChevronRight, {}) : _jsx(IconCloseOutline, {}) })] }), !isReadOnly && (_jsx(ToolboxContainer, { "$isVisible": isToolboxVisible, children: isToolboxVisible && availableItemTypes.map(type => (_jsxs(ToolboxItem, { draggable: true, onDragStart: (e) => handleToolboxDragStart(e, type), onDragEnd: handleToolboxDragEnd, children: [_jsx(ToolboxIconWrapper, { children: _jsx(DiagramItemSvgContent, { itemType: type, width: 38, height: 38, isToolboxPreview: true }) }), _jsx("span", { children: LocalizeDiagramItemType(type) })] }, type))) })), _jsx(SvgScrollContainer, { ref: containerRef, children: isLoading ?
1930
+ _jsxs(ToolbarContainer, { $isCollapsed: isToolbarCollapsed, $isFloating: isToolbarFloating, $isToolboxVisible: isToolboxVisible, $isReadOnly: isReadOnly, children: [allowEdit && _jsx(ButtonGroup, { $isFloating: isToolbarFloating, children: _jsxs("button", { onClick: toggleReadOnlyMode, title: isReadOnly ? SDKUI_Localizator.Design : SDKUI_Localizator.ReadOnly, children: [isReadOnly ? _jsx(IconPencil, {}) : _jsx(IconLock, {}), !isToolbarCollapsed && _jsx("span", { children: isReadOnly ? SDKUI_Localizator.Design : SDKUI_Localizator.ReadOnly })] }) }), allowEdit && _jsxs(ButtonGroup, { $isFloating: isToolbarFloating, children: [!isReadOnly && _jsxs("button", { onClick: handleToggleToolboxVisibility, title: SDKUI_Localizator.ShowToolbox, children: [_jsx(IconFlowChart, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ShowToolboxToggle })] }), _jsxs("button", { onClick: toggleFullScreenMode, title: SDKUI_Localizator.ShowFullScreen, children: [isFullScreen ? _jsx(IconWindowMinimize, {}) : _jsx(IconWindowMaximize, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ShowFullScreen })] })] }), _jsxs(ButtonGroup, { $isFloating: isToolbarFloating, children: [_jsxs("button", { onClick: handleZoomIn, title: SDKUI_Localizator.ZoomIn, disabled: isAutoZoomEnabled, children: [_jsx(IconZoomIn, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ZoomIn })] }), _jsxs("button", { onClick: handleZoomOut, title: SDKUI_Localizator.ZoomOut, disabled: isAutoZoomEnabled, children: [_jsx(IconZoomOut, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ZoomOut })] }), _jsxs("button", { onClick: handleToggleAutoZoom, title: "AutoZoom", style: { backgroundColor: isAutoZoomEnabled ? '#66b3ff' : undefined }, children: [_jsx(IconZoomAuto, {}), !isToolbarCollapsed && _jsx("span", { children: "AutoZoom" })] }), _jsx(ZoomLevelText, { $isFloating: isToolbarFloating, $isCollapsed: isToolbarCollapsed, children: formattedZoomLevel })] }), !isReadOnly && _jsxs(ButtonGroup, { $isFloating: isToolbarFloating, children: [_jsxs("button", { onClick: handleUndo, disabled: historyIndex === 0, title: SDKUI_Localizator.Undo, children: [_jsx(IconUndo, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Undo })] }), _jsxs("button", { onClick: handleRedo, disabled: historyIndex === wfDiagramHistory.length - 1, title: SDKUI_Localizator.Redo, children: [_jsx(IconUndo, { style: { transform: 'scaleX(-1)' } }), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Redo })] }), _jsxs("button", { onClick: handleRestore, title: SDKUI_Localizator.Restore, children: [_jsx(IconRestore, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Restore })] }), _jsxs("button", { onClick: handleNew, title: SDKUI_Localizator.DiagramNew, disabled: isReadOnly, children: [_jsx(IconNew, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.DiagramNew })] }), _jsxs("button", { onClick: handleExportDiagram, disabled: isReadOnly || !wfDiagram, title: SDKUI_Localizator.Export, children: [_jsx(IconExport, {}), _jsx("span", { children: SDKUI_Localizator.Export })] }), _jsxs("button", { onClick: handleImportDiagramClick, disabled: isReadOnly, title: SDKUI_Localizator.Import, children: [_jsx(IconImport, {}), _jsx("span", { children: SDKUI_Localizator.Import })] })] }), !isReadOnly && _jsx(ButtonGroup, { $isFloating: isToolbarFloating, children: _jsxs("button", { onClick: handleAutoAdjust, title: SDKUI_Localizator.AutoAdjust, children: [_jsx(IconAdjust, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.AutoAdjust })] }) }), !isReadOnly && _jsxs(ButtonGroup, { $isFloating: isToolbarFloating, children: [_jsxs("button", { onClick: handleCopy, disabled: selectedItems.size === 0, title: SDKUI_Localizator.Copy, children: [_jsx(IconCopy, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Copy })] }), _jsxs("button", { onClick: handleCut, disabled: selectedItems.size === 0, title: SDKUI_Localizator.Cut, children: [_jsx(IconCut, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Cut })] }), _jsxs("button", { onClick: handlePaste, disabled: copiedItems.length === 0 && copiedConnections.length === 0, title: SDKUI_Localizator.Paste, children: [_jsx(IconPaste, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Paste })] })] }), allowEdit && _jsxs("button", { onClick: handleToggleToolbarMode, title: isToolbarFloating ? SDKUI_Localizator.ToolbarDock : SDKUI_Localizator.ToolbarFloat, children: [isToolbarFloating ? _jsx(IconPin, {}) : _jsx(IconUnpin, {}), !isToolbarCollapsed && !isToolbarFloating && _jsx("span", { children: SDKUI_Localizator.ToggleMode })] }), !isToolbarFloating && _jsx(ToolbarToggle, { onClick: () => setIsToolbarCollapsed(!isToolbarCollapsed), title: isToolbarCollapsed ? SDKUI_Localizator.ToolbarExpand : SDKUI_Localizator.ToolbarCollapse, children: isToolbarCollapsed ? _jsx(IconChevronRight, {}) : _jsx(IconCloseOutline, {}) })] }), !isReadOnly && (_jsx(ToolboxContainer, { $isVisible: isToolboxVisible, children: isToolboxVisible && availableItemTypes.map(type => (_jsxs(ToolboxItem, { draggable: true, onDragStart: (e) => handleToolboxDragStart(e, type), onDragEnd: handleToolboxDragEnd, children: [_jsx(ToolboxIconWrapper, { children: _jsx(DiagramItemSvgContent, { itemType: type, width: 38, height: 38, isToolboxPreview: true }) }), _jsx("span", { children: LocalizeDiagramItemType(type) })] }, type))) })), _jsx(SvgScrollContainer, { ref: containerRef, children: isLoading ?
1931
1931
  (_jsxs(StyledLoadingContainer, { children: [_jsx(StyledSpinner, {}), _jsx("span", { children: `${'Caricamento diagramma'}...` })] })) : wfDiagram ? (_jsx(StyledSvg, { ref: svgRef, tabIndex: 0, onKeyDownCapture: handleKeyDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseDown: handleMouseDown, onDrop: handleDropOnCanvas, onDragOver: handleDragOver, width: svgWidth, height: svgHeight, style: {
1932
1932
  opacity: (defaultAutoZoom && !isInitialZoomCalculated) ? 0 : 1,
1933
1933
  transition: 'opacity 0.15s ease-in'
1934
- }, children: _jsxs(ScalableGroup, { "$scale": zoomLevel, "$translateX": translateX, "$translateY": translateY, children: [wfDiagram?.DiagramItems.map(item => (_jsx(DiagramItemComponent, { wf: wfDiagram?.Info, readOnly: isReadOnly, allowItemClick: !allowEdit && workitems && workitems.length > 0 && !!onDiagramItemClick, item: item, isSelected: selectedItems.has(item.ID), isCurrent: item.ID === currentSetID, onClick: handleDiagramItemClick, onDrag: handleDrag, onDragEnd: handleDragEnd, onConnectorMouseDown: handleConnectorMouseDown, onConnectorMouseUp: handleConnectorMouseUp, onDimensionsChange: handleItemDimensionsChange, onDoubleClick: handleDoubleClickItem, backgroundColor: getWorkItemBackgroundColor(item.ID) }, item.ID))), calculatedConnections.map(connection => {
1934
+ }, children: _jsxs(ScalableGroup, { $scale: zoomLevel, $translateX: translateX, $translateY: translateY, children: [wfDiagram?.DiagramItems.map(item => (_jsx(DiagramItemComponent, { wf: wfDiagram?.Info, readOnly: isReadOnly, allowItemClick: !allowEdit && workitems && workitems.length > 0 && !!onDiagramItemClick, item: item, isSelected: selectedItems.has(item.ID), isCurrent: item.ID === currentSetID, onClick: handleDiagramItemClick, onDrag: handleDrag, onDragEnd: handleDragEnd, onConnectorMouseDown: handleConnectorMouseDown, onConnectorMouseUp: handleConnectorMouseUp, onDimensionsChange: handleItemDimensionsChange, onDoubleClick: handleDoubleClickItem, backgroundColor: getWorkItemBackgroundColor(item.ID) }, item.ID))), calculatedConnections.map(connection => {
1935
1935
  const sourceItem = wfDiagram?.DiagramItems.find(item => item.ID === connection.Source.ParentDiagramItem.ID);
1936
1936
  const sinkItem = wfDiagram?.DiagramItems.find(item => item.ID === connection.Sink.ParentDiagramItem.ID);
1937
1937
  if (!sourceItem || !sinkItem)
@@ -43,6 +43,6 @@ const Menu = ({ visible = false, children, x, y, onClose }) => {
43
43
  document.removeEventListener("mousedown", handleClickOutside);
44
44
  };
45
45
  }, [visible, onClose]);
46
- return visible ? (_jsx(MenuContainer, { ref: menuRef, "$x": x, "$y": y, "$visible": visible, children: children })) : null;
46
+ return visible ? (_jsx(MenuContainer, { ref: menuRef, $x: x, $y: y, $visible: visible, children: children })) : null;
47
47
  };
48
48
  export default Menu;