@topconsultnpm/sdkui-react 6.22.0-dev2.9 → 6.22.0-t2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +1 -1
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +45 -43
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +1 -1
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +67 -60
- package/lib/components/base/Styled.d.ts +93 -77
- package/lib/components/base/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +2 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMDataGrid.d.ts +2 -0
- package/lib/components/base/TMDataGrid.js +260 -8
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMEditorBase.d.ts +2 -0
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManager.js +5 -3
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.js +11 -2
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +19 -9
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -6
- package/lib/components/base/TMFileManagerUtils.js +37 -1
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +2 -1
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMModal.d.ts +11 -0
- package/lib/components/base/TMModal.js +47 -13
- package/lib/components/base/TMPanel.d.ts +6 -0
- package/lib/components/base/TMPanel.js +138 -25
- package/lib/components/base/TMPopUp.js +3 -0
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTooltip.d.ts +2 -1
- package/lib/components/base/TMTooltip.js +24 -8
- package/lib/components/base/TMTreeView.d.ts +14 -8
- package/lib/components/base/TMTreeView.js +108 -67
- package/lib/components/base/TMUserAvatar.d.ts +2 -1
- package/lib/components/base/TMVilViewer.d.ts +2 -1
- package/lib/components/base/TMWaitPanel.d.ts +3 -2
- package/lib/components/choosers/TMDcmtTypeChooser.js +4 -3
- package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
- package/lib/components/choosers/TMDistinctValues.js +149 -142
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMMetadataChooser.js +1 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +13 -0
- package/lib/components/choosers/TMQuickSearchInfo.js +279 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.d.ts +16 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.js +94 -0
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
- package/lib/components/choosers/TMSelectedValuesSummary.js +91 -0
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMDropDown.d.ts +3 -0
- package/lib/components/editors/TMDropDown.js +197 -5
- package/lib/components/editors/TMEditorStyled.d.ts +20 -42
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/archive/TMArchive.js +17 -3
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/documents/TMBatchUpdateForm.js +19 -5
- package/lib/components/features/documents/TMDcmtBlog.d.ts +3 -0
- package/lib/components/features/documents/TMDcmtBlog.js +4 -4
- package/lib/components/features/documents/TMDcmtForm.d.ts +7 -0
- package/lib/components/features/documents/TMDcmtForm.js +178 -51
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +12 -1
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +77 -7
- package/lib/components/features/documents/TMDcmtIcon.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtIcon.js +5 -3
- package/lib/components/features/documents/TMDcmtPreview.d.ts +8 -6
- package/lib/components/features/documents/TMDcmtPreview.js +10 -6
- package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.js +95 -33
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +20 -0
- package/lib/components/features/documents/TMMasterInfoFields.js +186 -0
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +3 -3
- package/lib/components/features/documents/TMMergeToPdfForm.js +30 -5
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +46 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +323 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +370 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +283 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +14 -1
- package/lib/components/features/documents/TMRelationViewer.js +69 -20
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +2 -1
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.js +77 -11
- package/lib/components/features/search/TMSearchQueryEditor.js +5 -3
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +13 -3
- package/lib/components/features/search/TMSearchQueryPanel.js +141 -67
- package/lib/components/features/search/TMSearchResult.d.ts +16 -0
- package/lib/components/features/search/TMSearchResult.js +429 -108
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
- package/lib/components/features/search/TMTreeSelector.js +109 -64
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
- package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +18 -7
- package/lib/components/features/workflow/TMWorkflowPopup.js +8 -4
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/TMChooserForm.d.ts +2 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
- package/lib/components/grids/TMBlogAttachments.js +13 -2
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogHeader.js +5 -1
- package/lib/components/grids/TMBlogsPost.d.ts +3 -1
- package/lib/components/grids/TMBlogsPost.js +31 -4
- package/lib/components/grids/TMBlogsPostUtils.d.ts +10 -9
- package/lib/components/grids/TMBlogsPostUtils.js +14 -3
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +3 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +24 -14
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +5 -6
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.js +2 -2
- package/lib/components/layout/panelManager/types.d.ts +3 -0
- package/lib/components/layout/panelManager/utils.js +13 -11
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +14 -10
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMHeader.d.ts +3 -3
- package/lib/components/sidebar/TMHeader.js +30 -20
- package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMMidViewer.js +4 -1
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.js +86 -25
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/devextreme-license.d.ts +1 -0
- package/lib/devextreme-license.js +3 -0
- package/lib/helper/SDKUI_Globals.d.ts +110 -0
- package/lib/helper/SDKUI_Globals.js +151 -0
- package/lib/helper/SDKUI_Localizator.d.ts +44 -0
- package/lib/helper/SDKUI_Localizator.js +440 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +2 -0
- package/lib/helper/TMAppUpdatedModal.js +134 -0
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +280 -279
- package/lib/helper/TMIcons.js +3 -0
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +23 -4
- package/lib/helper/TMUtils.js +24 -2
- package/lib/helper/dataGridSearchHelper.d.ts +28 -0
- package/lib/helper/dataGridSearchHelper.js +51 -0
- package/lib/helper/dcmtsHelper.d.ts +20 -0
- package/lib/helper/dcmtsHelper.js +58 -1
- package/lib/helper/helpers.d.ts +12 -1
- package/lib/helper/helpers.js +25 -1
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +6 -1
- package/lib/helper/queryHelper.js +8 -3
- package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
- package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
- package/lib/hooks/useArchiveListForm.d.ts +39 -0
- package/lib/hooks/useArchiveListForm.js +46 -0
- package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
- package/lib/hooks/useCaseFlowApprove.js +157 -0
- package/lib/hooks/useDataUserIdItem.d.ts +1 -0
- package/lib/hooks/useDataUserIdItem.js +1 -0
- package/lib/hooks/useDocumentOperations.d.ts +4 -0
- package/lib/hooks/useDocumentOperations.js +52 -10
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +113 -0
- package/lib/hooks/useMultiMasterDetailDcmts.js +760 -0
- package/lib/hooks/useRelatedDocuments.d.ts +1 -0
- package/lib/hooks/useRelatedDocuments.js +22 -27
- package/lib/hooks/useShowDossiersV5.d.ts +12 -0
- package/lib/hooks/useShowDossiersV5.js +37 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
- package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
- package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
- package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
- package/lib/hooks/useTMDistinctValuesSource.js +105 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -2
- package/lib/services/caseflow/CaseFlowService.d.ts +236 -0
- package/lib/services/caseflow/CaseFlowService.js +693 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.d.ts +28 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.js +121 -0
- package/lib/services/caseflow/caseFlowNameCache.d.ts +32 -0
- package/lib/services/caseflow/caseFlowNameCache.js +116 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.d.ts +61 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.js +113 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/index.js +4 -0
- package/lib/services/platform_services.d.ts +4 -3
- package/package.json +9 -5
|
@@ -1,154 +1,161 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useMemo,
|
|
3
|
-
import { LayoutModes,
|
|
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, 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
|
+
/* Quota di larghezza attribuita a ciascuna colonna della griglia, oltre a una base fissa per la barra dei comandi.
|
|
60
|
+
I limiti evitano i due estremi: sotto il 40% la barra dei comandi diventa illeggibile, oltre il 95% il modale esce dallo schermo */
|
|
61
|
+
const QUICK_SEARCH_BASE_WIDTH_PERC = 16;
|
|
62
|
+
const QUICK_SEARCH_COLUMN_WIDTH_PERC = 12;
|
|
63
|
+
const QUICK_SEARCH_MIN_WIDTH_PERC = 40;
|
|
64
|
+
const QUICK_SEARCH_MAX_WIDTH_PERC = 95;
|
|
65
|
+
/**
|
|
66
|
+
* Larghezza del modale della ricerca rapida, proporzionale al numero di colonne mostrate: con poche colonne
|
|
67
|
+
* un modale a tutta pagina le lascerebbe stirate e meno leggibili, con molte serve tutto lo spazio disponibile.
|
|
68
|
+
*/
|
|
69
|
+
const calcQuickSearchModalWidth = (visibleColumnsCount) => {
|
|
70
|
+
const widthPerc = QUICK_SEARCH_BASE_WIDTH_PERC + visibleColumnsCount * QUICK_SEARCH_COLUMN_WIDTH_PERC;
|
|
71
|
+
return `${Math.min(QUICK_SEARCH_MAX_WIDTH_PERC, Math.max(QUICK_SEARCH_MIN_WIDTH_PERC, widthPerc))}%`;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Pannello da cui si preleva il valore di un campo del form scegliendolo fra quelli già archiviati.
|
|
75
|
+
*
|
|
76
|
+
* Le due sorgenti (valori distinti del metadato e ricerca rapida su una ricerca salvata) stanno in due hook
|
|
77
|
+
* dedicati che espongono la stessa interfaccia (righe, colonne, conteggi): qui restano la composizione,
|
|
78
|
+
* la scelta della sorgente da mostrare e il render.
|
|
79
|
+
*/
|
|
80
|
+
const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppendMode = true, showHeader = true, isModal, separator = ",", onSelectionChanged, onClosePanelCallback }) => {
|
|
81
|
+
const deviceType = useDeviceType();
|
|
82
|
+
const display = useTMDistinctValuesMetadataDisplay();
|
|
83
|
+
const distinctValues = useTMDistinctValuesSource({ tid, mid, display });
|
|
84
|
+
const quickSearch = useTMDistinctValuesQuickSearch({ tid, mid, md: distinctValues.md, display });
|
|
85
|
+
const { isQuickSearchMode, isQuickSearchGridVisible } = quickSearch;
|
|
86
|
+
// Il valore della riga sta in campi diversi nelle due sorgenti: nei valori distinti è sempre `value`,
|
|
87
|
+
// nella ricerca rapida è la colonna del metadato configurato
|
|
88
|
+
const getRowValue = useCallback((row) => {
|
|
89
|
+
if (!isQuickSearchGridVisible)
|
|
90
|
+
return row?.value;
|
|
91
|
+
return quickSearch.valueField ? row?.[quickSearch.valueField] : undefined;
|
|
92
|
+
}, [isQuickSearchGridVisible, quickSearch.valueField]);
|
|
93
|
+
const selection = useTMDistinctValuesSelection({
|
|
94
|
+
tid, mid, md: distinctValues.md, layoutMode, allowAppendMode, separator,
|
|
95
|
+
selectedValueMd: quickSearch.selectedValueMd,
|
|
96
|
+
getRowValue,
|
|
97
|
+
getMetadataDisplayValue: display.getMetadataDisplayValue,
|
|
98
|
+
onSelectionChanged
|
|
99
|
+
});
|
|
100
|
+
// Cambiando sorgente la riga focalizzata non esiste più: la griglia viene ricreata da zero
|
|
101
|
+
useEffect(() => { selection.setFocusedItem(undefined); }, [quickSearch.mode, quickSearch.settings]);
|
|
102
|
+
const refreshAsync = async () => {
|
|
103
|
+
if (!isQuickSearchMode) {
|
|
104
|
+
await distinctValues.loadAsync();
|
|
59
105
|
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
106
|
}
|
|
107
|
+
await quickSearch.refreshAsync();
|
|
89
108
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}, [
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
return rowObject;
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
|
-
const isVisibleAppend = () => {
|
|
135
|
-
if (!allowAppendMode)
|
|
136
|
-
return false;
|
|
137
|
-
if (layoutMode !== LayoutModes.Ark && layoutMode !== LayoutModes.Update)
|
|
138
|
-
return true;
|
|
139
|
-
if (!md)
|
|
140
|
-
return true;
|
|
141
|
-
if (md.dataType === MetadataDataTypes.DateTime)
|
|
142
|
-
return false;
|
|
143
|
-
if (md.dataType === MetadataDataTypes.Number)
|
|
144
|
-
return false;
|
|
145
|
-
return md.dataDomain === undefined || md.dataDomain === MetadataDataDomains.None;
|
|
146
|
-
};
|
|
109
|
+
// Finché le colonne della ricerca rapida non sono pronte la griglia non va montata: nascerebbe senza campi
|
|
110
|
+
const isGridReady = !isQuickSearchGridVisible || quickSearch.columns.length > 0;
|
|
111
|
+
const counterConfig = useMemo(() => {
|
|
112
|
+
const counts = isQuickSearchGridVisible ? quickSearch.counts : distinctValues.counts;
|
|
113
|
+
// Senza il totale resta il conteggio predefinito della griglia: un rapporto con totale a zero sarebbe fuorviante
|
|
114
|
+
if (!counts?.found)
|
|
115
|
+
return { show: true };
|
|
116
|
+
return {
|
|
117
|
+
show: true,
|
|
118
|
+
items: new Map([
|
|
119
|
+
[CounterItemKey.allItems, {
|
|
120
|
+
key: CounterItemKey.allItems,
|
|
121
|
+
show: true,
|
|
122
|
+
caption: `${counts.returned} restituiti su ${counts.found} trovati`,
|
|
123
|
+
value: `${counts.returned}/${counts.found}`,
|
|
124
|
+
icon: _jsx(IconAll, {}),
|
|
125
|
+
order: -1
|
|
126
|
+
}]
|
|
127
|
+
])
|
|
128
|
+
};
|
|
129
|
+
}, [isQuickSearchGridVisible, quickSearch.counts, distinctValues.counts]);
|
|
130
|
+
const modeDataSource = useMemo(() => ([
|
|
131
|
+
{ value: DistinctValuesModes.DistinctValues, display: SDKUI_Localizator.DistinctValues },
|
|
132
|
+
{ value: DistinctValuesModes.QuickSearch, display: SDK_Localizator.SavedQuery },
|
|
133
|
+
]), []);
|
|
134
|
+
const panelTitle = (isQuickSearchGridVisible ? SDK_Localizator.SavedQuery : SDKUI_Localizator.DistinctValues) + (distinctValues.md?.nameLoc ? ` (${distinctValues.md?.nameLoc})` : '');
|
|
135
|
+
/* Le colonne nascoste (metadati di sistema della query) non occupano spazio: non vanno contate nella larghezza.
|
|
136
|
+
Durante un ricaricamento le colonne tornano momentaneamente vuote: si conserva l'ultima larghezza calcolata,
|
|
137
|
+
altrimenti il modale si restringerebbe per poi riallargarsi */
|
|
138
|
+
const lastQuickSearchModalWidthRef = useRef();
|
|
139
|
+
const quickSearchModalWidth = useMemo(() => {
|
|
140
|
+
const visibleColumnsCount = quickSearch.columns.filter(col => col.visible !== false).length;
|
|
141
|
+
if (visibleColumnsCount > 0)
|
|
142
|
+
lastQuickSearchModalWidthRef.current = calcQuickSearchModalWidth(visibleColumnsCount);
|
|
143
|
+
return lastQuickSearchModalWidthRef.current;
|
|
144
|
+
}, [quickSearch.columns]);
|
|
145
|
+
/* La larghezza è nota solo a ricerca conclusa: mostrare subito il modale lo farebbe nascere alla larghezza minima
|
|
146
|
+
per poi allargarlo sotto gli occhi dell'utente, quindi si attende (l'attesa è coperta dallo spinner della ricerca) */
|
|
147
|
+
const isModalReady = !isQuickSearchGridVisible || !!quickSearchModalWidth || !quickSearch.isFirstSearchPending;
|
|
147
148
|
const renderContent = () => {
|
|
148
|
-
return (_jsxs(StyledDistinctValues, { children: [
|
|
149
|
+
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 &&
|
|
150
|
+
_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Settings, icon: _jsx(IconPencil, {}), onClick: () => quickSearch.setShowSettingsForm(true) }), isQuickSearchMode && Boolean(quickSearch.settings) &&
|
|
151
|
+
_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
|
|
152
|
+
/* Le due modalità hanno colonne del tutto diverse: ognuna ha la propria istanza di griglia.
|
|
153
|
+
Nei valori distinti l'intestazione è il nome del metadato, che arriva insieme al primo caricamento */
|
|
154
|
+
, { focusedRowKey: selection.focusedItem ? selection.focusedItem.rowIndex : undefined, selection: { showCheckBoxesMode: 'none' }, searchPanel: { highlightCaseSensitive: true, visible: true }, 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
155
|
};
|
|
150
|
-
return (
|
|
151
|
-
|
|
152
|
-
|
|
156
|
+
return (_jsxs(_Fragment, { children: [isModal
|
|
157
|
+
? 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')
|
|
158
|
+
: _jsx(TMPanel, { title: panelTitle, showHeader: showHeader, onClose: onClosePanelCallback, children: renderContent() }), quickSearch.showSettingsForm &&
|
|
159
|
+
_jsx(TMQuickSearchSettingsForm, { settings: quickSearch.settings, onSave: quickSearch.onSaveSettings, onDelete: quickSearch.onDeleteSettingsClick, onClose: quickSearch.onSettingsFormClose }), _jsx(quickSearch.ConfirmQueryParamsDialog, {})] }));
|
|
153
160
|
};
|
|
154
161
|
export default TMDistinctValues;
|
|
@@ -41,4 +41,4 @@ interface ITMDynDataListItemChooserFormProps extends ITMChooserFormProps<DataLis
|
|
|
41
41
|
/** Se presente, sono i parametri da passare alla query per recuperare il dataSource */
|
|
42
42
|
queryParamsDynDataList?: string[];
|
|
43
43
|
}
|
|
44
|
-
export declare const TMDynDataListItemChooserForm: (props: ITMDynDataListItemChooserFormProps) =>
|
|
44
|
+
export declare const TMDynDataListItemChooserForm: (props: ITMDynDataListItemChooserFormProps) => React.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { InvoiceRetrieveFormats } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
import { ITMEnumDataBinding } from '../../ts';
|
|
3
|
-
declare const TMInvoiceRetrieveFormats: ({ value, valueOrig, onValueChanged, valuesToExclude, label, width }: ITMEnumDataBinding<InvoiceRetrieveFormats>) =>
|
|
4
|
+
declare const TMInvoiceRetrieveFormats: ({ value, valueOrig, onValueChanged, valuesToExclude, label, width }: ITMEnumDataBinding<InvoiceRetrieveFormats>) => React.JSX.Element;
|
|
4
5
|
export default TMInvoiceRetrieveFormats;
|
|
@@ -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) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { OrderRetrieveFormats } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
import { ITMEnumDataBinding } from '../../ts';
|
|
3
|
-
declare const TMOrderRetrieveFormats: ({ value, valueOrig, onValueChanged, valuesToExclude, label, width }: ITMEnumDataBinding<OrderRetrieveFormats>) =>
|
|
4
|
+
declare const TMOrderRetrieveFormats: ({ value, valueOrig, onValueChanged, valuesToExclude, label, width }: ITMEnumDataBinding<OrderRetrieveFormats>) => React.JSX.Element;
|
|
4
5
|
export default TMOrderRetrieveFormats;
|
|
@@ -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 {};
|