@topconsultnpm/sdkui-react 6.22.0-dev2.9 → 6.22.0-t2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +1 -1
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +45 -43
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +1 -1
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +67 -60
- package/lib/components/base/Styled.d.ts +93 -77
- package/lib/components/base/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +2 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMDataGrid.d.ts +2 -0
- package/lib/components/base/TMDataGrid.js +260 -8
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMEditorBase.d.ts +2 -0
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManager.js +5 -3
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.js +11 -2
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +19 -9
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -6
- package/lib/components/base/TMFileManagerUtils.js +37 -1
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +2 -1
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMModal.d.ts +11 -0
- package/lib/components/base/TMModal.js +47 -13
- package/lib/components/base/TMPanel.d.ts +6 -0
- package/lib/components/base/TMPanel.js +138 -25
- package/lib/components/base/TMPopUp.js +3 -0
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTooltip.d.ts +2 -1
- package/lib/components/base/TMTooltip.js +24 -8
- package/lib/components/base/TMTreeView.d.ts +14 -8
- package/lib/components/base/TMTreeView.js +108 -67
- package/lib/components/base/TMUserAvatar.d.ts +2 -1
- package/lib/components/base/TMVilViewer.d.ts +2 -1
- package/lib/components/base/TMWaitPanel.d.ts +3 -2
- package/lib/components/choosers/TMDcmtTypeChooser.js +4 -3
- package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
- package/lib/components/choosers/TMDistinctValues.js +149 -142
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMMetadataChooser.js +1 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +13 -0
- package/lib/components/choosers/TMQuickSearchInfo.js +279 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.d.ts +16 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.js +94 -0
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
- package/lib/components/choosers/TMSelectedValuesSummary.js +91 -0
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMDropDown.d.ts +3 -0
- package/lib/components/editors/TMDropDown.js +197 -5
- package/lib/components/editors/TMEditorStyled.d.ts +20 -42
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/archive/TMArchive.js +17 -3
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/documents/TMBatchUpdateForm.js +19 -5
- package/lib/components/features/documents/TMDcmtBlog.d.ts +3 -0
- package/lib/components/features/documents/TMDcmtBlog.js +4 -4
- package/lib/components/features/documents/TMDcmtForm.d.ts +7 -0
- package/lib/components/features/documents/TMDcmtForm.js +178 -51
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +12 -1
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +77 -7
- package/lib/components/features/documents/TMDcmtIcon.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtIcon.js +5 -3
- package/lib/components/features/documents/TMDcmtPreview.d.ts +8 -6
- package/lib/components/features/documents/TMDcmtPreview.js +10 -6
- package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.js +95 -33
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +20 -0
- package/lib/components/features/documents/TMMasterInfoFields.js +186 -0
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +3 -3
- package/lib/components/features/documents/TMMergeToPdfForm.js +30 -5
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +46 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +323 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +370 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +283 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +14 -1
- package/lib/components/features/documents/TMRelationViewer.js +69 -20
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +2 -1
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.js +77 -11
- package/lib/components/features/search/TMSearchQueryEditor.js +5 -3
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +13 -3
- package/lib/components/features/search/TMSearchQueryPanel.js +141 -67
- package/lib/components/features/search/TMSearchResult.d.ts +16 -0
- package/lib/components/features/search/TMSearchResult.js +429 -108
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
- package/lib/components/features/search/TMTreeSelector.js +109 -64
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
- package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +18 -7
- package/lib/components/features/workflow/TMWorkflowPopup.js +8 -4
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/TMChooserForm.d.ts +2 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
- package/lib/components/grids/TMBlogAttachments.js +13 -2
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogHeader.js +5 -1
- package/lib/components/grids/TMBlogsPost.d.ts +3 -1
- package/lib/components/grids/TMBlogsPost.js +31 -4
- package/lib/components/grids/TMBlogsPostUtils.d.ts +10 -9
- package/lib/components/grids/TMBlogsPostUtils.js +14 -3
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +3 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +24 -14
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +5 -6
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.js +2 -2
- package/lib/components/layout/panelManager/types.d.ts +3 -0
- package/lib/components/layout/panelManager/utils.js +13 -11
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +14 -10
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMHeader.d.ts +3 -3
- package/lib/components/sidebar/TMHeader.js +30 -20
- package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMMidViewer.js +4 -1
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.js +86 -25
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/devextreme-license.d.ts +1 -0
- package/lib/devextreme-license.js +3 -0
- package/lib/helper/SDKUI_Globals.d.ts +110 -0
- package/lib/helper/SDKUI_Globals.js +151 -0
- package/lib/helper/SDKUI_Localizator.d.ts +44 -0
- package/lib/helper/SDKUI_Localizator.js +440 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +2 -0
- package/lib/helper/TMAppUpdatedModal.js +134 -0
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +280 -279
- package/lib/helper/TMIcons.js +3 -0
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +23 -4
- package/lib/helper/TMUtils.js +24 -2
- package/lib/helper/dataGridSearchHelper.d.ts +28 -0
- package/lib/helper/dataGridSearchHelper.js +51 -0
- package/lib/helper/dcmtsHelper.d.ts +20 -0
- package/lib/helper/dcmtsHelper.js +58 -1
- package/lib/helper/helpers.d.ts +12 -1
- package/lib/helper/helpers.js +25 -1
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +6 -1
- package/lib/helper/queryHelper.js +8 -3
- package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
- package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
- package/lib/hooks/useArchiveListForm.d.ts +39 -0
- package/lib/hooks/useArchiveListForm.js +46 -0
- package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
- package/lib/hooks/useCaseFlowApprove.js +157 -0
- package/lib/hooks/useDataUserIdItem.d.ts +1 -0
- package/lib/hooks/useDataUserIdItem.js +1 -0
- package/lib/hooks/useDocumentOperations.d.ts +4 -0
- package/lib/hooks/useDocumentOperations.js +52 -10
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +113 -0
- package/lib/hooks/useMultiMasterDetailDcmts.js +760 -0
- package/lib/hooks/useRelatedDocuments.d.ts +1 -0
- package/lib/hooks/useRelatedDocuments.js +22 -27
- package/lib/hooks/useShowDossiersV5.d.ts +12 -0
- package/lib/hooks/useShowDossiersV5.js +37 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
- package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
- package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
- package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
- package/lib/hooks/useTMDistinctValuesSource.js +105 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -2
- package/lib/services/caseflow/CaseFlowService.d.ts +236 -0
- package/lib/services/caseflow/CaseFlowService.js +693 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.d.ts +28 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.js +121 -0
- package/lib/services/caseflow/caseFlowNameCache.d.ts +32 -0
- package/lib/services/caseflow/caseFlowNameCache.js +116 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.d.ts +61 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.js +113 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/index.js +4 -0
- package/lib/services/platform_services.d.ts +4 -3
- package/package.json +9 -5
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { BlogPostAttachment, DcmtTypeDescriptor } from "@topconsultnpm/sdk-ts";
|
|
2
3
|
import { DcmtInfo } from "../../ts";
|
|
3
4
|
import { FileItem } from "../base/TMFileManagerUtils";
|
|
@@ -25,5 +26,5 @@ interface TMBlogAttachmentsProps {
|
|
|
25
26
|
handleAttachmentFocus: (attachment: DcmtInfo | undefined) => void;
|
|
26
27
|
openDcmtForm: (dcmtInfo: DcmtInfo) => void;
|
|
27
28
|
}
|
|
28
|
-
declare const TMBlogAttachments: (props: TMBlogAttachmentsProps) =>
|
|
29
|
+
declare const TMBlogAttachments: (props: TMBlogAttachmentsProps) => React.JSX.Element;
|
|
29
30
|
export default TMBlogAttachments;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { SDK_Globals } from "@topconsultnpm/sdk-ts";
|
|
3
|
-
import { getAttachmentInfo, lightenColor, removeFileExtension } from "./TMBlogsPostUtils";
|
|
3
|
+
import { findFileItemByDraftID, getAttachmentInfo, lightenColor, removeFileExtension } from "./TMBlogsPostUtils";
|
|
4
4
|
import TMDcmtIcon from "../features/documents/TMDcmtIcon";
|
|
5
5
|
import { IconAttachment } from "../../helper";
|
|
6
|
+
import { getFileItemLinkUrl } from "../base/TMFileManagerUtils";
|
|
6
7
|
const TMBlogAttachments = (props) => {
|
|
7
8
|
const { layoutMode, attachments, isSelected, isLoading = false, searchText, dcmtTypeDescriptors, treeFs, draftLatestInfoMap, archivedDocumentMap, handleAttachmentFocus, openDcmtForm } = props;
|
|
9
|
+
// Ritorna l'url del link associato all'allegato: gli allegati che sono link non hanno un documento da scaricare o da aprire nella form
|
|
10
|
+
const getAttachmentLinkUrl = (blogPostAttachment) => getFileItemLinkUrl(findFileItemByDraftID(treeFs, blogPostAttachment.draftID) ?? undefined);
|
|
8
11
|
const handleMouseEnter = (e, blogPostAttachment, name, fileExt) => {
|
|
9
12
|
e.currentTarget.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.15)';
|
|
10
13
|
e.currentTarget.style.backgroundColor = isSelected ? lightenColor("#135596", 40) : '#cfcfcf';
|
|
@@ -18,12 +21,20 @@ const TMBlogAttachments = (props) => {
|
|
|
18
21
|
handleAttachmentFocus(undefined);
|
|
19
22
|
};
|
|
20
23
|
const onDoubleClick = (e, blogPostAttachment, name, fileExt) => {
|
|
24
|
+
// i link non hanno un documento da aprire: il doppio click (su icona o testo) apre l'url in un nuovo tab
|
|
25
|
+
const linkUrl = getAttachmentLinkUrl(blogPostAttachment);
|
|
26
|
+
if (linkUrl) {
|
|
27
|
+
window.open(linkUrl, '_blank', 'noopener,noreferrer');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
21
30
|
const archiveID = SDK_Globals.tmSession?.SessionDescr?.archiveID;
|
|
22
31
|
const fileName = `${removeFileExtension(name)}_${archiveID}_${blogPostAttachment.tid}_${blogPostAttachment.did}.${fileExt}`;
|
|
23
32
|
openDcmtForm({ TID: blogPostAttachment.tid, DID: blogPostAttachment.did, fileName });
|
|
24
33
|
};
|
|
25
34
|
return _jsx("div", { style: { width: "100%", marginTop: "5px", overflow: "hidden" }, children: attachments.map((blogPostAttachment, index) => {
|
|
26
35
|
const { name, nameElement, tooltipContent, fileExt, archivedDocumentsExist, draftExist, isSigned } = getAttachmentInfo(blogPostAttachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText);
|
|
36
|
+
// i link non hanno un file associato: l'icona non deve avviare il download
|
|
37
|
+
const isLink = getAttachmentLinkUrl(blogPostAttachment) !== undefined;
|
|
27
38
|
return _jsx("div", { onDoubleClick: (e) => !isLoading && onDoubleClick(e, blogPostAttachment, name, fileExt), onMouseEnter: (e) => !isLoading && handleMouseEnter(e, blogPostAttachment, name, fileExt), onMouseLeave: (e) => !isLoading && handleMouseLeave(e), style: {
|
|
28
39
|
display: layoutMode === "extended" ? "inline-flex" : "flex",
|
|
29
40
|
padding: '4px 8px',
|
|
@@ -63,7 +74,7 @@ const TMBlogAttachments = (props) => {
|
|
|
63
74
|
}
|
|
64
75
|
` })] })) : (_jsxs(_Fragment, { children: [(!archivedDocumentsExist && !draftExist) ?
|
|
65
76
|
_jsx(IconAttachment, { style: { marginRight: "5px", flexShrink: 0 } }) :
|
|
66
|
-
_jsx("div", { style: { marginRight: "10px", flexShrink: 0, width: isSigned ? "40px" : undefined }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent, isSigned: isSigned }) }), _jsx("span", { title: layoutMode === 'compact' ? name + " (DID: " + blogPostAttachment.did + ")" : undefined, style: {
|
|
77
|
+
_jsx("div", { style: { marginRight: "10px", flexShrink: 0, width: isSigned ? "40px" : undefined }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: isLink ? 'none' : 'openInNewWindow', tooltipContent: tooltipContent, isSigned: isSigned }) }), _jsx("span", { title: layoutMode === 'compact' ? name + " (DID: " + blogPostAttachment.did + ")" : undefined, style: {
|
|
67
78
|
whiteSpace: 'nowrap',
|
|
68
79
|
overflow: 'hidden',
|
|
69
80
|
textOverflow: 'ellipsis',
|
|
@@ -27,5 +27,5 @@ interface TMBlogHeaderProps {
|
|
|
27
27
|
/** Callback when the search text changes */
|
|
28
28
|
onSearchChange: (value: string) => void;
|
|
29
29
|
}
|
|
30
|
-
declare const TMBlogHeader: (props: TMBlogHeaderProps) =>
|
|
30
|
+
declare const TMBlogHeader: (props: TMBlogHeaderProps) => React.JSX.Element;
|
|
31
31
|
export default TMBlogHeader;
|
|
@@ -4,7 +4,11 @@ import TMDropDown from "../editors/TMDropDown";
|
|
|
4
4
|
import TMTreeDropDown from "../editors/TMTreeDropDown";
|
|
5
5
|
import { TMSearchBar } from "../sidebar/TMHeader";
|
|
6
6
|
const TMBlogHeader = (props) => {
|
|
7
|
-
const { isVisible, layoutMode, height, width,
|
|
7
|
+
const { isVisible, layoutMode, height, width,
|
|
8
|
+
// Difensivo: un chiamante che passa una bacheca non ancora caricata (o
|
|
9
|
+
// assente perche' il ramo blog e' fallito lato server) non deve far
|
|
10
|
+
// esplodere l'header sulla lettura di length.
|
|
11
|
+
allPosts = [], postsToShow, onPostsToShowChange, categoryIdDataSource, appliedCategoryIdFilters, setAppliedCategoryIdFilters, searchText, onSearchChange } = props;
|
|
8
12
|
// Data source for the number of posts to display in the UI
|
|
9
13
|
const postsToShowDataSource = [
|
|
10
14
|
{ value: 30, display: SDKUI_Localizator.Latest + ' 30' },
|
|
@@ -86,6 +86,8 @@ interface TMBlogsPostProps {
|
|
|
86
86
|
addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
87
87
|
handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
|
|
88
88
|
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
89
|
+
/** Apre la pratica CaseFlow di una notizia con `classID === 'CF'` (bacheca Home V6). */
|
|
90
|
+
handleNavigateToCaseflows?: (value: HomeBlogPost | number) => Promise<void>;
|
|
89
91
|
}
|
|
90
|
-
declare const TMBlogsPost: (props: TMBlogsPostProps) =>
|
|
92
|
+
declare const TMBlogsPost: (props: TMBlogsPostProps) => React.JSX.Element;
|
|
91
93
|
export default TMBlogsPost;
|
|
@@ -5,6 +5,7 @@ import { ContextMenu as TMContextMenu } from "../NewComponents/ContextMenu";
|
|
|
5
5
|
import { SDKUI_Localizator, Globalization, getExceptionMessage, TMConditionalWrapper, getMoreInfoTasksForDocument, taskModalSizes } from "../../helper";
|
|
6
6
|
import TMToppyMessage from "../../helper/TMToppyMessage";
|
|
7
7
|
import { useDcmtOperations } from "../../hooks/useDcmtOperations";
|
|
8
|
+
import { CaseFlowService } from "../../services/caseflow/CaseFlowService";
|
|
8
9
|
import { DownloadTypes, FormModes } from "../../ts";
|
|
9
10
|
import { TMColors } from "../../utils/theme";
|
|
10
11
|
import ShowAlert from "../base/TMAlert";
|
|
@@ -21,7 +22,11 @@ import TMTaskForm from "../features/tasks/TMTaskForm";
|
|
|
21
22
|
import { useDeviceType } from "../base/TMDeviceProvider";
|
|
22
23
|
let localAbortController = new AbortController();
|
|
23
24
|
const TMBlogsPost = (props) => {
|
|
24
|
-
const { scrollToSelected, id,
|
|
25
|
+
const { scrollToSelected, id,
|
|
26
|
+
// Difensivo: `posts` e' obbligatoria nei tipi, ma a runtime puo' arrivare
|
|
27
|
+
// undefined (dato non ancora caricato o risposta parziale del server):
|
|
28
|
+
// il default evita i crash su filter/length.
|
|
29
|
+
posts = [], displayMode = "stacked", height = "100%", width = "100%", scrollToBottom = true, header, showExtendedAttachments = true, treeFs, draftLatestInfoMap, archivedDocumentMap, context, participants, contextMenuParams = {
|
|
25
30
|
isShowHideFilterEnabled: true,
|
|
26
31
|
isShowHideIDEnaled: true,
|
|
27
32
|
isCommentEnabled: false,
|
|
@@ -32,7 +37,7 @@ const TMBlogsPost = (props) => {
|
|
|
32
37
|
isRestoreEnabled: false,
|
|
33
38
|
isRefreshEnabled: false,
|
|
34
39
|
isCreateContextualTask: false,
|
|
35
|
-
}, showFloatingCommentButton = false, showCommentFormCallback, refreshCallback, showId, setShowId, refreshHomePageNews, markBlogAsRead, externalBlogPost, resetExternalBlogPost, visible = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, afterTaskSaved, handleNavigateToWGs, handleNavigateToDossiers, } = props;
|
|
40
|
+
}, showFloatingCommentButton = false, showCommentFormCallback, refreshCallback, showId, setShowId, refreshHomePageNews, markBlogAsRead, externalBlogPost, resetExternalBlogPost, visible = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, afterTaskSaved, handleNavigateToWGs, handleNavigateToDossiers, handleNavigateToCaseflows, } = props;
|
|
36
41
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
|
|
37
42
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
38
43
|
const deviceType = useDeviceType();
|
|
@@ -292,6 +297,8 @@ const TMBlogsPost = (props) => {
|
|
|
292
297
|
handleNavigateToWGs(blogPost);
|
|
293
298
|
if (handleNavigateToDossiers && id && blogPost.classID === 'DS')
|
|
294
299
|
handleNavigateToDossiers(blogPost);
|
|
300
|
+
if (handleNavigateToCaseflows && id && blogPost.classID === 'CF')
|
|
301
|
+
handleNavigateToCaseflows(blogPost);
|
|
295
302
|
};
|
|
296
303
|
const handleKeyDown = (event) => {
|
|
297
304
|
if (!selectedItem.length)
|
|
@@ -324,6 +331,9 @@ const TMBlogsPost = (props) => {
|
|
|
324
331
|
if (handleNavigateToDossiers && item.id && classItemID === 'DS') {
|
|
325
332
|
handleNavigateToDossiers(item);
|
|
326
333
|
}
|
|
334
|
+
if (handleNavigateToCaseflows && item.id && classItemID === 'CF') {
|
|
335
|
+
handleNavigateToCaseflows(item);
|
|
336
|
+
}
|
|
327
337
|
break;
|
|
328
338
|
default:
|
|
329
339
|
break;
|
|
@@ -367,6 +377,17 @@ const TMBlogsPost = (props) => {
|
|
|
367
377
|
result.push({ rowIndex: currentBlog.id, id1: currentBlog.id, id2: currentBlog.id, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
|
|
368
378
|
});
|
|
369
379
|
break;
|
|
380
|
+
case 'CF':
|
|
381
|
+
// La notizia porta il solo CFIID: il template (cftid) che l'API
|
|
382
|
+
// richiede lo risolve CaseFlowService.setFollow.
|
|
383
|
+
await CaseFlowService.setFollow(currentBlog.id, false).then(async () => {
|
|
384
|
+
result.push({ rowIndex: currentBlog.id, id1: currentBlog.id, id2: currentBlog.id, description: SDKUI_Localizator.OperationSuccess, resultType: ResultTypes.SUCCESS });
|
|
385
|
+
refreshHomePageNews?.();
|
|
386
|
+
})
|
|
387
|
+
.catch((err) => {
|
|
388
|
+
result.push({ rowIndex: currentBlog.id, id1: currentBlog.id, id2: currentBlog.id, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
|
|
389
|
+
});
|
|
390
|
+
break;
|
|
370
391
|
default:
|
|
371
392
|
ShowAlert({ message: 'TODO', mode: 'warning', title: SDKUI_Localizator.Unfollow, duration: 3000 });
|
|
372
393
|
break;
|
|
@@ -570,7 +591,7 @@ const TMBlogsPost = (props) => {
|
|
|
570
591
|
beginGroup: true
|
|
571
592
|
});
|
|
572
593
|
}
|
|
573
|
-
if (targetItem && Boolean(classId && (classId === 'WG' || classId === 'DS'))) {
|
|
594
|
+
if (targetItem && Boolean(classId && (classId === 'WG' || classId === 'DS' || classId === 'CF'))) {
|
|
574
595
|
menuItems.push({
|
|
575
596
|
icon: _jsx("span", { className: "dx-icon-eyeclose" }),
|
|
576
597
|
name: SDKUI_Localizator.Unfollow,
|
|
@@ -632,6 +653,12 @@ const TMBlogsPost = (props) => {
|
|
|
632
653
|
else
|
|
633
654
|
console.log("Working Group reference missing objID");
|
|
634
655
|
break;
|
|
656
|
+
case ObjectClasses.CaseFlowInstance:
|
|
657
|
+
if (ref.objID)
|
|
658
|
+
handleNavigateToCaseflows?.(ref.objID);
|
|
659
|
+
else
|
|
660
|
+
console.log("CaseFlow instance reference missing objID");
|
|
661
|
+
break;
|
|
635
662
|
// Handle other object types as needed
|
|
636
663
|
default:
|
|
637
664
|
console.warn(`Unhandled object type: ${ref.objClass}`);
|
|
@@ -687,7 +714,7 @@ const TMBlogsPost = (props) => {
|
|
|
687
714
|
textDecoration: blogPost.isDel ? 'line-through' : 'none',
|
|
688
715
|
boxShadow: isFocused ? "0 4px 12px rgba(19, 85, 150, 0.6)" : "none",
|
|
689
716
|
cursor: 'pointer',
|
|
690
|
-
}, 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 }), 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);
|
|
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);
|
|
691
718
|
}), _jsx("div", { ref: bottomRef })] }), _jsx(TMContextMenu, { items: menuItems, target: `#${id}-blogs-wrapper`, externalControl: {
|
|
692
719
|
visible: menuVisible,
|
|
693
720
|
position: menuPosition,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import { BlogPost, BlogPostAttachment, DcmtTypeDescriptor, DossierDescriptor, HomeBlogPost, TID_DID, WorkingGroupDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
3
|
import { FileItem } from "../base/TMFileManagerUtils";
|
|
4
4
|
export declare const DRAFT_TYPE_TID = 6;
|
|
@@ -59,10 +59,10 @@ export declare const getCompactEllipsisStyle: (layoutMode: "compact" | "extended
|
|
|
59
59
|
display: string;
|
|
60
60
|
};
|
|
61
61
|
export declare const findFileItemByDraftID: (tree: FileItem | undefined, draftID: number | undefined) => FileItem | null;
|
|
62
|
-
export declare const highlightText: (text: string, searchText: string, isSelected: boolean) => string | (string |
|
|
62
|
+
export declare const highlightText: (text: string, searchText: string, isSelected: boolean) => string | (string | React.JSX.Element)[];
|
|
63
63
|
export declare const lightenColor: (hex: string, amount: number) => string;
|
|
64
|
-
export declare const OwnerInitialsBadge: (blogPost: BlogPost | HomeBlogPost) =>
|
|
65
|
-
export declare const getTooltipContent: (title: string | undefined, content: JSX.Element) =>
|
|
64
|
+
export declare const OwnerInitialsBadge: (blogPost: BlogPost | HomeBlogPost) => React.JSX.Element;
|
|
65
|
+
export declare const getTooltipContent: (title: string | undefined, content: JSX.Element) => React.JSX.Element;
|
|
66
66
|
export declare const getAttachmentInfo: (attachment: BlogPostAttachment, treeFs: FileItem | undefined, draftLatestInfoMap: Map<number, {
|
|
67
67
|
latestVersion: number;
|
|
68
68
|
folderId: number;
|
|
@@ -76,8 +76,8 @@ export declare const getAttachmentInfo: (attachment: BlogPostAttachment, treeFs:
|
|
|
76
76
|
fileSize: string;
|
|
77
77
|
}> | undefined, dcmtTypeDescriptors: Map<number, DcmtTypeDescriptor>, isSelected: boolean, searchText: string) => {
|
|
78
78
|
name: string;
|
|
79
|
-
nameElement:
|
|
80
|
-
tooltipContent:
|
|
79
|
+
nameElement: React.JSX.Element;
|
|
80
|
+
tooltipContent: React.JSX.Element;
|
|
81
81
|
folderId: number;
|
|
82
82
|
fileExt: string;
|
|
83
83
|
draftExist: boolean;
|
|
@@ -85,7 +85,7 @@ export declare const getAttachmentInfo: (attachment: BlogPostAttachment, treeFs:
|
|
|
85
85
|
isSigned: number;
|
|
86
86
|
};
|
|
87
87
|
export declare const getDcmtTypeDescriptor: (blogPosts: Array<BlogPost>) => Promise<Map<number, DcmtTypeDescriptor>>;
|
|
88
|
-
export declare const BlogPostHomeHeader: (header: string | undefined, classId: string | undefined, isSelected: boolean, searchText: string, headerClickCallback: () => void) =>
|
|
88
|
+
export declare const BlogPostHomeHeader: (header: string | undefined, classId: string | undefined, isSelected: boolean, searchText: string, headerClickCallback: () => void) => React.JSX.Element;
|
|
89
89
|
export declare const isHeaderFullyHidden: (header: {
|
|
90
90
|
showViewMode: boolean;
|
|
91
91
|
showFilters: boolean;
|
|
@@ -95,7 +95,7 @@ export declare const isHeaderFullyHidden: (header: {
|
|
|
95
95
|
interface NewBadgeProps {
|
|
96
96
|
layoutMode: "compact" | "extended";
|
|
97
97
|
}
|
|
98
|
-
export declare const NewBadge: ({ layoutMode }: NewBadgeProps) =>
|
|
98
|
+
export declare const NewBadge: ({ layoutMode }: NewBadgeProps) => React.JSX.Element;
|
|
99
99
|
export declare const removeFileExtension: (filename: string) => string;
|
|
100
100
|
interface BlogPostTitleProps {
|
|
101
101
|
displayMode: "chat" | "stacked";
|
|
@@ -109,7 +109,8 @@ interface BlogPostTitleProps {
|
|
|
109
109
|
showId: boolean;
|
|
110
110
|
handleNavigateToWGs?: (blogPost: BlogPost | HomeBlogPost) => void;
|
|
111
111
|
handleNavigateToDossiers?: (blogPost: BlogPost | HomeBlogPost) => void;
|
|
112
|
+
handleNavigateToCaseflows?: (blogPost: BlogPost | HomeBlogPost) => void;
|
|
112
113
|
}
|
|
113
|
-
export declare const BlogPostTitle: (props: BlogPostTitleProps) =>
|
|
114
|
+
export declare const BlogPostTitle: (props: BlogPostTitleProps) => React.JSX.Element;
|
|
114
115
|
export declare const stripHtml: (html: string) => string;
|
|
115
116
|
export {};
|
|
@@ -162,8 +162,16 @@ export const getDcmtTypeDescriptor = async (blogPosts) => {
|
|
|
162
162
|
return dcmtTypeMap;
|
|
163
163
|
};
|
|
164
164
|
export const BlogPostHomeHeader = (header, classId, isSelected, searchText, headerClickCallback) => {
|
|
165
|
+
// 'CF' = istanza di CaseFlow (bacheca Home V6). Attenzione: nel mondo dei
|
|
166
|
+
// task PdGs.CF indica invece la pratica-dossier; qui il dominio e' il
|
|
167
|
+
// ClassID di HomeBlogPost, dove 'DS' e' la pratica e 'CF' la pratica CaseFlow.
|
|
165
168
|
const isWorkGroup = classId === 'WG';
|
|
166
|
-
const
|
|
169
|
+
const isCaseFlow = classId === 'CF';
|
|
170
|
+
const iconColor = isSelected
|
|
171
|
+
? '#ffffff'
|
|
172
|
+
: isWorkGroup ? PDGS_COLORS.WORKING_GROUP
|
|
173
|
+
: isCaseFlow ? PDGS_COLORS.CASEFLOW
|
|
174
|
+
: PDGS_COLORS.DOSSIER;
|
|
167
175
|
return (_jsxs("div", { style: {
|
|
168
176
|
display: "flex",
|
|
169
177
|
alignItems: "center",
|
|
@@ -171,7 +179,7 @@ export const BlogPostHomeHeader = (header, classId, isSelected, searchText, head
|
|
|
171
179
|
fontWeight: "bold",
|
|
172
180
|
color: isSelected ? "#fff" : TMColors.primary,
|
|
173
181
|
gap: "4px",
|
|
174
|
-
}, children: [_jsx(TMTooltip, { content: isWorkGroup ? SDKUI_Localizator.WorkGroup : SDKUI_Localizator.Dossier, children: isWorkGroup ? (_jsx(IconMenuCAWorkingGroups, { color: iconColor, fontSize: 28, onClick: headerClickCallback })) : (_jsx(IconCADossier, { color: iconColor, fontSize: 28, onClick: headerClickCallback })) }), _jsx("div", { onClick: headerClickCallback, style: {
|
|
182
|
+
}, children: [_jsx(TMTooltip, { content: isWorkGroup ? SDKUI_Localizator.WorkGroup : isCaseFlow ? "CaseFlow" : SDKUI_Localizator.Dossier, children: isWorkGroup ? (_jsx(IconMenuCAWorkingGroups, { color: iconColor, fontSize: 28, onClick: headerClickCallback })) : isCaseFlow ? (_jsx(IconCADossier, { color: iconColor, fontSize: 28, onClick: headerClickCallback })) : (_jsx(IconCADossier, { color: iconColor, fontSize: 28, onClick: headerClickCallback })) }), _jsx("div", { onClick: headerClickCallback, style: {
|
|
175
183
|
whiteSpace: "nowrap",
|
|
176
184
|
overflow: "hidden",
|
|
177
185
|
textOverflow: "ellipsis",
|
|
@@ -218,7 +226,7 @@ export const removeFileExtension = (filename) => {
|
|
|
218
226
|
return filename.includes('.') ? filename.substring(0, filename.lastIndexOf('.')) : filename;
|
|
219
227
|
};
|
|
220
228
|
export const BlogPostTitle = (props) => {
|
|
221
|
-
const { displayMode, layoutMode, blogPost, isSelected, isOwnComment, searchText, isSys, isHomeBlogPost, showId, handleNavigateToWGs, handleNavigateToDossiers } = props;
|
|
229
|
+
const { displayMode, layoutMode, blogPost, isSelected, isOwnComment, searchText, isSys, isHomeBlogPost, showId, handleNavigateToWGs, handleNavigateToDossiers, handleNavigateToCaseflows } = props;
|
|
222
230
|
const showOwnerBadge = (displayMode === "stacked" || !isOwnComment) && layoutMode === "extended";
|
|
223
231
|
let subtitle = "";
|
|
224
232
|
if (isHomeBlogPost) {
|
|
@@ -239,6 +247,9 @@ export const BlogPostTitle = (props) => {
|
|
|
239
247
|
if (handleNavigateToDossiers && blogPost.id && blogPost.classID === 'DS') {
|
|
240
248
|
handleNavigateToDossiers(blogPost);
|
|
241
249
|
}
|
|
250
|
+
if (handleNavigateToCaseflows && blogPost.id && blogPost.classID === 'CF') {
|
|
251
|
+
handleNavigateToCaseflows(blogPost);
|
|
252
|
+
}
|
|
242
253
|
};
|
|
243
254
|
return _jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [showOwnerBadge && (_jsx("div", { style: { width: "40px", height: "40px", flexShrink: 0 }, children: OwnerInitialsBadge(blogPost) })), _jsxs("div", { style: {
|
|
244
255
|
display: "flex",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
interface ITMValidationItemsList {
|
|
3
4
|
validationItems?: ValidationItem[];
|
|
4
5
|
}
|
|
5
|
-
declare const TMValidationItemsList: ({ validationItems }: ITMValidationItemsList) =>
|
|
6
|
+
declare const TMValidationItemsList: ({ validationItems }: ITMValidationItemsList) => React.JSX.Element;
|
|
6
7
|
export default TMValidationItemsList;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { TMPanelDefinition, TMPanelDirection } from './types';
|
|
2
3
|
interface TMPanelManagerContainerProps {
|
|
3
4
|
panels: Array<TMPanelDefinition>;
|
|
@@ -5,6 +6,7 @@ interface TMPanelManagerContainerProps {
|
|
|
5
6
|
direction: TMPanelDirection;
|
|
6
7
|
parentId?: string;
|
|
7
8
|
minPanelSizePx?: number;
|
|
9
|
+
gutterSizePx?: number;
|
|
8
10
|
}
|
|
9
|
-
declare const TMPanelManagerContainer: (props: TMPanelManagerContainerProps) =>
|
|
11
|
+
declare const TMPanelManagerContainer: (props: TMPanelManagerContainerProps) => React.JSX.Element | null;
|
|
10
12
|
export default TMPanelManagerContainer;
|
|
@@ -18,20 +18,20 @@ const StyledPanelContainerWrapper = styled.div `
|
|
|
18
18
|
`;
|
|
19
19
|
// Styled Component per il gutter (separatore)
|
|
20
20
|
const StyledResizerGutter = styled.div `
|
|
21
|
-
cursor: ${props => (props.$direction === 'horizontal' ? 'col-resize' : 'row-resize')};
|
|
22
|
-
${props => (props.$direction === 'horizontal' ? `width: ${
|
|
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
23
|
flex-shrink: 0;
|
|
24
24
|
background-color: "transparent";
|
|
25
25
|
z-index: 10;
|
|
26
26
|
`;
|
|
27
27
|
const TMPanelManagerContainer = (props) => {
|
|
28
|
-
const { panels, showToolbar, direction, parentId, minPanelSizePx = 150 } = props;
|
|
28
|
+
const { panels, showToolbar, direction, parentId, minPanelSizePx = 150, gutterSizePx } = props;
|
|
29
29
|
const { panelVisibility, setPanelDimensionsById, hasVisiblePanels, maximizedPanels, updateIsResizingActive } = useTMPanelManagerContext();
|
|
30
30
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook
|
|
31
31
|
const deviceType = useDeviceType();
|
|
32
32
|
// This avoids unnecessary re-renders by only recalculating when deviceType changes
|
|
33
33
|
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
34
|
-
const gutters = Gutters.getGutters();
|
|
34
|
+
const gutters = gutterSizePx ?? Gutters.getGutters();
|
|
35
35
|
// References to store information related to resizing
|
|
36
36
|
// startMousePos: stores the mouse position when resizing starts (x or y coordinate)
|
|
37
37
|
const startMousePos = useRef(0);
|
|
@@ -47,6 +47,19 @@ const TMPanelManagerContainer = (props) => {
|
|
|
47
47
|
const containerRef = useRef(null);
|
|
48
48
|
// Count how many child panels are currently visible (based on panelVisibility)
|
|
49
49
|
const currentlyVisibleChildrenCount = panels.filter(panel => panelVisibility[panel.id]).length;
|
|
50
|
+
/**
|
|
51
|
+
* Pannello ridimensionabile più prossimo a partire da `from` nella direzione `step`:
|
|
52
|
+
* i pannelli non visibili e quelli collassati (che vivono del solo ingombro minimo) si saltano,
|
|
53
|
+
* altrimenti il trascinamento del separatore assegnerebbe spazio a un pannello ridotto
|
|
54
|
+
*/
|
|
55
|
+
const findResizablePanelId = (from, step) => {
|
|
56
|
+
for (let i = from; i >= 0 && i < panels.length; i += step) {
|
|
57
|
+
const candidate = panels[i];
|
|
58
|
+
if (panelVisibility[candidate.id] && candidate.contentOptions?.isCollapsed !== true)
|
|
59
|
+
return candidate.id;
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
};
|
|
50
63
|
// If this component has a parent panel, and the parent panel is visible,
|
|
51
64
|
// but none of the current child panels are visible, return null to avoid rendering empty container
|
|
52
65
|
if (parentId && panelVisibility[parentId] && currentlyVisibleChildrenCount === 0) {
|
|
@@ -156,14 +169,6 @@ const TMPanelManagerContainer = (props) => {
|
|
|
156
169
|
}, children: _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(StyledPanelContainerWrapper, { ref: containerRef, "$direction": direction, "$hasVisiblePanels": hasVisiblePanels(), children: panels.map((panel, index) => {
|
|
157
170
|
// Check if current panel is visible according to context state
|
|
158
171
|
const isVisible = panelVisibility[panel.id];
|
|
159
|
-
// Find the closest previous visible panel's ID to place the resizer gutter between
|
|
160
|
-
let prevPanelIdForGutter = null;
|
|
161
|
-
for (let i = index - 1; i >= 0; i--) {
|
|
162
|
-
if (panelVisibility[panels[i].id]) {
|
|
163
|
-
prevPanelIdForGutter = panels[i].id;
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
172
|
/*
|
|
168
173
|
Determine if we should show the gutter (resize handle) before this panel.
|
|
169
174
|
The gutter is shown only if:
|
|
@@ -171,6 +176,11 @@ const TMPanelManagerContainer = (props) => {
|
|
|
171
176
|
- at least one visible panel was encountered before this one
|
|
172
177
|
*/
|
|
173
178
|
const showGutter = isVisible && hasSeenVisiblePanel && maximizedPanels.length === 0;
|
|
179
|
+
// I due pannelli su cui agisce il separatore: i più prossimi fra quelli ridimensionabili.
|
|
180
|
+
// Senza una coppia valida (es. tutti i vicini collassati) il separatore resta solo un divisorio
|
|
181
|
+
const resizeFromId = showGutter ? findResizablePanelId(index - 1, -1) : null;
|
|
182
|
+
const resizeToId = showGutter ? findResizablePanelId(index, 1) : null;
|
|
183
|
+
const canResize = resizeFromId !== null && resizeToId !== null && resizeFromId !== resizeToId;
|
|
174
184
|
// Update the flag once a visible panel is found, so gutters after it are shown correctly
|
|
175
185
|
if (isVisible) {
|
|
176
186
|
hasSeenVisiblePanel = true;
|
|
@@ -178,7 +188,7 @@ const TMPanelManagerContainer = (props) => {
|
|
|
178
188
|
// If the panel has child panels, render a nested TMPanelManagerContainer or a component
|
|
179
189
|
if (panel.children && panel.children.length > 0) {
|
|
180
190
|
const jsxComponent = panel.contentOptions?.component;
|
|
181
|
-
return (_jsxs(React.Fragment, { children: [showGutter && (_jsx(StyledResizerGutter, { "$direction": direction, onMouseDown: (e) => startResizing(e,
|
|
191
|
+
return (_jsxs(React.Fragment, { children: [showGutter && (_jsx(StyledResizerGutter, { "$direction": direction, "$size": gutters, "$canResize": canResize, onMouseDown: canResize ? (e) => startResizing(e, resizeFromId, resizeToId) : undefined })), _jsx(TMPanelWrapper, { panel: panel, children: jsxComponent
|
|
182
192
|
? React.isValidElement(jsxComponent)
|
|
183
193
|
? React.cloneElement(jsxComponent, { groupId: panel.id, mainDirection: panel.childrenGroupDirection || direction })
|
|
184
194
|
: jsxComponent
|
|
@@ -186,7 +196,7 @@ const TMPanelManagerContainer = (props) => {
|
|
|
186
196
|
}
|
|
187
197
|
// If the panel has a component specified, render it with a possible gutter before it
|
|
188
198
|
if (panel.contentOptions && panel.contentOptions.component) {
|
|
189
|
-
return (_jsxs(React.Fragment, { children: [showGutter && (_jsx(StyledResizerGutter, { "$direction": direction, onMouseDown: (e) => startResizing(e,
|
|
199
|
+
return (_jsxs(React.Fragment, { children: [showGutter && (_jsx(StyledResizerGutter, { "$direction": direction, "$size": gutters, "$canResize": canResize, onMouseDown: canResize ? (e) => startResizing(e, resizeFromId, resizeToId) : undefined })), _jsx(TMPanelWrapper, { panel: panel, children: panel.contentOptions.component })] }, panel.id));
|
|
190
200
|
}
|
|
191
201
|
// If no children or components, render nothing for this panel
|
|
192
202
|
return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import type { TMPanelDefinition, TMPanelDimensionsMap } from './types';
|
|
3
3
|
interface TMPanelManagerContextType {
|
|
4
4
|
panelVisibility: {
|
|
@@ -34,6 +34,6 @@ interface TMPanelManagerProviderProps {
|
|
|
34
34
|
initialMobilePanelId: string;
|
|
35
35
|
isPersistenceEnabled?: boolean;
|
|
36
36
|
}
|
|
37
|
-
export declare const TMPanelManagerProvider: (props: TMPanelManagerProviderProps) =>
|
|
37
|
+
export declare const TMPanelManagerProvider: (props: TMPanelManagerProviderProps) => React.JSX.Element;
|
|
38
38
|
export declare const useTMPanelManagerContext: () => TMPanelManagerContextType;
|
|
39
39
|
export {};
|