@topconsultnpm/sdkui-react 6.22.0-t1 → 6.22.0-t3
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 +3 -3
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +1 -1
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +45 -43
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +80 -73
- package/lib/components/base/Styled.d.ts +92 -76
- package/lib/components/base/Styled.js +7 -5
- package/lib/components/base/TMAccordionNew.js +7 -7
- package/lib/components/base/TMAlert.d.ts +32 -32
- package/lib/components/base/TMAlert.js +6 -8
- package/lib/components/base/TMAreaManager.js +53 -55
- package/lib/components/base/TMButton.d.ts +13 -0
- package/lib/components/base/TMButton.js +139 -7
- package/lib/components/base/TMClosableList.js +3 -3
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.d.ts +4 -0
- package/lib/components/base/TMDataGrid.js +292 -12
- package/lib/components/base/TMDataGridExportForm.js +39 -30
- package/lib/components/base/TMDropDownMenu.js +1 -1
- package/lib/components/base/TMEditorBase.d.ts +2 -0
- package/lib/components/base/TMFileManager.js +5 -3
- package/lib/components/base/TMFileManagerDataGridView.js +12 -3
- package/lib/components/base/TMFileManagerThumbnailItems.js +20 -10
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -6
- package/lib/components/base/TMFileManagerUtils.js +37 -1
- package/lib/components/base/TMLayout.d.ts +2 -2
- package/lib/components/base/TMLayout.js +3 -3
- package/lib/components/base/TMList.js +1 -1
- package/lib/components/base/TMListView.js +3 -3
- 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 +141 -28
- package/lib/components/base/TMPopUp.js +5 -2
- package/lib/components/base/TMResizableMenu.js +2 -2
- package/lib/components/base/TMRightSidebar.js +1 -1
- package/lib/components/base/TMShowAllOrMaxItemsButton.js +1 -1
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMSpinner.js +9 -7
- package/lib/components/base/TMTab.js +2 -2
- package/lib/components/base/TMTabControl.d.ts +106 -0
- package/lib/components/base/TMTabControl.js +664 -0
- package/lib/components/base/TMToggleButton.js +2 -2
- package/lib/components/base/TMToolbarCard.js +3 -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 +13 -7
- package/lib/components/base/TMTreeView.js +143 -70
- package/lib/components/base/TMWaitPanel.js +3 -3
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +169 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +320 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +53 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +274 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- package/lib/components/choosers/TMCultureIDPicker.js +2 -2
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.js +2 -2
- package/lib/components/choosers/TMDcmtTypeChooser.js +5 -4
- package/lib/components/choosers/TMDiskChooser.js +1 -1
- package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
- package/lib/components/choosers/TMDistinctValues.js +157 -141
- package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMImageIDChooser.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +3 -3
- package/lib/components/choosers/TMPathChooser.js +17 -34
- 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.js +1 -1
- package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
- package/lib/components/choosers/TMSelectedValuesSummary.js +89 -0
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMCheckBox.js +1 -1
- package/lib/components/editors/TMDateBox.d.ts +16 -1
- package/lib/components/editors/TMDateBox.js +90 -22
- package/lib/components/editors/TMDropDown.d.ts +3 -0
- package/lib/components/editors/TMDropDown.js +197 -5
- package/lib/components/editors/TMEditorStyled.d.ts +21 -43
- package/lib/components/editors/TMFormulaEditor.js +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.js +1 -1
- package/lib/components/editors/TMLocalizedTextBox.js +1 -1
- package/lib/components/editors/TMMetadataEditor.d.ts +5 -1
- package/lib/components/editors/TMMetadataEditor.js +27 -23
- package/lib/components/editors/TMMetadataValues.js +6 -6
- package/lib/components/editors/TMRadioButton.js +2 -2
- package/lib/components/editors/TMSummary.js +3 -3
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +25 -17
- package/lib/components/editors/TMTextBox.d.ts +2 -0
- package/lib/components/editors/TMTextBox.js +32 -21
- package/lib/components/editors/TMTextExpression.js +1 -1
- package/lib/components/features/archive/TMArchive.js +24 -5
- package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +29 -0
- package/lib/components/features/assistant/TMHelpOnLineChat.js +1384 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +4 -4
- package/lib/components/features/assistant/TMToppySpeechBubble.js +1 -1
- package/lib/components/features/assistant/dataset/Designer-Suggested-Questions.json +102 -0
- package/lib/components/features/assistant/dataset/Login-Suggested-Questions.json +32 -0
- package/lib/components/features/assistant/dataset/Surfer-Suggested-Questions.json +102 -0
- package/lib/components/features/documents/TMBatchUpdateForm.js +22 -9
- package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
- 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 +281 -113
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +11 -0
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +79 -9
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -3
- package/lib/components/features/documents/TMDcmtIcon.js +8 -8
- package/lib/components/features/documents/TMDcmtPreview.d.ts +7 -5
- package/lib/components/features/documents/TMDcmtPreview.js +16 -10
- package/lib/components/features/documents/TMDcmtTasks.js +2 -9
- package/lib/components/features/documents/TMDownloadRelationViewerSection.js +1 -1
- package/lib/components/features/documents/TMFileUploader.js +7 -7
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +95 -108
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +20 -0
- package/lib/components/features/documents/TMMasterInfoFields.js +185 -0
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +83 -56
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +46 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +320 -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 +29 -9
- package/lib/components/features/documents/TMRelationViewer.js +310 -208
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +1 -1
- package/lib/components/features/documents/relationTreeState.d.ts +32 -0
- package/lib/components/features/documents/relationTreeState.js +89 -0
- package/lib/components/features/search/TMMetadataOutputForm.js +1 -1
- package/lib/components/features/search/TMMetadataSorterForm.js +1 -1
- package/lib/components/features/search/TMSavedQuerySelector.js +2 -2
- package/lib/components/features/search/TMSearch.d.ts +1 -1
- package/lib/components/features/search/TMSearch.js +172 -34
- package/lib/components/features/search/TMSearchQueryEditor.js +7 -5
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +14 -4
- package/lib/components/features/search/TMSearchQueryPanel.js +153 -62
- package/lib/components/features/search/TMSearchResult.d.ts +21 -0
- package/lib/components/features/search/TMSearchResult.js +461 -152
- package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
- package/lib/components/features/search/TMTreeSelector.js +130 -83
- package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
- package/lib/components/features/tasks/TMTaskForm.js +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.js +3 -3
- package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.js +1 -1
- package/lib/components/features/tasks/TMTasksView.js +97 -102
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +92 -92
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +10 -0
- package/lib/components/features/workflow/TMWorkflowPopup.js +9 -5
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +4 -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/Menu.js +1 -1
- package/lib/components/forms/Login/OTPReader.js +1 -1
- package/lib/components/forms/Login/PasswordStrengthChecker.js +1 -1
- package/lib/components/forms/Login/RapidAccessLogin.js +2 -2
- package/lib/components/forms/Login/RecoverPasswordFlow.js +2 -2
- package/lib/components/forms/Login/SelectBox.js +1 -1
- package/lib/components/forms/Login/StepIndicator.js +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +7 -7
- package/lib/components/forms/Login/TextBox.js +1 -1
- package/lib/components/forms/TMApplyForm.js +3 -3
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/forms/TMSaveForm.js +3 -3
- package/lib/components/grids/TMBlogAttachments.js +14 -3
- package/lib/components/grids/TMBlogHeader.js +5 -1
- package/lib/components/grids/TMBlogsPost.d.ts +2 -0
- package/lib/components/grids/TMBlogsPost.js +122 -99
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +15 -4
- package/lib/components/grids/TMRecentsManager.js +4 -4
- package/lib/components/grids/TMValidationItemsList.js +1 -1
- package/lib/components/index.d.ts +6 -0
- package/lib/components/index.js +5 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +25 -15
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +4 -5
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
- package/lib/components/layout/panelManager/TMPanelWrapper.js +3 -3
- package/lib/components/layout/panelManager/types.d.ts +3 -0
- package/lib/components/layout/panelManager/utils.js +13 -11
- package/lib/components/pages/TMPage.js +30 -32
- package/lib/components/query/TMQueryCountButton.js +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +17 -10
- package/lib/components/query/TMQueryEditor.js +9 -8
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMCommandsPanel.js +1 -1
- package/lib/components/sidebar/TMHeader.d.ts +1 -0
- package/lib/components/sidebar/TMHeader.js +37 -27
- package/lib/components/sidebar/TMSidebar.js +1 -1
- package/lib/components/sidebar/TMSidebarItem.js +1 -1
- package/lib/components/viewers/TMMidViewer.js +6 -3
- package/lib/components/viewers/TMTidViewer.js +89 -28
- package/lib/components/wizard/TMStepIndicator.js +3 -3
- 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/Enum_Localizator.d.ts +4 -4
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/Globalization.d.ts +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +110 -0
- package/lib/helper/SDKUI_Globals.js +151 -0
- package/lib/helper/SDKUI_Localizator.d.ts +756 -677
- package/lib/helper/SDKUI_Localizator.js +790 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +2 -0
- package/lib/helper/TMAppUpdatedModal.js +134 -0
- package/lib/helper/TMIcons.d.ts +1 -0
- package/lib/helper/TMIcons.js +4 -3
- package/lib/helper/TMPdfViewer.js +1 -1
- package/lib/helper/TMToppyMessage.js +1 -1
- package/lib/helper/TMUtils.d.ts +51 -4
- package/lib/helper/TMUtils.js +273 -12
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +1 -1
- package/lib/helper/dataGridSearchHelper.d.ts +28 -0
- package/lib/helper/dataGridSearchHelper.js +51 -0
- package/lib/helper/dcmtsHelper.d.ts +22 -0
- package/lib/helper/dcmtsHelper.js +60 -1
- package/lib/helper/helpers.d.ts +24 -2
- package/lib/helper/helpers.js +59 -3
- 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/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +14 -34
- package/lib/hooks/useDataUserIdItem.d.ts +1 -0
- package/lib/hooks/useDataUserIdItem.js +1 -0
- package/lib/hooks/useDcmtOperations.d.ts +3 -12
- package/lib/hooks/useDcmtOperations.js +187 -179
- package/lib/hooks/useDocumentOperations.d.ts +5 -0
- package/lib/hooks/useDocumentOperations.js +64 -33
- package/lib/hooks/useInputDialog.js +1 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +98 -0
- package/lib/hooks/useMultiMasterDetailDcmts.js +758 -0
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useQueryParametersDialog.js +1 -1
- 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/hooks/useWorkflowApprove.js +33 -17
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -2
- package/lib/services/caseflow/CaseFlowService.d.ts +277 -0
- package/lib/services/caseflow/CaseFlowService.js +761 -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 -4
- package/package.json +16 -13
|
@@ -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) {
|
|
@@ -153,17 +166,9 @@ const TMPanelManagerContainer = (props) => {
|
|
|
153
166
|
width: (isMobile || maximizedPanels.length > 0) ? '100%' : showToolbar ? `calc(100% - 70px)` : '100%',
|
|
154
167
|
height: isMobile ? (showToolbar ? `calc(100% - 55px)` : '100%') : '100%',
|
|
155
168
|
flexDirection: 'row'
|
|
156
|
-
}, children: _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(StyledPanelContainerWrapper, { ref: containerRef,
|
|
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, {
|
|
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, {
|
|
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;
|
|
@@ -14,12 +14,14 @@ export const TMPanelManagerProvider = (props) => {
|
|
|
14
14
|
const defaultPanelDimensionsRef = useRef(defaultDimensions);
|
|
15
15
|
// Memoize the panel hierarchy map to avoid re-generating it on every render unless `panels` change
|
|
16
16
|
const hierarchyMap = useMemo(() => generatePanelHierarchyMap(panels), [panels]);
|
|
17
|
-
// State to track the dimensions (width and height) of each panel, initialized with props
|
|
18
|
-
const [
|
|
17
|
+
// State to track the visibility and the dimensions (width and height) of each panel, initialized with props
|
|
18
|
+
const [panelLayout, setPanelLayout] = useState({ visibility: {}, dimensions: initialDimensions });
|
|
19
|
+
// Visibility of each panel, keyed by panel ID
|
|
20
|
+
const panelVisibility = panelLayout.visibility;
|
|
21
|
+
// Dimensions of each panel, keyed by panel ID
|
|
22
|
+
const panelDimensions = panelLayout.dimensions;
|
|
19
23
|
// IDs of maximized panels, including their parents if present
|
|
20
24
|
const [maximizedPanels, setMaximizedPanels] = useState([]);
|
|
21
|
-
// State to track the visibility of each panel, keyed by panel ID
|
|
22
|
-
const [panelVisibility, setPanelVisibility] = useState({});
|
|
23
25
|
// State to track visibility of toolbar buttons, keyed by panel ID
|
|
24
26
|
const [toolbarButtonsVisibility, setToolbarButtonsVisibility] = useState({});
|
|
25
27
|
// State to track disabled status of toolbar buttons, keyed by panel ID
|
|
@@ -31,94 +33,73 @@ export const TMPanelManagerProvider = (props) => {
|
|
|
31
33
|
setToolbarButtonsVisibility(visibilityMap);
|
|
32
34
|
setToolbarButtonsDisabled(disabledMap);
|
|
33
35
|
}, []);
|
|
34
|
-
// Callback to update the visibility state of a specific panel and its related hierarchy
|
|
35
|
-
const adjustPanelVisibilityAndSize = useCallback((id, isVisible,
|
|
36
|
+
// Callback to update the visibility state of a specific panel and its related hierarchy, redistributing the dimensions accordingly
|
|
37
|
+
const adjustPanelVisibilityAndSize = useCallback((id, isVisible, prevLayout) => {
|
|
36
38
|
// Clone previous visibility state to work with
|
|
37
|
-
let updatedVisibility = { ...
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const parentsToShow = showParentRecursively(id, hierarchyMap);
|
|
44
|
-
parentsToShow.forEach(([pid, visible]) => { updatedVisibility[pid] = visible; });
|
|
45
|
-
// Show the target panel
|
|
46
|
-
updatedVisibility[id] = true;
|
|
47
|
-
// Redistribute dimensions to account for newly shown panel
|
|
48
|
-
setPanelDimensions(prev => redistributeDimensionsOnShow(id, prev, defaultPanelDimensionsRef.current, hierarchyMap, updatedVisibility));
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
// Hide the panel
|
|
52
|
-
updatedVisibility[id] = false;
|
|
53
|
-
// Recursively hide parents
|
|
54
|
-
const parentsToHide = hideParentRecursively(id, hierarchyMap, updatedVisibility);
|
|
55
|
-
parentsToHide.forEach(([pid, visible]) => { updatedVisibility[pid] = visible; });
|
|
56
|
-
4;
|
|
57
|
-
// Redistribute dimensions after hiding
|
|
58
|
-
setPanelDimensions(prev => redistributeDimensionsOnHide(id, prev, hierarchyMap, updatedVisibility));
|
|
39
|
+
let updatedVisibility = { ...prevLayout.visibility };
|
|
40
|
+
let updatedDimensions;
|
|
41
|
+
if (isVisible) {
|
|
42
|
+
// On mobile, showing one panel hides all others first
|
|
43
|
+
if (isMobile) {
|
|
44
|
+
updatedVisibility = Object.keys(prevLayout.visibility).reduce((acc, key) => { acc[key] = false; return acc; }, {});
|
|
59
45
|
}
|
|
46
|
+
// Recursively determine and show parent panels
|
|
47
|
+
const parentsToShow = showParentRecursively(id, hierarchyMap);
|
|
48
|
+
parentsToShow.forEach(([pid, visible]) => { updatedVisibility[pid] = visible; });
|
|
49
|
+
// Show the target panel
|
|
50
|
+
updatedVisibility[id] = true;
|
|
51
|
+
// Redistribute dimensions to account for newly shown panel
|
|
52
|
+
updatedDimensions = redistributeDimensionsOnShow(id, prevLayout.dimensions, defaultPanelDimensionsRef.current, hierarchyMap, updatedVisibility);
|
|
60
53
|
}
|
|
61
54
|
else {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
setPanelDimensions(prev => redistributeDimensionsOnShow(id, prev, defaultPanelDimensionsRef.current, hierarchyMap, updatedVisibility));
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
// Hide the panel
|
|
73
|
-
updatedVisibility[id] = false;
|
|
74
|
-
// Recursively hide parent panels
|
|
75
|
-
const parentsToHide = hideParentRecursively(id, hierarchyMap, updatedVisibility);
|
|
76
|
-
parentsToHide.forEach(([pid, visible]) => { updatedVisibility[pid] = visible; });
|
|
77
|
-
// Adjust dimensions after hiding
|
|
78
|
-
setPanelDimensions(prev => redistributeDimensionsOnHide(id, prev, hierarchyMap, updatedVisibility));
|
|
79
|
-
}
|
|
55
|
+
// Hide the panel
|
|
56
|
+
updatedVisibility[id] = false;
|
|
57
|
+
// Recursively hide parents
|
|
58
|
+
const parentsToHide = hideParentRecursively(id, hierarchyMap, updatedVisibility);
|
|
59
|
+
parentsToHide.forEach(([pid, visible]) => { updatedVisibility[pid] = visible; });
|
|
60
|
+
// Redistribute dimensions after hiding
|
|
61
|
+
updatedDimensions = redistributeDimensionsOnHide(id, prevLayout.dimensions, hierarchyMap, updatedVisibility);
|
|
80
62
|
}
|
|
81
|
-
return updatedVisibility;
|
|
63
|
+
return { visibility: updatedVisibility, dimensions: updatedDimensions };
|
|
82
64
|
}, [hierarchyMap, isMobile]);
|
|
83
65
|
// On initial mount: initialize panel visibility using the provided `initialVisibility` config
|
|
84
66
|
// Each panel's visibility is processed through `updatePanelVisibility` to ensure hierarchy logic is applied
|
|
85
67
|
useEffect(() => {
|
|
86
68
|
if (isPersistenceEnabled) {
|
|
87
69
|
// If persistence is enabled, visibility and dimensions are already synced from persisted state, so just set them directly
|
|
88
|
-
|
|
89
|
-
setPanelDimensions(initialDimensions);
|
|
70
|
+
setPanelLayout({ visibility: initialVisibility, dimensions: initialDimensions });
|
|
90
71
|
}
|
|
91
72
|
else {
|
|
92
73
|
// If persistence is not enabled, recalculate visibility and dimensions based on the initial visibility, applying the hierarchy logic
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
74
|
+
setPanelLayout(prev => {
|
|
75
|
+
let updated = { visibility: { ...initialVisibility }, dimensions: prev.dimensions };
|
|
76
|
+
Object.entries(initialVisibility).forEach(([id, isVisible]) => {
|
|
77
|
+
updated = adjustPanelVisibilityAndSize(id, isVisible, updated);
|
|
78
|
+
});
|
|
79
|
+
return updated;
|
|
96
80
|
});
|
|
97
|
-
// Update panel visibility state with recalculated values
|
|
98
|
-
setPanelVisibility(updated);
|
|
99
81
|
}
|
|
100
82
|
}, []);
|
|
101
83
|
// On mobile devices: automatically show the initial mobile panel when layout switches to mobile
|
|
102
84
|
// This ensures the correct panel is visible by default on smaller screens
|
|
103
85
|
useEffect(() => {
|
|
104
86
|
if (isMobile) {
|
|
105
|
-
|
|
106
|
-
return adjustPanelVisibilityAndSize(initialMobilePanelId, true, prev);
|
|
107
|
-
});
|
|
87
|
+
setPanelLayout(prev => adjustPanelVisibilityAndSize(initialMobilePanelId, true, prev));
|
|
108
88
|
}
|
|
109
89
|
else {
|
|
110
90
|
if (isPersistenceEnabled) {
|
|
111
91
|
// If persistence is enabled, visibility and dimensions are already synced from persisted state, so just set them directly
|
|
112
|
-
|
|
92
|
+
setPanelLayout(prev => ({ ...prev, visibility: initialVisibility }));
|
|
113
93
|
}
|
|
114
94
|
else {
|
|
115
95
|
// If persistence is not enabled, recalculate visibility and dimensions based on the initial visibility, applying the hierarchy logic
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
96
|
+
setPanelLayout(prev => {
|
|
97
|
+
let updated = { visibility: { ...initialVisibility }, dimensions: prev.dimensions };
|
|
98
|
+
Object.entries(initialVisibility).forEach(([id, isVisible]) => {
|
|
99
|
+
updated = adjustPanelVisibilityAndSize(id, isVisible, updated);
|
|
100
|
+
});
|
|
101
|
+
return updated;
|
|
119
102
|
});
|
|
120
|
-
// Update panel visibility state with recalculated values
|
|
121
|
-
setPanelVisibility(updated);
|
|
122
103
|
}
|
|
123
104
|
}
|
|
124
105
|
}, [isMobile]);
|
|
@@ -131,9 +112,9 @@ export const TMPanelManagerProvider = (props) => {
|
|
|
131
112
|
// Update state to track which panels are maximized
|
|
132
113
|
setMaximizedPanels(toMaximize);
|
|
133
114
|
// Update panel dimensions accordingly
|
|
134
|
-
|
|
115
|
+
setPanelLayout(prev => {
|
|
135
116
|
const newDimensions = {};
|
|
136
|
-
Object.keys(prev).forEach(pid => {
|
|
117
|
+
Object.keys(prev.dimensions).forEach(pid => {
|
|
137
118
|
if (toMaximize.includes(pid)) {
|
|
138
119
|
// For maximized panels (target + parents), set width and height to 100%
|
|
139
120
|
newDimensions[pid] = { width: '100%', height: '100%' };
|
|
@@ -143,31 +124,31 @@ export const TMPanelManagerProvider = (props) => {
|
|
|
143
124
|
newDimensions[pid] = { width: '0%', height: '0%' };
|
|
144
125
|
}
|
|
145
126
|
});
|
|
146
|
-
return newDimensions;
|
|
127
|
+
return { ...prev, dimensions: newDimensions };
|
|
147
128
|
});
|
|
148
129
|
}, [hierarchyMap]);
|
|
149
130
|
// Restore all panels to their original dimensions
|
|
150
131
|
const resetMaximization = useCallback(() => {
|
|
151
132
|
// Clear the list of maximized panels to exit maximize mode
|
|
152
133
|
setMaximizedPanels([]);
|
|
153
|
-
// Clone the current visibility state of panels
|
|
154
|
-
let updatedVisibility = { ...panelVisibility };
|
|
155
134
|
// Start with the initial panel dimensions as the base for restoration
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
135
|
+
setPanelLayout(prev => {
|
|
136
|
+
const updatedVisibility = prev.visibility;
|
|
137
|
+
const nextDimensions = Object.entries(updatedVisibility).reduce((acc, [id, isVisible]) => {
|
|
138
|
+
if (isVisible) {
|
|
139
|
+
// If the panel is visible, adjust dimensions to show it properly
|
|
140
|
+
acc = redistributeDimensionsOnShow(id, acc, defaultPanelDimensionsRef.current, hierarchyMap, updatedVisibility);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
// If the panel is hidden, adjust dimensions to hide it
|
|
144
|
+
acc = redistributeDimensionsOnHide(id, acc, hierarchyMap, updatedVisibility);
|
|
145
|
+
}
|
|
146
|
+
return acc;
|
|
147
|
+
}, defaultPanelDimensionsRef.current);
|
|
148
|
+
// Apply the recalculated dimensions to the panel state
|
|
149
|
+
return { ...prev, dimensions: nextDimensions };
|
|
150
|
+
});
|
|
151
|
+
}, [hierarchyMap]);
|
|
171
152
|
// Toggle the maximized state of a panel by its ID
|
|
172
153
|
const toggleMaximize = useCallback((id) => {
|
|
173
154
|
if (maximizedPanels.includes(id)) {
|
|
@@ -186,17 +167,11 @@ export const TMPanelManagerProvider = (props) => {
|
|
|
186
167
|
// If it is maximized, first reset all maximized panels to their original state
|
|
187
168
|
resetMaximization();
|
|
188
169
|
// Then update the visibility of the panel, toggling its current state
|
|
189
|
-
|
|
190
|
-
const isCurrentlyVisible = prev[id];
|
|
191
|
-
return adjustPanelVisibilityAndSize(id, !isCurrentlyVisible, prev);
|
|
192
|
-
});
|
|
170
|
+
setPanelLayout(prev => adjustPanelVisibilityAndSize(id, !prev.visibility[id], prev));
|
|
193
171
|
}
|
|
194
172
|
else {
|
|
195
173
|
// If the panel is not maximized, simply toggle its visibility
|
|
196
|
-
|
|
197
|
-
const isCurrentlyVisible = prev[id];
|
|
198
|
-
return adjustPanelVisibilityAndSize(id, !isCurrentlyVisible, prev);
|
|
199
|
-
});
|
|
174
|
+
setPanelLayout(prev => adjustPanelVisibilityAndSize(id, !prev.visibility[id], prev));
|
|
200
175
|
}
|
|
201
176
|
}, [maximizedPanels, resetMaximization, adjustPanelVisibilityAndSize]);
|
|
202
177
|
// Sets the visibility of a panel by its ID to a specific value (true = show, false = hide)
|
|
@@ -206,14 +181,14 @@ export const TMPanelManagerProvider = (props) => {
|
|
|
206
181
|
resetMaximization();
|
|
207
182
|
}
|
|
208
183
|
// Then update the visibility state of the panel to the given value
|
|
209
|
-
|
|
184
|
+
setPanelLayout(prev => adjustPanelVisibilityAndSize(id, isVisible, prev));
|
|
210
185
|
}, [maximizedPanels, resetMaximization, adjustPanelVisibilityAndSize]);
|
|
211
186
|
// Sets the dimensions (width and height) of a specific panel by its ID
|
|
212
187
|
const setPanelDimensionsById = useCallback((id, width, height) => {
|
|
213
188
|
// Update the ref holding the initial dimensions
|
|
214
189
|
defaultPanelDimensionsRef.current = { ...defaultPanelDimensionsRef.current, [id]: { width, height } };
|
|
215
190
|
// Update the panel dimensions state
|
|
216
|
-
|
|
191
|
+
setPanelLayout(prev => ({ ...prev, dimensions: { ...prev.dimensions, [id]: { width, height } } }));
|
|
217
192
|
}, []);
|
|
218
193
|
// Checks if there is at least one panel currently visible
|
|
219
194
|
const hasVisiblePanels = useCallback(() => {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TMPanelDefinition } from './types';
|
|
3
|
-
export declare const StyledToolbarButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
3
|
+
export declare const StyledToolbarButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
4
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
5
|
+
}, {
|
|
4
6
|
$isActive?: boolean;
|
|
5
7
|
$isDisabled?: boolean;
|
|
6
|
-
}
|
|
7
|
-
$isActive?: boolean;
|
|
8
|
-
$isDisabled?: boolean;
|
|
9
|
-
}, never>>> & string;
|
|
8
|
+
}>> & string;
|
|
10
9
|
interface TMPanelManagerToolbarProps {
|
|
11
10
|
panels: Array<TMPanelDefinition>;
|
|
12
11
|
}
|
|
@@ -77,7 +77,7 @@ const TMPanelManagerToolbar = (props) => {
|
|
|
77
77
|
const isDisabled = toolbarButtonsDisabled[visibleLeafPanel.id];
|
|
78
78
|
const count = visibleLeafPanel.toolbarOptions?.count ?? 0;
|
|
79
79
|
const tooltip = visibleLeafPanel.toolbarOptions?.tooltip ?? '';
|
|
80
|
-
return _jsx(TMTooltip, { content: tooltip || (visibleLeafPanel.name + (count > 0 ? ": " + count : '')), position: isMobile ? 'top' : 'left', children: _jsxs(StyledToolbarButton, { disabled: isDisabled,
|
|
80
|
+
return _jsx(TMTooltip, { content: tooltip || (visibleLeafPanel.name + (count > 0 ? ": " + count : '')), position: isMobile ? 'top' : 'left', children: _jsxs(StyledToolbarButton, { disabled: isDisabled, $isDisabled: isDisabled, onClick: () => onClickCallback(visibleLeafPanel.id, isActive), $isActive: isActive || visibleLeafPanel.toolbarOptions?.alwaysActiveColor, children: [typeof visibleLeafPanel.toolbarOptions?.icon === 'string' ? (_jsx("i", { className: `dx-icon dx-icon-${visibleLeafPanel.toolbarOptions?.icon}` })) : (visibleLeafPanel.toolbarOptions?.icon), (!isActive && count > 0) && _jsxs(Badge, { $background: visibleLeafPanel.toolbarOptions?.countBackgroundColor, children: [" ", formatCount(count), " "] })] }, visibleLeafPanel.id) }, visibleLeafPanel.id);
|
|
81
81
|
}) }));
|
|
82
82
|
};
|
|
83
83
|
export default TMPanelManagerToolbar;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useMemo, useState, useEffect } from 'react';
|
|
3
3
|
import { useTMPanelManagerContext } from './TMPanelManagerContext';
|
|
4
4
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
@@ -34,8 +34,8 @@ const TMPanelWrapper = (props) => {
|
|
|
34
34
|
// Applica 'flex' o 'none' solo se è già stato reso visibile almeno una volta
|
|
35
35
|
display: isCurrentlyVisible ? 'flex' : 'none',
|
|
36
36
|
flexDirection: 'column',
|
|
37
|
-
minWidth: '50px',
|
|
38
|
-
minHeight: '50px',
|
|
37
|
+
minWidth: panel.contentOptions?.minWidth ?? '50px',
|
|
38
|
+
minHeight: panel.contentOptions?.minHeight ?? '50px',
|
|
39
39
|
width: width,
|
|
40
40
|
height: height,
|
|
41
41
|
pointerEvents: 'auto',
|
|
@@ -97,18 +97,20 @@ export const redistributeDimensionsOnHide = (hiddenPanelId, currentDimensions, h
|
|
|
97
97
|
const hiddenWidthNum = parseFloat(hiddenDims.width);
|
|
98
98
|
const hiddenHeightNum = parseFloat(hiddenDims.height);
|
|
99
99
|
const visibleSiblings = siblings.filter(siblingId => panelVisibility[siblingId]);
|
|
100
|
-
const widthIncrement = hiddenWidthNum / visibleSiblings.length;
|
|
101
|
-
const heightIncrement = hiddenHeightNum / visibleSiblings.length;
|
|
102
100
|
let newDimensions = { ...currentDimensions };
|
|
103
|
-
visibleSiblings.
|
|
104
|
-
const
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
if (visibleSiblings.length > 0) {
|
|
102
|
+
const widthIncrement = hiddenWidthNum / visibleSiblings.length;
|
|
103
|
+
const heightIncrement = hiddenHeightNum / visibleSiblings.length;
|
|
104
|
+
visibleSiblings.forEach(siblingId => {
|
|
105
|
+
const siblingDims = newDimensions[siblingId] || { width: '0%', height: '0%' };
|
|
106
|
+
const siblingWidthNum = parseFloat(siblingDims.width) || 0;
|
|
107
|
+
const siblingHeightNum = parseFloat(siblingDims.height) || 0;
|
|
108
|
+
const newWidthNum = Math.min(siblingWidthNum + widthIncrement, 100);
|
|
109
|
+
const newHeightNum = Math.min(siblingHeightNum + heightIncrement, 100);
|
|
110
|
+
newDimensions[siblingId] = { width: `${newWidthNum}%`, height: `${newHeightNum}%` };
|
|
111
|
+
});
|
|
112
|
+
newDimensions[hiddenPanelId] = { width: '0%', height: '0%' };
|
|
113
|
+
}
|
|
112
114
|
// Ora controllo se il parent non ha più figli visibili e chiamo ricorsivamente
|
|
113
115
|
if (parentId) {
|
|
114
116
|
const parentInfo = hierarchyMap.get(parentId);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useState, useEffect } from "react";
|
|
3
3
|
import { SDK_Globals, ObjectClasses, ResultTypes } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import DataGrid, { Column, GroupPanel, Grouping, HeaderFilter, LoadPanel, Pager, Paging, Scrolling, SearchPanel, Selection } from "devextreme-react/data-grid";
|
|
@@ -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
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
91
|
+
const waitPanel = TMWaitPanelManager.show({
|
|
92
|
+
title: operationTitle,
|
|
93
|
+
max: selectedItems.length,
|
|
94
|
+
cancelable: true,
|
|
95
|
+
});
|
|
102
96
|
let result = [];
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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(
|
|
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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import TMButton from '../base/TMButton';
|
|
3
3
|
import { getQueryCountAsync, IconCount, IsParametricQuery, SDKUI_Localizator } from '../../helper';
|
|
4
4
|
import { useQueryParametersDialog } from '../../hooks/useQueryParametersDialog';
|
|
@@ -2,18 +2,22 @@ import React from 'react';
|
|
|
2
2
|
import { QueryDescriptor, ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { ITMApplyFormProps, FormModes } from '../../ts';
|
|
4
4
|
import type { TMContextMenuItemProps } from '../NewComponents/ContextMenu/types';
|
|
5
|
-
export declare const StyledRowItem: import("styled-components/dist/types").IStyledComponentBase<"web",
|
|
6
|
-
|
|
5
|
+
export declare const StyledRowItem: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
6
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
7
|
+
}> & string;
|
|
8
|
+
export declare const StyledItemWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
9
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
10
|
+
}, {
|
|
7
11
|
$borderRadius?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare const StyledAccordionItemContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
13
|
-
|
|
14
|
-
},
|
|
12
|
+
}>> & string;
|
|
13
|
+
export declare const StyledAccordionItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
14
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
15
|
+
}> & string;
|
|
16
|
+
export declare const StyledAccordionItemContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
17
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
18
|
+
}, {
|
|
15
19
|
$disabled?: boolean;
|
|
16
|
-
}
|
|
20
|
+
}>> & string;
|
|
17
21
|
export declare const colorValue = "rgba(224,224,224,.5)";
|
|
18
22
|
export declare const colorBrackets = "rgba(209,52,56,.3)";
|
|
19
23
|
export declare const colorOperator = "rgba(16,124,16,.3)";
|
|
@@ -43,6 +47,9 @@ interface ITMQueryEditor extends ITMApplyFormProps<QueryDescriptor> {
|
|
|
43
47
|
isExpertMode?: boolean;
|
|
44
48
|
validateSelect?: boolean;
|
|
45
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;
|
|
46
53
|
showDistinct?: boolean;
|
|
47
54
|
raiseWarningForOnlyMetadataDcmtTypes?: boolean;
|
|
48
55
|
borderRadius?: string;
|