@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
|
@@ -1,154 +1,170 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCallback, useEffect, useMemo,
|
|
3
|
-
import { LayoutModes,
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { LayoutModes, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
5
|
+
import { calcResponsiveSizes, IconAll, IconDelete, IconPencil, IconRefresh, IconSelected, SDKUI_Localizator } from '../../helper';
|
|
6
|
+
import TMButton from '../base/TMButton';
|
|
7
|
+
import TMDataGrid from '../base/TMDataGrid';
|
|
8
|
+
import { CounterItemKey } from '../base/TMCounterContainer';
|
|
9
|
+
import { useDeviceType } from '../base/TMDeviceProvider';
|
|
9
10
|
import TMCheckBox from '../editors/TMCheckBox';
|
|
11
|
+
import TMDropDown from '../editors/TMDropDown';
|
|
12
|
+
import TMTextBox from '../editors/TMTextBox';
|
|
10
13
|
import TMPanel from '../base/TMPanel';
|
|
11
14
|
import TMModal from '../base/TMModal';
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
15
|
+
import TMQuickSearchSettingsForm from './TMQuickSearchSettingsForm';
|
|
16
|
+
import TMSelectedValuesSummary from './TMSelectedValuesSummary';
|
|
17
|
+
import { useTMDistinctValuesMetadataDisplay } from '../../hooks/useTMDistinctValuesMetadataDisplay';
|
|
18
|
+
import { DistinctValuesModes, QUICK_SEARCH_VALUE_COLUMN_CLASS, useTMDistinctValuesQuickSearch } from '../../hooks/useTMDistinctValuesQuickSearch';
|
|
19
|
+
import { useTMDistinctValuesSelection } from '../../hooks/useTMDistinctValuesSelection';
|
|
20
|
+
import { useTMDistinctValuesSource } from '../../hooks/useTMDistinctValuesSource';
|
|
21
|
+
import { TMColors } from '../../utils/theme';
|
|
22
|
+
/* Il padding orizzontale stacca il contenuto dai bordi del pannello/modale che lo ospita */
|
|
23
|
+
const StyledDistinctValues = styled.div `display: flex; flex-direction: column; height: 100%; overflow: hidden; gap: 6px; padding: 4px 8px 6px; position: relative;`;
|
|
24
|
+
const StyledTopBar = styled.div `
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: flex-start;
|
|
29
|
+
gap: 15px;
|
|
30
|
+
flex-wrap: wrap;
|
|
31
|
+
padding: 6px 10px;
|
|
32
|
+
background-color: ${TMColors.toolbar_background};
|
|
33
|
+
border: 1px solid ${TMColors.border_normal};
|
|
34
|
+
border-radius: 6px;
|
|
35
|
+
`;
|
|
36
|
+
/* Accodamento e separatore stanno con il resto della configurazione: il divisore li distingue dai comandi senza staccarli dal gruppo */
|
|
37
|
+
const StyledAppendBar = styled.div `
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: row;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: 8px;
|
|
42
|
+
min-height: 30px;
|
|
43
|
+
padding-left: 10px;
|
|
44
|
+
border-left: 1px solid ${TMColors.border_normal};
|
|
45
|
+
`;
|
|
46
|
+
/* Modalità, comandi e opzioni di accodamento: tutta la configurazione del pannello su un'unica riga */
|
|
47
|
+
const StyledConfigBar = styled.div `display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px;`;
|
|
48
|
+
const StyledGridContainer = styled.div `
|
|
49
|
+
flex: 1;
|
|
50
|
+
min-height: 0;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
|
|
53
|
+
/* Evidenzia intestazione e celle della colonna da cui viene prelevato il valore */
|
|
54
|
+
.${QUICK_SEARCH_VALUE_COLUMN_CLASS} {
|
|
55
|
+
background-color: ${TMColors.primary_container};
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
const NO_SELECTED_ROW_KEYS = [];
|
|
60
|
+
/* Quota di larghezza attribuita a ciascuna colonna della griglia, oltre a una base fissa per la barra dei comandi.
|
|
61
|
+
I limiti evitano i due estremi: sotto il 40% la barra dei comandi diventa illeggibile, oltre il 95% il modale esce dallo schermo */
|
|
62
|
+
const QUICK_SEARCH_BASE_WIDTH_PERC = 16;
|
|
63
|
+
const QUICK_SEARCH_COLUMN_WIDTH_PERC = 12;
|
|
64
|
+
const QUICK_SEARCH_MIN_WIDTH_PERC = 40;
|
|
65
|
+
const QUICK_SEARCH_MAX_WIDTH_PERC = 95;
|
|
66
|
+
/**
|
|
67
|
+
* Larghezza del modale della ricerca rapida, proporzionale al numero di colonne mostrate: con poche colonne
|
|
68
|
+
* un modale a tutta pagina le lascerebbe stirate e meno leggibili, con molte serve tutto lo spazio disponibile.
|
|
69
|
+
*/
|
|
70
|
+
const calcQuickSearchModalWidth = (visibleColumnsCount) => {
|
|
71
|
+
const widthPerc = QUICK_SEARCH_BASE_WIDTH_PERC + visibleColumnsCount * QUICK_SEARCH_COLUMN_WIDTH_PERC;
|
|
72
|
+
return `${Math.min(QUICK_SEARCH_MAX_WIDTH_PERC, Math.max(QUICK_SEARCH_MIN_WIDTH_PERC, widthPerc))}%`;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Pannello da cui si preleva il valore di un campo del form scegliendolo fra quelli già archiviati.
|
|
76
|
+
*
|
|
77
|
+
* Le due sorgenti (valori distinti del metadato e ricerca rapida su una ricerca salvata) stanno in due hook
|
|
78
|
+
* dedicati che espongono la stessa interfaccia (righe, colonne, conteggi): qui restano la composizione,
|
|
79
|
+
* la scelta della sorgente da mostrare e il render.
|
|
80
|
+
*/
|
|
81
|
+
const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppendMode = true, showHeader = true, isModal, separator = ",", onSelectionChanged, onClosePanelCallback }) => {
|
|
82
|
+
const deviceType = useDeviceType();
|
|
83
|
+
const display = useTMDistinctValuesMetadataDisplay();
|
|
84
|
+
const distinctValues = useTMDistinctValuesSource({ tid, mid, display });
|
|
85
|
+
const quickSearch = useTMDistinctValuesQuickSearch({ tid, mid, md: distinctValues.md, display });
|
|
86
|
+
const { isQuickSearchMode, isQuickSearchGridVisible } = quickSearch;
|
|
87
|
+
// Il valore della riga sta in campi diversi nelle due sorgenti: nei valori distinti è sempre `value`,
|
|
88
|
+
// nella ricerca rapida è la colonna del metadato configurato
|
|
89
|
+
const getRowValue = useCallback((row) => {
|
|
90
|
+
if (!isQuickSearchGridVisible)
|
|
91
|
+
return row?.value;
|
|
92
|
+
return quickSearch.valueField ? row?.[quickSearch.valueField] : undefined;
|
|
93
|
+
}, [isQuickSearchGridVisible, quickSearch.valueField]);
|
|
94
|
+
const selection = useTMDistinctValuesSelection({
|
|
95
|
+
tid, mid, md: distinctValues.md, layoutMode, allowAppendMode, separator,
|
|
96
|
+
selectedValueMd: quickSearch.selectedValueMd,
|
|
97
|
+
getRowValue,
|
|
98
|
+
getMetadataDisplayValue: display.getMetadataDisplayValue,
|
|
99
|
+
onSelectionChanged
|
|
100
|
+
});
|
|
101
|
+
// Cambiando sorgente la riga focalizzata non esiste più: la griglia viene ricreata da zero
|
|
102
|
+
useEffect(() => { selection.setFocusedItem(undefined); }, [quickSearch.mode, quickSearch.settings]);
|
|
103
|
+
const refreshAsync = async () => {
|
|
104
|
+
if (!isQuickSearchMode) {
|
|
105
|
+
await distinctValues.loadAsync();
|
|
59
106
|
return;
|
|
60
|
-
try {
|
|
61
|
-
TMSpinner.show({ description: 'Caricamento dei valori distinti...' });
|
|
62
|
-
let dtd = await DcmtTypeListCacheService.GetAsync(tid, true);
|
|
63
|
-
const currentMd = dtd?.metadata?.find(o => o.id === mid);
|
|
64
|
-
setMd(currentMd);
|
|
65
|
-
let result = await SDK_Globals.tmSession?.NewSearchEngine().GetDistinctValuesAsync(tid, mid, 10000);
|
|
66
|
-
// Load DataList or UserID cache based on metadata domain
|
|
67
|
-
if (currentMd?.dataDomain === MetadataDataDomains.DataList && currentMd.dataListID) {
|
|
68
|
-
await loadDataListsAsync(new Set([currentMd.dataListID]));
|
|
69
|
-
}
|
|
70
|
-
if (currentMd?.dataDomain === MetadataDataDomains.UserID && result?.dtdResult?.rows) {
|
|
71
|
-
const userIDs = new Set();
|
|
72
|
-
result.dtdResult.rows.forEach((row) => {
|
|
73
|
-
const userId = Number(row[0]);
|
|
74
|
-
if (userId && userId > 0) {
|
|
75
|
-
userIDs.add(userId);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
await loadUsersAsync(userIDs);
|
|
79
|
-
}
|
|
80
|
-
setDataSource(convertDataTableToObject(result?.dtdResult));
|
|
81
|
-
}
|
|
82
|
-
catch (e) {
|
|
83
|
-
let err = e;
|
|
84
|
-
TMExceptionBoxManager.show({ exception: err });
|
|
85
|
-
}
|
|
86
|
-
finally {
|
|
87
|
-
TMSpinner.hide();
|
|
88
107
|
}
|
|
108
|
+
await quickSearch.refreshAsync();
|
|
89
109
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}, [md, renderDataListCell, renderUserIdViewer]);
|
|
104
|
-
const customColumns = useMemo(() => {
|
|
105
|
-
const needsCellRender = md?.dataDomain === MetadataDataDomains.DataList || md?.dataDomain === MetadataDataDomains.UserID;
|
|
106
|
-
return ([
|
|
107
|
-
{ dataField: 'value', dataType: md?.dataType === MetadataDataTypes.DateTime ? 'date' : 'string', caption: md?.nameLoc, width: 'min-content', ...(needsCellRender && { cellRender: valueCellRender }) },
|
|
108
|
-
{ dataField: 'Count', dataType: 'number', caption: 'N°' }
|
|
110
|
+
// Finché le colonne della ricerca rapida non sono pronte la griglia non va montata: nascerebbe senza campi
|
|
111
|
+
const isGridReady = !isQuickSearchGridVisible || quickSearch.columns.length > 0;
|
|
112
|
+
const counterConfig = useMemo(() => {
|
|
113
|
+
const counts = isQuickSearchGridVisible ? quickSearch.counts : distinctValues.counts;
|
|
114
|
+
const items = new Map([
|
|
115
|
+
[CounterItemKey.selectedItems, {
|
|
116
|
+
key: CounterItemKey.selectedItems,
|
|
117
|
+
show: true,
|
|
118
|
+
caption: SDKUI_Localizator.SelectedItems,
|
|
119
|
+
value: selection.selectedValues.length,
|
|
120
|
+
icon: _jsx(IconSelected, {}),
|
|
121
|
+
order: 1
|
|
122
|
+
}]
|
|
109
123
|
]);
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const convertDataTableToObject = (dtdResult) => {
|
|
120
|
-
if (!dtdResult?.columns?.length || !dtdResult?.rows?.length)
|
|
121
|
-
return [];
|
|
122
|
-
return dtdResult.rows.map((row, index) => {
|
|
123
|
-
let rowObject = { rowIndex: index };
|
|
124
|
-
dtdResult.columns && dtdResult.columns.forEach((col, colIndex) => {
|
|
125
|
-
if (col?.caption) {
|
|
126
|
-
rowObject[colIndex === 0 ? "value" : col.caption] = col.dataType === DataColumnTypes.Number
|
|
127
|
-
? row?.[colIndex]?.replace('.', ',')
|
|
128
|
-
: row?.[colIndex] ?? null;
|
|
129
|
-
}
|
|
124
|
+
// Senza il totale resta il conteggio predefinito della griglia: un rapporto con totale a zero sarebbe fuorviante
|
|
125
|
+
if (counts?.found) {
|
|
126
|
+
items.set(CounterItemKey.allItems, {
|
|
127
|
+
key: CounterItemKey.allItems,
|
|
128
|
+
show: true,
|
|
129
|
+
caption: `${counts.returned} restituiti su ${counts.found} trovati`,
|
|
130
|
+
value: `${counts.returned}/${counts.found}`,
|
|
131
|
+
icon: _jsx(IconAll, {}),
|
|
132
|
+
order: -1
|
|
130
133
|
});
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
}
|
|
135
|
+
return { show: true, items: items };
|
|
136
|
+
}, [isQuickSearchGridVisible, quickSearch.counts, distinctValues.counts, selection.selectedValues]);
|
|
137
|
+
// Configurazione fissa: dal pannello si preleva un valore per volta, le caselle di selezione non servono
|
|
138
|
+
const gridSelection = useMemo(() => ({ showCheckBoxesMode: 'none' }), []);
|
|
139
|
+
const modeDataSource = useMemo(() => ([
|
|
140
|
+
{ value: DistinctValuesModes.DistinctValues, display: SDKUI_Localizator.DistinctValues },
|
|
141
|
+
{ value: DistinctValuesModes.QuickSearch, display: SDK_Localizator.SavedQuery },
|
|
142
|
+
]), []);
|
|
143
|
+
const panelTitle = (isQuickSearchGridVisible ? SDK_Localizator.SavedQuery : SDKUI_Localizator.DistinctValues) + (distinctValues.md?.nameLoc ? ` (${distinctValues.md?.nameLoc})` : '');
|
|
144
|
+
/* Le colonne nascoste (metadati di sistema della query) non occupano spazio: non vanno contate nella larghezza.
|
|
145
|
+
Durante un ricaricamento le colonne tornano momentaneamente vuote: si conserva l'ultima larghezza calcolata,
|
|
146
|
+
altrimenti il modale si restringerebbe per poi riallargarsi */
|
|
147
|
+
const lastQuickSearchModalWidthRef = useRef();
|
|
148
|
+
const quickSearchModalWidth = useMemo(() => {
|
|
149
|
+
const visibleColumnsCount = quickSearch.columns.filter(col => col.visible !== false).length;
|
|
150
|
+
if (visibleColumnsCount > 0)
|
|
151
|
+
lastQuickSearchModalWidthRef.current = calcQuickSearchModalWidth(visibleColumnsCount);
|
|
152
|
+
return lastQuickSearchModalWidthRef.current;
|
|
153
|
+
}, [quickSearch.columns]);
|
|
154
|
+
/* La larghezza è nota solo a ricerca conclusa: mostrare subito il modale lo farebbe nascere alla larghezza minima
|
|
155
|
+
per poi allargarlo sotto gli occhi dell'utente, quindi si attende (l'attesa è coperta dallo spinner della ricerca) */
|
|
156
|
+
const isModalReady = !isQuickSearchGridVisible || !!quickSearchModalWidth || !quickSearch.isFirstSearchPending;
|
|
147
157
|
const renderContent = () => {
|
|
148
|
-
return (_jsxs(StyledDistinctValues, { children: [
|
|
158
|
+
return (_jsxs(StyledDistinctValues, { children: [_jsx(StyledTopBar, { children: _jsxs(StyledConfigBar, { children: [_jsx(TMDropDown, { width: '180px', value: quickSearch.mode, dataSource: modeDataSource, elementStyle: { display: 'flex', alignItems: 'center' }, onValueChanged: (e) => quickSearch.onModeChanged(Number(e.target.value)) }), isQuickSearchMode &&
|
|
159
|
+
_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Settings, icon: _jsx(IconPencil, {}), onClick: () => quickSearch.setShowSettingsForm(true) }), isQuickSearchMode && Boolean(quickSearch.settings) &&
|
|
160
|
+
_jsx(TMButton, { btnStyle: 'toolbar', color: 'error', caption: SDKUI_Localizator.Delete, icon: _jsx(IconDelete, {}), onClick: quickSearch.onDeleteSettingsClick }), _jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Refresh, icon: _jsx(IconRefresh, {}), onClick: () => refreshAsync() }), selection.isAppendVisible && _jsxs(StyledAppendBar, { children: [_jsx(TMCheckBox, { label: 'Accoda e separa con', value: selection.isAppendMode, onValueChanged: selection.onAppendModeChanged }), _jsx(TMTextBox, { width: '30px', readOnly: true, disabled: !selection.isAppendMode, value: separator })] })] }) }), _jsx(TMSelectedValuesSummary, { items: selection.selectedValues, onRemove: selection.onRemoveSelectedValue, onClear: selection.onClearSelectedValues }), _jsx(StyledGridContainer, { children: isGridReady && _jsx(TMDataGrid
|
|
161
|
+
/* Le due modalità hanno colonne del tutto diverse: ognuna ha la propria istanza di griglia.
|
|
162
|
+
Nei valori distinti l'intestazione è il nome del metadato, che arriva insieme al primo caricamento */
|
|
163
|
+
, { focusedRowKey: selection.focusedItem ? selection.focusedItem.rowIndex : undefined, selection: gridSelection, selectedRowKeys: NO_SELECTED_ROW_KEYS, searchPanel: { highlightCaseSensitive: true, visible: true }, searchPanelFocusTrigger: 1, dataColumns: isQuickSearchGridVisible ? quickSearch.columns : distinctValues.columns, dataSource: isQuickSearchGridVisible ? quickSearch.dataSource : distinctValues.dataSource, customizeColumns: isQuickSearchGridVisible ? quickSearch.customizeColumns : distinctValues.customizeColumns, keyExpr: 'rowIndex', height: 'calc(100%)', showHeaderColumnChooser: true, onFocusedRowChanged: selection.onFocusedRowChanged, onRowDblClick: () => onClosePanelCallback?.(), counterConfig: counterConfig }, isQuickSearchGridVisible ? 'quickSearch' : `distinctValues_${distinctValues.md?.id ?? 0}`) })] }));
|
|
149
164
|
};
|
|
150
|
-
return (
|
|
151
|
-
|
|
152
|
-
|
|
165
|
+
return (_jsxs(_Fragment, { children: [isModal
|
|
166
|
+
? isModalReady && _jsx(TMModal, { title: panelTitle, width: isQuickSearchGridVisible ? calcResponsiveSizes(deviceType, quickSearchModalWidth ?? calcQuickSearchModalWidth(0), '95%', '95%') : calcResponsiveSizes(deviceType, '700px', '95%', '95%'), height: isQuickSearchGridVisible ? '95%' : calcResponsiveSizes(deviceType, '600px', '95%', '95%'), resizable: true, expandable: true, onClose: onClosePanelCallback, children: renderContent() }, isQuickSearchGridVisible ? 'quickSearch' : 'distinctValues')
|
|
167
|
+
: _jsx(TMPanel, { title: panelTitle, showHeader: showHeader, onClose: onClosePanelCallback, children: renderContent() }), quickSearch.showSettingsForm &&
|
|
168
|
+
_jsx(TMQuickSearchSettingsForm, { settings: quickSearch.settings, onSave: quickSearch.onSaveSettings, onDelete: quickSearch.onDeleteSettingsClick, onClose: quickSearch.onSettingsFormClose }), _jsx(quickSearch.ConfirmQueryParamsDialog, {})] }));
|
|
153
169
|
};
|
|
154
170
|
export default TMDistinctValues;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { DataColumnTypes, SDK_Localizator, DataListCacheService, SDK_Globals, LayoutModes } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { IconDetails, IconSearch, generateUniqueColumnKeys, Globalization, SDKUI_Localizator, searchResultDescriptorToSimpleArray, IsParametricQuery, IconWarning } from '../../helper';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from 'react';
|
|
3
3
|
import { TMImageLibrary, IconSearch } from '../../helper';
|
|
4
4
|
import { StyledDivHorizontal } from '../base/Styled';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useMemo, useState } from 'react';
|
|
3
3
|
import { DcmtTypeDescriptor, DcmtTypeListCacheService, SDK_Globals, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { TMMetadataIcon, TMMidViewer, getDisplayAlias } from '../viewers/TMMidViewer';
|
|
@@ -21,7 +21,7 @@ const TMMetadataChooser = ({ tmSession, dataSource, showEditButton = true, butto
|
|
|
21
21
|
return undefined;
|
|
22
22
|
};
|
|
23
23
|
const renderTemplate = useMemo(() => {
|
|
24
|
-
return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && values.length > 0 && values[0].mid && values[0].mid > 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 0 && values[0].mid && values[0].mid < 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], inputMd: getinputMd(), showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { children: placeHolder ?? SDKUI_Localizator.SelectMetadata })] }));
|
|
24
|
+
return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && values.length > 0 && values[0].mid && values[0].mid > 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], color: 'inherit', showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 0 && values[0].mid && values[0].mid < 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], inputMd: getinputMd(), color: 'inherit', showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { margin: 0, marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { style: { margin: 0 }, children: placeHolder ?? SDKUI_Localizator.SelectMetadata })] }));
|
|
25
25
|
}, [values, tmSession, showId, showCompleteMetadataName, placeHolder]);
|
|
26
26
|
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { label: label, width: width, height: height, disabled: disabled, validationItems: validationItems, backgroundColor: backgroundColor, buttons: buttons, placeHolder: placeHolder, fontSize: fontSize, showBorder: showBorder, borderRadius: borderRadius, hasValue: values && values.length > 0, showClearButton: showClearButton, showEditButton: showEditButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), openEditorOnSummaryClick: openEditorOnSummaryClick, onEditorClick: () => {
|
|
27
27
|
if (!disabled) {
|
|
@@ -142,7 +142,7 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
|
|
|
142
142
|
const groupCellRender = useCallback((data) => {
|
|
143
143
|
let tid_alias = JSON.parse(data.value);
|
|
144
144
|
let dtd = dcmtTypes?.find(o => o.id == tid_alias.tid);
|
|
145
|
-
return _jsxs(StyledDxGridGroupHeader, {
|
|
145
|
+
return _jsxs(StyledDxGridGroupHeader, { $backgroundColor: getColorIndex?.(tid_alias), children: [_jsx(TMDcmtTypeIcon, { dtd: dtd }), _jsx("p", { children: getDisplayAlias(SDK_Globals.useLocalizedName ? dtd?.nameLoc : dtd?.name, tid_alias.alias) }), data.summaryItems && data.summaryItems.length > 0 && _jsx(StyledBadge, { $backgroundColor: TMColors.info, children: data.summaryItems[0].value })] });
|
|
146
146
|
}, [dcmtTypes, getColorIndex]);
|
|
147
147
|
const dataColumns = useMemo(() => {
|
|
148
148
|
return [
|
|
@@ -6,12 +6,11 @@ import { TMColors } from '../../utils/theme';
|
|
|
6
6
|
import ShowAlert from '../base/TMAlert';
|
|
7
7
|
import TMAreaManager from '../base/TMAreaManager';
|
|
8
8
|
import TMButton from '../base/TMButton';
|
|
9
|
-
import { TMLayoutItem } from '../base/TMLayout';
|
|
9
|
+
import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
|
|
10
10
|
import TMModal from '../base/TMModal';
|
|
11
11
|
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
12
|
-
import
|
|
12
|
+
import TMWaitPanelManager from '../base/waitPanel/TMWaitPanelManager';
|
|
13
13
|
import TMTextBox from '../editors/TMTextBox';
|
|
14
|
-
let abortController = new AbortController();
|
|
15
14
|
const TMPathChooser = (props) => {
|
|
16
15
|
//const [path, setPath] = useState<string>(props.value)
|
|
17
16
|
const [elementStyle, setElementStyle] = useState(props.elementStyle);
|
|
@@ -22,12 +21,6 @@ const TMPathChooser = (props) => {
|
|
|
22
21
|
const [showAreaManager, setShowAreaManager] = useState(false);
|
|
23
22
|
const [downloadLink, setDownloadLink] = useState(null);
|
|
24
23
|
const [file, setFile] = useState(null);
|
|
25
|
-
const [showWaitPanel, setShowWaitPanel] = useState(false);
|
|
26
|
-
const [waitPanelTitle, setWaitPanelTitle] = useState('');
|
|
27
|
-
const [showSecondary, setShowSecondary] = useState(false);
|
|
28
|
-
const [waitPanelTextSecondary, setWaitPanelTextSecondary] = useState('');
|
|
29
|
-
const [waitPanelValueSecondary, setWaitPanelValueSecondary] = useState(0);
|
|
30
|
-
const [waitPanelMaxValueSecondary, setWaitPanelMaxValueSecondary] = useState(0);
|
|
31
24
|
const formulaItems = ['{@JobName}', '{@JobStartDate}', '{@JobStartDate_DDMMYYYY}', '{@JobStartDateTime}', '{@ProcessRunID}', '{@ProcessName}', '{@ProcessStartDate}', '{@ProcessStartDateTime}'];
|
|
32
25
|
//useEffect(() => { setPath(props.value) }, [props.value])
|
|
33
26
|
useEffect(() => {
|
|
@@ -98,30 +91,23 @@ const TMPathChooser = (props) => {
|
|
|
98
91
|
return buttons;
|
|
99
92
|
};
|
|
100
93
|
const onFileDownloadHandler = async () => {
|
|
94
|
+
// Un solo file: la barra del pannello segue i byte scaricati
|
|
95
|
+
const waitPanel = TMWaitPanelManager.show({
|
|
96
|
+
title: "Download",
|
|
97
|
+
cancelable: true,
|
|
98
|
+
showCounters: false,
|
|
99
|
+
});
|
|
101
100
|
try {
|
|
102
101
|
let av = AreaHelper.ExtractAreaInfo_2(props.value, true);
|
|
103
102
|
let doc;
|
|
104
103
|
let tms = props.tmSession ?? SDK_Globals.tmSession;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (firstBlock) {
|
|
113
|
-
maxFileSize = pd.ProgressBarMaximum ?? 0;
|
|
114
|
-
setWaitPanelMaxValueSecondary(maxFileSize);
|
|
115
|
-
firstBlock = false;
|
|
116
|
-
}
|
|
117
|
-
setWaitPanelValueSecondary(pd.ProgressBarValue);
|
|
118
|
-
setWaitPanelTextSecondary(`Downloading... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
|
|
119
|
-
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
120
|
-
setWaitPanelMaxValueSecondary(0);
|
|
121
|
-
setWaitPanelValueSecondary(0);
|
|
122
|
-
setWaitPanelTextSecondary('');
|
|
123
|
-
firstBlock = true;
|
|
124
|
-
}
|
|
104
|
+
doc = await tms?.NewAreaEngine().RetrieveFileAsync(av.aid, av.subFolder, av.fileName, FileFormats.None, waitPanel.signal, (pd) => {
|
|
105
|
+
const total = pd.ProgressBarMaximum ?? 0;
|
|
106
|
+
waitPanel.update({
|
|
107
|
+
value: pd.ProgressBarValue,
|
|
108
|
+
max: total,
|
|
109
|
+
subtitle: `Downloading... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(total, true)}`
|
|
110
|
+
});
|
|
125
111
|
});
|
|
126
112
|
setFile(doc);
|
|
127
113
|
}
|
|
@@ -135,13 +121,10 @@ const TMPathChooser = (props) => {
|
|
|
135
121
|
setFile(null);
|
|
136
122
|
}
|
|
137
123
|
finally {
|
|
138
|
-
|
|
139
|
-
setWaitPanelMaxValueSecondary(0);
|
|
140
|
-
setWaitPanelValueSecondary(0);
|
|
141
|
-
setShowWaitPanel(false);
|
|
124
|
+
waitPanel.close();
|
|
142
125
|
}
|
|
143
126
|
};
|
|
144
|
-
return (_jsxs(
|
|
127
|
+
return (_jsxs(TMLayoutContainer, { direction: 'vertical', children: [_jsx(TMLayoutItem, { children: _jsx(TMTextBox, { buttons: renderButtons(), elementStyle: elementStyle, formulaItems: props.allowParametricPath ? formulaItems : [], isModifiedWhen: props.isModifiedWhen, label: props.label, value: props.value || '', onValueChanged: (e) => { /*setPath(e.target.value);*/ props.onValueChanged?.(e.target.value); }, validationItems: props.validationItems }) }), showAreaManager &&
|
|
145
128
|
_jsxs(TMModal, { resizable: true, width: '80%', onClose: () => setShowAreaManager(false), children: [_jsx(TMAreaManager, { showOnlyFolders: props.allowBrowseFolder_Area && !props.allowBrowseFile_Area, initialPath: props.value, onFolderChanged: (folder) => setAreaFolderPath(folder), onFileChanged: (file) => setAreaFilePath(file), isPathChooser: true, areaChoose: areaChoose, width: '98%', height: props.allowBrowseFile_Area ? '70vh' : '90%', tmSession: props.tmSession, selectionMode: 'single' }), _jsx("div", { style: { position: 'absolute', right: '22px', bottom: '8px' }, children: _jsx(TMButton, { caption: 'OK', onClick: () => areaChoose() }) })] })] }));
|
|
146
129
|
};
|
|
147
130
|
export default TMPathChooser;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TMEditorButtonData } from '../base/TMEditorBase';
|
|
3
|
+
interface ITMQuickSearchInfo {
|
|
4
|
+
/** Tipo documento della ricerca rapida: serve a ricostruire la ricerca di sistema con tutti i documenti */
|
|
5
|
+
tid: number | undefined;
|
|
6
|
+
/** Senza ricerca salvata non c'è nulla da spiegare e l'icona non viene mostrata */
|
|
7
|
+
sqdId: number | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare const useTMQuickSearchInfo: ({ tid, sqdId }: ITMQuickSearchInfo) => {
|
|
10
|
+
infoButton: TMEditorButtonData | undefined;
|
|
11
|
+
detailForm: React.JSX.Element | null;
|
|
12
|
+
};
|
|
13
|
+
export {};
|