@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,11 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import styled, { css } from "styled-components";
|
|
4
5
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
5
6
|
import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, TMEditorsDefaultBorderRadius, editorColorManager } from "./TMEditorStyled";
|
|
6
7
|
import TMLayoutContainer, { TMLayoutItem } from "../base/TMLayout";
|
|
7
8
|
import TMVilViewer from "../base/TMVilViewer";
|
|
8
9
|
import TMTooltip from "../base/TMTooltip";
|
|
10
|
+
import { SDKUI_Localizator } from "../../helper";
|
|
9
11
|
const StyledDropDownWrapper = styled.div `
|
|
10
12
|
position: relative;
|
|
11
13
|
width: ${props => props.$width};
|
|
@@ -54,9 +56,199 @@ const StyledDropDownEditorButton = styled.div `
|
|
|
54
56
|
align-items: center;
|
|
55
57
|
cursor: pointer;
|
|
56
58
|
`;
|
|
57
|
-
|
|
59
|
+
// Variante filtrabile: un input di testo con la stessa resa grafica della select nativa
|
|
60
|
+
const StyledSearchInput = styled.input `
|
|
61
|
+
width: 100%;
|
|
62
|
+
padding: 5px 35px 3px 9px;
|
|
63
|
+
border: 1px solid;
|
|
64
|
+
border-color: ${props => props.$isModified ? TMColors.isModified : TMColors.border_normal};
|
|
65
|
+
border-bottom: ${props => (props.$vil.length > 0) ? '3px' : '1px'} solid;
|
|
66
|
+
border-bottom-color: ${props => (props.$vil.length === 0) ? !props.$isModified ? TMColors.border_normal : TMColors.isModified : editorColorManager(props.$vil)};
|
|
67
|
+
color: ${props => !props.$disabled ? (props.$vil.length === 0 ? (!props.$isModified ? TMColors.text_normal : TMColors.isModified) : editorColorManager(props.$vil)) : TMColors.disabled};
|
|
68
|
+
border-radius: ${props => props.$borderRadius ?? TMEditorsDefaultBorderRadius};
|
|
69
|
+
font-size: ${props => props.$fontSize};
|
|
70
|
+
background-color: ${props => props.$disabled ? '#F5F5F5' : 'white'};
|
|
71
|
+
text-overflow: ellipsis;
|
|
72
|
+
|
|
73
|
+
&:focus {
|
|
74
|
+
outline: none;
|
|
75
|
+
border: ${props => props.$isModified ? `1px solid ${TMColors.isModified}` : '1px solid rgb(180,180,180)'};
|
|
76
|
+
border-bottom: 2px solid;
|
|
77
|
+
border-bottom-color: ${props => (props.$vil.length === 0) ? !props.$isModified ? TMColors.primary : TMColors.isModified : editorColorManager(props.$vil)};
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
const OPTIONS_PANEL_MAX_HEIGHT = 220;
|
|
81
|
+
const OPTIONS_PANEL_MIN_HEIGHT = 80;
|
|
82
|
+
const OPTIONS_PANEL_MARGIN = 4;
|
|
83
|
+
// L'elenco aperto con usePortal esce dal contenitore dell'editor: deve stare sopra tutto ciò che può trovarsi nella stessa pagina
|
|
84
|
+
const DROPDOWN_OPTIONS_PANEL_Z_INDEX = 100001;
|
|
85
|
+
const optionsPanelCss = css `
|
|
86
|
+
overflow-y: auto;
|
|
87
|
+
background-color: white;
|
|
88
|
+
border: 1px solid ${TMColors.border_normal};
|
|
89
|
+
border-radius: ${TMEditorsDefaultBorderRadius};
|
|
90
|
+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
|
|
91
|
+
`;
|
|
92
|
+
// Elenco ancorato all'editor: resta nel flusso del DOM e quindi soggetto al clipping dei contenitori con overflow
|
|
93
|
+
const StyledOptionsPanel = styled.div `
|
|
94
|
+
${optionsPanelCss}
|
|
95
|
+
position: absolute;
|
|
96
|
+
top: calc(100% + 2px);
|
|
97
|
+
left: 0;
|
|
98
|
+
right: 0;
|
|
99
|
+
z-index: 10001;
|
|
100
|
+
max-height: ${OPTIONS_PANEL_MAX_HEIGHT}px;
|
|
101
|
+
`;
|
|
102
|
+
// Variante usePortal: posizione calcolata rispetto alla finestra, così l'elenco non viene tagliato da nessun contenitore
|
|
103
|
+
const StyledPortalOptionsPanel = styled.div `
|
|
104
|
+
${optionsPanelCss}
|
|
105
|
+
position: fixed;
|
|
106
|
+
left: ${props => props.$left}px;
|
|
107
|
+
${props => props.$top !== undefined ? `top: ${props.$top}px;` : ''}
|
|
108
|
+
${props => props.$bottom !== undefined ? `bottom: ${props.$bottom}px;` : ''}
|
|
109
|
+
width: ${props => props.$width}px;
|
|
110
|
+
z-index: ${DROPDOWN_OPTIONS_PANEL_Z_INDEX};
|
|
111
|
+
max-height: ${props => props.$maxHeight}px;
|
|
112
|
+
`;
|
|
113
|
+
const StyledOption = styled.div `
|
|
114
|
+
padding: 5px 9px;
|
|
115
|
+
font-size: ${props => props.$fontSize};
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
white-space: nowrap;
|
|
118
|
+
overflow: hidden;
|
|
119
|
+
text-overflow: ellipsis;
|
|
120
|
+
font-weight: ${props => props.$isSelected ? 600 : 'normal'};
|
|
121
|
+
background-color: ${props => props.$isHighlighted ? TMColors.primary_container : 'transparent'};
|
|
122
|
+
`;
|
|
123
|
+
const StyledNoOptions = styled.div `
|
|
124
|
+
padding: 5px 9px;
|
|
125
|
+
font-size: ${props => props.$fontSize};
|
|
126
|
+
color: ${TMColors.disabled};
|
|
127
|
+
`;
|
|
128
|
+
// L'elenco si apre sotto l'editor se c'è spazio, altrimenti sopra, e in ogni caso non esce dalla finestra
|
|
129
|
+
const calcOptionsPanelPosition = (rect) => {
|
|
130
|
+
const spaceBelow = window.innerHeight - rect.bottom - OPTIONS_PANEL_MARGIN;
|
|
131
|
+
const spaceAbove = rect.top - OPTIONS_PANEL_MARGIN;
|
|
132
|
+
const openUpwards = spaceBelow < OPTIONS_PANEL_MAX_HEIGHT && spaceAbove > spaceBelow;
|
|
133
|
+
const availableHeight = openUpwards ? spaceAbove : spaceBelow;
|
|
134
|
+
return {
|
|
135
|
+
left: Math.max(OPTIONS_PANEL_MARGIN, Math.min(rect.left, window.innerWidth - rect.width - OPTIONS_PANEL_MARGIN)),
|
|
136
|
+
top: openUpwards ? undefined : rect.bottom + OPTIONS_PANEL_MARGIN,
|
|
137
|
+
bottom: openUpwards ? window.innerHeight - rect.top + OPTIONS_PANEL_MARGIN : undefined,
|
|
138
|
+
width: rect.width,
|
|
139
|
+
maxHeight: Math.max(OPTIONS_PANEL_MIN_HEIGHT, Math.min(OPTIONS_PANEL_MAX_HEIGHT, availableHeight)),
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
const TMDropDown = ({ validationItems = [], disabled = false, elementStyle, isModifiedWhen, labelPosition = 'left', label, icon, width = '100%', fontSize = FontSize.defaultFontSize, dataSource, value, searchEnabled = false, usePortal = false, itemRender, onValueChanged, buttons = [], placeHolder, }) => {
|
|
58
143
|
const [isFocused, setIsFocused] = useState(false);
|
|
59
|
-
const
|
|
144
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
145
|
+
const [searchText, setSearchText] = useState('');
|
|
146
|
+
const [highlightedIndex, setHighlightedIndex] = useState(-1);
|
|
147
|
+
const [optionsPanelPosition, setOptionsPanelPosition] = useState();
|
|
148
|
+
const optionsPanelRef = useRef(null);
|
|
149
|
+
const dropDownWrapperRef = useRef(null);
|
|
150
|
+
const selectedItem = dataSource?.find(o => String(o.value) === String(value));
|
|
151
|
+
// A elenco chiuso l'input mostra la voce selezionata, ad elenco aperto il testo digitato
|
|
152
|
+
const filteredDataSource = (!isOpen || !searchText) ? (dataSource ?? []) : (dataSource ?? []).filter(o => String(o.display ?? '').toLocaleLowerCase().includes(searchText.toLocaleLowerCase()));
|
|
153
|
+
// Mantiene visibile la voce evidenziata durante la navigazione da tastiera
|
|
154
|
+
useEffect(() => {
|
|
155
|
+
if (!isOpen || highlightedIndex < 0)
|
|
156
|
+
return;
|
|
157
|
+
const option = optionsPanelRef.current?.children[highlightedIndex];
|
|
158
|
+
option?.scrollIntoView({ block: 'nearest' });
|
|
159
|
+
}, [isOpen, highlightedIndex]);
|
|
160
|
+
// Solo nel portal la posizione va ricalcolata: essendo fissa non segue lo scorrimento o il ridimensionamento del contenitore
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (!isOpen || !usePortal)
|
|
163
|
+
return;
|
|
164
|
+
const updatePosition = () => updateOptionsPanelPosition();
|
|
165
|
+
window.addEventListener('scroll', updatePosition, true);
|
|
166
|
+
window.addEventListener('resize', updatePosition);
|
|
167
|
+
return () => {
|
|
168
|
+
window.removeEventListener('scroll', updatePosition, true);
|
|
169
|
+
window.removeEventListener('resize', updatePosition);
|
|
170
|
+
};
|
|
171
|
+
}, [isOpen, usePortal]);
|
|
172
|
+
const updateOptionsPanelPosition = () => {
|
|
173
|
+
const rect = dropDownWrapperRef.current?.getBoundingClientRect();
|
|
174
|
+
if (rect)
|
|
175
|
+
setOptionsPanelPosition(calcOptionsPanelPosition(rect));
|
|
176
|
+
};
|
|
177
|
+
const openOptions = () => {
|
|
178
|
+
if (disabled)
|
|
179
|
+
return;
|
|
180
|
+
if (usePortal)
|
|
181
|
+
updateOptionsPanelPosition();
|
|
182
|
+
setIsOpen(true);
|
|
183
|
+
setSearchText('');
|
|
184
|
+
setHighlightedIndex(dataSource?.findIndex(o => String(o.value) === String(value)) ?? -1);
|
|
185
|
+
};
|
|
186
|
+
const closeOptions = () => {
|
|
187
|
+
setIsOpen(false);
|
|
188
|
+
setSearchText('');
|
|
189
|
+
setHighlightedIndex(-1);
|
|
190
|
+
};
|
|
191
|
+
const selectItem = (item) => {
|
|
192
|
+
closeOptions();
|
|
193
|
+
// La select nativa notifica un ChangeEvent: qui viene ricostruito il solo dato letto dai consumatori (target.value)
|
|
194
|
+
onValueChanged?.({ target: { value: String(item.value) } });
|
|
195
|
+
};
|
|
196
|
+
const onSearchKeyDown = (e) => {
|
|
197
|
+
switch (e.key) {
|
|
198
|
+
case 'ArrowDown':
|
|
199
|
+
case 'ArrowUp':
|
|
200
|
+
e.preventDefault();
|
|
201
|
+
if (!isOpen) {
|
|
202
|
+
openOptions();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (filteredDataSource.length <= 0)
|
|
206
|
+
return;
|
|
207
|
+
setHighlightedIndex(prev => {
|
|
208
|
+
const delta = e.key === 'ArrowDown' ? 1 : -1;
|
|
209
|
+
const next = prev + delta;
|
|
210
|
+
if (next < 0)
|
|
211
|
+
return filteredDataSource.length - 1;
|
|
212
|
+
if (next >= filteredDataSource.length)
|
|
213
|
+
return 0;
|
|
214
|
+
return next;
|
|
215
|
+
});
|
|
216
|
+
break;
|
|
217
|
+
case 'Enter': {
|
|
218
|
+
if (!isOpen)
|
|
219
|
+
return;
|
|
220
|
+
e.preventDefault();
|
|
221
|
+
const item = filteredDataSource[highlightedIndex] ?? filteredDataSource[0];
|
|
222
|
+
if (item)
|
|
223
|
+
selectItem(item);
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
case 'Escape':
|
|
227
|
+
if (isOpen) {
|
|
228
|
+
e.preventDefault();
|
|
229
|
+
closeOptions();
|
|
230
|
+
}
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
const renderOptions = () => (filteredDataSource.length > 0
|
|
235
|
+
? filteredDataSource.map((data, index) => (_jsx(StyledOption, { "$fontSize": fontSize, "$isSelected": String(data.value) === String(value), "$isHighlighted": index === highlightedIndex, onMouseEnter: () => setHighlightedIndex(index), onClick: () => selectItem(data), children: itemRender ? itemRender(data) : data.display }, index)))
|
|
236
|
+
: _jsx(StyledNoOptions, { "$fontSize": fontSize, children: SDKUI_Localizator.NoDataToDisplay }));
|
|
237
|
+
// onMouseDown va bloccato: senza preventDefault il blur dell'input chiuderebbe l'elenco prima del click
|
|
238
|
+
const renderOptionsPanel = () => {
|
|
239
|
+
if (!isOpen)
|
|
240
|
+
return null;
|
|
241
|
+
if (!usePortal) {
|
|
242
|
+
return (_jsx(StyledOptionsPanel, { ref: optionsPanelRef, onMouseDown: (e) => e.preventDefault(), children: renderOptions() }));
|
|
243
|
+
}
|
|
244
|
+
if (!optionsPanelPosition)
|
|
245
|
+
return null;
|
|
246
|
+
return createPortal(_jsx(StyledPortalOptionsPanel, { ref: optionsPanelRef, "$left": optionsPanelPosition.left, "$top": optionsPanelPosition.top, "$bottom": optionsPanelPosition.bottom, "$width": optionsPanelPosition.width, "$maxHeight": optionsPanelPosition.maxHeight, onMouseDown: (e) => e.preventDefault(), children: renderOptions() }), document.body);
|
|
247
|
+
};
|
|
248
|
+
const renderSearchableDropDown = () => (_jsxs(_Fragment, { children: [_jsx(StyledSearchInput, { value: isOpen ? searchText : (selectedItem?.display ?? ''), placeholder: isOpen ? SDKUI_Localizator.Search : placeHolder, readOnly: disabled, disabled: disabled, "$disabled": disabled, "$fontSize": fontSize, "$isModified": isModifiedWhen, "$vil": validationItems, onFocus: () => { setIsFocused(true); openOptions(); }, onBlur: () => { setIsFocused(false); closeOptions(); }, onClick: () => { if (!isOpen)
|
|
249
|
+
openOptions(); }, onChange: (e) => { setSearchText(e.target.value); setIsOpen(true); setHighlightedIndex(0); }, onKeyDown: onSearchKeyDown }), renderOptionsPanel()] }));
|
|
250
|
+
const renderNativeDropDown = () => (_jsxs(StyledDropDown, { value: value, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), "$disabled": disabled, disabled: disabled, "$fontSize": fontSize, "$isModified": isModifiedWhen, "$vil": validationItems, onChange: onValueChanged, children: [placeHolder && _jsx("option", { value: "", disabled: true, hidden: true, children: placeHolder }), dataSource?.map((data, index) => (_jsx("option", { value: data.value, children: data.display }, index)))] }));
|
|
251
|
+
const renderedLeftLabelTextBox = () => (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, children: label }), _jsxs(StyledDropDownWrapper, { ref: dropDownWrapperRef, "$width": width, children: [searchEnabled ? renderSearchableDropDown() : renderNativeDropDown(), buttons.length > 0 && (_jsx(ButtonsContainer, { children: buttons.map((buttonItem) => (_jsx(StyledDropDownEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.tooltipContent ?? buttonItem.text, children: buttonItem.icon }) }, buttonItem.text))) })), _jsx(CustomArrow, {})] }), _jsx(TMVilViewer, { vil: validationItems })] }) })] }));
|
|
60
252
|
return _jsx("div", { style: elementStyle, children: renderedLeftLabelTextBox() });
|
|
61
253
|
};
|
|
62
254
|
export default TMDropDown;
|
|
@@ -2,22 +2,14 @@ import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
|
2
2
|
export declare const TMEditorsDefaultBorderRadius = "5px";
|
|
3
3
|
export declare const TMEditorsDefaultLabelFontSize = "0.9rem";
|
|
4
4
|
export declare const editorColorManager: (validationItems: ValidationItem[]) => string;
|
|
5
|
-
export declare const StyledEditorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
5
|
+
export declare const StyledEditorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
6
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
7
|
+
}, {
|
|
6
8
|
$width: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
$vil: ValidationItem[];
|
|
12
|
-
$width: string;
|
|
13
|
-
$type: string;
|
|
14
|
-
$isModified: boolean;
|
|
15
|
-
$maxValue: number;
|
|
16
|
-
$fontSize: string;
|
|
17
|
-
$disabled: boolean;
|
|
18
|
-
$isMobile?: boolean;
|
|
19
|
-
$borderRadius?: string;
|
|
20
|
-
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$width" | "$borderRadius" | "$fontSize" | "$type" | "$disabled" | "$vil" | "$isModified" | "$maxValue" | "$isMobile"> & {
|
|
9
|
+
}>> & string;
|
|
10
|
+
export declare const StyledEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "style"> & {
|
|
11
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
12
|
+
}, {
|
|
21
13
|
$vil: ValidationItem[];
|
|
22
14
|
$width: string;
|
|
23
15
|
$type: string;
|
|
@@ -27,40 +19,26 @@ export declare const StyledEditor: import("styled-components/dist/types").IStyle
|
|
|
27
19
|
$disabled: boolean;
|
|
28
20
|
$isMobile?: boolean;
|
|
29
21
|
$borderRadius?: string;
|
|
30
|
-
}
|
|
31
|
-
export declare const StyledEditorIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
22
|
+
}>> & string;
|
|
23
|
+
export declare const StyledEditorIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
24
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
25
|
+
}, {
|
|
32
26
|
$vil: ValidationItem[];
|
|
33
27
|
$disabled: boolean;
|
|
34
28
|
$isModified: boolean;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, never>>> & string;
|
|
40
|
-
export declare const StyledEditorLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$fontSize" | "$disabled" | "$isFocused" | "$labelPosition"> & {
|
|
29
|
+
}>> & string;
|
|
30
|
+
export declare const StyledEditorLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
31
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
32
|
+
}, {
|
|
41
33
|
$isFocused: boolean;
|
|
42
34
|
$labelPosition: "right" | "left" | "top";
|
|
43
35
|
$disabled: boolean;
|
|
44
36
|
$fontSize?: string;
|
|
45
37
|
$color?: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
$fontSize?: string;
|
|
51
|
-
$color?: string;
|
|
52
|
-
}, never>>> & string;
|
|
53
|
-
export declare const StyledTextareaEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$width" | "$maxHeight" | "$borderRadius" | "$fontSize" | "$disabled" | "$vil" | "$isModified" | "$isMobile" | "$resize"> & {
|
|
54
|
-
$vil: ValidationItem[];
|
|
55
|
-
$width: string;
|
|
56
|
-
$isModified: boolean;
|
|
57
|
-
$fontSize: string;
|
|
58
|
-
$disabled: boolean;
|
|
59
|
-
$isMobile?: boolean;
|
|
60
|
-
$maxHeight?: string;
|
|
61
|
-
$borderRadius?: string;
|
|
62
|
-
$resize?: boolean;
|
|
63
|
-
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$width" | "$maxHeight" | "$borderRadius" | "$fontSize" | "$disabled" | "$vil" | "$isModified" | "$isMobile" | "$resize"> & {
|
|
38
|
+
}>> & string;
|
|
39
|
+
export declare const StyledTextareaEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "style"> & {
|
|
40
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
41
|
+
}, {
|
|
64
42
|
$vil: ValidationItem[];
|
|
65
43
|
$width: string;
|
|
66
44
|
$isModified: boolean;
|
|
@@ -70,4 +48,4 @@ export declare const StyledTextareaEditor: import("styled-components/dist/types"
|
|
|
70
48
|
$maxHeight?: string;
|
|
71
49
|
$borderRadius?: string;
|
|
72
50
|
$resize?: boolean;
|
|
73
|
-
}
|
|
51
|
+
}>> & string;
|
|
@@ -30,7 +30,7 @@ export declare class FormulaDescriptor {
|
|
|
30
30
|
description?: string;
|
|
31
31
|
syntax?: string;
|
|
32
32
|
}
|
|
33
|
-
export declare const renderFormulaIcon: (iconType: FormulaIconTypes, tid?: number, md?: MetadataDescriptor) =>
|
|
33
|
+
export declare const renderFormulaIcon: (iconType: FormulaIconTypes, tid?: number, md?: MetadataDescriptor) => React.JSX.Element;
|
|
34
34
|
declare const TMFormulaEditor: React.FunctionComponent<ITMApplyFormProps<FormulaDescriptor>>;
|
|
35
35
|
export default TMFormulaEditor;
|
|
36
36
|
export declare class FormulaHelper {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface IHtmlContentDisplay {
|
|
2
3
|
markup: string;
|
|
3
4
|
isSelected: boolean;
|
|
4
5
|
searchText?: string;
|
|
5
6
|
}
|
|
6
|
-
declare const TMHtmlContentDisplay: (props: IHtmlContentDisplay) =>
|
|
7
|
+
declare const TMHtmlContentDisplay: (props: IHtmlContentDisplay) => React.JSX.Element;
|
|
7
8
|
export default TMHtmlContentDisplay;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
export declare const sanitizeAndFormatComment: (raw?: string) => string;
|
|
3
4
|
export interface ITMHtmlEditor {
|
|
@@ -34,5 +35,5 @@ export interface ITMHtmlEditor {
|
|
|
34
35
|
/** If true, displays a character count below the editor */
|
|
35
36
|
showCount?: boolean;
|
|
36
37
|
}
|
|
37
|
-
declare const TMHtmlEditor: (props: ITMHtmlEditor) =>
|
|
38
|
+
declare const TMHtmlEditor: (props: ITMHtmlEditor) => React.JSX.Element;
|
|
38
39
|
export default TMHtmlEditor;
|
|
@@ -14,5 +14,5 @@ interface TMTreeDropDownProps {
|
|
|
14
14
|
isValidKey?: (key: number) => boolean;
|
|
15
15
|
elementStyle?: React.CSSProperties;
|
|
16
16
|
}
|
|
17
|
-
declare const TMTreeDropDown: (props: TMTreeDropDownProps) =>
|
|
17
|
+
declare const TMTreeDropDown: (props: TMTreeDropDownProps) => React.JSX.Element;
|
|
18
18
|
export default TMTreeDropDown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import Logo from '../../../assets/Toppy-generico.png';
|
|
4
4
|
import { ArchiveConstraints, DcmtTypeListCacheService, LayoutModes, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
import { IconTree, SDKUI_Globals, SDKUI_Localizator, IconRecentlyViewed, IconPreview, IconShow, IconBoard, IconDcmtTypeSys, removeMruTid, getMoreInfoTasksForDocument } from '../../../helper';
|
|
@@ -56,6 +56,13 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
56
56
|
previousTIDRef.current = currentTID;
|
|
57
57
|
}, [currentTID, onDcmtTypeSelect, isSharedArchive]);
|
|
58
58
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
59
|
+
// Scorciatoie: rilegge dal server l'elenco dei tipi documento, così le scorciatoie riflettono
|
|
60
|
+
// quelli aggiunti o rimossi. La nuova identità di mruTIDs fa ricaricare i descrittori a TMRecentsManager.
|
|
61
|
+
const refreshRecentsAsync = useCallback(async () => {
|
|
62
|
+
DcmtTypeListCacheService.RemoveAllWithoutMetadata();
|
|
63
|
+
await DcmtTypeListCacheService.GetAllWithoutMetadataAsync();
|
|
64
|
+
setMruTIDs([...SDKUI_Globals.userSettings.archivingSettings.mruTIDs]);
|
|
65
|
+
}, []);
|
|
59
66
|
const tmTreeSelectorElement = useMemo(() => _jsx(TMTreeSelectorWrapper, { isMobile: isMobile, isSharedArchive: isSharedArchive, onSelectedTIDChanged: (tid) => {
|
|
60
67
|
setCurrentTID(tid);
|
|
61
68
|
if (tid && mruTIDs.includes(tid))
|
|
@@ -108,7 +115,14 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
108
115
|
{
|
|
109
116
|
id: 'tmRecentsManager',
|
|
110
117
|
name: SDKUI_Localizator.Shortcuts,
|
|
111
|
-
contentOptions: {
|
|
118
|
+
contentOptions: {
|
|
119
|
+
component: tmRecentsManagerElement,
|
|
120
|
+
panelContainer: {
|
|
121
|
+
title: SDKUI_Localizator.Shortcuts,
|
|
122
|
+
totalItems: mruTIDs.length,
|
|
123
|
+
onRefresh: refreshRecentsAsync
|
|
124
|
+
}
|
|
125
|
+
},
|
|
112
126
|
toolbarOptions: { icon: _jsx(IconRecentlyViewed, { fontSize: 24 }), visible: true, orderNumber: 2, isActive: allInitialPanelVisibility['tmRecentsManager'] }
|
|
113
127
|
},
|
|
114
128
|
{
|
|
@@ -139,7 +153,7 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
139
153
|
}
|
|
140
154
|
]
|
|
141
155
|
},
|
|
142
|
-
], [tmTreeSelectorElement, tmRecentsManagerElement, tmFormElement, currentTID, mruTIDs, isSharedArchive]);
|
|
156
|
+
], [tmTreeSelectorElement, tmRecentsManagerElement, tmFormElement, currentTID, mruTIDs, isSharedArchive, refreshRecentsAsync]);
|
|
143
157
|
return (_jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmRecentsManager', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }));
|
|
144
158
|
};
|
|
145
159
|
export default TMArchive;
|
|
@@ -11,5 +11,5 @@ interface TMToppyDraggableHelpCenterProps {
|
|
|
11
11
|
/** Callback chiamato quando si clicca sull'immagine di Toppy */
|
|
12
12
|
onToppyImageClick?: () => void;
|
|
13
13
|
}
|
|
14
|
-
declare const TMToppyDraggableHelpCenter: (props: TMToppyDraggableHelpCenterProps) =>
|
|
14
|
+
declare const TMToppyDraggableHelpCenter: (props: TMToppyDraggableHelpCenterProps) => React.JSX.Element;
|
|
15
15
|
export default TMToppyDraggableHelpCenter;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { BlogPost, UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
2
3
|
import { FileItem } from '../../base/TMFileManagerUtils';
|
|
3
4
|
import { TMBlogContextDescriptor } from '../../grids/TMBlogsPostUtils';
|
|
@@ -18,5 +19,5 @@ interface TMBlogCommentFormProps {
|
|
|
18
19
|
/** External save handler - when provided, bypasses internal engine logic */
|
|
19
20
|
onCustomSave?: (blogPost: BlogPost) => Promise<void>;
|
|
20
21
|
}
|
|
21
|
-
declare const TMBlogCommentForm: (props: TMBlogCommentFormProps) =>
|
|
22
|
+
declare const TMBlogCommentForm: (props: TMBlogCommentFormProps) => React.JSX.Element;
|
|
22
23
|
export default TMBlogCommentForm;
|
|
@@ -7,7 +7,7 @@ import { DcmtOperationTypes, FormModes } from '../../../ts';
|
|
|
7
7
|
import { StyledToolbarCardContainer, StyledFormButtonsContainer } from '../../base/Styled';
|
|
8
8
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
9
9
|
import { TMSplitterLayout } from '../../base/TMLayout';
|
|
10
|
-
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
10
|
+
import { TMExceptionBoxManager, TMMessageBoxManager, ButtonNames } from '../../base/TMPopUp';
|
|
11
11
|
import TMShowAllOrMaxItemsButton from '../../base/TMShowAllOrMaxItemsButton';
|
|
12
12
|
import TMSpinner from '../../base/TMSpinner';
|
|
13
13
|
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
@@ -114,10 +114,24 @@ const TMBatchUpdateForm = ({ inputDcmts, TID, DID, isExpertMode = SDKUI_Globals.
|
|
|
114
114
|
const totalItems = metadataValues.filter(o => o.mid && o.mid > 100).length;
|
|
115
115
|
const metadataValuesSource = metadataValues.filter(o => o.mid && o.mid > 100).slice(0, showAll ? metadataValues.filter(o => o.mid && o.mid > 100).length : listMaxItems);
|
|
116
116
|
const metadataValuesSourceOrig = metadataValuesOrig.filter(o => o.mid && o.mid > 100).slice(0, showAll ? metadataValuesOrig.filter(o => o.mid && o.mid > 100).length : listMaxItems);
|
|
117
|
+
/**
|
|
118
|
+
* Chiusura del form: con modifiche pendenti chiede conferma prima di scartarle.
|
|
119
|
+
* Il TMModal è montato con askClosingConfirm, quindi non si auto-nasconde: la chiusura
|
|
120
|
+
* effettiva avviene solo quando onBack smonta il componente.
|
|
121
|
+
*/
|
|
122
|
+
const handleClose = () => {
|
|
123
|
+
if (!isModified) {
|
|
124
|
+
onBack?.();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
TMMessageBoxManager.show({
|
|
128
|
+
title: SDKUI_Localizator.Cancel, message: SDKUI_Localizator.ConfirmOnCancel, buttons: [ButtonNames.YES, ButtonNames.NO],
|
|
129
|
+
onButtonClick: (e) => { if (e === ButtonNames.YES)
|
|
130
|
+
onBack?.(); }
|
|
131
|
+
});
|
|
132
|
+
};
|
|
117
133
|
const renderContent = () => {
|
|
118
|
-
return (_jsx(TMLayoutWaitingContainer, { showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorColor: 'transparent', separatorActiveColor: 'transparent', showSeparator: showFormulaEditor, start: showFormulaEditor ? ['50%', '50%'] : ['100%', '0%'], min: ['0', '0'], children: [_jsx(TMPanel, { title: isModal ? 'Modifica i metadati' : `${SDKUI_Localizator.BatchUpdate} (${inputDcmts.length} documenti selezionati)`, onBack: deviceType === DeviceType.MOBILE ?
|
|
119
|
-
// onClose={deviceType !== DeviceType.MOBILE ? onBack : undefined}
|
|
120
|
-
allowMaximize: !isModal, showHeader: !isModal, children: _jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, isExpertMode: isExpertMode, showCheckBoxes: ShowCheckBoxesMode.Always, showNullValueCheckBoxes: true, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, validationItems: validationItems, isOpenDistinctValues: showDistinctValuesPanel, selectedMID: focusedMetadataValue?.mid, onFocusedItemChanged: (item) => { setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
|
|
134
|
+
return (_jsx(TMLayoutWaitingContainer, { showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorColor: 'transparent', separatorActiveColor: 'transparent', showSeparator: showFormulaEditor, start: showFormulaEditor ? ['50%', '50%'] : ['100%', '0%'], min: ['0', '0'], children: [_jsx(TMPanel, { title: isModal ? 'Modifica i metadati' : `${SDKUI_Localizator.BatchUpdate} (${inputDcmts.length} documenti selezionati)`, onBack: deviceType === DeviceType.MOBILE ? handleClose : undefined, allowMaximize: !isModal, showHeader: !isModal, children: _jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, isExpertMode: isExpertMode, showCheckBoxes: ShowCheckBoxesMode.Always, showNullValueCheckBoxes: true, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, validationItems: validationItems, isOpenDistinctValues: showDistinctValuesPanel, selectedMID: focusedMetadataValue?.mid, onFocusedItemChanged: (item) => { setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
|
|
121
135
|
setMetadataValues((prevItems) => prevItems.map((item) => {
|
|
122
136
|
const newItem = newItems.find((newItem) => newItem.tid === item.tid && newItem.mid === item.mid);
|
|
123
137
|
return newItem ? { ...item, ...newItem } : item;
|
|
@@ -153,7 +167,7 @@ const TMBatchUpdateForm = ({ inputDcmts, TID, DID, isExpertMode = SDKUI_Globals.
|
|
|
153
167
|
} })] }) })] }) }));
|
|
154
168
|
};
|
|
155
169
|
return (_jsx(_Fragment, { children: (isModal && onBack)
|
|
156
|
-
? _jsx(TMModal, { title: titleModal, onClose:
|
|
170
|
+
? _jsx(TMModal, { title: titleModal, onClose: handleClose, width: widthModal ?? '100%', height: heightModal ?? '100%', hidePopup: false, askClosingConfirm: true, children: _jsx("div", { style: { width: "100%", height: "100%", display: 'block', padding: "4px" }, children: renderContent() }) })
|
|
157
171
|
: renderContent() }));
|
|
158
172
|
};
|
|
159
173
|
export default TMBatchUpdateForm;
|
|
@@ -3,7 +3,10 @@ import { HomeBlogPost, TaskDescriptor } from '@topconsultnpm/sdk-ts';
|
|
|
3
3
|
interface ITMDcmtBlogProps {
|
|
4
4
|
tid: number | undefined;
|
|
5
5
|
did: number | undefined;
|
|
6
|
+
/** Il pannello è aperto. La inietta TMPanelWrapper, non va passata dal chiamante */
|
|
6
7
|
isVisible?: boolean;
|
|
8
|
+
/** La pagina che contiene il pannello è a video: quelle in secondo piano restano montate e non devono caricare */
|
|
9
|
+
isPageVisible?: boolean;
|
|
7
10
|
fetchBlogDataTrigger?: number;
|
|
8
11
|
onRefreshBlogDatagrid?: () => Promise<void>;
|
|
9
12
|
showFloatingCommentButton?: boolean;
|
|
@@ -8,7 +8,7 @@ import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
|
8
8
|
import TMBlogsPost from '../../grids/TMBlogsPost';
|
|
9
9
|
import TMSpinner from '../../base/TMSpinner';
|
|
10
10
|
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
11
|
-
const TMDcmtBlog = ({ tid, did, isVisible, fetchBlogDataTrigger, onRefreshBlogDatagrid, showFloatingCommentButton = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers }) => {
|
|
11
|
+
const TMDcmtBlog = ({ tid, did, isVisible, isPageVisible = true, fetchBlogDataTrigger, onRefreshBlogDatagrid, showFloatingCommentButton = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers }) => {
|
|
12
12
|
const [blogsDatasource, setBlogsDatasource] = useState([]);
|
|
13
13
|
const [hasLoadedDataOnce, setHasLoadedDataOnce] = useState(false); //traccia se *qualsiasi* dato è stato caricato per la prima volta
|
|
14
14
|
const [lastLoadedDid, setLastLoadedDid] = useState(undefined); // `lastLoadedDid` tiene traccia dell'ultimo `did` per cui abbiamo caricato i dati
|
|
@@ -47,15 +47,15 @@ const TMDcmtBlog = ({ tid, did, isVisible, fetchBlogDataTrigger, onRefreshBlogDa
|
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
// Condizione per eseguire il fetch:
|
|
50
|
-
// 1. Il pannello è visibile
|
|
50
|
+
// 1. Il pannello è visibile in una pagina a video
|
|
51
51
|
// 2. E (non abbiamo ancora caricato dati o il `did` è cambiato rispetto all'ultima volta)
|
|
52
|
-
const shouldFetch = isVisible && (!hasLoadedDataOnce || did !== lastLoadedDid);
|
|
52
|
+
const shouldFetch = isVisible && isPageVisible && (!hasLoadedDataOnce || did !== lastLoadedDid);
|
|
53
53
|
// Esegui la chiamata API solo se il pannello è visibile E i dati non sono già stati caricati
|
|
54
54
|
// O, se vuoi ricaricare ogni volta che diventa visibile (ma è meno efficiente per "pesante")
|
|
55
55
|
if (shouldFetch) {
|
|
56
56
|
fetchBlogDataAsync(tid, did);
|
|
57
57
|
}
|
|
58
|
-
}, [tid, did, isVisible, hasLoadedDataOnce, lastLoadedDid]);
|
|
58
|
+
}, [tid, did, isVisible, isPageVisible, hasLoadedDataOnce, lastLoadedDid]);
|
|
59
59
|
const refreshCallback = async () => {
|
|
60
60
|
await fetchBlogDataAsync(tid, did);
|
|
61
61
|
await onRefreshBlogDatagrid?.();
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { DcmtTypeDescriptor, HomeBlogPost, LayoutModes, ObjectRef, SearchResultDescriptor, TaskDescriptor, ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { DcmtInfo, FormModes, MetadataValueDescriptorEx, TaskContext, IGraphometricManagerProp } from '../../../ts';
|
|
4
4
|
import { IntesiCertificateData } from '../../../helper';
|
|
5
|
+
import { ArchiveListMode } from '../../../hooks/useArchiveListForm';
|
|
5
6
|
/**
|
|
6
7
|
* Definisce il contesto da cui è stato invocato il TMDcmtForm.
|
|
7
8
|
* Permette di gestire logiche diverse in base alla provenienza.
|
|
@@ -77,6 +78,12 @@ interface ITMDcmtFormProps {
|
|
|
77
78
|
mid: number;
|
|
78
79
|
value: string;
|
|
79
80
|
}>, tid?: number) => void;
|
|
81
|
+
/**
|
|
82
|
+
* Modalità "aggiungi a elenco" (es. archiviazione dettagli multipli): se valorizzata, in layout di archiviazione
|
|
83
|
+
* il form non archivia ma emette i metadati compilati al chiamante (pulsanti "Aggiungi"/"Modifica" + "Pulisci").
|
|
84
|
+
* Tutta la logica è incapsulata in useArchiveListForm; usata solo da TMMultiMasterDetailDcmts.
|
|
85
|
+
*/
|
|
86
|
+
archiveListMode?: ArchiveListMode;
|
|
80
87
|
fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>;
|
|
81
88
|
datagridUtility?: {
|
|
82
89
|
onRefreshSearchAsyncDatagrid?: () => Promise<void>;
|