@topconsultnpm/sdkui-react 6.22.0-dev2.9 → 6.22.0-t2

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 (214) hide show
  1. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +1 -1
  2. package/lib/components/NewComponents/ContextMenu/styles.d.ts +45 -43
  3. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +1 -1
  4. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +67 -60
  5. package/lib/components/base/Styled.d.ts +93 -77
  6. package/lib/components/base/TMCounterBar.d.ts +2 -2
  7. package/lib/components/base/TMCounterContainer.d.ts +2 -1
  8. package/lib/components/base/TMCustomButton.d.ts +1 -1
  9. package/lib/components/base/TMDataGrid.d.ts +2 -0
  10. package/lib/components/base/TMDataGrid.js +260 -8
  11. package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
  12. package/lib/components/base/TMEditorBase.d.ts +2 -0
  13. package/lib/components/base/TMFileManager.d.ts +2 -1
  14. package/lib/components/base/TMFileManager.js +5 -3
  15. package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
  16. package/lib/components/base/TMFileManagerDataGridView.js +11 -2
  17. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
  18. package/lib/components/base/TMFileManagerThumbnailItems.js +19 -9
  19. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
  20. package/lib/components/base/TMFileManagerUtils.d.ts +6 -6
  21. package/lib/components/base/TMFileManagerUtils.js +37 -1
  22. package/lib/components/base/TMLayout.d.ts +4 -4
  23. package/lib/components/base/TMList.d.ts +2 -1
  24. package/lib/components/base/TMListView.d.ts +1 -1
  25. package/lib/components/base/TMModal.d.ts +11 -0
  26. package/lib/components/base/TMModal.js +47 -13
  27. package/lib/components/base/TMPanel.d.ts +6 -0
  28. package/lib/components/base/TMPanel.js +138 -25
  29. package/lib/components/base/TMPopUp.js +3 -0
  30. package/lib/components/base/TMSpinner.d.ts +2 -1
  31. package/lib/components/base/TMTab.d.ts +4 -3
  32. package/lib/components/base/TMTooltip.d.ts +2 -1
  33. package/lib/components/base/TMTooltip.js +24 -8
  34. package/lib/components/base/TMTreeView.d.ts +14 -8
  35. package/lib/components/base/TMTreeView.js +108 -67
  36. package/lib/components/base/TMUserAvatar.d.ts +2 -1
  37. package/lib/components/base/TMVilViewer.d.ts +2 -1
  38. package/lib/components/base/TMWaitPanel.d.ts +3 -2
  39. package/lib/components/choosers/TMDcmtTypeChooser.js +4 -3
  40. package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
  41. package/lib/components/choosers/TMDistinctValues.js +149 -142
  42. package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
  43. package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
  44. package/lib/components/choosers/TMMetadataChooser.js +1 -1
  45. package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
  46. package/lib/components/choosers/TMQuickSearchInfo.d.ts +13 -0
  47. package/lib/components/choosers/TMQuickSearchInfo.js +279 -0
  48. package/lib/components/choosers/TMQuickSearchSettingsForm.d.ts +16 -0
  49. package/lib/components/choosers/TMQuickSearchSettingsForm.js +94 -0
  50. package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
  51. package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
  52. package/lib/components/choosers/TMSelectedValuesSummary.js +91 -0
  53. package/lib/components/choosers/TMUserChooser.d.ts +2 -2
  54. package/lib/components/editors/TMDropDown.d.ts +3 -0
  55. package/lib/components/editors/TMDropDown.js +197 -5
  56. package/lib/components/editors/TMEditorStyled.d.ts +20 -42
  57. package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
  58. package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
  59. package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
  60. package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
  61. package/lib/components/features/archive/TMArchive.js +17 -3
  62. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
  63. package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
  64. package/lib/components/features/documents/TMBatchUpdateForm.js +19 -5
  65. package/lib/components/features/documents/TMDcmtBlog.d.ts +3 -0
  66. package/lib/components/features/documents/TMDcmtBlog.js +4 -4
  67. package/lib/components/features/documents/TMDcmtForm.d.ts +7 -0
  68. package/lib/components/features/documents/TMDcmtForm.js +178 -51
  69. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +12 -1
  70. package/lib/components/features/documents/TMDcmtFormActionButtons.js +77 -7
  71. package/lib/components/features/documents/TMDcmtIcon.d.ts +2 -1
  72. package/lib/components/features/documents/TMDcmtIcon.js +5 -3
  73. package/lib/components/features/documents/TMDcmtPreview.d.ts +8 -6
  74. package/lib/components/features/documents/TMDcmtPreview.js +10 -6
  75. package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
  76. package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
  77. package/lib/components/features/documents/TMMasterDetailDcmts.js +95 -33
  78. package/lib/components/features/documents/TMMasterInfoFields.d.ts +20 -0
  79. package/lib/components/features/documents/TMMasterInfoFields.js +186 -0
  80. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +3 -3
  81. package/lib/components/features/documents/TMMergeToPdfForm.js +30 -5
  82. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +46 -0
  83. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +323 -0
  84. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +370 -0
  85. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +283 -0
  86. package/lib/components/features/documents/TMRelationViewer.d.ts +14 -1
  87. package/lib/components/features/documents/TMRelationViewer.js +69 -20
  88. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
  89. package/lib/components/features/search/TMMetadataOutputForm.d.ts +2 -1
  90. package/lib/components/features/search/TMMetadataSorterForm.d.ts +2 -1
  91. package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
  92. package/lib/components/features/search/TMSearch.js +77 -11
  93. package/lib/components/features/search/TMSearchQueryEditor.js +5 -3
  94. package/lib/components/features/search/TMSearchQueryPanel.d.ts +13 -3
  95. package/lib/components/features/search/TMSearchQueryPanel.js +141 -67
  96. package/lib/components/features/search/TMSearchResult.d.ts +16 -0
  97. package/lib/components/features/search/TMSearchResult.js +429 -108
  98. package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
  99. package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
  100. package/lib/components/features/search/TMTreeSelector.js +109 -64
  101. package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
  102. package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
  103. package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
  104. package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
  105. package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
  106. package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
  107. package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
  108. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
  109. package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
  110. package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
  111. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +18 -7
  112. package/lib/components/features/workflow/TMWorkflowPopup.js +8 -4
  113. package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
  114. package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
  115. package/lib/components/forms/Login/Chooser.d.ts +2 -2
  116. package/lib/components/forms/TMChooserForm.d.ts +2 -1
  117. package/lib/components/forms/TMSaveForm.d.ts +4 -4
  118. package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
  119. package/lib/components/grids/TMBlogAttachments.js +13 -2
  120. package/lib/components/grids/TMBlogHeader.d.ts +1 -1
  121. package/lib/components/grids/TMBlogHeader.js +5 -1
  122. package/lib/components/grids/TMBlogsPost.d.ts +3 -1
  123. package/lib/components/grids/TMBlogsPost.js +31 -4
  124. package/lib/components/grids/TMBlogsPostUtils.d.ts +10 -9
  125. package/lib/components/grids/TMBlogsPostUtils.js +14 -3
  126. package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
  127. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +3 -1
  128. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +24 -14
  129. package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
  130. package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
  131. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +5 -6
  132. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
  133. package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
  134. package/lib/components/layout/panelManager/TMPanelWrapper.js +2 -2
  135. package/lib/components/layout/panelManager/types.d.ts +3 -0
  136. package/lib/components/layout/panelManager/utils.js +13 -11
  137. package/lib/components/pages/TMPage.d.ts +1 -1
  138. package/lib/components/query/TMQueryEditor.d.ts +14 -10
  139. package/lib/components/settings/SettingsAppearance.d.ts +2 -1
  140. package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
  141. package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
  142. package/lib/components/sidebar/TMHeader.d.ts +3 -3
  143. package/lib/components/sidebar/TMHeader.js +30 -20
  144. package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
  145. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
  146. package/lib/components/viewers/TMMidViewer.d.ts +2 -2
  147. package/lib/components/viewers/TMMidViewer.js +4 -1
  148. package/lib/components/viewers/TMTidViewer.d.ts +2 -2
  149. package/lib/components/viewers/TMTidViewer.js +86 -25
  150. package/lib/css/tm-sdkui.css +1 -1
  151. package/lib/devextreme-license.d.ts +1 -0
  152. package/lib/devextreme-license.js +3 -0
  153. package/lib/helper/SDKUI_Globals.d.ts +110 -0
  154. package/lib/helper/SDKUI_Globals.js +151 -0
  155. package/lib/helper/SDKUI_Localizator.d.ts +44 -0
  156. package/lib/helper/SDKUI_Localizator.js +440 -0
  157. package/lib/helper/TMAppUpdatedModal.d.ts +2 -0
  158. package/lib/helper/TMAppUpdatedModal.js +134 -0
  159. package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
  160. package/lib/helper/TMIcons.d.ts +280 -279
  161. package/lib/helper/TMIcons.js +3 -0
  162. package/lib/helper/TMPdfViewer.d.ts +2 -1
  163. package/lib/helper/TMToppyMessage.d.ts +2 -2
  164. package/lib/helper/TMUtils.d.ts +23 -4
  165. package/lib/helper/TMUtils.js +24 -2
  166. package/lib/helper/dataGridSearchHelper.d.ts +28 -0
  167. package/lib/helper/dataGridSearchHelper.js +51 -0
  168. package/lib/helper/dcmtsHelper.d.ts +20 -0
  169. package/lib/helper/dcmtsHelper.js +58 -1
  170. package/lib/helper/helpers.d.ts +12 -1
  171. package/lib/helper/helpers.js +25 -1
  172. package/lib/helper/index.d.ts +2 -0
  173. package/lib/helper/index.js +2 -0
  174. package/lib/helper/queryHelper.d.ts +6 -1
  175. package/lib/helper/queryHelper.js +8 -3
  176. package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
  177. package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
  178. package/lib/hooks/useArchiveListForm.d.ts +39 -0
  179. package/lib/hooks/useArchiveListForm.js +46 -0
  180. package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
  181. package/lib/hooks/useCaseFlowApprove.js +157 -0
  182. package/lib/hooks/useDataUserIdItem.d.ts +1 -0
  183. package/lib/hooks/useDataUserIdItem.js +1 -0
  184. package/lib/hooks/useDocumentOperations.d.ts +4 -0
  185. package/lib/hooks/useDocumentOperations.js +52 -10
  186. package/lib/hooks/useInputDialog.d.ts +2 -1
  187. package/lib/hooks/useMultiMasterDetailDcmts.d.ts +113 -0
  188. package/lib/hooks/useMultiMasterDetailDcmts.js +760 -0
  189. package/lib/hooks/useRelatedDocuments.d.ts +1 -0
  190. package/lib/hooks/useRelatedDocuments.js +22 -27
  191. package/lib/hooks/useShowDossiersV5.d.ts +12 -0
  192. package/lib/hooks/useShowDossiersV5.js +37 -0
  193. package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
  194. package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
  195. package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
  196. package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
  197. package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
  198. package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
  199. package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
  200. package/lib/hooks/useTMDistinctValuesSource.js +105 -0
  201. package/lib/index.d.ts +2 -0
  202. package/lib/index.js +5 -2
  203. package/lib/services/caseflow/CaseFlowService.d.ts +236 -0
  204. package/lib/services/caseflow/CaseFlowService.js +693 -0
  205. package/lib/services/caseflow/CaseFlowTemplateCacheService.d.ts +28 -0
  206. package/lib/services/caseflow/CaseFlowTemplateCacheService.js +121 -0
  207. package/lib/services/caseflow/caseFlowNameCache.d.ts +32 -0
  208. package/lib/services/caseflow/caseFlowNameCache.js +116 -0
  209. package/lib/services/caseflow/caseFlowWorkItemUtils.d.ts +61 -0
  210. package/lib/services/caseflow/caseFlowWorkItemUtils.js +113 -0
  211. package/lib/services/index.d.ts +4 -0
  212. package/lib/services/index.js +4 -0
  213. package/lib/services/platform_services.d.ts +4 -3
  214. package/package.json +9 -5
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { ValidationItem } from "@topconsultnpm/sdk-ts";
2
3
  export type Colors = 'error' | 'warning' | 'success' | 'info' | 'primary' | 'secondary' | 'tertiary' | 'standard';
3
4
  type IconModes = 'outside' | 'inside' | 'none';
@@ -6,6 +7,7 @@ export type Sizes = 'small' | 'medium' | 'large';
6
7
  export type TMEditorButtonData = {
7
8
  icon: any;
8
9
  text?: string;
10
+ tooltipContent?: React.ReactNode;
9
11
  onClick?: () => void;
10
12
  };
11
13
  export interface ITMEditorBase {
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { FileItem } from "./TMFileManagerUtils";
2
3
  import { TMContextMenuItemProps } from '../NewComponents/ContextMenu/types';
3
4
  interface TMFileManagerProps {
@@ -42,5 +43,5 @@ interface TMFileManagerProps {
42
43
  /** Optional: Callback to handle back button */
43
44
  onMaximizePanel?: () => void;
44
45
  }
45
- declare const TMFileManager: (props: TMFileManagerProps) => import("react/jsx-runtime").JSX.Element;
46
+ declare const TMFileManager: (props: TMFileManagerProps) => React.JSX.Element;
46
47
  export default TMFileManager;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useState } from "react";
3
- import { extractTextsFromDirectory, findFileItems, setFolderTreeViewItems } from "./TMFileManagerUtils";
3
+ import { extractTextsFromDirectory, findFileItems, resolveFileItemUserNames, setFolderTreeViewItems } from "./TMFileManagerUtils";
4
4
  import { DeviceType, useDeviceType } from "./TMDeviceProvider";
5
5
  import { formatBytes, Globalization, IconDashboard, IconFolder, IconHide, IconList, IconMenuVertical, IconRefresh, IconShow, SDKUI_Globals, SDKUI_Localizator, TMCommandsContextMenu, TMConditionalWrapper } from "../../helper";
6
6
  import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
@@ -91,10 +91,12 @@ const TMFileManager = (props) => {
91
91
  (Globalization.getDateTimeDisplayValue(item.lastUpdateTime)?.toLowerCase().toString().includes(searchText.toLowerCase().trim())) ||
92
92
  (Globalization.getDateTimeDisplayValue(item.creationTime)?.toLowerCase().toString().includes(searchText.toLowerCase().trim())) ||
93
93
  (item.version?.toString().includes(searchText.toLowerCase().trim()))));
94
- setFilteredFileItems(filtered);
94
+ // I nomi utente possono mancare quando la lista viene ricostruita senza i partecipanti
95
+ // (es. refresh dopo la condivisione di un file): vengono risolti qui dagli ID
96
+ setFilteredFileItems(filtered.map(item => resolveFileItemUserNames(item, allUsers)));
95
97
  };
96
98
  filterItems();
97
- }, [searchText, selectedFolder]);
99
+ }, [searchText, selectedFolder, allUsers]);
98
100
  // Callback to handle the "back" action (closing the draft list view)
99
101
  const onBackCallback = useCallback(() => {
100
102
  setOpenDraftList(false);
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { FileItem } from "./TMFileManagerUtils";
2
3
  import { UserDescriptor } from "@topconsultnpm/sdk-ts";
3
4
  import { TMContextMenuItemProps } from "../NewComponents/ContextMenu/types";
@@ -13,5 +14,5 @@ interface TMFileManagerDataGridViewProps {
13
14
  userID?: number;
14
15
  onDoubleClickHandler?: (fileItem: FileItem | undefined) => void;
15
16
  }
16
- declare const TMFileManagerDataGridView: (props: TMFileManagerDataGridViewProps) => import("react/jsx-runtime").JSX.Element;
17
+ declare const TMFileManagerDataGridView: (props: TMFileManagerDataGridViewProps) => React.JSX.Element;
17
18
  export default TMFileManagerDataGridView;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useState } from "react";
3
+ import { getFileItemLinkUrl } from "./TMFileManagerUtils";
3
4
  import { formatBytes, Globalization, renderHighlightedText, SDKUI_Localizator } from "../../helper";
4
5
  import TMDataGrid from "./TMDataGrid";
5
6
  import TMDcmtIcon from "../features/documents/TMDcmtIcon";
@@ -43,6 +44,12 @@ const TMFileManagerDataGridView = (props) => {
43
44
  }, [handleSelectedFiles]);
44
45
  // Handler for double-click cell event
45
46
  const onCellDblClick = useCallback((e) => {
47
+ // i link non hanno un documento da aprire: il doppio click (anche sull'icona dell'estensione) apre l'url in un nuovo tab
48
+ const linkUrl = getFileItemLinkUrl(e.data);
49
+ if (linkUrl) {
50
+ window.open(linkUrl, '_blank', 'noopener,noreferrer');
51
+ return;
52
+ }
46
53
  if (e.column.dataField === "ext")
47
54
  return;
48
55
  if (onDoubleClickHandler)
@@ -62,8 +69,10 @@ const TMFileManagerDataGridView = (props) => {
62
69
  }, [searchText, findCheckOutUserName]);
63
70
  const cellExtRender = useCallback((cellData) => {
64
71
  const item = cellData.data;
65
- const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", item.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", item.did ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", item.tid ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", item.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Extension, ":"] }), " ", item.ext ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", item.updaterName ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", item.version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(item.size ?? 0)] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.creationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime)] })] }));
66
- return _jsx(TMDcmtIcon, { tid: item.tid, did: item.did, fileExtension: item.ext, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent, isSigned: item.isSigned });
72
+ const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", item.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", item.did ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", item.tid ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", item.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Extension, ":"] }), " ", item.ext ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", item.updaterName ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", item.version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(item.size ?? 0)] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.creationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime)] }), item.description && _jsxs(_Fragment, { children: [_jsx("hr", {}), _jsxs("div", { style: { maxWidth: '400px', overflowWrap: 'anywhere' }, children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Description, ":"] }), " ", item.description] })] })] }));
73
+ // i link non hanno un file associato: l'icona non deve avviare il download
74
+ const isLink = getFileItemLinkUrl(item) !== undefined;
75
+ return _jsx(TMDcmtIcon, { tid: item.tid, did: item.did, fileExtension: item.ext, downloadMode: isLink ? 'none' : 'openInNewWindow', tooltipContent: tooltipContent, isSigned: item.isSigned });
67
76
  }, []);
68
77
  const cellDatetimeRender = useCallback((cellData) => {
69
78
  if (!cellData.value)
@@ -20,5 +20,5 @@ export interface TMFileManagerThumbnailItemsProps {
20
20
  onDoubleClick?: (file: FileItem) => void;
21
21
  userID?: number;
22
22
  }
23
- declare const TMFileManagerThumbnailItems: (props: TMFileManagerThumbnailItemsProps) => import("react/jsx-runtime").JSX.Element;
23
+ declare const TMFileManagerThumbnailItems: (props: TMFileManagerThumbnailItemsProps) => React.JSX.Element;
24
24
  export default TMFileManagerThumbnailItems;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useRef } from 'react';
3
- import { colors, TMFileItemContainer } from './TMFileManagerUtils';
3
+ import { colors, getFileItemLinkUrl, TMFileItemContainer } from './TMFileManagerUtils';
4
4
  import { formatBytes, Globalization, renderHighlightedText, SDKUI_Localizator } from '../../helper';
5
5
  import TMTooltip from './TMTooltip';
6
6
  import TMDcmtIcon from '../features/documents/TMDcmtIcon';
@@ -35,6 +35,16 @@ const TMFileManagerThumbnailItems = (props) => {
35
35
  }
36
36
  }
37
37
  }, [items, lastSelectedIndexRef.current]);
38
+ // Apre l'item: i link non hanno un documento da aprire, si apre direttamente l'url in un nuovo tab
39
+ const openFileItem = useCallback((item) => {
40
+ const linkUrl = getFileItemLinkUrl(item);
41
+ if (linkUrl) {
42
+ window.open(linkUrl, '_blank', 'noopener,noreferrer');
43
+ return;
44
+ }
45
+ if (onDoubleClick)
46
+ onDoubleClick(item);
47
+ }, [onDoubleClick]);
38
48
  const handleKeyDown = useCallback((event) => {
39
49
  event.preventDefault();
40
50
  if (event.key === 'ArrowDown' && lastSelectedIndexRef.current !== null) {
@@ -44,21 +54,21 @@ const TMFileManagerThumbnailItems = (props) => {
44
54
  lastSelectedIndexRef.current = currentIndex;
45
55
  }
46
56
  }
47
- if (event.key === 'Enter' && selectedFiles.length === 1 && onDoubleClick) {
57
+ if (event.key === 'Enter' && selectedFiles.length === 1) {
48
58
  const currentItem = items.find(item => item.id === selectedFiles[0].id);
49
59
  if (currentItem)
50
- onDoubleClick(currentItem);
60
+ openFileItem(currentItem);
51
61
  }
52
- }, [items, lastSelectedIndexRef.current, selectedFiles]);
62
+ }, [items, lastSelectedIndexRef.current, selectedFiles, openFileItem]);
53
63
  // Double click handler with timeout cleanup
54
64
  const onDoubleClickHandler = useCallback((item) => {
55
65
  if (clickTimeoutRef.current) {
56
66
  clearTimeout(clickTimeoutRef.current);
57
67
  clickTimeoutRef.current = null;
58
68
  }
59
- if (onDoubleClick && item)
60
- onDoubleClick(item);
61
- }, [onDoubleClick]);
69
+ if (item)
70
+ openFileItem(item);
71
+ }, [openFileItem]);
62
72
  const onClickHandler = useCallback((e, item) => {
63
73
  // If a click timeout is already running, clear it (distinguish between single and double clicks)
64
74
  if (clickTimeoutRef.current) {
@@ -144,8 +154,8 @@ const TMFileManagerThumbnailItems = (props) => {
144
154
  bgHoverColor = isSelected ? colors.PRIMARY_BLUE : "#fff59d";
145
155
  }
146
156
  const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", findCheckOutUserName(item) ?? '-', " (ID: ", item.checkOutUserID, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(item.checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", item.version ?? 1] }) }), _jsx("hr", {}), _jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Extension }), ": ", item.ext] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.CreationTime }), ": ", Globalization.getDateTimeDisplayValue(item.creationTime?.toString())] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.LastUpdateTime }), ": ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime?.toString())] })] })] })] });
147
- const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", item.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", item.did ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", item.tid ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", item.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Extension, ":"] }), " ", item.ext ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", item.updaterName ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", item.version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(item.size ?? 0)] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.creationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime)] })] }));
148
- return _jsx(TMFileItemContainer, { className: "tm-file-manager-thumbnail-items", ref: containerRef, id: "tm-file-manager-thumbnail-item-" + item.id.toString(), "$backgroundColor": bgColor, "$bgHoverColor": bgHoverColor, "$textColor": textColor, onDoubleClick: () => onDoubleClickHandler(item), onContextMenu: (e) => onContextMenu(e, item), onClick: (e) => onClickHandler(e, item), tabIndex: 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', width: '100%' }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', flex: 1, minWidth: 0 }, children: [_jsxs("div", { style: { marginRight: '16px', flexShrink: 0, display: 'flex', flexDirection: 'column', alignItems: 'center' }, children: [_jsx("div", { style: { width: '40px' }, children: _jsx(TMDcmtIcon, { tid: item.tid, did: item.did, fileExtension: item.ext, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent, isSigned: item.isSigned }) }), _jsxs("div", { style: { display: 'flex', justifyContent: 'center', width: '40px' }, children: [editMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: !isSelected ? colors.MEDIUM_GREEN : '#fff', fontWeight: "bold" }, className: "dx-icon-edit" }) }), lockMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: !isSelected ? colors.MEDIUM_GREEN : '#fff', fontWeight: "bold" }, className: "dx-icon-lock" }) })] })] }), _jsxs("div", { style: { overflow: 'hidden', minWidth: 0 }, children: [_jsx("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block', fontSize: '1rem', fontWeight: "bold" }, children: _jsx(TMTooltip, { parentStyle: { overflow: 'hidden' }, childStyle: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block' }, children: renderHighlightedText(item.name, searchText, isSelected) }) }), _jsx("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block', fontSize: 'calc(1rem - 1px)' }, children: formatBytes(item.size ?? 0) })] })] }), item.version && (_jsx("div", { style: { flexShrink: 0, marginLeft: '12px', whiteSpace: 'nowrap' }, children: _jsx(TMTooltip, { content: SDKUI_Localizator.Version, children: _jsx("div", { style: { border: "2px solid #28a745", backgroundColor: "#28a745", color: "#ffffff", borderRadius: '50%', width: '30px', height: '30px', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '12px', fontWeight: 'bold' }, children: item.version }) }) }))] }) }, "tm-file-manager-thumbnail-item-" + item.id);
157
+ const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", item.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", item.did ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", item.tid ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", item.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Extension, ":"] }), " ", item.ext ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", item.updaterName ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", item.version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(item.size ?? 0)] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.creationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime)] }), item.description && _jsxs(_Fragment, { children: [_jsx("hr", {}), _jsxs("div", { style: { maxWidth: '400px', overflowWrap: 'anywhere' }, children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Description, ":"] }), " ", item.description] })] })] }));
158
+ return _jsx(TMFileItemContainer, { className: "tm-file-manager-thumbnail-items", ref: containerRef, id: "tm-file-manager-thumbnail-item-" + item.id.toString(), "$backgroundColor": bgColor, "$bgHoverColor": bgHoverColor, "$textColor": textColor, onDoubleClick: () => onDoubleClickHandler(item), onContextMenu: (e) => onContextMenu(e, item), onClick: (e) => onClickHandler(e, item), tabIndex: 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', width: '100%' }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', flex: 1, minWidth: 0 }, children: [_jsxs("div", { style: { marginRight: '16px', flexShrink: 0, display: 'flex', flexDirection: 'column', alignItems: 'center' }, children: [_jsx("div", { style: { width: '40px' }, children: _jsx(TMDcmtIcon, { tid: item.tid, did: item.did, fileExtension: item.ext, downloadMode: getFileItemLinkUrl(item) !== undefined ? 'none' : 'openInNewWindow', tooltipContent: tooltipContent, isSigned: item.isSigned }) }), _jsxs("div", { style: { display: 'flex', justifyContent: 'center', width: '40px' }, children: [editMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: !isSelected ? colors.MEDIUM_GREEN : '#fff', fontWeight: "bold" }, className: "dx-icon-edit" }) }), lockMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: !isSelected ? colors.MEDIUM_GREEN : '#fff', fontWeight: "bold" }, className: "dx-icon-lock" }) })] })] }), _jsxs("div", { style: { overflow: 'hidden', minWidth: 0 }, children: [_jsx("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block', fontSize: '1rem', fontWeight: "bold" }, children: _jsx(TMTooltip, { parentStyle: { overflow: 'hidden' }, childStyle: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block' }, children: renderHighlightedText(item.name, searchText, isSelected) }) }), _jsx("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block', fontSize: 'calc(1rem - 1px)' }, children: formatBytes(item.size ?? 0) })] })] }), item.version && (_jsx("div", { style: { flexShrink: 0, marginLeft: '12px', whiteSpace: 'nowrap' }, children: _jsx(TMTooltip, { content: SDKUI_Localizator.Version, children: _jsx("div", { style: { border: "2px solid #28a745", backgroundColor: "#28a745", color: "#ffffff", borderRadius: '50%', width: '30px', height: '30px', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '12px', fontWeight: 'bold' }, children: item.version }) }) }))] }) }, "tm-file-manager-thumbnail-item-" + item.id);
149
159
  }) });
150
160
  };
151
161
  export default TMFileManagerThumbnailItems;
@@ -28,5 +28,5 @@ interface TMFileManagerThumbnailsViewProps {
28
28
  };
29
29
  }>>;
30
30
  }
31
- declare const TMFileManagerThumbnailsView: (props: TMFileManagerThumbnailsViewProps) => import("react/jsx-runtime").JSX.Element;
31
+ declare const TMFileManagerThumbnailsView: (props: TMFileManagerThumbnailsViewProps) => React.JSX.Element;
32
32
  export default TMFileManagerThumbnailsView;
@@ -26,6 +26,7 @@ export interface FileItem {
26
26
  version?: number;
27
27
  isSigned?: number;
28
28
  }
29
+ export declare const resolveFileItemUserNames: (item: FileItem, users: Array<UserDescriptor>) => FileItem;
29
30
  export interface TMFileManagerTreeViewDirectory {
30
31
  id: number;
31
32
  text: string;
@@ -47,15 +48,14 @@ export declare const colors: {
47
48
  LIGHT_YELLOW: string;
48
49
  MEDIUM_GREEN: string;
49
50
  };
50
- export declare const TMFileItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$backgroundColor" | "$textColor" | "$bgHoverColor"> & {
51
+ export declare const TMFileItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
52
+ style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
53
+ }, {
51
54
  $backgroundColor?: string;
52
55
  $textColor?: string;
53
56
  $bgHoverColor?: string;
54
- }, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$backgroundColor" | "$textColor" | "$bgHoverColor"> & {
55
- $backgroundColor?: string;
56
- $textColor?: string;
57
- $bgHoverColor?: string;
58
- }, never>>> & string;
57
+ }>> & string;
58
+ export declare const getFileItemLinkUrl: (fileItem: FileItem | undefined) => string | undefined;
59
59
  export declare const findFileItems: (items: Array<FileItem>, id: number) => FileItem | undefined;
60
60
  export declare const setFolderTreeViewItems: (items: Array<FileItem>) => Array<TMFileManagerTreeViewDirectory>;
61
61
  export declare const buildFolderHierarchy: (fileSystemTree: WGTreeDescriptor | undefined, draftsFile: SearchResultDescriptor | undefined, archivedDocuments: Array<SearchResultDescriptor> | undefined, participants: Array<UserDescriptor> | undefined) => {
@@ -1,5 +1,5 @@
1
1
  import styled from "styled-components";
2
- import { associateColumnsToRows, SIGNATURE_EXTENSIONS } from "../../helper";
2
+ import { associateColumnsToRows, SIGNATURE_EXTENSIONS, WHATS_NEWS_FILE_NAME, WHATS_NEWS_LINK_URL } from "../../helper";
3
3
  /**
4
4
  * Verifica se un'estensione indica che il file è firmato digitalmente.
5
5
  * Controlla se l'estensione (es. "pdf.p7m", ".p7m", "p7m") contiene
@@ -12,6 +12,22 @@ export const isSigned = (ext) => {
12
12
  const parts = normalized.split('.');
13
13
  return parts.some(part => SIGNATURE_EXTENSIONS.has(part));
14
14
  };
15
+ // Completa i nomi utente (autore e utente di check-out) di un FileItem quando mancano, risolvendoli dagli ID.
16
+ export const resolveFileItemUserNames = (item, users) => {
17
+ if (!users || users.length === 0)
18
+ return item;
19
+ const isValidUserID = (id) => id !== undefined && Number.isFinite(id) && id > 0;
20
+ const needsUpdaterName = !item.updaterName && isValidUserID(item.updaterID);
21
+ const needsCheckOutUserName = !item.checkOutUserName && isValidUserID(item.checkOutUserID);
22
+ if (!needsUpdaterName && !needsCheckOutUserName)
23
+ return item;
24
+ const resolved = { ...item };
25
+ if (needsUpdaterName)
26
+ resolved.updaterName = users.find(user => user.id === item.updaterID)?.name ?? item.updaterName;
27
+ if (needsCheckOutUserName)
28
+ resolved.checkOutUserName = users.find(user => user.id === item.checkOutUserID)?.name ?? item.checkOutUserName;
29
+ return resolved;
30
+ };
15
31
  export var TMFileManagerPageSize;
16
32
  (function (TMFileManagerPageSize) {
17
33
  TMFileManagerPageSize[TMFileManagerPageSize["Small"] = 30] = "Small";
@@ -47,6 +63,26 @@ export const TMFileItemContainer = styled.div `
47
63
  outline: none;
48
64
  }
49
65
  `;
66
+ // Confronto case-insensitive con il nome del file
67
+ const isWhatsNewsFileName = (name) => (name ?? '').toLowerCase() === WHATS_NEWS_FILE_NAME;
68
+ // Ritorna l'url del link associato al file: un file il cui metadato "description" contiene un url http/https
69
+ // e' un link, quindi non ha un file/documento da scaricare o da aprire nella form: si apre direttamente l'url
70
+ export const getFileItemLinkUrl = (fileItem) => {
71
+ if (!fileItem || fileItem.isDirectory)
72
+ return undefined;
73
+ if (isWhatsNewsFileName(fileItem.name))
74
+ return WHATS_NEWS_LINK_URL;
75
+ const value = fileItem.description?.trim();
76
+ if (!value)
77
+ return undefined;
78
+ try {
79
+ const url = new URL(value);
80
+ return (url.protocol === 'http:' || url.protocol === 'https:') ? url.href : undefined;
81
+ }
82
+ catch {
83
+ return undefined;
84
+ }
85
+ };
50
86
  // Function to find a specific file or folder based on its ID (used for finding nested items)
51
87
  export const findFileItems = (items, id) => {
52
88
  for (let item of items) {
@@ -17,7 +17,7 @@ declare const TMCard: ({ borderRadius, onClick, scrollX, scrollY, width, height,
17
17
  scroll?: boolean;
18
18
  backgroundColor?: string;
19
19
  color?: string;
20
- }) => import("react/jsx-runtime").JSX.Element;
20
+ }) => React.JSX.Element;
21
21
  declare const TMSplitterLayout: ({ animation, showSeparator, separatorColor, overflow, separatorActiveColor, separatorSize, direction, children, start, min, }: {
22
22
  animation?: boolean;
23
23
  separatorColor?: string;
@@ -29,7 +29,7 @@ declare const TMSplitterLayout: ({ animation, showSeparator, separatorColor, ove
29
29
  children?: React.ReactNode;
30
30
  start?: string[];
31
31
  min?: string[];
32
- }) => import("react/jsx-runtime").JSX.Element;
32
+ }) => React.JSX.Element;
33
33
  declare const TMLayoutItem: ({ onClick, children, width, minWidth, maxWidth, maxHeight, height, minHeight }: {
34
34
  onClick?: () => void;
35
35
  children: React.ReactNode;
@@ -40,7 +40,7 @@ declare const TMLayoutItem: ({ onClick, children, width, minWidth, maxWidth, max
40
40
  fixed?: boolean;
41
41
  height?: string;
42
42
  minHeight?: string;
43
- }) => import("react/jsx-runtime").JSX.Element;
43
+ }) => React.JSX.Element;
44
44
  export interface ITMLayoutContainerProps {
45
45
  children: React.ReactNode;
46
46
  gap?: number;
@@ -50,6 +50,6 @@ export interface ITMLayoutContainerProps {
50
50
  onClick?: () => void;
51
51
  onContextMenu?: (e: React.MouseEvent) => void;
52
52
  }
53
- declare const TMLayoutContainer: ({ gap, onClick, justifyContent, alignItems, children, direction, onContextMenu }: ITMLayoutContainerProps) => import("react/jsx-runtime").JSX.Element;
53
+ declare const TMLayoutContainer: ({ gap, onClick, justifyContent, alignItems, children, direction, onContextMenu }: ITMLayoutContainerProps) => React.JSX.Element;
54
54
  export { TMCard, TMLayoutItem, TMSplitterLayout };
55
55
  export default TMLayoutContainer;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  interface ITMListItem {
2
3
  icon: any;
3
4
  text?: string;
@@ -5,5 +6,5 @@ interface ITMListItem {
5
6
  }
6
7
  declare const TMList: ({ items }: {
7
8
  items: ITMListItem[];
8
- }) => import("react/jsx-runtime").JSX.Element;
9
+ }) => React.JSX.Element;
9
10
  export default TMList;
@@ -37,6 +37,6 @@ interface ListProps<T> {
37
37
  onItemDblClick?: (item: T) => void;
38
38
  itemTemplate?: (item: T) => JSX.Element;
39
39
  }
40
- declare const TMListView: <T>({ customGroupingHeaders, headerBackGroundColor, header, showId, setShowId, showSearch, setShowSearch, grouping, orderBy, id, onScrollChange, scroll, searchKeys, searchable, itemTemplate, customColor, dataSource, exprKey, onSelectionChanged, onItemClick, onItemDblClick, selectedItem, autoScrollToSelectedItem }: ListProps<T>) => import("react/jsx-runtime").JSX.Element;
40
+ declare const TMListView: <T>({ customGroupingHeaders, headerBackGroundColor, header, showId, setShowId, showSearch, setShowSearch, grouping, orderBy, id, onScrollChange, scroll, searchKeys, searchable, itemTemplate, customColor, dataSource, exprKey, onSelectionChanged, onItemClick, onItemDblClick, selectedItem, autoScrollToSelectedItem }: ListProps<T>) => React.JSX.Element;
41
41
  export default TMListView;
42
42
  export declare const CustomListViewHeader: React.FC<ITMListViewHeader>;
@@ -14,6 +14,17 @@ interface ITMModal {
14
14
  askClosingConfirm?: boolean;
15
15
  showCloseButton?: boolean;
16
16
  showHeader?: boolean;
17
+ /** Se true, ricentra il popup ogni volta che cambiano width/height, annullando lo spostamento manuale */
18
+ recenterOnResize?: boolean;
19
+ /** Contenuto aggiuntivo nella barra del titolo, prima del pulsante di chiusura (es. un menu di opzioni) */
20
+ titleActions?: React.ReactNode;
21
+ /** Dimensioni in px al termine di un ridimensionamento manuale */
22
+ onResized?: (size: {
23
+ width: number;
24
+ height: number;
25
+ }) => void;
26
+ /** A ogni cambio di valore le dimensioni tornano a `width`/`height`, anche se invariate */
27
+ sizeResetToken?: number | string;
17
28
  }
18
29
  declare const TMModal: React.FC<ITMModal>;
19
30
  export default TMModal;
@@ -1,10 +1,13 @@
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, useEffect, useRef } from 'react';
3
3
  import { Popup } from 'devextreme-react';
4
+ import { ToolbarItem } from 'devextreme-react/popup';
4
5
  import styled from 'styled-components';
5
6
  import { TMCard } from './TMLayout';
6
7
  import { FontSize, TMColors } from '../../utils/theme';
7
8
  import { IconWindowMaximize, IconWindowMinimize, svgToString } from '../../helper';
9
+ /** Valori di `height` con cui il popup si dimensiona sul contenuto (vedi applyContentFillLayout) */
10
+ const CONTENT_DRIVEN_HEIGHTS = ['auto', 'max-content', 'min-content', 'fit-content'];
8
11
  const StyledModal = styled.div `
9
12
  width: ${props => props.$width};
10
13
  height: ${props => props.$height};
@@ -39,10 +42,13 @@ const StyledModalContext = styled.div `
39
42
  overflow: auto;
40
43
  height: 100%;
41
44
  `;
42
- const TMModal = ({ resizable = true, expandable = false, isModal = true, title = '', toolbar, onClose, children, width = '100%', height = '100%', fontSize = FontSize.defaultFontSize, hidePopup = true, askClosingConfirm = false, showCloseButton = true, showHeader = true }) => {
45
+ const TMModal = ({ resizable = true, expandable = false, isModal = true, title = '', toolbar, onClose, children, width = '100%', height = '100%', fontSize = FontSize.defaultFontSize, hidePopup = true, askClosingConfirm = false, showCloseButton = true, showHeader = true, recenterOnResize = false, titleActions, onResized, sizeResetToken }) => {
43
46
  const popupRef = useRef(null);
44
47
  const [initialWidth, setInitialWidth] = useState(width);
45
48
  const [initialHeight, setInitialHeight] = useState(height);
49
+ // Posizione controllata: un nuovo riferimento oggetto forza DevExtreme a riposizionare (ricentrare).
50
+ // Lasciata invariata durante il drag, così lo spostamento manuale viene preservato
51
+ const [position, setPosition] = useState(undefined);
46
52
  const [showPopup, setShowPopup] = useState(false);
47
53
  const [isResizing, setIsResizing] = useState(false);
48
54
  const [isFullScreen, setIsFullScreen] = useState(false);
@@ -51,6 +57,26 @@ const TMModal = ({ resizable = true, expandable = false, isModal = true, title =
51
57
  const DEFAULT_MIN_HEIGHT = 400;
52
58
  const [minWidth, setMinWidth] = useState(0);
53
59
  const [minHeight, setMinHeight] = useState(0);
60
+ /**
61
+ * DevExtreme fissa in px l'altezza del contenuto del popup: se le dimensioni cambiano a popup
62
+ * già aperto (es. cambio step) resta quella del passo precedente e sotto rimane spazio vuoto.
63
+ * Come figlio flex il contenuto riempie il popup senza dipendere da quel calcolo.
64
+ * Non si applica alle altezze dimensionate sul contenuto (`auto`, `max-content`, ...):
65
+ * lì è il contenuto a dare l'altezza al popup e non c'è spazio da riempire.
66
+ */
67
+ const applyContentFillLayout = () => {
68
+ const content = popupRef.current?.instance()?.content();
69
+ const overlayContent = content?.parentElement;
70
+ if (!content || !overlayContent)
71
+ return;
72
+ const fill = !CONTENT_DRIVEN_HEIGHTS.some(value => initialHeight.trim().startsWith(value));
73
+ overlayContent.style.display = fill ? 'flex' : '';
74
+ overlayContent.style.flexDirection = fill ? 'column' : '';
75
+ content.style.flex = fill ? '1 1 auto' : '';
76
+ // Testata e toolbar inferiore restano alla loro altezza naturale
77
+ overlayContent.querySelectorAll(':scope > .dx-popup-title, :scope > .dx-popup-bottom')
78
+ .forEach(el => { el.style.flexShrink = fill ? '0' : ''; });
79
+ };
54
80
  /**
55
81
  * Gestore chiamato quando il popup viene mostrato.
56
82
  * Calcola e imposta le dimensioni minime del popup in base allo spazio disponibile.
@@ -59,6 +85,7 @@ const TMModal = ({ resizable = true, expandable = false, isModal = true, title =
59
85
  const handleShown = () => {
60
86
  // Usa requestAnimationFrame per attendere il completamento del rendering
61
87
  requestAnimationFrame(() => {
88
+ applyContentFillLayout();
62
89
  if (popupRef.current && popupRef.current.instance) {
63
90
  const instance = popupRef.current.instance();
64
91
  if (instance) {
@@ -85,14 +112,27 @@ const TMModal = ({ resizable = true, expandable = false, isModal = true, title =
85
112
  useEffect(() => {
86
113
  setInitialWidth(width);
87
114
  setInitialHeight(height);
88
- }, [width, height]);
115
+ // Al cambio di dimensioni (es. cambio step) ricentra il popup con un nuovo riferimento oggetto,
116
+ // annullando l'eventuale spostamento manuale precedente
117
+ if (recenterOnResize)
118
+ setPosition({ my: 'center', at: 'center', of: window });
119
+ // Il token annulla un ridimensionamento manuale, che non cambia width/height
120
+ }, [width, height, recenterOnResize, sizeResetToken]);
121
+ // Dimensioni, testata e schermo pieno fanno rigenerare geometria ed elementi del popup:
122
+ // il layout flex del contenuto va riapplicato dopo il ridisegno (vedi applyContentFillLayout)
123
+ useEffect(() => {
124
+ const rafId = requestAnimationFrame(() => applyContentFillLayout());
125
+ return () => cancelAnimationFrame(rafId);
126
+ }, [initialWidth, initialHeight, title, isFullScreen, showPopup]);
89
127
  const handleResizeStart = () => {
90
128
  setIsResizing(true);
91
129
  };
92
130
  const handleResizeEnd = (e) => {
93
131
  setIsResizing(false);
94
- setInitialWidth(e.width.toString());
95
- setInitialHeight(e.height.toString());
132
+ // Le dimensioni arrivano in px: senza unità non sarebbero un valore CSS valido
133
+ setInitialWidth(`${e.width}px`);
134
+ setInitialHeight(`${e.height}px`);
135
+ onResized?.({ width: e.width, height: e.height });
96
136
  };
97
137
  const onHiding = (e) => {
98
138
  if (askClosingConfirm)
@@ -101,15 +141,9 @@ const TMModal = ({ resizable = true, expandable = false, isModal = true, title =
101
141
  setShowPopup(false);
102
142
  onClose && onClose();
103
143
  };
104
- return (_jsx(_Fragment, { children: isModal ? (_jsx(Popup, { ref: popupRef, showCloseButton: showHeader ? showCloseButton : false, showTitle: showHeader, animation: undefined, minWidth: minWidth, minHeight: minHeight, maxHeight: '95%', maxWidth: '95%', dragEnabled: !isResizing && !isFullScreen, resizeEnabled: resizable && !isFullScreen, position: expandable && isFullScreen ? { my: 'center', at: 'center', of: window } : undefined, width: expandable && isFullScreen ? '95%' : initialWidth, height: expandable && isFullScreen ? '95%' : initialHeight, title: title, visible: showPopup, onShown: handleShown, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd, onHiding: onHiding, toolbarItems: showHeader && expandable ? [
105
- {
106
- widget: 'dxButton',
107
- location: 'after',
108
- options: {
144
+ return (_jsx(_Fragment, { children: isModal ? (_jsxs(Popup, { ref: popupRef, showCloseButton: showHeader ? showCloseButton : false, showTitle: showHeader, animation: undefined, minWidth: minWidth, minHeight: minHeight, maxHeight: '95%', maxWidth: '95%', dragEnabled: !isResizing && !isFullScreen, resizeEnabled: resizable && !isFullScreen, position: expandable && isFullScreen ? { my: 'center', at: 'center', of: window } : position, width: expandable && isFullScreen ? '95%' : initialWidth, height: expandable && isFullScreen ? '95%' : initialHeight, title: title, visible: showPopup, onShown: handleShown, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd, onHiding: onHiding, children: [showHeader && titleActions && (_jsx(ToolbarItem, { toolbar: 'top', location: 'after', render: () => _jsx(_Fragment, { children: titleActions }) })), showHeader && expandable && (_jsx(ToolbarItem, { toolbar: 'top', location: 'after', widget: 'dxButton', options: {
109
145
  icon: isFullScreen ? svgToString(_jsx(IconWindowMinimize, {})) : svgToString(_jsx(IconWindowMaximize, {})),
110
146
  onClick: () => setIsFullScreen(!isFullScreen)
111
- }
112
- }
113
- ] : undefined, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', width: '100%' }, children: [toolbar && (_jsx(StyledModalToolbar, { children: toolbar })), _jsx("div", { style: { flex: 1, overflow: 'hidden', minHeight: 0 }, children: _jsx(TMCard, { showBorder: false, padding: false, scrollY: true, children: children }) })] }) })) : (_jsxs(StyledModal, { "$isModal": isModal, className: "temp-modal", "$fontSize": fontSize, "$width": initialWidth, "$height": initialHeight, children: [toolbar ? _jsx(StyledModalToolbar, { children: toolbar }) : _jsx(_Fragment, {}), _jsx(StyledModalContext, { children: children })] })) }));
147
+ } })), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', width: '100%' }, children: [toolbar && (_jsx(StyledModalToolbar, { children: toolbar })), _jsx("div", { style: { flex: 1, overflow: 'hidden', minHeight: 0 }, children: _jsx(TMCard, { showBorder: false, padding: false, scrollY: true, children: children }) })] })] })) : (_jsxs(StyledModal, { "$isModal": isModal, className: "temp-modal", "$fontSize": fontSize, "$width": initialWidth, "$height": initialHeight, children: [toolbar ? _jsx(StyledModalToolbar, { children: toolbar }) : _jsx(_Fragment, {}), _jsx(StyledModalContext, { children: children })] })) }));
114
148
  };
115
149
  export default TMModal;
@@ -10,6 +10,7 @@ export interface ITMPanelProps {
10
10
  children?: React.ReactNode;
11
11
  showHeader?: boolean;
12
12
  title?: React.ReactNode;
13
+ enableTitleMarquee?: boolean;
13
14
  displayedItemsCount?: number;
14
15
  totalItems?: number;
15
16
  toolbar?: any;
@@ -17,9 +18,14 @@ export interface ITMPanelProps {
17
18
  isVisible?: boolean;
18
19
  panelID?: string;
19
20
  isActive?: boolean;
21
+ /** Se fornita, in testata compare il bottone di ricarica: finché la Promise è pendente il pannello mostra il loader */
22
+ onRefresh?: () => void | Promise<void>;
23
+ /** Mostra il loader sul contenuto anche per caricamenti non avviati dal bottone di ricarica */
24
+ isRefreshing?: boolean;
20
25
  onActivate?: (panelID: string) => void;
21
26
  onActiveChanged?: (isActive: boolean) => void;
22
27
  onBack?: () => void;
28
+ backCaption?: string;
23
29
  onClose?: () => void;
24
30
  onHeaderDoubleClick?: () => void;
25
31
  onMaximize?: (isMaximized: boolean) => void;