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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/lib/components/base/TMAlert.js +6 -8
  2. package/lib/components/base/TMAreaManager.js +53 -55
  3. package/lib/components/base/TMButton.js +4 -2
  4. package/lib/components/base/TMCustomButton.js +40 -48
  5. package/lib/components/base/TMDataGrid.js +219 -219
  6. package/lib/components/base/TMPanel.js +173 -170
  7. package/lib/components/base/TMSpinner.d.ts +2 -1
  8. package/lib/components/base/TMSpinner.js +9 -7
  9. package/lib/components/base/TMTabControl.d.ts +5 -0
  10. package/lib/components/base/TMTabControl.js +18 -7
  11. package/lib/components/base/TMTreeView.js +20 -0
  12. package/lib/components/base/TMWaitPanel.js +1 -1
  13. package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
  14. package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
  15. package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +169 -0
  16. package/lib/components/base/waitPanel/TMWaitPanelManager.js +320 -0
  17. package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +53 -0
  18. package/lib/components/base/waitPanel/TMWaitPanelView.js +274 -0
  19. package/lib/components/base/waitPanel/index.d.ts +1 -0
  20. package/lib/components/base/waitPanel/index.js +1 -0
  21. package/lib/components/choosers/TMPathChooser.js +17 -34
  22. package/lib/components/editors/TMTextBox.d.ts +4 -0
  23. package/lib/components/editors/TMTextBox.js +99 -11
  24. package/lib/components/features/archive/TMArchive.js +7 -2
  25. package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +29 -0
  26. package/lib/components/features/assistant/TMHelpOnLineChat.js +1384 -0
  27. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
  28. package/lib/components/features/assistant/dataset/Designer-Suggested-Questions.json +102 -0
  29. package/lib/components/features/assistant/dataset/Login-Suggested-Questions.json +32 -0
  30. package/lib/components/features/assistant/dataset/Surfer-Suggested-Questions.json +102 -0
  31. package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
  32. package/lib/components/features/documents/TMCopyToFolderForm.js +53 -84
  33. package/lib/components/features/documents/TMDcmtForm.js +50 -61
  34. package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -3
  35. package/lib/components/features/documents/TMDcmtIcon.js +3 -5
  36. package/lib/components/features/documents/TMDcmtPreview.js +5 -3
  37. package/lib/components/features/documents/TMDcmtTasks.js +2 -9
  38. package/lib/components/features/documents/TMFileUploader.js +26 -26
  39. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
  40. package/lib/components/features/documents/TMMasterDetailDcmts.js +53 -148
  41. package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
  42. package/lib/components/features/documents/TMMergeToPdfForm.js +49 -54
  43. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
  44. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +1 -1
  45. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +3 -3
  46. package/lib/components/features/documents/TMRelationViewer.d.ts +13 -14
  47. package/lib/components/features/documents/TMRelationViewer.js +206 -143
  48. package/lib/components/features/documents/relationTreeState.d.ts +32 -0
  49. package/lib/components/features/documents/relationTreeState.js +89 -0
  50. package/lib/components/features/search/TMSearch.js +3 -4
  51. package/lib/components/features/search/TMSearchQueryPanel.js +0 -4
  52. package/lib/components/features/search/TMSearchResult.d.ts +5 -0
  53. package/lib/components/features/search/TMSearchResult.js +39 -19
  54. package/lib/components/features/search/TMTreeSelector.js +23 -27
  55. package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
  56. package/lib/components/features/tasks/TMTasksView.js +91 -90
  57. package/lib/components/features/wg/TMWGsCopyMoveForm.js +91 -91
  58. package/lib/components/forms/TMResultDialog.js +1 -1
  59. package/lib/components/grids/TMBlogsPost.js +92 -96
  60. package/lib/components/index.d.ts +5 -1
  61. package/lib/components/index.js +4 -1
  62. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +16 -15
  63. package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +1 -0
  64. package/lib/components/layout/panelManager/TMPanelManagerContext.js +5 -1
  65. package/lib/components/layout/panelManager/TMPanelManagerLoader.d.ts +6 -0
  66. package/lib/components/layout/panelManager/TMPanelManagerLoader.js +18 -0
  67. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +4 -8
  68. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +1 -1
  69. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +2 -1
  70. package/lib/components/pages/TMPage.js +29 -31
  71. package/lib/components/query/TMQueryEditor.d.ts +3 -0
  72. package/lib/components/query/TMQueryEditor.js +2 -1
  73. package/lib/components/sidebar/TMHeader.d.ts +1 -0
  74. package/lib/components/sidebar/TMHeader.js +2 -2
  75. package/lib/helper/Enum_Localizator.js +1 -0
  76. package/lib/helper/SDKUI_Globals.d.ts +3 -0
  77. package/lib/helper/SDKUI_Globals.js +3 -0
  78. package/lib/helper/SDKUI_Localizator.d.ts +21 -0
  79. package/lib/helper/SDKUI_Localizator.js +210 -0
  80. package/lib/helper/ZipManager.d.ts +1 -1
  81. package/lib/helper/ZipManager.js +2 -1
  82. package/lib/helper/dcmtsHelper.d.ts +2 -0
  83. package/lib/helper/dcmtsHelper.js +3 -1
  84. package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
  85. package/lib/hooks/useCheckInOutOperations.js +14 -34
  86. package/lib/hooks/useDcmtOperations.d.ts +3 -19
  87. package/lib/hooks/useDcmtOperations.js +160 -222
  88. package/lib/hooks/useDocumentOperations.d.ts +1 -0
  89. package/lib/hooks/useDocumentOperations.js +14 -25
  90. package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
  91. package/lib/hooks/useMultiMasterDetailDcmts.js +65 -67
  92. package/lib/hooks/usePreventFileDrop.js +9 -0
  93. package/lib/hooks/useWorkflowApprove.js +33 -17
  94. package/lib/services/caseflow/CaseFlowService.d.ts +36 -6
  95. package/lib/services/caseflow/CaseFlowService.js +55 -14
  96. package/package.json +69 -69
@@ -11,7 +11,8 @@ import { TMColors } from "../../utils/theme";
11
11
  import ShowAlert from "../base/TMAlert";
12
12
  import { TMMessageBoxManager, ButtonNames } from "../base/TMPopUp";
13
13
  import TMTooltip from "../base/TMTooltip";
14
- import { TMLayoutWaitingContainer } from "../base/TMWaitPanel";
14
+ import TMLayoutContainer from "../base/TMLayout";
15
+ import TMWaitPanelManager from "../base/waitPanel/TMWaitPanelManager";
15
16
  import TMHtmlContentDisplay from "../editors/TMHtmlContentDisplay";
16
17
  import TMDcmtForm from "../features/documents/TMDcmtForm";
17
18
  import { TMResultManager } from "../forms/TMResultDialog";
@@ -38,7 +39,7 @@ const TMBlogsPost = (props) => {
38
39
  isRefreshEnabled: false,
39
40
  isCreateContextualTask: false,
40
41
  }, showFloatingCommentButton = false, showCommentFormCallback, refreshCallback, showId, setShowId, refreshHomePageNews, markBlogAsRead, externalBlogPost, resetExternalBlogPost, visible = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, afterTaskSaved, handleNavigateToWGs, handleNavigateToDossiers, handleNavigateToCaseflows, } = props;
41
- const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
42
+ const { downloadDcmtsAsync } = useDcmtOperations();
42
43
  // Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
43
44
  const deviceType = useDeviceType();
44
45
  const bottomRef = useRef(null);
@@ -77,12 +78,6 @@ const TMBlogsPost = (props) => {
77
78
  const [menuVisible, setMenuVisible] = useState(false);
78
79
  const [menuPosition, setMenuPosition] = useState({ x: 0, y: 0 });
79
80
  const [menuItems, setMenuItems] = useState([]);
80
- const [localShowWaitPanel, setLocalShowWaitPanel] = useState(false);
81
- const [localWaitPanelTitle, setLocalWaitPanelTitle] = useState('');
82
- const [localShowPrimary, setLocalShowPrimary] = useState(false);
83
- const [localWaitPanelTextPrimary, setLocalWaitPanelTextPrimary] = useState('');
84
- const [localWaitPanelValuePrimary, setLocalWaitPanelValuePrimary] = useState(0);
85
- const [localWaitPanelMaxValuePrimary, setLocalWaitPanelMaxValuePrimary] = useState(0);
86
81
  const handleFocusedItem = (item) => {
87
82
  setFocusedAttachment(undefined);
88
83
  setFocusedItem(item);
@@ -430,18 +425,22 @@ const TMBlogsPost = (props) => {
430
425
  || (context.engine === 'DossierEngine' && !context.object.id)) {
431
426
  return Promise.resolve();
432
427
  }
433
- setLocalWaitPanelTitle(del ? SDKUI_Localizator.Delete : SDKUI_Localizator.Restore);
434
- setLocalShowWaitPanel(true);
435
- setLocalShowPrimary(true);
428
+ const operationTitle = del ? SDKUI_Localizator.Delete : SDKUI_Localizator.Restore;
436
429
  localAbortController = new AbortController();
430
+ const panel = TMWaitPanelManager.show({
431
+ title: operationTitle,
432
+ max: 1,
433
+ showCounters: false,
434
+ cancelable: true,
435
+ onAbort: () => localAbortController.abort(),
436
+ });
437
437
  let result = [];
438
438
  let i = 0;
439
- setLocalWaitPanelMaxValuePrimary(1);
440
439
  if (localAbortController.signal.aborted) {
441
440
  result.push({ rowIndex: i, id1: currentBlog.id, id2: currentBlog.id, resultType: ResultTypes.WARNING, description: `Operazione interrotta. Elaborate ${i}` });
442
441
  }
443
442
  else {
444
- setLocalWaitPanelTextPrimary(del ? SDKUI_Localizator.Delete : SDKUI_Localizator.Restore);
443
+ panel.setSubtitle(operationTitle);
445
444
  if (context.engine === 'WorkingGroupEngine' && context.object.id) {
446
445
  const workingGroupEngine = new WorkingGroupEngine(SDK_Globals.tmSession);
447
446
  await workingGroupEngine.BlogPostDeleteOrUndeleteAsync(context.object.id, currentBlog.id, del)
@@ -479,10 +478,7 @@ const TMBlogsPost = (props) => {
479
478
  });
480
479
  }
481
480
  }
482
- setLocalWaitPanelTextPrimary('');
483
- setLocalWaitPanelMaxValuePrimary(0);
484
- setLocalWaitPanelValuePrimary(0);
485
- setLocalShowWaitPanel(false);
481
+ panel.close();
486
482
  }
487
483
  });
488
484
  };
@@ -664,86 +660,86 @@ const TMBlogsPost = (props) => {
664
660
  console.warn(`Unhandled object type: ${ref.objClass}`);
665
661
  }
666
662
  };
667
- return _jsx("div", { ref: containerRef, style: { height: height, width: width }, children: _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: localShowWaitPanel, showWaitPanelPrimary: localShowPrimary, waitPanelTitle: localWaitPanelTitle, waitPanelTextPrimary: localWaitPanelTextPrimary, waitPanelValuePrimary: localWaitPanelValuePrimary, waitPanelMaxValuePrimary: localWaitPanelMaxValuePrimary, isCancelable: true, abortController: localAbortController, children: [_jsx(TMBlogHeader, { isVisible: currentHeader !== undefined && !isHeaderHidden, layoutMode: layoutMode, height: layoutMode === 'extended' ? "40px" : "70px", width: "100%", allPosts: posts, postsToShow: postsToShow, onPostsToShowChange: handlePostsToShowChange, categoryIdDataSource: categoryIdDataSource, appliedCategoryIdFilters: appliedCategoryIdFilters, setAppliedCategoryIdFilters: setAppliedCategoryIdFilters, searchText: searchText, onSearchChange: handleSearchChange }), _jsxs("div", { id: `${id}-blogs-wrapper`, onContextMenu: onContextMenu, style: {
668
- width: "100%",
669
- height: currentHeader !== undefined && !isHeaderHidden ? `calc(100% - ${layoutMode === 'extended' ? "40px" : "70px"})` : "100%",
670
- }, children: [blogPosts.length === 0 && _jsx(TMToppyMessage, { message: searchText.length > 0 ? SDKUI_Localizator.NoMessagesFound : SDKUI_Localizator.NoMessages }), blogPosts.length > 0 && _jsxs("div", { id: `${id}-blogs-container`, tabIndex: 0, onKeyDown: handleKeyDown, style: {
671
- height: '100%',
672
- width: '100%',
673
- outline: "none",
674
- display: "flex",
675
- flexDirection: "column",
676
- rowGap: "10px",
677
- overflowY: "auto",
678
- padding: "5px",
679
- backgroundColor: displayMode === 'stacked' ? "#e0e0e0" : "#fff"
680
- }, children: [blogPosts.map((blogPost) => {
681
- const isSelected = selectedItem.some(item => item.id === blogPost.id);
682
- const isFocused = focusedItem?.id === blogPost.id;
683
- const isHomeBlogPost = Boolean(blogPost.header?.trim());
684
- const isNew = Boolean(blogPost.newPosts ?? blogPost.customData1);
685
- const isOwnComment = blogPost.ownerID === SDK_Globals.tmSession?.SessionDescr?.userID;
686
- const isSys = blogPost.isSys === 1;
687
- return _jsxs(React.Fragment, { children: [(firstUnreadPost && blogPost.id === firstUnreadPost.id) && (_jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', color: TMColors.primary, fontWeight: '600', fontSize: '0.9rem', userSelect: 'none', marginTop: "12px", marginBottom: "12px" }, children: [_jsx("hr", { style: { flex: 1, border: 'none', borderTop: `1px solid ${TMColors.primary}`, marginRight: '15px' } }), _jsx("span", { children: SDKUI_Localizator.LastRead }), _jsx("hr", { style: { flex: 1, border: 'none', borderTop: `1px solid ${TMColors.primary}`, marginLeft: '15px' } })] })), _jsx(TMConditionalWrapper, { condition: displayMode === "chat", wrapper: children => _jsx("div", { style: {
688
- display: "flex",
689
- flexDirection: "row",
690
- alignItems: "flex-start",
691
- padding: "2px",
692
- borderRadius: "12px",
693
- cursor: "default",
694
- justifyContent: isOwnComment ? "flex-end" : "flex-start",
695
- }, children: _jsx("div", { style: {
696
- display: "flex",
697
- flexDirection: "column",
698
- alignItems: isOwnComment ? "flex-end" : "flex-start",
699
- textAlign: "left",
700
- maxWidth: '90%',
701
- borderRadius: '8px',
702
- }, children: children }) }), children: _jsxs("div", { id: `${id}-blogpost-${blogPost.id}`, onMouseEnter: () => handleMouseEnter(blogPost), onMouseLeave: handleMouseLeave, onClick: () => handleClick(blogPost), onDoubleClick: () => handleDoubleClick(blogPost), style: {
663
+ return _jsx("div", { ref: containerRef, style: { height: height, width: width }, children: _jsxs(TMLayoutContainer, { direction: 'vertical', children: [_jsx(TMBlogHeader, { isVisible: currentHeader !== undefined && !isHeaderHidden, layoutMode: layoutMode, height: layoutMode === 'extended' ? "40px" : "70px", width: "100%", allPosts: posts, postsToShow: postsToShow, onPostsToShowChange: handlePostsToShowChange, categoryIdDataSource: categoryIdDataSource, appliedCategoryIdFilters: appliedCategoryIdFilters, setAppliedCategoryIdFilters: setAppliedCategoryIdFilters, searchText: searchText, onSearchChange: handleSearchChange }), _jsxs("div", { id: `${id}-blogs-wrapper`, onContextMenu: onContextMenu, style: {
664
+ width: "100%",
665
+ height: currentHeader !== undefined && !isHeaderHidden ? `calc(100% - ${layoutMode === 'extended' ? "40px" : "70px"})` : "100%",
666
+ }, children: [blogPosts.length === 0 && _jsx(TMToppyMessage, { message: searchText.length > 0 ? SDKUI_Localizator.NoMessagesFound : SDKUI_Localizator.NoMessages }), blogPosts.length > 0 && _jsxs("div", { id: `${id}-blogs-container`, tabIndex: 0, onKeyDown: handleKeyDown, style: {
667
+ height: '100%',
668
+ width: '100%',
669
+ outline: "none",
670
+ display: "flex",
671
+ flexDirection: "column",
672
+ rowGap: "10px",
673
+ overflowY: "auto",
674
+ padding: "5px",
675
+ backgroundColor: displayMode === 'stacked' ? "#e0e0e0" : "#fff"
676
+ }, children: [blogPosts.map((blogPost) => {
677
+ const isSelected = selectedItem.some(item => item.id === blogPost.id);
678
+ const isFocused = focusedItem?.id === blogPost.id;
679
+ const isHomeBlogPost = Boolean(blogPost.header?.trim());
680
+ const isNew = Boolean(blogPost.newPosts ?? blogPost.customData1);
681
+ const isOwnComment = blogPost.ownerID === SDK_Globals.tmSession?.SessionDescr?.userID;
682
+ const isSys = blogPost.isSys === 1;
683
+ return _jsxs(React.Fragment, { children: [(firstUnreadPost && blogPost.id === firstUnreadPost.id) && (_jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', color: TMColors.primary, fontWeight: '600', fontSize: '0.9rem', userSelect: 'none', marginTop: "12px", marginBottom: "12px" }, children: [_jsx("hr", { style: { flex: 1, border: 'none', borderTop: `1px solid ${TMColors.primary}`, marginRight: '15px' } }), _jsx("span", { children: SDKUI_Localizator.LastRead }), _jsx("hr", { style: { flex: 1, border: 'none', borderTop: `1px solid ${TMColors.primary}`, marginLeft: '15px' } })] })), _jsx(TMConditionalWrapper, { condition: displayMode === "chat", wrapper: children => _jsx("div", { style: {
684
+ display: "flex",
685
+ flexDirection: "row",
686
+ alignItems: "flex-start",
687
+ padding: "2px",
688
+ borderRadius: "12px",
689
+ cursor: "default",
690
+ justifyContent: isOwnComment ? "flex-end" : "flex-start",
691
+ }, children: _jsx("div", { style: {
703
692
  display: "flex",
704
693
  flexDirection: "column",
705
- width: "100%",
706
- position: "relative",
707
- backgroundColor: isSelected ? "#135596"
708
- : displayMode === 'stacked' ? "#f9f9f9" : isOwnComment ? '#D9EFE0' : '#F3E6E6',
709
- transition: "all 0.2s ease",
710
- color: isSys ? "#ff0000" : isSelected ? "#ffffff" : TMColors.primary,
711
- borderRadius: "5px",
712
- padding: isHomeBlogPost ? '10px' : `10px ${isOwnComment ? '50px' : '10px'} 10px 10px`,
713
- borderLeft: "5px solid transparent",
714
- textDecoration: blogPost.isDel ? 'line-through' : 'none',
715
- boxShadow: isFocused ? "0 4px 12px rgba(19, 85, 150, 0.6)" : "none",
716
- cursor: 'pointer',
717
- }, children: [_jsx(BlogPostTitle, { displayMode: displayMode, layoutMode: layoutMode, blogPost: blogPost, isSelected: isSelected, isOwnComment: isOwnComment, searchText: searchText, isSys: isSys, isHomeBlogPost: isHomeBlogPost, showId: localShowId, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, handleNavigateToCaseflows: handleNavigateToCaseflows }), isNew && _jsx(NewBadge, { layoutMode: layoutMode }), _jsx("div", { style: { fontSize: '1rem', color: "#000", marginTop: "10px", overflow: "hidden" }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0 && (_jsx(TMBlogAttachments, { attachments: blogPost.attachments, layoutMode: layoutMode, isSelected: isSelected, isLoading: !descriptorsLoaded, searchText: searchText, dcmtTypeDescriptors: dcmtTypeDescriptors, treeFs: treeFs, draftLatestInfoMap: draftLatestInfoMap, archivedDocumentMap: archivedDocumentMap, handleAttachmentFocus: handleFocusedAttachment, openDcmtForm: openDcmtForm }))] }, `${id}-blogpost-${blogPost.id}`) })] }, "blog-post-wrapper-" + id + "-" + blogPost.id);
718
- }), _jsx("div", { ref: bottomRef })] }), _jsx(TMContextMenu, { items: menuItems, target: `#${id}-blogs-wrapper`, externalControl: {
719
- visible: menuVisible,
720
- position: menuPosition,
721
- onClose: closeContextMenu,
722
- } }), (showTaskForm && handleNavigateToWGs && handleNavigateToDossiers && getAllTasks && deleteTaskByIdsCallback && addTaskCallback && editTaskCallback) && _jsx("div", { style: { height: "100%", width: "100%" }, children: _jsx(TMTaskForm, { id: -1, title: SDKUI_Localizator.ContextualTask, isModal: true, width: taskModalSizes(deviceType, FormModes.Create).width, height: taskModalSizes(deviceType, FormModes.Create).height, formMode: FormModes.Create, visualizedTasks: [], currentTask: currentTask, setCurrentTask: () => { }, selectedRowKeys: [], handleFocusedRowKeyChange: () => { }, onStatusChanged: () => { }, onSaved: onSavedTaskFormCallback, onClose: () => closeTaskFormCallback(), onCancel: () => closeTaskFormCallback(), usersList: participants, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, isContextualCreate: true, taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback }) }), (dcmtForm.dcmt && dcmtForm.dcmt.TID && dcmtForm.dcmt.DID) && _jsx(TMDcmtForm, { TID: Number(dcmtForm.dcmt.TID), DID: Number(dcmtForm.dcmt.DID), layoutMode: LayoutModes.Update, onClose: closeDcmtForm, isClosable: true, titleModal: SDKUI_Localizator.Attachment + ": " + dcmtForm.dcmt.fileName, isModal: true, widthModal: "95%", heightModal: "95%", allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, Number(dcmtForm.dcmt.TID), Number(dcmtForm.dcmt.DID)) }), (showFloatingCommentButton && showCommentFormCallback && !(context?.engine === 'WorkingGroupEngine' && context?.object?.customData1 === 1)) && _jsx("button", { style: {
723
- position: 'absolute',
724
- bottom: '18px',
725
- right: '20px',
726
- width: '40px',
727
- height: '40px',
728
- borderRadius: "50%",
729
- backgroundColor: "#C2388B",
730
- color: '#fff',
731
- border: 'none',
732
- cursor: 'pointer',
733
- boxShadow: '0 2px 6px rgba(0,0,0,0.2)',
734
- zIndex: 1000,
735
- transition: 'background-color 0.3s ease, transform 0.2s ease',
736
- display: 'flex',
737
- justifyContent: 'center',
738
- alignItems: 'center',
739
- }, onMouseEnter: (e) => {
740
- e.currentTarget.style.backgroundColor = '#D94A9F';
741
- e.currentTarget.style.transform = 'scale(1.1)';
742
- e.currentTarget.style.boxShadow = '0 4px 12px rgba(37, 89, 165, 0.6)';
743
- }, onMouseLeave: (e) => {
744
- e.currentTarget.style.backgroundColor = "#C2388B";
745
- e.currentTarget.style.transform = 'scale(1)';
746
- e.currentTarget.style.boxShadow = '0 2px 6px rgba(0,0,0,0.2)';
747
- }, onClick: () => { showCommentFormCallback(undefined); }, children: _jsx(TMTooltip, { content: SDKUI_Localizator.AddNewComment, children: _jsx("i", { className: "dx-icon-chat", style: { fontSize: '25px' } }) }) })] })] }) }) });
694
+ alignItems: isOwnComment ? "flex-end" : "flex-start",
695
+ textAlign: "left",
696
+ maxWidth: '90%',
697
+ borderRadius: '8px',
698
+ }, children: children }) }), children: _jsxs("div", { id: `${id}-blogpost-${blogPost.id}`, onMouseEnter: () => handleMouseEnter(blogPost), onMouseLeave: handleMouseLeave, onClick: () => handleClick(blogPost), onDoubleClick: () => handleDoubleClick(blogPost), style: {
699
+ display: "flex",
700
+ flexDirection: "column",
701
+ width: "100%",
702
+ position: "relative",
703
+ backgroundColor: isSelected ? "#135596"
704
+ : displayMode === 'stacked' ? "#f9f9f9" : isOwnComment ? '#D9EFE0' : '#F3E6E6',
705
+ transition: "all 0.2s ease",
706
+ color: isSys ? "#ff0000" : isSelected ? "#ffffff" : TMColors.primary,
707
+ borderRadius: "5px",
708
+ padding: isHomeBlogPost ? '10px' : `10px ${isOwnComment ? '50px' : '10px'} 10px 10px`,
709
+ borderLeft: "5px solid transparent",
710
+ textDecoration: blogPost.isDel ? 'line-through' : 'none',
711
+ boxShadow: isFocused ? "0 4px 12px rgba(19, 85, 150, 0.6)" : "none",
712
+ cursor: 'pointer',
713
+ }, children: [_jsx(BlogPostTitle, { displayMode: displayMode, layoutMode: layoutMode, blogPost: blogPost, isSelected: isSelected, isOwnComment: isOwnComment, searchText: searchText, isSys: isSys, isHomeBlogPost: isHomeBlogPost, showId: localShowId, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, handleNavigateToCaseflows: handleNavigateToCaseflows }), isNew && _jsx(NewBadge, { layoutMode: layoutMode }), _jsx("div", { style: { fontSize: '1rem', color: "#000", marginTop: "10px", overflow: "hidden" }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0 && (_jsx(TMBlogAttachments, { attachments: blogPost.attachments, layoutMode: layoutMode, isSelected: isSelected, isLoading: !descriptorsLoaded, searchText: searchText, dcmtTypeDescriptors: dcmtTypeDescriptors, treeFs: treeFs, draftLatestInfoMap: draftLatestInfoMap, archivedDocumentMap: archivedDocumentMap, handleAttachmentFocus: handleFocusedAttachment, openDcmtForm: openDcmtForm }))] }, `${id}-blogpost-${blogPost.id}`) })] }, "blog-post-wrapper-" + id + "-" + blogPost.id);
714
+ }), _jsx("div", { ref: bottomRef })] }), _jsx(TMContextMenu, { items: menuItems, target: `#${id}-blogs-wrapper`, externalControl: {
715
+ visible: menuVisible,
716
+ position: menuPosition,
717
+ onClose: closeContextMenu,
718
+ } }), (showTaskForm && handleNavigateToWGs && handleNavigateToDossiers && getAllTasks && deleteTaskByIdsCallback && addTaskCallback && editTaskCallback) && _jsx("div", { style: { height: "100%", width: "100%" }, children: _jsx(TMTaskForm, { id: -1, title: SDKUI_Localizator.ContextualTask, isModal: true, width: taskModalSizes(deviceType, FormModes.Create).width, height: taskModalSizes(deviceType, FormModes.Create).height, formMode: FormModes.Create, visualizedTasks: [], currentTask: currentTask, setCurrentTask: () => { }, selectedRowKeys: [], handleFocusedRowKeyChange: () => { }, onStatusChanged: () => { }, onSaved: onSavedTaskFormCallback, onClose: () => closeTaskFormCallback(), onCancel: () => closeTaskFormCallback(), usersList: participants, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, isContextualCreate: true, taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback }) }), (dcmtForm.dcmt && dcmtForm.dcmt.TID && dcmtForm.dcmt.DID) && _jsx(TMDcmtForm, { TID: Number(dcmtForm.dcmt.TID), DID: Number(dcmtForm.dcmt.DID), layoutMode: LayoutModes.Update, onClose: closeDcmtForm, isClosable: true, titleModal: SDKUI_Localizator.Attachment + ": " + dcmtForm.dcmt.fileName, isModal: true, widthModal: "95%", heightModal: "95%", allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, Number(dcmtForm.dcmt.TID), Number(dcmtForm.dcmt.DID)) }), (showFloatingCommentButton && showCommentFormCallback && !(context?.engine === 'WorkingGroupEngine' && context?.object?.customData1 === 1)) && _jsx("button", { style: {
719
+ position: 'absolute',
720
+ bottom: '18px',
721
+ right: '20px',
722
+ width: '40px',
723
+ height: '40px',
724
+ borderRadius: "50%",
725
+ backgroundColor: "#C2388B",
726
+ color: '#fff',
727
+ border: 'none',
728
+ cursor: 'pointer',
729
+ boxShadow: '0 2px 6px rgba(0,0,0,0.2)',
730
+ zIndex: 1000,
731
+ transition: 'background-color 0.3s ease, transform 0.2s ease',
732
+ display: 'flex',
733
+ justifyContent: 'center',
734
+ alignItems: 'center',
735
+ }, onMouseEnter: (e) => {
736
+ e.currentTarget.style.backgroundColor = '#D94A9F';
737
+ e.currentTarget.style.transform = 'scale(1.1)';
738
+ e.currentTarget.style.boxShadow = '0 4px 12px rgba(37, 89, 165, 0.6)';
739
+ }, onMouseLeave: (e) => {
740
+ e.currentTarget.style.backgroundColor = "#C2388B";
741
+ e.currentTarget.style.transform = 'scale(1)';
742
+ e.currentTarget.style.boxShadow = '0 2px 6px rgba(0,0,0,0.2)';
743
+ }, onClick: () => { showCommentFormCallback(undefined); }, children: _jsx(TMTooltip, { content: SDKUI_Localizator.AddNewComment, children: _jsx("i", { className: "dx-icon-chat", style: { fontSize: '25px' } }) }) })] })] }) });
748
744
  };
749
745
  export default TMBlogsPost;
@@ -7,8 +7,10 @@ export { default as TMList } from './base/TMList';
7
7
  export { default as TMModal } from './base/TMModal';
8
8
  export * from './base/TMPopUp';
9
9
  export * from './base/TMLayout';
10
+ export { default as TMLayoutContainer } from './base/TMLayout';
10
11
  export * from './base/Styled';
11
12
  export * from './base/TMWaitPanel';
13
+ export * from './base/waitPanel';
12
14
  export * from './base/TMToolbarCard';
13
15
  export * from './base/TMRightSidebar';
14
16
  export * from './base/TMTreeView';
@@ -19,7 +21,7 @@ export * from './NewComponents/ContextMenu';
19
21
  export { default as CounterBar } from './base/TMCounterBar';
20
22
  export { default as TMProgressBar } from './base/TMProgressBar';
21
23
  export { default as TMSpinner } from './base/TMSpinner';
22
- export { Spinner } from './base/TMSpinner';
24
+ export { Spinner, SpinnerGraphic } from './base/TMSpinner';
23
25
  export { default as TMToggleButton } from './base/TMToggleButton';
24
26
  export { default as TMTabControl } from './base/TMTabControl';
25
27
  export * from './base/TMTabControl';
@@ -66,6 +68,8 @@ export * from './query/TMQueryEditor';
66
68
  export * from './query/TMQuerySummary';
67
69
  export * from './query/TMQueryCountButton';
68
70
  export { default as TMToppyDraggableHelpCenter } from './features/assistant/TMToppyDraggableHelpCenter';
71
+ export { default as TMHelpOnLineChat, TMToppyHeaderButton } from './features/assistant/TMHelpOnLineChat';
72
+ export type { HolChatMessage, ITMHelpOnLineChatProps, ITMToppyHeaderButtonProps } from './features/assistant/TMHelpOnLineChat';
69
73
  export * from './features/documents/TMDcmtForm';
70
74
  export * from './features/documents/TMDcmtIcon';
71
75
  export * from './features/documents/TMDcmtPreview';
@@ -8,8 +8,10 @@ export { default as TMList } from './base/TMList';
8
8
  export { default as TMModal } from './base/TMModal';
9
9
  export * from './base/TMPopUp';
10
10
  export * from './base/TMLayout';
11
+ export { default as TMLayoutContainer } from './base/TMLayout';
11
12
  export * from './base/Styled';
12
13
  export * from './base/TMWaitPanel';
14
+ export * from './base/waitPanel';
13
15
  export * from './base/TMToolbarCard';
14
16
  export * from './base/TMRightSidebar';
15
17
  export * from './base/TMTreeView';
@@ -20,7 +22,7 @@ export * from './NewComponents/ContextMenu';
20
22
  export { default as CounterBar } from './base/TMCounterBar';
21
23
  export { default as TMProgressBar } from './base/TMProgressBar';
22
24
  export { default as TMSpinner } from './base/TMSpinner';
23
- export { Spinner } from './base/TMSpinner';
25
+ export { Spinner, SpinnerGraphic } from './base/TMSpinner';
24
26
  export { default as TMToggleButton } from './base/TMToggleButton';
25
27
  export { default as TMTabControl } from './base/TMTabControl';
26
28
  export * from './base/TMTabControl';
@@ -73,6 +75,7 @@ export * from './query/TMQuerySummary';
73
75
  export * from './query/TMQueryCountButton';
74
76
  //assistant
75
77
  export { default as TMToppyDraggableHelpCenter } from './features/assistant/TMToppyDraggableHelpCenter';
78
+ export { default as TMHelpOnLineChat, TMToppyHeaderButton } from './features/assistant/TMHelpOnLineChat';
76
79
  //documents
77
80
  export * from './features/documents/TMDcmtForm';
78
81
  export * from './features/documents/TMDcmtIcon';
@@ -4,29 +4,30 @@ import styled from 'styled-components';
4
4
  import { useTMPanelManagerContext } from './TMPanelManagerContext';
5
5
  import TMPanelWrapper from './TMPanelWrapper';
6
6
  import TMPanelManagerToolbar from './TMPanelManagerToolbar';
7
+ import TMPanelManagerLoader from './TMPanelManagerLoader';
7
8
  import { getPanelManagerToolbarColor, IconInfo, SDKUI_Localizator } from '../../../helper';
8
9
  import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
9
10
  import { Gutters } from '../../../utils/theme';
10
11
  import { AppModules, SDK_Globals } from '@topconsultnpm/sdk-ts';
11
12
  // Styled Component per il contenitore principale di PanelContainer
12
- const StyledPanelContainerWrapper = styled.div `
13
- display: ${props => (props.$hasVisiblePanels ? 'flex' : 'none')};
14
- flex-direction: ${props => (props.$direction === 'vertical' ? 'column' : 'row')};
15
- height: 100%;
16
- width: 100%;
17
- // overflow: hidden;
13
+ const StyledPanelContainerWrapper = styled.div `
14
+ display: ${props => (props.$hasVisiblePanels ? 'flex' : 'none')};
15
+ flex-direction: ${props => (props.$direction === 'vertical' ? 'column' : 'row')};
16
+ height: 100%;
17
+ width: 100%;
18
+ // overflow: hidden;
18
19
  `;
19
20
  // Styled Component per il gutter (separatore)
20
- const StyledResizerGutter = styled.div `
21
- cursor: ${props => (!props.$canResize ? 'default' : props.$direction === 'horizontal' ? 'col-resize' : 'row-resize')};
22
- ${props => (props.$direction === 'horizontal' ? `width: ${props.$size}px;` : `height: ${props.$size}px;`)}
23
- flex-shrink: 0;
24
- background-color: "transparent";
25
- z-index: 10;
21
+ const StyledResizerGutter = styled.div `
22
+ cursor: ${props => (!props.$canResize ? 'default' : props.$direction === 'horizontal' ? 'col-resize' : 'row-resize')};
23
+ ${props => (props.$direction === 'horizontal' ? `width: ${props.$size}px;` : `height: ${props.$size}px;`)}
24
+ flex-shrink: 0;
25
+ background-color: "transparent";
26
+ z-index: 10;
26
27
  `;
27
28
  const TMPanelManagerContainer = (props) => {
28
29
  const { panels, showToolbar, direction, parentId, minPanelSizePx = 150, gutterSizePx } = props;
29
- const { panelVisibility, setPanelDimensionsById, hasVisiblePanels, maximizedPanels, updateIsResizingActive } = useTMPanelManagerContext();
30
+ const { panelVisibility, setPanelDimensionsById, hasVisiblePanels, maximizedPanels, updateIsResizingActive, isLayoutInitialized } = useTMPanelManagerContext();
30
31
  // Get the current device type (e.g., mobile, tablet, desktop) using a custom hook
31
32
  const deviceType = useDeviceType();
32
33
  // This avoids unnecessary re-renders by only recalculating when deviceType changes
@@ -161,7 +162,7 @@ const TMPanelManagerContainer = (props) => {
161
162
  document.body.style.cursor = direction === 'horizontal' ? 'col-resize' : 'row-resize';
162
163
  document.body.style.userSelect = 'none';
163
164
  };
164
- return (_jsxs("div", { style: { display: 'flex', height: '100%', width: '100%', flexDirection: isMobile ? 'column' : 'row', gap: gutters }, children: [_jsx("div", { style: {
165
+ return (_jsxs("div", { style: { display: 'flex', height: '100%', width: '100%', flexDirection: isMobile ? 'column' : 'row', gap: gutters, position: isLayoutInitialized ? undefined : 'relative' }, children: [!isLayoutInitialized && _jsx(TMPanelManagerLoader, {}), _jsx("div", { style: {
165
166
  display: 'flex',
166
167
  width: (isMobile || maximizedPanels.length > 0) ? '100%' : showToolbar ? `calc(100% - 70px)` : '100%',
167
168
  height: isMobile ? (showToolbar ? `calc(100% - 55px)` : '100%') : '100%',
@@ -201,7 +202,7 @@ const TMPanelManagerContainer = (props) => {
201
202
  // If no children or components, render nothing for this panel
202
203
  return null;
203
204
  }) }), _jsxs("div", { style: {
204
- display: hasVisiblePanels() ? 'none' : 'flex',
205
+ display: (!isLayoutInitialized || hasVisiblePanels()) ? 'none' : 'flex',
205
206
  flexDirection: 'column',
206
207
  width: '100%',
207
208
  height: '100%',
@@ -22,6 +22,7 @@ interface TMPanelManagerContextType {
22
22
  isResizingActive: boolean;
23
23
  updateIsResizingActive: (isActive: boolean) => void;
24
24
  countVisibleLeafPanels: () => number;
25
+ isLayoutInitialized: boolean;
25
26
  }
26
27
  interface TMPanelManagerProviderProps {
27
28
  children: ReactNode;
@@ -28,6 +28,8 @@ export const TMPanelManagerProvider = (props) => {
28
28
  const [toolbarButtonsDisabled, setToolbarButtonsDisabled] = useState({});
29
29
  // State to track if a resizing operation is currently active (mouse drag on gutter)
30
30
  const [isResizingActive, setIsResizingActive] = useState(false);
31
+ // State to track if the initial panel visibility has been applied
32
+ const [isLayoutInitialized, setIsLayoutInitialized] = useState(false);
31
33
  useEffect(() => {
32
34
  const { visibilityMap, disabledMap } = getToolbarStates(panels);
33
35
  setToolbarButtonsVisibility(visibilityMap);
@@ -79,6 +81,7 @@ export const TMPanelManagerProvider = (props) => {
79
81
  return updated;
80
82
  });
81
83
  }
84
+ setIsLayoutInitialized(true);
82
85
  }, []);
83
86
  // On mobile devices: automatically show the initial mobile panel when layout switches to mobile
84
87
  // This ensures the correct panel is visible by default on smaller screens
@@ -228,7 +231,8 @@ export const TMPanelManagerProvider = (props) => {
228
231
  setToolbarButtonDisabled,
229
232
  isResizingActive,
230
233
  updateIsResizingActive,
231
- countVisibleLeafPanels
234
+ countVisibleLeafPanels,
235
+ isLayoutInitialized
232
236
  }, children: children }));
233
237
  };
234
238
  export const useTMPanelManagerContext = () => {
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface TMPanelManagerLoaderProps {
3
+ backgroundColor?: string;
4
+ }
5
+ declare const TMPanelManagerLoader: ({ backgroundColor }: TMPanelManagerLoaderProps) => React.JSX.Element;
6
+ export default TMPanelManagerLoader;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SpinnerGraphic } from '../../base/TMSpinner';
3
+ import { SDKUI_Localizator } from '../../../helper';
4
+ import { TMColors } from '../../../utils/theme';
5
+ const TMPanelManagerLoader = ({ backgroundColor = '#fff' }) => (_jsxs("div", { style: {
6
+ position: 'absolute',
7
+ inset: 0,
8
+ zIndex: 10,
9
+ display: 'flex',
10
+ flexDirection: 'column',
11
+ justifyContent: 'center',
12
+ alignItems: 'center',
13
+ gap: '10px',
14
+ background: backgroundColor,
15
+ borderRadius: '10px',
16
+ color: TMColors.primaryColor
17
+ }, children: [_jsx(SpinnerGraphic, {}), _jsx("div", { children: SDKUI_Localizator.Loading })] }));
18
+ export default TMPanelManagerLoader;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useMemo, useState } from 'react';
2
+ import { useMemo } from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { useTMPanelManagerContext } from './TMPanelManagerContext';
5
5
  import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
@@ -46,13 +46,9 @@ const TMPanelManagerToolbar = (props) => {
46
46
  const { togglePanelVisibility, countVisibleLeafPanels, panelVisibility, toolbarButtonsDisabled, toolbarButtonsVisibility } = useTMPanelManagerContext();
47
47
  const deviceType = useDeviceType();
48
48
  let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
49
- const [visibleLeafPanels, setVisibleLeafPanels] = useState([]);
50
- useEffect(() => {
51
- const visibleLeafPanelsSorted = flattenPanels(panels)
52
- .filter(panel => toolbarButtonsVisibility[panel.id] && !panel.children?.length)
53
- .sort((a, b) => (a.toolbarOptions?.orderNumber ?? 0) - (b.toolbarOptions?.orderNumber ?? 0));
54
- setVisibleLeafPanels(visibleLeafPanelsSorted);
55
- }, [toolbarButtonsVisibility, panels]);
49
+ const visibleLeafPanels = useMemo(() => flattenPanels(panels)
50
+ .filter(panel => toolbarButtonsVisibility[panel.id] && !panel.children?.length)
51
+ .sort((a, b) => (a.toolbarOptions?.orderNumber ?? 0) - (b.toolbarOptions?.orderNumber ?? 0)), [toolbarButtonsVisibility, panels]);
56
52
  const onClickCallback = (panelId, isActive) => {
57
53
  if (isActive && countVisibleLeafPanels() <= 1) {
58
54
  return undefined;
@@ -17,5 +17,5 @@ interface TMPanelManagerWithPersistenceProps {
17
17
  }>) => void;
18
18
  persistedPanelStates?: Record<string, any>;
19
19
  }
20
- export declare const TMPanelManagerWithPersistenceProvider: (props: TMPanelManagerWithPersistenceProps) => React.JSX.Element | null;
20
+ export declare const TMPanelManagerWithPersistenceProvider: (props: TMPanelManagerWithPersistenceProps) => React.JSX.Element;
21
21
  export {};
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useEffect, useState } from 'react';
3
3
  import { TMPanelManagerProvider, useTMPanelManagerContext } from './TMPanelManagerContext';
4
+ import TMPanelManagerLoader from './TMPanelManagerLoader';
4
5
  export const TMPanelManagerWithPersistenceProvider = (props) => {
5
6
  const { children, panels, initialVisibility, defaultDimensions, initialDimensions, initialMobilePanelId, isPersistenceEnabled = false, persistedPanelStates, persistPanelStates } = props;
6
7
  // Track when persisted state is loaded
@@ -32,7 +33,7 @@ export const TMPanelManagerWithPersistenceProvider = (props) => {
32
33
  loadPersistedState();
33
34
  }, []);
34
35
  if (!loaded)
35
- return null;
36
+ return _jsx("div", { style: { position: 'relative', width: '100%', height: '100%' }, children: _jsx(TMPanelManagerLoader, {}) });
36
37
  return (_jsxs(TMPanelManagerProvider, { panels: panels, initialVisibility: persistedInitialVisibility, defaultDimensions: defaultDimensions, initialDimensions: persistedInitialDimensions, initialMobilePanelId: initialMobilePanelId, isPersistenceEnabled: isPersistenceEnabled, children: [_jsx(PanelDimensionPersistenceEffect, { persistPanelStates: persistPanelStates }), children] }));
37
38
  };
38
39
  // Effect to watch for panel visibility and size changes and persist them
@@ -14,9 +14,8 @@ import { FontSize, TMColors } from "../../utils/theme";
14
14
  import selectionManagerImage from '../../assets/multipleSelectionManager.jpg';
15
15
  import { DeviceType, useDeviceType } from "../base/TMDeviceProvider";
16
16
  import { TMResultManager } from "../forms/TMResultDialog";
17
- import { TMLayoutWaitingContainer } from "../base/TMWaitPanel";
17
+ import TMWaitPanelManager from "../base/waitPanel/TMWaitPanelManager";
18
18
  import TMToolbarCard from "../base/TMToolbarCard";
19
- let abortController = new AbortController();
20
19
  const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastRefreshTime, objType, listInsteadOfContent, detailInsteadOfContent, routePage, customButtons, customColumns, searchText, detailForm, detailTitlePathKeys, deps, onSelectionChanged, onCountersChanged }) => {
21
20
  const deviceType = useDeviceType();
22
21
  let gridInstance;
@@ -28,12 +27,6 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
28
27
  const [selectedItems, setSelectedItems] = useState([]);
29
28
  const [visibleItems, setVisibleItems] = useState([]);
30
29
  const [formMode, setFormMode] = useState(FormModes.Update);
31
- const [showWaitPanel, setShowWaitPanel] = useState(false);
32
- const [waitPanelTitle, setWaitPanelTitle] = useState('');
33
- const [showPrimary, setShowPrimary] = useState(false);
34
- const [waitPanelTextPrimary, setWaitPanelTextPrimary] = useState('');
35
- const [waitPanelValuePrimary, setWaitPanelValuePrimary] = useState(0);
36
- const [waitPanelMaxValuePrimary, setWaitPanelMaxValuePrimary] = useState(0);
37
30
  let objName = PlatformObjectService.getName(objClass, objType);
38
31
  let objNames = PlatformObjectService.getName(objClass, objType, true);
39
32
  useEffect(() => { gridInstance?.instance().searchByText(searchText ?? ''); }, [searchText]);
@@ -95,31 +88,36 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
95
88
  break;
96
89
  }
97
90
  const doOperationAsync = async () => {
98
- setShowWaitPanel(true);
99
- setShowPrimary(true);
100
- setWaitPanelTitle(operationTitle);
101
- abortController = new AbortController();
91
+ const waitPanel = TMWaitPanelManager.show({
92
+ title: operationTitle,
93
+ max: selectedItems.length,
94
+ cancelable: true,
95
+ });
102
96
  let result = [];
103
- setWaitPanelMaxValuePrimary(selectedItems.length);
104
- for (let i = 0; i < selectedItems.length; i++) {
105
- if (abortController.signal.aborted) {
106
- result.push({ rowIndex: i, id1: selectedItems[i].id, id2: 0, resultType: ResultTypes.WARNING, description: `Operazione interrotta. Elaborati ${i + 1} lavori` });
107
- break;
108
- }
109
- setWaitPanelValuePrimary(i + 1);
110
- setWaitPanelTextPrimary(`Documento ${i + 1} di ${selectedItems.length}`);
111
- try {
112
- await PlatformObjectService.deleteAsync(objClass, selectedItems[i]?.id);
113
- result.push({ rowIndex: i, id1: selectedItems[i].id, id2: 0, description: objType?.toString(), resultType: ResultTypes.SUCCESS });
114
- }
115
- catch (ex) {
116
- result.push({ rowIndex: i, id1: selectedItems[i].id, id2: 0, resultType: ResultTypes.ERROR, description: getExceptionMessage(ex) });
97
+ try {
98
+ for (let i = 0; i < selectedItems.length; i++) {
99
+ if (waitPanel.aborted) {
100
+ result.push({ rowIndex: i, id1: selectedItems[i].id, id2: 0, resultType: ResultTypes.WARNING, description: `Operazione interrotta. Elaborati ${i} lavori` });
101
+ waitPanel.warning();
102
+ break;
103
+ }
104
+ waitPanel.setSubtitle(`Documento ${i + 1} di ${selectedItems.length}`);
105
+ try {
106
+ await PlatformObjectService.deleteAsync(objClass, selectedItems[i]?.id);
107
+ result.push({ rowIndex: i, id1: selectedItems[i].id, id2: 0, description: objType?.toString(), resultType: ResultTypes.SUCCESS });
108
+ waitPanel.ok();
109
+ }
110
+ catch (ex) {
111
+ result.push({ rowIndex: i, id1: selectedItems[i].id, id2: 0, resultType: ResultTypes.ERROR, description: getExceptionMessage(ex) });
112
+ waitPanel.error();
113
+ }
114
+ // Avanza a elaborazione conclusa: con un solo elemento la barra non parte dal 100%
115
+ await waitPanel.step();
117
116
  }
118
117
  }
119
- setWaitPanelMaxValuePrimary(0);
120
- setWaitPanelValuePrimary(0);
121
- setWaitPanelTextPrimary('');
122
- setShowWaitPanel(false);
118
+ finally {
119
+ waitPanel.close();
120
+ }
123
121
  TMResultManager.show(result, operationTitle, "JobID", undefined);
124
122
  await loadDataAsync();
125
123
  };
@@ -208,7 +206,7 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
208
206
  });
209
207
  };
210
208
  const cellRenderObjectIcon = (data) => { return PlatformObjectService.getIcon(objClass, data.row.data); };
211
- return (_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: _jsxs(TMSplitterLayout, { direction: "horizontal", showSeparator: showList && deviceType !== DeviceType.MOBILE, separatorSize: 10, separatorColor: 'transparent', separatorActiveColor: 'transparent', start: showList ? deviceType !== DeviceType.MOBILE ? ['30%', '70%'] : ['100%', '0%'] : ['0', '100%'], min: ['0px', '0px'], children: [listInsteadOfContent ??
209
+ return (_jsx(TMLayoutContainer, { direction: 'vertical', children: _jsxs(TMSplitterLayout, { direction: "horizontal", showSeparator: showList && deviceType !== DeviceType.MOBILE, separatorSize: 10, separatorColor: 'transparent', separatorActiveColor: 'transparent', start: showList ? deviceType !== DeviceType.MOBILE ? ['30%', '70%'] : ['100%', '0%'] : ['0', '100%'], min: ['0px', '0px'], children: [listInsteadOfContent ??
212
210
  _jsxs(TMToolbarCard, { title: objNames, children: [_jsx(ToolbarPage, {}), _jsxs(DataGrid, { disabled: selectionListDisabled, ref: (grid) => (gridInstance = grid), height: "calc(100% - 35px)", width: 'calc(100% - 5px)', dataSource: items, keyExpr: "id", allowColumnResizing: true, columnResizingMode: "widget", allowColumnReordering: true, showBorders: false, onContentReady: (e) => {
213
211
  setVisibleItems(e.component.getVisibleRows().map((row) => { return row.data; }));
214
212
  e.component.selectRows(selectedItems?.map((item) => item.id), false);
@@ -47,6 +47,9 @@ interface ITMQueryEditor extends ITMApplyFormProps<QueryDescriptor> {
47
47
  isExpertMode?: boolean;
48
48
  validateSelect?: boolean;
49
49
  validateOrderBy?: boolean;
50
+ /** Richiede almeno un filtro: senza, l'errore compare nell'elenco e l'applica resta disabilitato.
51
+ * Default false — una query senza filtri è legittima quasi ovunque nel prodotto. */
52
+ validateWhereRequired?: boolean;
50
53
  showDistinct?: boolean;
51
54
  raiseWarningForOnlyMetadataDcmtTypes?: boolean;
52
55
  borderRadius?: string;