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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/lib/assets/Toppy-help-center.png +0 -0
  2. package/lib/assets/headergradient.svg +87 -0
  3. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +322 -30
  4. package/lib/components/NewComponents/ContextMenu/hooks.d.ts +8 -1
  5. package/lib/components/NewComponents/ContextMenu/hooks.js +80 -8
  6. package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
  7. package/lib/components/NewComponents/ContextMenu/index.js +2 -0
  8. package/lib/components/NewComponents/ContextMenu/styles.d.ts +9 -1
  9. package/lib/components/NewComponents/ContextMenu/styles.js +146 -47
  10. package/lib/components/NewComponents/ContextMenu/types.d.ts +22 -3
  11. package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
  12. package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
  13. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +620 -125
  14. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +25 -5
  15. package/lib/components/NewComponents/FloatingMenuBar/styles.js +215 -59
  16. package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +12 -3
  17. package/lib/components/base/TMAccordionNew.js +35 -14
  18. package/lib/components/base/TMButton.js +6 -0
  19. package/lib/components/base/TMClosableList.js +4 -0
  20. package/lib/components/base/TMCustomButton.js +61 -17
  21. package/lib/components/base/TMDataGrid.d.ts +7 -4
  22. package/lib/components/base/TMDataGrid.js +153 -11
  23. package/lib/components/base/TMDropDownMenu.js +21 -18
  24. package/lib/components/base/TMFileManager.d.ts +4 -3
  25. package/lib/components/base/TMFileManager.js +32 -24
  26. package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
  27. package/lib/components/base/TMFileManagerDataGridView.js +1 -11
  28. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
  29. package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
  30. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
  31. package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
  32. package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
  33. package/lib/components/base/TMListView.js +33 -15
  34. package/lib/components/base/TMPanel.d.ts +1 -1
  35. package/lib/components/base/TMPanel.js +4 -2
  36. package/lib/components/base/TMPopUp.js +6 -0
  37. package/lib/components/base/TMToolbarCard.js +2 -0
  38. package/lib/components/base/TMTreeView.d.ts +2 -1
  39. package/lib/components/base/TMTreeView.js +33 -26
  40. package/lib/components/choosers/TMDataListItemChooser.d.ts +2 -0
  41. package/lib/components/choosers/TMDataListItemChooser.js +8 -2
  42. package/lib/components/choosers/TMDcmtTypeChooser.d.ts +1 -0
  43. package/lib/components/choosers/TMDcmtTypeChooser.js +11 -3
  44. package/lib/components/choosers/TMDistinctValues.js +2 -2
  45. package/lib/components/choosers/TMDynDataListItemChooser.d.ts +2 -0
  46. package/lib/components/choosers/TMDynDataListItemChooser.js +8 -2
  47. package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
  48. package/lib/components/choosers/TMMetadataChooser.d.ts +2 -0
  49. package/lib/components/choosers/TMMetadataChooser.js +19 -4
  50. package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
  51. package/lib/components/choosers/TMUserChooser.d.ts +2 -5
  52. package/lib/components/choosers/TMUserChooser.js +33 -47
  53. package/lib/components/editors/TMCheckBox.js +2 -0
  54. package/lib/components/editors/TMDateBox.js +18 -9
  55. package/lib/components/editors/TMEditorStyled.js +7 -0
  56. package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
  57. package/lib/components/editors/TMLocalizedTextBox.js +16 -14
  58. package/lib/components/editors/TMMetadataEditor.d.ts +1 -0
  59. package/lib/components/editors/TMMetadataEditor.js +4 -4
  60. package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
  61. package/lib/components/editors/TMMetadataTextBox.js +92 -0
  62. package/lib/components/editors/TMMetadataValues.d.ts +2 -0
  63. package/lib/components/editors/TMMetadataValues.js +26 -8
  64. package/lib/components/editors/TMRadioButton.js +2 -0
  65. package/lib/components/editors/TMTextArea.js +18 -30
  66. package/lib/components/editors/TMTextBox.d.ts +1 -1
  67. package/lib/components/editors/TMTextBox.js +29 -4
  68. package/lib/components/editors/TMTextExpression.js +6 -91
  69. package/lib/components/features/archive/TMArchive.js +2 -2
  70. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
  71. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +462 -0
  72. package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
  73. package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
  74. package/lib/components/features/documents/TMDcmtBlog.js +1 -1
  75. package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
  76. package/lib/components/features/documents/TMDcmtForm.js +576 -292
  77. package/lib/components/features/documents/TMDcmtPreview.js +42 -155
  78. package/lib/components/features/documents/TMDcmtTasks.js +9 -9
  79. package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
  80. package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
  81. package/lib/components/features/documents/TMRelationViewer.js +2 -2
  82. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
  83. package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +2 -2
  84. package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
  85. package/lib/components/features/search/TMSearch.d.ts +3 -0
  86. package/lib/components/features/search/TMSearch.js +50 -11
  87. package/lib/components/features/search/TMSearchQueryEditor.d.ts +1 -0
  88. package/lib/components/features/search/TMSearchQueryEditor.js +10 -10
  89. package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
  90. package/lib/components/features/search/TMSearchQueryPanel.js +40 -25
  91. package/lib/components/features/search/TMSearchResult.d.ts +3 -0
  92. package/lib/components/features/search/TMSearchResult.js +370 -252
  93. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
  94. package/lib/components/features/search/TMSearchResultsMenuItems.js +227 -171
  95. package/lib/components/features/search/TMSignSettingsForm.js +1 -1
  96. package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
  97. package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
  98. package/lib/components/features/search/TMViewHistoryDcmt.js +47 -52
  99. package/lib/components/features/tasks/TMTaskForm.js +75 -25
  100. package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
  101. package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
  102. package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
  103. package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
  104. package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
  105. package/lib/components/features/tasks/TMTasksUtils.js +57 -37
  106. package/lib/components/features/tasks/TMTasksView.js +28 -19
  107. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
  108. package/lib/components/features/workflow/TMWorkflowPopup.js +140 -34
  109. package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
  110. package/lib/components/features/workflow/diagram/DiagramItemComponent.js +14 -7
  111. package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
  112. package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
  113. package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
  114. package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
  115. package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
  116. package/lib/components/forms/Login/LoginValidatorService.js +7 -2
  117. package/lib/components/forms/Login/TMLoginForm.js +35 -7
  118. package/lib/components/forms/TMChooserForm.js +1 -1
  119. package/lib/components/grids/TMBlogsPost.js +56 -31
  120. package/lib/components/grids/TMRecentsManager.js +20 -10
  121. package/lib/components/grids/TMValidationItemsList.js +6 -0
  122. package/lib/components/index.d.ts +6 -3
  123. package/lib/components/index.js +6 -3
  124. package/lib/components/layout/panelManager/TMPanelManagerContext.js +13 -5
  125. package/lib/components/query/TMQueryEditor.d.ts +6 -1
  126. package/lib/components/query/TMQueryEditor.js +105 -101
  127. package/lib/components/settings/SettingsAppearance.d.ts +2 -1
  128. package/lib/components/settings/SettingsAppearance.js +99 -30
  129. package/lib/components/sidebar/TMHeader.js +11 -7
  130. package/lib/components/sidebar/TMSidebar.d.ts +0 -1
  131. package/lib/components/sidebar/TMSidebar.js +16 -44
  132. package/lib/components/sidebar/TMSidebarItem.js +36 -17
  133. package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
  134. package/lib/components/viewers/TMDataListItemViewer.js +35 -71
  135. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
  136. package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
  137. package/lib/css/tm-sdkui.css +1 -1
  138. package/lib/helper/SDKUI_Globals.d.ts +22 -0
  139. package/lib/helper/SDKUI_Globals.js +10 -1
  140. package/lib/helper/SDKUI_Localizator.d.ts +21 -3
  141. package/lib/helper/SDKUI_Localizator.js +196 -10
  142. package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
  143. package/lib/helper/TMCommandsContextMenu.js +15 -4
  144. package/lib/helper/TMIcons.d.ts +4 -0
  145. package/lib/helper/TMIcons.js +13 -3
  146. package/lib/helper/TMPdfViewer.d.ts +8 -0
  147. package/lib/helper/TMPdfViewer.js +373 -0
  148. package/lib/helper/TMToppyMessage.js +4 -0
  149. package/lib/helper/checkinCheckoutManager.d.ts +31 -1
  150. package/lib/helper/checkinCheckoutManager.js +112 -30
  151. package/lib/helper/devextremeCustomMessages.d.ts +30 -0
  152. package/lib/helper/devextremeCustomMessages.js +30 -0
  153. package/lib/helper/helpers.d.ts +30 -2
  154. package/lib/helper/helpers.js +132 -4
  155. package/lib/helper/index.d.ts +2 -0
  156. package/lib/helper/index.js +2 -0
  157. package/lib/helper/queryHelper.d.ts +2 -2
  158. package/lib/helper/queryHelper.js +80 -24
  159. package/lib/helper/workItemsHelper.d.ts +6 -0
  160. package/lib/helper/workItemsHelper.js +230 -0
  161. package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
  162. package/lib/hooks/useCheckInOutOperations.js +223 -0
  163. package/lib/hooks/useDataListItem.d.ts +12 -0
  164. package/lib/hooks/useDataListItem.js +132 -0
  165. package/lib/hooks/useDataUserIdItem.d.ts +10 -0
  166. package/lib/hooks/useDataUserIdItem.js +96 -0
  167. package/lib/hooks/useFloatingBarPinnedItems.d.ts +11 -0
  168. package/lib/hooks/useFloatingBarPinnedItems.js +54 -0
  169. package/lib/hooks/useMetadataExpression.d.ts +19 -0
  170. package/lib/hooks/useMetadataExpression.js +99 -0
  171. package/lib/hooks/useSettingsFeedback.d.ts +11 -0
  172. package/lib/hooks/useSettingsFeedback.js +38 -0
  173. package/lib/hooks/useWorkflowApprove.d.ts +4 -0
  174. package/lib/hooks/useWorkflowApprove.js +14 -1
  175. package/lib/index.d.ts +1 -0
  176. package/lib/index.js +3 -2
  177. package/lib/services/platform_services.d.ts +3 -3
  178. package/lib/ts/types.d.ts +61 -1
  179. package/lib/utils/theme.d.ts +1 -1
  180. package/lib/utils/theme.js +1 -1
  181. package/package.json +8 -6
  182. package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
  183. package/lib/components/NewComponents/Notification/Notification.js +0 -60
  184. package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
  185. package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
  186. package/lib/components/NewComponents/Notification/index.d.ts +0 -2
  187. package/lib/components/NewComponents/Notification/index.js +0 -2
  188. package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
  189. package/lib/components/NewComponents/Notification/styles.js +0 -180
  190. package/lib/components/NewComponents/Notification/types.d.ts +0 -18
  191. package/lib/components/NewComponents/Notification/types.js +0 -1
  192. package/lib/components/base/TMContextMenu.d.ts +0 -25
  193. package/lib/components/base/TMContextMenu.js +0 -109
  194. package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
  195. package/lib/components/base/TMContextMenuOLD.js +0 -56
  196. package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
  197. package/lib/components/base/TMFloatingToolbar.js +0 -101
  198. package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
  199. package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
  200. package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
  201. package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
  202. package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
@@ -2,22 +2,20 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useRef, useState } from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, FileFormats } from '@topconsultnpm/sdk-ts';
5
- import { extensionHandler, sleep, getExceptionMessage, formatBytes, IconMenuVertical, IconCloseCircle, IconClear, IconCloseOutline, IconPreview, SDKUI_Globals, IconZoomOutLinear, IconZoomInLinear, IconPrintOutline, SDKUI_Localizator, IconRefresh } from '../../../helper';
5
+ import { extensionHandler, sleep, getExceptionMessage, formatBytes, IconMenuVertical, IconCloseCircle, IconClear, IconCloseOutline, IconPreview, SDKUI_Globals, IconZoomOutLinear, IconZoomInLinear, IconPrintOutline, SDKUI_Localizator, IconRefresh, IconCache } from '../../../helper';
6
6
  import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
7
7
  import { FileExtensionHandler, FormModes } from '../../../ts';
8
8
  import { TMColors } from '../../../utils/theme';
9
9
  import ShowAlert from '../../base/TMAlert';
10
10
  import TMButton from '../../base/TMButton';
11
- import TMDropDownMenu from '../../base/TMDropDownMenu';
12
11
  import { TMExceptionBoxManager } from '../../base/TMPopUp';
13
12
  import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
14
13
  import { TMSaveFormButtonPrevious, TMSaveFormButtonNext } from '../../forms/TMSaveForm';
15
14
  import { StyledAnimatedComponentOpacity } from '../../base/Styled';
16
15
  import TMPanel from '../../base/TMPanel';
17
16
  import TMTooltip from '../../base/TMTooltip';
18
- import { Document, Page, pdfjs } from 'react-pdf';
19
- // Configure PDF.js worker
20
- pdfjs.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;
17
+ import { ContextMenu } from '../../NewComponents/ContextMenu';
18
+ import TMPdfViewer from '../../../helper/TMPdfViewer';
21
19
  const ErrorContent = ({ error, isAbortError, onRetry }) => {
22
20
  if (isAbortError) {
23
21
  return (_jsx(StyledAnimatedComponentOpacity, { style: { width: '100%', height: '100%' }, children: _jsxs(StyledPanelStatusContainer, { children: [_jsx(IconCloseOutline, { fontSize: 92, color: TMColors.error }), _jsxs(StyledPreviewNotAvailable, { children: [_jsx("div", { children: error }), _jsx("div", { children: SDKUI_Localizator.PreviewNotAvailable })] }), _jsx(TMButton, { caption: SDKUI_Localizator.TryAgain, onClick: onRetry, showTooltip: false })] }) }));
@@ -109,8 +107,9 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
109
107
  extensionInfo = '';
110
108
  title += extensionInfo;
111
109
  title += dcmtData.fileSize && dcmtData.fileSize > 0 ? formatBytes(dcmtData.fileSize) + ')' : '';
112
- if ((isDcmtFileInCache(cacheKey) && isFromCache)) {
113
- title += ' | da cache';
110
+ const isCached = isDcmtFileInCache(cacheKey) && isFromCache;
111
+ if (isCached) {
112
+ return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '3px' }, children: [title, _jsx(TMTooltip, { content: "da cache", children: _jsx(IconCache, { fontSize: 13 }) })] }));
114
113
  }
115
114
  return title;
116
115
  };
@@ -127,10 +126,11 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
127
126
  console.error('Error reopening document:', error);
128
127
  }
129
128
  };
130
- return (_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsx(TMPanel, { padding: '0', title: titleHandler(), onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, toolbar: _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [onPrev && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), onNext && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(StyledHeaderIcon, { "$color": TMColors.primaryColor, children: _jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'icon', caption: 'Altro', icon: _jsx(IconMenuVertical, {}), showTooltip: false }), items: [
131
- { icon: _jsx(IconCloseCircle, {}), text: SDKUI_Localizator.RemoveFromCache, onClick: () => { removeDcmtsFileCache(cacheKey); setIsFromCache(false); } },
132
- { icon: _jsx(IconClear, {}), text: SDKUI_Localizator.ClearCache, onClick: () => { clearDcmtsFileCache(); setIsFromCache(false); } },
133
- ] }, "btn13") }), _jsx(StyledHeaderIcon, { onClick: reOpenDcmt, "$color": TMColors.primaryColor, children: _jsx(TMTooltip, { content: SDKUI_Localizator.ReopenDocument, children: _jsx(IconRefresh, {}) }) })] }), children: error
129
+ const cacheMenuItems = useMemo(() => [
130
+ { icon: _jsx(IconCloseCircle, {}), name: SDKUI_Localizator.RemoveFromCache, onClick: () => { removeDcmtsFileCache(cacheKey); setIsFromCache(false); } },
131
+ { icon: _jsx(IconClear, {}), name: SDKUI_Localizator.ClearCache, onClick: () => { clearDcmtsFileCache(); setIsFromCache(false); } },
132
+ ], [cacheKey, removeDcmtsFileCache, clearDcmtsFileCache, setIsFromCache]);
133
+ return (_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsx(TMPanel, { padding: '0', title: titleHandler(), onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, toolbar: _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [onPrev && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), onNext && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(StyledHeaderIcon, { "$color": TMColors.primaryColor, children: _jsx(ContextMenu, { items: cacheMenuItems, trigger: "left", children: _jsx(IconMenuVertical, {}) }) }), _jsx(StyledHeaderIcon, { onClick: reOpenDcmt, "$color": TMColors.primaryColor, children: _jsx(TMTooltip, { content: SDKUI_Localizator.ReopenDocument, children: _jsx(IconRefresh, {}) }) })] }), children: error
134
134
  ? _jsx(ErrorContent, { error: error, isAbortError: isAbortError, onRetry: reOpenDcmt })
135
135
  : renderedPreview(dcmtData?.tid, dcmtData?.did, dcmtData?.fileExt, dcmtData?.fileSize, dcmtData?.fileCount, extensionHandler(dcmtData?.fileExt), showPreview, isResizingActive, () => { loadDocumentWithCache(); setShowPreview(true); }, dcmtBlob) }) }));
136
136
  };
@@ -139,41 +139,15 @@ export const TMFileViewer = ({ fileBlob, isResizingActive }) => {
139
139
  const [blobUrl, setBlobUrl] = useState(undefined);
140
140
  const [fileType, setFileType] = useState(undefined);
141
141
  const [formattedXml, setFormattedXml] = useState(undefined);
142
- const [isMobile, setIsMobile] = useState(false);
143
- const [numPages, setNumPages] = useState(0);
144
- useEffect(() => {
145
- const checkIsMobile = () => {
146
- const userAgent = navigator.userAgent || navigator.vendor || window.opera;
147
- // Only detect actual mobile/tablet devices, NOT desktop browsers
148
- const isMobileDevice =
149
- // Traditional mobile detection (phones and tablets)
150
- /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent) ||
151
- // Additional Android tablet detection (covers tablets in landscape)
152
- /android.*tablet|android.*mobile/i.test(userAgent) ||
153
- // Touch-only devices (excludes laptops with touchscreen)
154
- (('ontouchstart' in window || navigator.maxTouchPoints > 0) &&
155
- !/Windows NT|Macintosh|Linux/.test(userAgent)) ||
156
- // Small screen mobile devices only
157
- (window.screen.width <= 768 && /Mobi|Android/i.test(userAgent));
158
- setIsMobile(isMobileDevice);
159
- };
160
- checkIsMobile();
161
- // Listen for orientation changes (important for tablets)
162
- window.addEventListener('orientationchange', checkIsMobile);
163
- window.addEventListener('resize', checkIsMobile);
164
- return () => {
165
- window.removeEventListener('orientationchange', checkIsMobile);
166
- window.removeEventListener('resize', checkIsMobile);
167
- };
168
- }, []);
169
142
  useEffect(() => {
170
143
  if (fileBlob) {
171
- setFileType(fileBlob.type);
144
+ const blobType = fileBlob.type;
145
+ setFileType(blobType);
172
146
  setFormattedXml(undefined);
173
147
  const fileName = fileBlob.name || '';
174
148
  const fileExtension = fileName.split('.').pop()?.toLowerCase() || '';
175
- const isConfigFile = ['config', 'cfg'].includes(fileExtension);
176
- if (fileBlob.type.includes("xml") && !isConfigFile) {
149
+ const isTextBasedFile = ['config', 'cfg', 'sql'].includes(fileExtension);
150
+ if (fileBlob.type.includes("xml") && !isTextBasedFile) {
177
151
  fileBlob.text().then((text) => {
178
152
  const parser = new DOMParser();
179
153
  const xmlDoc = parser.parseFromString(text, "application/xml");
@@ -192,7 +166,7 @@ export const TMFileViewer = ({ fileBlob, isResizingActive }) => {
192
166
  });
193
167
  setBlobUrl(undefined);
194
168
  }
195
- else if (isConfigFile) {
169
+ else if (isTextBasedFile) {
196
170
  fileBlob.text().then((text) => {
197
171
  const escapedText = text
198
172
  .replace(/&/g, "&amp;")
@@ -226,93 +200,10 @@ export const TMFileViewer = ({ fileBlob, isResizingActive }) => {
226
200
  if (fileBlob.type.includes('image')) {
227
201
  return (_jsx(ImageViewer, { fileBlob: fileBlob, alt: '' }));
228
202
  }
229
- // if (fileType === 'application/pdf' && isMobile) {
230
- // return (
231
- // <object
232
- // key={blobUrl}
233
- // data={blobUrl}
234
- // type="application/pdf"
235
- // width="100%"
236
- // height="100%"
237
- // style={{
238
- // border: 'none',
239
- // zIndex: 0,
240
- // pointerEvents: isResizingActive === true ? "none" : "auto"
241
- // }}
242
- // >
243
- // {/* Fallback UI if <object> tag fails to render PDF */}
244
- // <div style={{
245
- // padding: '40px',
246
- // textAlign: 'center',
247
- // display: 'flex',
248
- // flexDirection: 'column',
249
- // alignItems: 'center',
250
- // justifyContent: 'center',
251
- // height: '100%',
252
- // gap: '20px'
253
- // }}>
254
- // <IconPreview fontSize={96} />
255
- // <div>
256
- // <h3>{SDKUI_Localizator.PDFDocument}</h3>
257
- // <p>{SDKUI_Localizator.PreviewNotAvailableOnDevice}</p>
258
- // </div>
259
- // <div style={{ display: 'flex', gap: '10px', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center' }}>
260
- // <a
261
- // href={blobUrl}
262
- // download="document.pdf"
263
- // style={{
264
- // minWidth: '180px',
265
- // padding: '12px 24px',
266
- // backgroundColor: TMColors.primaryColor,
267
- // color: 'white',
268
- // textDecoration: 'none',
269
- // borderRadius: '4px',
270
- // display: 'inline-block'
271
- // }}
272
- // >
273
- // {SDKUI_Localizator.DownloadFile}
274
- // </a>
275
- // <a
276
- // href={blobUrl}
277
- // target="_blank"
278
- // rel="noopener noreferrer"
279
- // style={{
280
- // minWidth: '180px',
281
- // padding: '12px 24px',
282
- // backgroundColor: TMColors.primaryColor,
283
- // color: 'white',
284
- // textDecoration: 'none',
285
- // borderRadius: '4px',
286
- // display: 'inline-block'
287
- // }}
288
- // >
289
- // {SDKUI_Localizator.OpenInNewTab}
290
- // </a>
291
- // </div>
292
- // </div>
293
- // </object>
294
- // );
295
- // }
296
- if (fileType === 'application/pdf' && isMobile) {
297
- return (_jsx(PDFViewerContainer, { children: _jsx(Document, { file: blobUrl, onLoadSuccess: ({ numPages }) => setNumPages(numPages), loading: _jsxs("div", { style: {
298
- display: 'flex',
299
- justifyContent: 'center',
300
- alignItems: 'center',
301
- height: '100%',
302
- flexDirection: 'column',
303
- gap: '10px'
304
- }, children: [_jsx(IconPreview, { fontSize: 64 }), _jsxs("div", { children: [SDKUI_Localizator.Loading, "..."] })] }), error: _jsxs("div", { style: {
305
- display: 'flex',
306
- justifyContent: 'center',
307
- alignItems: 'center',
308
- height: '100%',
309
- flexDirection: 'column',
310
- gap: '10px'
311
- }, children: [_jsx(IconCloseOutline, { fontSize: 64, color: TMColors.error }), _jsx("div", { children: "Errore nel caricamento del PDF" })] }), children: Array.from(new Array(numPages), (el, index) => (_jsx(Page, { pageNumber: index + 1, renderTextLayer: false, renderAnnotationLayer: false, width: window.innerWidth }, `page_${index + 1}`))) }) }));
203
+ if (fileType === 'application/pdf') {
204
+ return _jsx(TMPdfViewer, { pdfBlob: fileBlob, isResizingActive: isResizingActive, enableFitToWidth: true });
312
205
  }
313
- return (_jsx("iframe", { srcDoc: formattedXml ? `<html><body>${formattedXml}</body></html>` : undefined, src: !formattedXml
314
- ? (fileType === 'application/pdf' ? `${blobUrl}#view=FitH&scrollbar=1` : blobUrl)
315
- : undefined, title: "File Viewer", width: "100%", height: "100%", style: { border: 'none', zIndex: 0, pointerEvents: isResizingActive === true ? "none" : "auto" } }, blobUrl));
206
+ return (_jsx("iframe", { srcDoc: formattedXml ? `<html><body>${formattedXml}</body></html>` : undefined, src: !formattedXml ? blobUrl : undefined, title: "File Viewer", width: "100%", height: "100%", style: { border: 'none', zIndex: 0, pointerEvents: isResizingActive === true ? "none" : "auto" } }, blobUrl));
316
207
  };
317
208
  const ImageViewer = ({ fileBlob, alt = 'Image', className }) => {
318
209
  const containerRef = useRef(null);
@@ -450,32 +341,28 @@ const ImageViewer = ({ fileBlob, alt = 'Image', className }) => {
450
341
  const doc = iframe.contentWindow?.document;
451
342
  if (!doc)
452
343
  return;
453
- doc.open();
454
- doc.write(`
455
- <html>
456
- <head>
457
- <title>Print Image</title>
458
- <style>
459
- body, html {
460
- margin: 0;
461
- padding: 0;
462
- height: 100%;
463
- display: flex;
464
- justify-content: center;
465
- align-items: center;
466
- }
467
- img {
468
- max-width: 100%;
469
- max-height: 100%;
470
- }
471
- </style>
472
- </head>
473
- <body>
474
- <img src="${dataUrl}" onload="setTimeout(() => { window.print(); window.close(); }, 100);" />
475
- </body>
476
- </html>
477
- `);
478
- doc.close();
344
+ doc.documentElement.innerHTML = `
345
+ <head>
346
+ <title>Print Image</title>
347
+ <style>
348
+ body, html {
349
+ margin: 0;
350
+ padding: 0;
351
+ height: 100%;
352
+ display: flex;
353
+ justify-content: center;
354
+ align-items: center;
355
+ }
356
+ img {
357
+ max-width: 100%;
358
+ max-height: 100%;
359
+ }
360
+ </style>
361
+ </head>
362
+ <body>
363
+ <img src="${dataUrl}" onload="setTimeout(() => { window.print(); window.close(); }, 100);" />
364
+ </body>
365
+ `;
479
366
  iframe.contentWindow?.addEventListener('afterprint', () => {
480
367
  document.body.removeChild(iframe);
481
368
  });
@@ -514,7 +401,7 @@ const StyledPreviewContainer = styled.div `display: flex; justify-content: cente
514
401
  export const StyledHeaderIcon = styled.div ` color: ${props => props.$color}; cursor: pointer; display: flex; align-items: center; justify-content: center; &:hover{ color: white ; transition: 200ms ease; } `;
515
402
  export const StyledPanelStatusContainer = styled.div ` width: 100%; height: 100%; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; `;
516
403
  const StyledPreviewNotAvailable = styled.div ` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; `;
517
- const ImageContainer = styled.div ` width: calc(100% - 20px); height: 100%; left:10px; position: absolute; top:50px; overflow: hidden; background: #f5f5f5; touch-action: none; user-select: none; cursor: ${({ $cursor }) => $cursor ?? 'default'}; `;
404
+ const ImageContainer = styled.div ` width: calc(100% - 20px); height: 100%; left:10px; position: absolute; top:50px; overflow: hidden; background: #f5f5f5; touch-action: none; user-select: none; -webkit-touch-callout: none; -webkit-user-select: none; cursor: ${({ $cursor }) => $cursor ?? 'default'}; `;
518
405
  const TopToolbar = styled.div ` position: absolute; top: 0; width: 100%; height: 40px; background-color: #e4e4e4; display: flex; justify-content: center; align-items: center; z-index: 10; `;
519
406
  const ToolbarCenter = styled.div ` display: flex; align-items: center; gap: 12px;`;
520
407
  const ToolbarIconButton = styled.button ` background: #f0f0f0; border: none; color: #313131; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; height: 32px; width: 32px; padding: 0; border-radius: 50px; &:hover{ background-color: #c4c4c4; } &:disabled { color: #c2c2c2; cursor: not-allowed; } `;
@@ -1,6 +1,6 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
- import { IconMenuVertical, IconRefresh, SDKUI_Localizator, svgToString, TMCommandsContextMenu } from "../../../helper";
3
+ import { IconMenuVertical, IconRefresh, SDKUI_Localizator, TMCommandsContextMenu } from "../../../helper";
4
4
  import { DeviceType, useDeviceType } from "../../base/TMDeviceProvider";
5
5
  import { useTMPanelManagerContext } from "../../layout/panelManager/TMPanelManagerContext";
6
6
  import TMPanel from "../../base/TMPanel";
@@ -12,13 +12,13 @@ const TMDcmtTasks = (props) => {
12
12
  // This avoids unnecessary re-renders by only recalculating when deviceType changes.
13
13
  let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
14
14
  const { togglePanelVisibility, toggleMaximize, countVisibleLeafPanels } = useTMPanelManagerContext();
15
- const toolbar = useMemo(() => _jsxs(_Fragment, { children: [_jsx(IconMenuVertical, { id: "TMTaksPanel-Commands-Header", color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: '#TMTaksPanel-Commands-Header', showEvent: "click", menuItems: [
16
- {
17
- icon: svgToString(_jsx(IconRefresh, {})),
18
- onClick: async () => await getAllTasks(),
19
- text: SDKUI_Localizator.Refresh,
20
- },
21
- ] })] }), []);
15
+ const toolbar = useMemo(() => _jsx(TMCommandsContextMenu, { target: '#TMTaksPanel-Commands-Header', showEvent: "click", menuItems: [
16
+ {
17
+ icon: _jsx(IconRefresh, {}),
18
+ onClick: async () => await getAllTasks(),
19
+ text: SDKUI_Localizator.Refresh,
20
+ },
21
+ ], children: _jsx(IconMenuVertical, { id: "TMTaksPanel-Commands-Header", color: 'white', cursor: 'pointer' }) }), []);
22
22
  return _jsx("div", { style: { width: "100%", height: "100%", position: 'relative' }, children: _jsx(TMPanel, { title: SDKUI_Localizator.Widget_Activities, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onClose: countVisibleLeafPanels() > 1 ? () => togglePanelVisibility("tmDcmtTasks") : undefined, onMaximize: countVisibleLeafPanels() > 1 ? () => toggleMaximize("tmDcmtTasks") : undefined, toolbar: toolbar, children: _jsx(TMTasksPanelContent, { id: "dcmtTasks", taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: () => { return Promise.resolve(); }, handleNavigateToDossiers: () => { return Promise.resolve(); }, afterTaskSaved: afterTaskSaved }) }) });
23
23
  };
24
24
  export default TMDcmtTasks;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useState } from 'react';
3
3
  import { DcmtTypeListCacheService, SDK_Localizator } from '@topconsultnpm/sdk-ts';
4
- import { ContextMenu } from 'devextreme-react';
5
4
  import TMRelationViewer from './TMRelationViewer';
6
- import { genUniqueId, svgToString, IconMultipleSelection, IconCheckFile, IconDetailDcmts, SDKUI_Localizator, IconMail, IconDcmtTypeOnlyMetadata, IconCopy, IconMenuVertical, IconDataList, IconPreview, IconSearchCheck, IconBoard, IconDcmtTypeSys, IconShow } from '../../../helper';
5
+ import TMContextMenu from '../../NewComponents/ContextMenu/TMContextMenu';
6
+ import { genUniqueId, IconMultipleSelection, IconCheckFile, IconDetailDcmts, SDKUI_Localizator, IconMail, IconDcmtTypeOnlyMetadata, IconCopy, IconMenuVertical, IconDataList, IconPreview, IconSearchCheck, IconBoard, IconDcmtTypeSys, IconShow, getMoreInfoTasksForDocument } from '../../../helper';
7
7
  import { FormModes, SearchResultContext } from '../../../ts';
8
8
  import { TMColors } from '../../../utils/theme';
9
9
  import ShowAlert from '../../base/TMAlert';
@@ -46,120 +46,105 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
46
46
  }, []);
47
47
  const commandsMenuItems = [
48
48
  {
49
- icon: svgToString(_jsx(IconMultipleSelection, { color: allowMultipleSelection ? TMColors.tertiary : TMColors.text_normal })),
50
- text: "Selezione multipla",
51
- operationType: 'singleRow',
49
+ icon: _jsx(IconMultipleSelection, { color: allowMultipleSelection ? TMColors.tertiary : TMColors.text_normal }),
50
+ name: "Selezione multipla",
52
51
  onClick: () => {
53
52
  setAllowMultipleSelection(prev => !prev);
54
53
  }
55
54
  },
56
55
  {
57
- icon: svgToString(_jsx(IconCheckFile, {})),
58
- text: "Consenti dettagli con 0 documenti",
59
- operationType: 'singleRow',
56
+ icon: _jsx(IconCheckFile, {}),
57
+ name: "Consenti dettagli con 0 documenti",
60
58
  onClick: () => {
61
59
  setShowZeroDcmts(prev => !prev);
62
60
  }
63
61
  },
64
62
  {
65
- icon: svgToString(_jsx(IconDetailDcmts, { transform: 'scale(-1, 1)' })),
66
- text: SDKUI_Localizator.DcmtsMaster,
67
- operationType: 'singleRow',
63
+ icon: _jsx(IconDetailDcmts, { transform: 'scale(-1, 1)' }),
64
+ name: SDKUI_Localizator.DcmtsMaster,
68
65
  disabled: !focusedItem?.isDcmt || !isForMaster,
69
66
  onClick: () => {
70
67
  appendMasterDcmts?.(focusedItem?.tid, focusedItem?.did);
71
68
  }
72
69
  },
73
70
  {
74
- icon: svgToString(_jsx(IconMail, {})),
75
- text: "Invia per posta",
76
- operationType: 'multiRow',
71
+ icon: _jsx(IconMail, {}),
72
+ name: "Invia per posta",
77
73
  disabled: false,
78
74
  beginGroup: true,
79
- items: [
75
+ submenu: [
80
76
  {
81
- icon: svgToString(_jsx(IconMail, {})),
82
- text: "I documenti selezionati",
83
- operationType: 'multiRow',
77
+ icon: _jsx(IconMail, {}),
78
+ name: "I documenti selezionati",
84
79
  disabled: false,
85
80
  onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
86
81
  },
87
82
  {
88
- icon: svgToString(_jsx(IconMail, {})),
89
- text: "I documenti di primo livello e tutti i documenti correlati",
90
- operationType: 'multiRow',
83
+ icon: _jsx(IconMail, {}),
84
+ name: "I documenti di primo livello e tutti i documenti correlati",
91
85
  disabled: false,
92
86
  onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
93
87
  },
94
88
  {
95
- icon: svgToString(_jsx(IconMail, {})),
96
- text: "I documenti di primo livello e i documenti correlati personalizzando l'operazione",
97
- operationType: 'multiRow',
89
+ icon: _jsx(IconMail, {}),
90
+ name: "I documenti di primo livello e i documenti correlati personalizzando l'operazione",
98
91
  disabled: false,
99
92
  onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
100
93
  },
101
94
  ]
102
95
  },
103
96
  {
104
- icon: svgToString(_jsx(IconDcmtTypeOnlyMetadata, {})),
105
- text: "Unisci in un file PDF",
106
- operationType: 'multiRow',
97
+ icon: _jsx(IconDcmtTypeOnlyMetadata, {}),
98
+ name: "Unisci in un file PDF",
107
99
  disabled: false,
108
- items: [
100
+ submenu: [
109
101
  {
110
- icon: svgToString(_jsx(IconDcmtTypeOnlyMetadata, {})),
111
- text: "I documenti selezionati",
112
- operationType: 'multiRow',
102
+ icon: _jsx(IconDcmtTypeOnlyMetadata, {}),
103
+ name: "I documenti selezionati",
113
104
  disabled: false,
114
105
  onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
115
106
  },
116
107
  {
117
- icon: svgToString(_jsx(IconDcmtTypeOnlyMetadata, {})),
118
- text: "I documenti di primo livello e tutti i documenti correlati",
119
- operationType: 'multiRow',
108
+ icon: _jsx(IconDcmtTypeOnlyMetadata, {}),
109
+ name: "I documenti di primo livello e tutti i documenti correlati",
120
110
  disabled: false,
121
111
  onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
122
112
  },
123
113
  {
124
- icon: svgToString(_jsx(IconDcmtTypeOnlyMetadata, {})),
125
- text: "I documenti di primo livello e i documenti correlati personalizzando l'operazione",
126
- operationType: 'multiRow',
114
+ icon: _jsx(IconDcmtTypeOnlyMetadata, {}),
115
+ name: "I documenti di primo livello e i documenti correlati personalizzando l'operazione",
127
116
  disabled: false,
128
117
  onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
129
118
  },
130
119
  ]
131
120
  },
132
121
  {
133
- icon: svgToString(_jsx(IconCopy, {})),
134
- text: "Copia in una cartella",
135
- operationType: 'multiRow',
122
+ icon: _jsx(IconCopy, {}),
123
+ name: "Copia in una cartella",
136
124
  disabled: false,
137
- items: [
125
+ submenu: [
138
126
  {
139
- icon: svgToString(_jsx(IconCopy, {})),
140
- text: "I documenti selezionati",
141
- operationType: 'multiRow',
127
+ icon: _jsx(IconCopy, {}),
128
+ name: "I documenti selezionati",
142
129
  disabled: false,
143
130
  onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
144
131
  },
145
132
  {
146
- icon: svgToString(_jsx(IconCopy, {})),
147
- text: "I documenti di primo livello e tutti i documenti correlati",
148
- operationType: 'multiRow',
133
+ icon: _jsx(IconCopy, {}),
134
+ name: "I documenti di primo livello e tutti i documenti correlati",
149
135
  disabled: false,
150
136
  onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
151
137
  },
152
138
  {
153
- icon: svgToString(_jsx(IconCopy, {})),
154
- text: "I documenti di primo livello e i documenti correlati personalizzando l'operazione",
155
- operationType: 'multiRow',
139
+ icon: _jsx(IconCopy, {}),
140
+ name: "I documenti di primo livello e i documenti correlati personalizzando l'operazione",
156
141
  disabled: false,
157
142
  onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
158
143
  },
159
144
  ]
160
145
  }
161
146
  ];
162
- const toolbar = _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowMultipleSelection && _jsx("p", { style: { color: TMColors.colorHeader, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${selectedItems.length} selezionati` }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(IconMenuVertical, { id: `commands-detail-${id}`, color: 'white', cursor: 'pointer' }), _jsx(ContextMenu, { showEvent: 'click', dataSource: commandsMenuItems, target: `#commands-detail-${id}` })] });
147
+ const toolbar = _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowMultipleSelection && _jsx("p", { style: { color: TMColors.colorHeader, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${selectedItems.length} selezionati` }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(TMContextMenu, { items: commandsMenuItems, trigger: 'left', children: _jsx(IconMenuVertical, { color: 'white', cursor: 'pointer' }) })] });
163
148
  const getTitle = () => isForMaster ? `${SDKUI_Localizator.DcmtsMaster} - ${dtdMaster?.nameLoc}` : SDKUI_Localizator.DcmtsDetail;
164
149
  const isMobile = deviceType === DeviceType.MOBILE;
165
150
  const tmTreeView = useMemo(() => _jsx(_Fragment, { children: !inputDcmts || inputDcmts.length === 0
@@ -169,7 +154,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
169
154
  _jsx(TMRelationViewerWrapper, { inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, showZeroDcmts: showZeroDcmts,
170
155
  // customItemRender={customItemRender}
171
156
  allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged]);
172
- const tmFormOrResult = useMemo(() => _jsx(TMFormOrResultWrapper, { deviceType: deviceType, focusedItem: focusedItem, onTaskCreateRequest: onTaskCreateRequest, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), [focusedItem, deviceType, allTasks]);
157
+ const tmFormOrResult = useMemo(() => _jsx(TMFormOrResultWrapper, { deviceType: deviceType, focusedItem: focusedItem, onTaskCreateRequest: onTaskCreateRequest, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), [focusedItem, deviceType, allTasks, handleNavigateToWGs, handleNavigateToDossiers]);
173
158
  const initialPanelDimensions = {
174
159
  'tmTreeView': { width: '50%', height: '100%' },
175
160
  'tmFormOrResult': { width: '50%', height: '100%' },
@@ -281,7 +266,7 @@ const TMFormOrResultWrapper = ({ deviceType, focusedItem, onTaskCreateRequest, a
281
266
  return (_jsx(_Fragment, { children: focusedItem?.isDcmt ?
282
267
  _jsx(TMDcmtForm, { groupId: 'tmFormOrResult', TID: focusedItem?.tid, DID: focusedItem.did, allowButtonsRefs: true, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: false, onClose: () => {
283
268
  setPanelVisibilityById('tmTreeView', true);
284
- }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) :
269
+ }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.tid, focusedItem?.did) }) :
285
270
  _jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => {
286
271
  setPanelVisibilityById('tmTreeView', true);
287
272
  }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }));
@@ -65,7 +65,7 @@ export interface TMRelationViewerProps {
65
65
  /**
66
66
  * Show metadata names before values (default: false).
67
67
  * When true, displays "MetadataName: Value", otherwise just "Value".
68
- * Value rendering respects DataDomain (uses TMDataListItemViewer for lists, TMUserIdViewer for users, etc.)
68
+ * Value rendering respects DataDomain (uses TMDataListItemViewer for lists, TMDataUserIdItemViewer for users, etc.)
69
69
  */
70
70
  showMetadataNames?: boolean;
71
71
  /** Maximum depth level for recursive loading (default: 2) */
@@ -6,9 +6,9 @@ import { TMColors } from '../../../utils/theme';
6
6
  import { StyledDivHorizontal, StyledBadge } from '../../base/Styled';
7
7
  import TMTreeView from '../../base/TMTreeView';
8
8
  import { TMWaitPanel } from '../../base/TMWaitPanel';
9
- import { TMUserIdViewer } from '../../choosers/TMUserChooser';
10
9
  import TMDataListItemViewer from '../../viewers/TMDataListItemViewer';
11
10
  import TMDcmtIcon from './TMDcmtIcon';
11
+ import TMDataUserIdItemViewer from '../../viewers/TMDataUserIdItemViewer';
12
12
  /**
13
13
  * Check if document type has detail relations
14
14
  */
@@ -685,7 +685,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
685
685
  flexShrink: isLast ? 1 : 0,
686
686
  minWidth: isLast ? 0 : 'auto',
687
687
  overflow: isLast ? 'hidden' : 'visible'
688
- }, children: [index > 0 && _jsx("span", { style: { margin: '0 5px', color: '#999' }, children: "\u2022" }), showMetadataNames && (_jsxs("span", { style: { color: '#666', marginRight: '5px' }, children: [md?.name || key, ":"] })), md?.dataDomain === MetadataDataDomains.DataList ? (_jsx(TMDataListItemViewer, { dataListId: md.dataListID, viewMode: md.dataListViewMode, value: value })) : md?.dataDomain === MetadataDataDomains.UserID ? (_jsx(TMUserIdViewer, { userId: value, showIcon: true, noneSelectionText: '' })) : (_jsx("span", { style: {
688
+ }, children: [index > 0 && _jsx("span", { style: { margin: '0 5px', color: '#999' }, children: "\u2022" }), showMetadataNames && (_jsxs("span", { style: { color: '#666', marginRight: '5px' }, children: [md?.name || key, ":"] })), md?.dataDomain === MetadataDataDomains.DataList ? (_jsx(TMDataListItemViewer, { dataListId: md.dataListID, viewMode: md.dataListViewMode, value: value })) : md?.dataDomain === MetadataDataDomains.UserID ? (_jsx(TMDataUserIdItemViewer, { userId: value, showIcon: true })) : (_jsx("span", { style: {
689
689
  fontWeight: 500,
690
690
  overflow: isLast ? 'hidden' : 'visible',
691
691
  textOverflow: isLast ? 'ellipsis' : 'clip',
@@ -0,0 +1,8 @@
1
+ import { DcmtInfo } from "../../../ts";
2
+ interface TMDcmtCheckoutInfoFormProps {
3
+ dtdName: string;
4
+ selectedDcmtOrFocused: DcmtInfo;
5
+ onClose: () => void;
6
+ }
7
+ declare const TMDcmtCheckoutInfoForm: (props: TMDcmtCheckoutInfoFormProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default TMDcmtCheckoutInfoForm;
@@ -12,7 +12,7 @@ import TMTooltip from "../../base/TMTooltip";
12
12
  import TMTextBox from "../../editors/TMTextBox";
13
13
  import ShowAlert from "../../base/TMAlert";
14
14
  import { TMExceptionBoxManager } from "../../base/TMPopUp";
15
- const TMSearchResultCheckoutInfoForm = (props) => {
15
+ const TMDcmtCheckoutInfoForm = (props) => {
16
16
  const { dtdName, selectedDcmtOrFocused, onClose } = props;
17
17
  const [initialDcmtCheckoutFolder, setInitialDcmtCheckoutFolder] = useState("");
18
18
  const [initialDcmtCheckoutName, setInitialDcmtCheckoutName] = useState("");
@@ -126,4 +126,4 @@ const TMSearchResultCheckoutInfoForm = (props) => {
126
126
  e.currentTarget.style.color = TMColors.primary;
127
127
  }, children: SDKUI_Localizator.Cancel })] })] }) }) }) }) });
128
128
  };
129
- export default TMSearchResultCheckoutInfoForm;
129
+ export default TMDcmtCheckoutInfoForm;