@topconsultnpm/sdkui-react 6.20.0-dev1.7 → 6.20.0-dev1.70

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 (116) hide show
  1. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +258 -17
  2. package/lib/components/NewComponents/ContextMenu/hooks.d.ts +2 -0
  3. package/lib/components/NewComponents/ContextMenu/hooks.js +17 -4
  4. package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
  5. package/lib/components/NewComponents/ContextMenu/index.js +2 -0
  6. package/lib/components/NewComponents/ContextMenu/styles.d.ts +5 -1
  7. package/lib/components/NewComponents/ContextMenu/styles.js +59 -31
  8. package/lib/components/NewComponents/ContextMenu/types.d.ts +13 -0
  9. package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
  10. package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
  11. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +517 -100
  12. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +19 -5
  13. package/lib/components/NewComponents/FloatingMenuBar/styles.js +206 -54
  14. package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +1 -2
  15. package/lib/components/base/TMAccordionNew.js +35 -14
  16. package/lib/components/base/TMCustomButton.js +61 -17
  17. package/lib/components/base/TMDataGrid.d.ts +7 -4
  18. package/lib/components/base/TMDataGrid.js +142 -11
  19. package/lib/components/base/TMDropDownMenu.js +19 -18
  20. package/lib/components/base/TMPanel.js +1 -1
  21. package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
  22. package/lib/components/choosers/TMMetadataChooser.js +8 -1
  23. package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
  24. package/lib/components/choosers/TMUserChooser.d.ts +0 -5
  25. package/lib/components/choosers/TMUserChooser.js +25 -45
  26. package/lib/components/editors/TMMetadataValues.js +23 -5
  27. package/lib/components/editors/TMTextBox.js +6 -3
  28. package/lib/components/features/documents/TMDcmtForm.d.ts +13 -1
  29. package/lib/components/features/documents/TMDcmtForm.js +386 -194
  30. package/lib/components/features/documents/TMDcmtPreview.js +41 -105
  31. package/lib/components/features/documents/TMMasterDetailDcmts.js +37 -52
  32. package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
  33. package/lib/components/features/documents/TMRelationViewer.js +2 -2
  34. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
  35. package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +5 -10
  36. package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
  37. package/lib/components/features/search/TMSearch.js +41 -9
  38. package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
  39. package/lib/components/features/search/TMSearchQueryPanel.js +19 -18
  40. package/lib/components/features/search/TMSearchResult.js +118 -242
  41. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
  42. package/lib/components/features/search/TMSearchResultsMenuItems.js +205 -169
  43. package/lib/components/features/search/TMSignSettingsForm.js +1 -1
  44. package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
  45. package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
  46. package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
  47. package/lib/components/features/tasks/TMTaskForm.js +20 -1
  48. package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
  49. package/lib/components/features/tasks/TMTasksUtils.js +62 -52
  50. package/lib/components/features/tasks/TMTasksView.js +6 -6
  51. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
  52. package/lib/components/features/workflow/TMWorkflowPopup.js +134 -24
  53. package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +1 -0
  54. package/lib/components/features/workflow/diagram/DiagramItemComponent.js +2 -3
  55. package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
  56. package/lib/components/features/workflow/diagram/WFDiagram.d.ts +2 -0
  57. package/lib/components/features/workflow/diagram/WFDiagram.js +21 -4
  58. package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
  59. package/lib/components/forms/Login/LoginValidatorService.js +7 -2
  60. package/lib/components/forms/Login/TMLoginForm.js +34 -6
  61. package/lib/components/forms/TMChooserForm.js +1 -1
  62. package/lib/components/grids/TMBlogsPost.js +55 -30
  63. package/lib/components/grids/TMRecentsManager.js +20 -10
  64. package/lib/components/index.d.ts +4 -0
  65. package/lib/components/index.js +4 -0
  66. package/lib/components/settings/SettingsAppearance.js +92 -29
  67. package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
  68. package/lib/components/viewers/TMDataListItemViewer.js +35 -71
  69. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
  70. package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
  71. package/lib/css/tm-sdkui.css +1 -1
  72. package/lib/helper/SDKUI_Globals.d.ts +19 -0
  73. package/lib/helper/SDKUI_Globals.js +11 -0
  74. package/lib/helper/SDKUI_Localizator.d.ts +15 -1
  75. package/lib/helper/SDKUI_Localizator.js +147 -1
  76. package/lib/helper/TMIcons.d.ts +2 -0
  77. package/lib/helper/TMIcons.js +6 -0
  78. package/lib/helper/TMPdfViewer.d.ts +8 -0
  79. package/lib/helper/TMPdfViewer.js +373 -0
  80. package/lib/helper/checkinCheckoutManager.d.ts +32 -2
  81. package/lib/helper/checkinCheckoutManager.js +115 -38
  82. package/lib/helper/devextremeCustomMessages.d.ts +30 -0
  83. package/lib/helper/devextremeCustomMessages.js +30 -0
  84. package/lib/helper/helpers.d.ts +2 -1
  85. package/lib/helper/helpers.js +14 -3
  86. package/lib/helper/index.d.ts +1 -0
  87. package/lib/helper/index.js +1 -0
  88. package/lib/helper/queryHelper.d.ts +1 -1
  89. package/lib/helper/queryHelper.js +33 -3
  90. package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
  91. package/lib/hooks/useCheckInOutOperations.js +223 -0
  92. package/lib/hooks/useDataListItem.d.ts +12 -0
  93. package/lib/hooks/useDataListItem.js +131 -0
  94. package/lib/hooks/useDataUserIdItem.d.ts +10 -0
  95. package/lib/hooks/useDataUserIdItem.js +96 -0
  96. package/lib/hooks/useSettingsFeedback.d.ts +11 -0
  97. package/lib/hooks/useSettingsFeedback.js +38 -0
  98. package/lib/hooks/useWorkflowApprove.d.ts +4 -0
  99. package/lib/hooks/useWorkflowApprove.js +14 -1
  100. package/lib/index.d.ts +1 -0
  101. package/lib/index.js +1 -0
  102. package/lib/ts/types.d.ts +58 -1
  103. package/lib/utils/theme.d.ts +1 -1
  104. package/lib/utils/theme.js +1 -1
  105. package/package.json +5 -2
  106. package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
  107. package/lib/components/NewComponents/Notification/Notification.js +0 -60
  108. package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
  109. package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
  110. package/lib/components/NewComponents/Notification/index.d.ts +0 -2
  111. package/lib/components/NewComponents/Notification/index.js +0 -2
  112. package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
  113. package/lib/components/NewComponents/Notification/styles.js +0 -180
  114. package/lib/components/NewComponents/Notification/types.d.ts +0 -18
  115. package/lib/components/NewComponents/Notification/types.js +0 -1
  116. package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
@@ -8,13 +8,14 @@ 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';
17
+ import { ContextMenu } from '../../NewComponents/ContextMenu';
18
+ import TMPdfViewer from '../../../helper/TMPdfViewer';
18
19
  const ErrorContent = ({ error, isAbortError, onRetry }) => {
19
20
  if (isAbortError) {
20
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 })] }) }));
@@ -124,10 +125,11 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
124
125
  console.error('Error reopening document:', error);
125
126
  }
126
127
  };
127
- 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: [
128
- { icon: _jsx(IconCloseCircle, {}), text: SDKUI_Localizator.RemoveFromCache, onClick: () => { removeDcmtsFileCache(cacheKey); setIsFromCache(false); } },
129
- { icon: _jsx(IconClear, {}), text: SDKUI_Localizator.ClearCache, onClick: () => { clearDcmtsFileCache(); setIsFromCache(false); } },
130
- ] }, "btn13") }), _jsx(StyledHeaderIcon, { onClick: reOpenDcmt, "$color": TMColors.primaryColor, children: _jsx(TMTooltip, { content: SDKUI_Localizator.ReopenDocument, children: _jsx(IconRefresh, {}) }) })] }), children: error
128
+ const cacheMenuItems = useMemo(() => [
129
+ { icon: _jsx(IconCloseCircle, {}), name: SDKUI_Localizator.RemoveFromCache, onClick: () => { removeDcmtsFileCache(cacheKey); setIsFromCache(false); } },
130
+ { icon: _jsx(IconClear, {}), name: SDKUI_Localizator.ClearCache, onClick: () => { clearDcmtsFileCache(); setIsFromCache(false); } },
131
+ ], [cacheKey, removeDcmtsFileCache, clearDcmtsFileCache, setIsFromCache]);
132
+ 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
131
133
  ? _jsx(ErrorContent, { error: error, isAbortError: isAbortError, onRetry: reOpenDcmt })
132
134
  : renderedPreview(dcmtData?.tid, dcmtData?.did, dcmtData?.fileExt, dcmtData?.fileSize, dcmtData?.fileCount, extensionHandler(dcmtData?.fileExt), showPreview, isResizingActive, () => { loadDocumentWithCache(); setShowPreview(true); }, dcmtBlob) }) }));
133
135
  };
@@ -136,40 +138,15 @@ export const TMFileViewer = ({ fileBlob, isResizingActive }) => {
136
138
  const [blobUrl, setBlobUrl] = useState(undefined);
137
139
  const [fileType, setFileType] = useState(undefined);
138
140
  const [formattedXml, setFormattedXml] = useState(undefined);
139
- // const [isMobile, setIsMobile] = useState<boolean>(false);
140
- // useEffect(() => {
141
- // const checkIsMobile = () => {
142
- // const userAgent = navigator.userAgent || navigator.vendor || (window as any).opera;
143
- // // Only detect actual mobile/tablet devices, NOT desktop browsers
144
- // const isMobileDevice =
145
- // // Traditional mobile detection (phones and tablets)
146
- // /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent) ||
147
- // // Additional Android tablet detection (covers tablets in landscape)
148
- // /android.*tablet|android.*mobile/i.test(userAgent) ||
149
- // // Touch-only devices (excludes laptops with touchscreen)
150
- // (('ontouchstart' in window || navigator.maxTouchPoints > 0) &&
151
- // !/Windows NT|Macintosh|Linux/.test(userAgent)) ||
152
- // // Small screen mobile devices only
153
- // (window.screen.width <= 768 && /Mobi|Android/i.test(userAgent));
154
- // setIsMobile(isMobileDevice);
155
- // };
156
- // checkIsMobile();
157
- // // Listen for orientation changes (important for tablets)
158
- // window.addEventListener('orientationchange', checkIsMobile);
159
- // window.addEventListener('resize', checkIsMobile);
160
- // return () => {
161
- // window.removeEventListener('orientationchange', checkIsMobile);
162
- // window.removeEventListener('resize', checkIsMobile);
163
- // };
164
- // }, []);
165
141
  useEffect(() => {
166
142
  if (fileBlob) {
167
- setFileType(fileBlob.type);
143
+ const blobType = fileBlob.type;
144
+ setFileType(blobType);
168
145
  setFormattedXml(undefined);
169
146
  const fileName = fileBlob.name || '';
170
147
  const fileExtension = fileName.split('.').pop()?.toLowerCase() || '';
171
- const isConfigFile = ['config', 'cfg'].includes(fileExtension);
172
- if (fileBlob.type.includes("xml") && !isConfigFile) {
148
+ const isTextBasedFile = ['config', 'cfg', 'sql'].includes(fileExtension);
149
+ if (fileBlob.type.includes("xml") && !isTextBasedFile) {
173
150
  fileBlob.text().then((text) => {
174
151
  const parser = new DOMParser();
175
152
  const xmlDoc = parser.parseFromString(text, "application/xml");
@@ -188,7 +165,7 @@ export const TMFileViewer = ({ fileBlob, isResizingActive }) => {
188
165
  });
189
166
  setBlobUrl(undefined);
190
167
  }
191
- else if (isConfigFile) {
168
+ else if (isTextBasedFile) {
192
169
  fileBlob.text().then((text) => {
193
170
  const escapedText = text
194
171
  .replace(/&/g, "&amp;")
@@ -222,76 +199,10 @@ export const TMFileViewer = ({ fileBlob, isResizingActive }) => {
222
199
  if (fileBlob.type.includes('image')) {
223
200
  return (_jsx(ImageViewer, { fileBlob: fileBlob, alt: '' }));
224
201
  }
225
- // if (fileType === 'application/pdf' && isMobile) {
226
- // return (
227
- // <object
228
- // key={blobUrl}
229
- // data={blobUrl}
230
- // type="application/pdf"
231
- // width="100%"
232
- // height="100%"
233
- // style={{
234
- // border: 'none',
235
- // zIndex: 0,
236
- // pointerEvents: isResizingActive === true ? "none" : "auto"
237
- // }}
238
- // >
239
- // {/* Fallback UI if <object> tag fails to render PDF */}
240
- // <div style={{
241
- // padding: '40px',
242
- // textAlign: 'center',
243
- // display: 'flex',
244
- // flexDirection: 'column',
245
- // alignItems: 'center',
246
- // justifyContent: 'center',
247
- // height: '100%',
248
- // gap: '20px'
249
- // }}>
250
- // <IconPreview fontSize={96} />
251
- // <div>
252
- // <h3>{SDKUI_Localizator.PDFDocument}</h3>
253
- // <p>{SDKUI_Localizator.PreviewNotAvailableOnDevice}</p>
254
- // </div>
255
- // <div style={{ display: 'flex', gap: '10px', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center' }}>
256
- // <a
257
- // href={blobUrl}
258
- // download="document.pdf"
259
- // style={{
260
- // minWidth: '180px',
261
- // padding: '12px 24px',
262
- // backgroundColor: TMColors.primaryColor,
263
- // color: 'white',
264
- // textDecoration: 'none',
265
- // borderRadius: '4px',
266
- // display: 'inline-block'
267
- // }}
268
- // >
269
- // {SDKUI_Localizator.DownloadFile}
270
- // </a>
271
- // <a
272
- // href={blobUrl}
273
- // target="_blank"
274
- // rel="noopener noreferrer"
275
- // style={{
276
- // minWidth: '180px',
277
- // padding: '12px 24px',
278
- // backgroundColor: TMColors.primaryColor,
279
- // color: 'white',
280
- // textDecoration: 'none',
281
- // borderRadius: '4px',
282
- // display: 'inline-block'
283
- // }}
284
- // >
285
- // {SDKUI_Localizator.OpenInNewTab}
286
- // </a>
287
- // </div>
288
- // </div>
289
- // </object>
290
- // );
291
- // }
292
- return (_jsx("iframe", { srcDoc: formattedXml ? `<html><body>${formattedXml}</body></html>` : undefined, src: !formattedXml
293
- ? (fileType === 'application/pdf' ? `${blobUrl}#view=FitH&scrollbar=1` : blobUrl)
294
- : undefined, title: "File Viewer", width: "100%", height: "100%", style: { border: 'none', zIndex: 0, pointerEvents: isResizingActive === true ? "none" : "auto" } }, blobUrl));
202
+ if (fileType === 'application/pdf') {
203
+ return _jsx(TMPdfViewer, { pdfBlob: fileBlob, isResizingActive: isResizingActive, enableFitToWidth: true });
204
+ }
205
+ 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));
295
206
  };
296
207
  const ImageViewer = ({ fileBlob, alt = 'Image', className }) => {
297
208
  const containerRef = useRef(null);
@@ -510,3 +421,28 @@ const StyledImage = styled.img.attrs(props => ({
510
421
  pointer-events: none;
511
422
  position: absolute;
512
423
  `;
424
+ const PDFViewerContainer = styled.div `
425
+ width: 100%;
426
+ height: 100%;
427
+ overflow-y: auto;
428
+ overflow-x: hidden;
429
+ background-color: #f5f5f5;
430
+
431
+ .react-pdf__Document {
432
+ display: flex;
433
+ flex-direction: column;
434
+ align-items: center;
435
+ gap: 10px;
436
+ padding: 10px 0;
437
+ }
438
+
439
+ .react-pdf__Page {
440
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
441
+ margin: 0 auto;
442
+ }
443
+
444
+ .react-pdf__Page__canvas {
445
+ max-width: 100%;
446
+ height: auto !important;
447
+ }
448
+ `;
@@ -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 } 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%' },
@@ -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;
@@ -5,14 +5,14 @@ import { IconBxInfo, IconFileDots, IconFolder, SDKUI_Globals, SDKUI_Localizator
5
5
  import { FormModes } from "../../../ts";
6
6
  import { ResultTypes, ValidationItem } from "@topconsultnpm/sdk-ts";
7
7
  import { SaveFormOptions, useSaveForm } from "../../../hooks/useForm";
8
- import { getCicoDownloadFileName, updateCheckoutItem } from "../../../helper/checkinCheckoutManager";
8
+ import { getCicoDownloadFileName, updateCicoCheckoutStorageItem } from "../../../helper/checkinCheckoutManager";
9
9
  import { TMColors } from "../../../utils/theme";
10
10
  import TMLayoutContainer, { TMLayoutItem } from "../../base/TMLayout";
11
11
  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("");
@@ -57,13 +57,8 @@ const TMSearchResultCheckoutInfoForm = (props) => {
57
57
  // Check: formData must exist, selectedDcmtOrFocused.TID and selectedDcmtOrFocused.DID must exist, and at least one of checkoutFolder or checkoutName must be filled
58
58
  if (formData && selectedDcmtOrFocused.TID && selectedDcmtOrFocused.DID) {
59
59
  // Create a new draft checkout item with TID, DID, and folder/name values
60
- const newItem = {
61
- TID: selectedDcmtOrFocused.TID.toString(),
62
- DID: selectedDcmtOrFocused.DID.toString(),
63
- checkoutFolder: formData.checkoutFolder ?? "",
64
- checkoutName: formData.checkoutName ?? ""
65
- };
66
- updateCheckoutItem(newItem, "dcmtInfo", "addOrUpdate");
60
+ const newItem = { TID: selectedDcmtOrFocused.TID.toString(), DID: selectedDcmtOrFocused.DID.toString(), checkoutFolder: formData.checkoutFolder ?? "", checkoutName: formData.checkoutName ?? "" };
61
+ updateCicoCheckoutStorageItem(newItem, "dcmtInfo", "addOrUpdate");
67
62
  onClose();
68
63
  ShowAlert({ mode: 'success', title: SDKUI_Localizator.CheckoutInfo, message: SDKUI_Localizator.OperationSuccess, duration: 3000 });
69
64
  }
@@ -131,4 +126,4 @@ const TMSearchResultCheckoutInfoForm = (props) => {
131
126
  e.currentTarget.style.color = TMColors.primary;
132
127
  }, children: SDKUI_Localizator.Cancel })] })] }) }) }) }) });
133
128
  };
134
- export default TMSearchResultCheckoutInfoForm;
129
+ export default TMDcmtCheckoutInfoForm;