@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,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useRef, useState, forwardRef, useImperativeHandle } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { getAppModuleGradient, IconArrowLeft, IconClearButton, IconWindowMaximize, IconWindowMinimize, isPositiveNumber, SDKUI_Localizator } from '../../helper';
|
|
3
|
+
import styled, { css, keyframes } from 'styled-components';
|
|
4
|
+
import { getAppModuleGradient, IconArrowLeft, IconClearButton, IconRefresh, IconWindowMaximize, IconWindowMinimize, isPositiveNumber, SDKUI_Localizator } from '../../helper';
|
|
5
5
|
import TMButton from './TMButton';
|
|
6
|
-
import {
|
|
6
|
+
import { LoadIndicator } from 'devextreme-react/load-indicator';
|
|
7
|
+
import { TMExceptionBoxManager } from './TMPopUp';
|
|
8
|
+
import { Gutters, TMColors } from '../../utils/theme';
|
|
7
9
|
const StyledBackButton = styled.button `
|
|
8
10
|
display: flex;
|
|
9
11
|
align-items: center;
|
|
@@ -96,6 +98,110 @@ const StyledPanelContent = styled.div `
|
|
|
96
98
|
outline: none;
|
|
97
99
|
}
|
|
98
100
|
`;
|
|
101
|
+
// Allineata al TABLET_BREAKPOINT (768) di TMDeviceProvider
|
|
102
|
+
const MOBILE_MEDIA_QUERY = '(max-width: 767.98px)';
|
|
103
|
+
// L'eccedenza da scorrere è "larghezza viewport - larghezza testo", ma nessuna delle due
|
|
104
|
+
// è nota al CSS. La si ottiene componendo due percentuali che si risolvono su box diversi:
|
|
105
|
+
// la track (larga quanto il viewport) va a +100% della PROPRIA larghezza, il testo a -100%
|
|
106
|
+
// della SUA. Le due animazioni hanno stessa durata ed easing, quindi lo scostamento netto
|
|
107
|
+
// in ogni istante è esattamente e(t) * (viewport - testo).
|
|
108
|
+
const panelTitleTrackMarquee = keyframes `
|
|
109
|
+
0%, 15% { transform: translateX(0); }
|
|
110
|
+
45%, 55% { transform: translateX(100%); }
|
|
111
|
+
85%, 100% { transform: translateX(0); }
|
|
112
|
+
`;
|
|
113
|
+
const panelTitleTextMarquee = keyframes `
|
|
114
|
+
0%, 15% { transform: translateX(0); }
|
|
115
|
+
45%, 55% { transform: translateX(-100%); }
|
|
116
|
+
85%, 100% { transform: translateX(0); }
|
|
117
|
+
`;
|
|
118
|
+
// Ritaglia il testo in eccesso: è l'unico box con overflow hidden, la track ci scorre dentro
|
|
119
|
+
const StyledPanelTitleViewport = styled.div `
|
|
120
|
+
flex: 1;
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
justify-content: flex-start;
|
|
124
|
+
min-width: 0;
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
padding: 0 8px;
|
|
127
|
+
`;
|
|
128
|
+
// Larga quanto il viewport: è il metro con cui il -100% del testo viene compensato.
|
|
129
|
+
const StyledPanelTitleTrack = styled.div `
|
|
130
|
+
flex: 1;
|
|
131
|
+
min-width: 0;
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
|
|
135
|
+
${({ $marquee }) => $marquee && css `
|
|
136
|
+
@media ${MOBILE_MEDIA_QUERY} {
|
|
137
|
+
animation: ${panelTitleTrackMarquee} 10s ease-in-out infinite;
|
|
138
|
+
|
|
139
|
+
@media (prefers-reduced-motion: reduce) {
|
|
140
|
+
animation: none;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
`}
|
|
144
|
+
`;
|
|
145
|
+
// Senza $marquee resta il troncamento con i puntini di sempre
|
|
146
|
+
const StyledPanelTitle = styled.div `
|
|
147
|
+
margin: 0;
|
|
148
|
+
white-space: nowrap;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
text-overflow: ellipsis;
|
|
151
|
+
|
|
152
|
+
${({ $marquee }) => $marquee && css `
|
|
153
|
+
@media ${MOBILE_MEDIA_QUERY} {
|
|
154
|
+
flex: 0 0 auto;
|
|
155
|
+
width: max-content;
|
|
156
|
+
min-width: 100%;
|
|
157
|
+
max-width: none;
|
|
158
|
+
overflow: visible;
|
|
159
|
+
text-overflow: clip;
|
|
160
|
+
animation: ${panelTitleTextMarquee} 10s ease-in-out infinite;
|
|
161
|
+
|
|
162
|
+
@media (prefers-reduced-motion: reduce) {
|
|
163
|
+
animation: none;
|
|
164
|
+
width: auto;
|
|
165
|
+
min-width: 0;
|
|
166
|
+
overflow: hidden;
|
|
167
|
+
text-overflow: ellipsis;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
`}
|
|
171
|
+
`;
|
|
172
|
+
const refreshSpin = keyframes `
|
|
173
|
+
from { transform: rotate(0deg); }
|
|
174
|
+
to { transform: rotate(360deg); }
|
|
175
|
+
`;
|
|
176
|
+
// Fa girare l'icona per tutta la durata del ricaricamento
|
|
177
|
+
const StyledRefreshIcon = styled.span `
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
justify-content: center;
|
|
181
|
+
|
|
182
|
+
${({ $isSpinning }) => $isSpinning && css `
|
|
183
|
+
animation: ${refreshSpin} 1s linear infinite;
|
|
184
|
+
|
|
185
|
+
@media (prefers-reduced-motion: reduce) {
|
|
186
|
+
animation: none;
|
|
187
|
+
}
|
|
188
|
+
`}
|
|
189
|
+
`;
|
|
190
|
+
// Copre il solo contenuto del pannello (StyledPanelContent è position: relative con overflow hidden)
|
|
191
|
+
const StyledPanelLoaderOverlay = styled.div `
|
|
192
|
+
position: absolute;
|
|
193
|
+
inset: 0;
|
|
194
|
+
z-index: 10;
|
|
195
|
+
display: flex;
|
|
196
|
+
flex-direction: column;
|
|
197
|
+
align-items: center;
|
|
198
|
+
justify-content: center;
|
|
199
|
+
gap: 10px;
|
|
200
|
+
background: rgba(255, 255, 255, 0.65);
|
|
201
|
+
border-bottom-right-radius: 10px;
|
|
202
|
+
border-bottom-left-radius: 10px;
|
|
203
|
+
color: ${TMColors.primaryColor};
|
|
204
|
+
`;
|
|
99
205
|
/**
|
|
100
206
|
* TMPanel - Pannello con supporto Controlled/Uncontrolled
|
|
101
207
|
*
|
|
@@ -103,9 +209,27 @@ const StyledPanelContent = styled.div `
|
|
|
103
209
|
* - Se NON passata → Uncontrolled: gestione interna dello stato attivo (plug-and-play)
|
|
104
210
|
* - Se passata → Controlled: il parent gestisce lo stato tramite onActivate
|
|
105
211
|
*/
|
|
106
|
-
const TMPanel = forwardRef(({ allowMaximize = true, color, backgroundColor, backgroundColorContainer, children, showHeader = true, title, totalItems, displayedItemsCount, toolbar, padding = '5px', isVisible = true, panelID = 'tmpanel', isActive, // Questa prop determinerà la modalità
|
|
107
|
-
onActivate, onBack, onClose, onHeaderDoubleClick, onMaximize, onActiveChanged }, ref) => {
|
|
212
|
+
const TMPanel = forwardRef(({ allowMaximize = true, color, backgroundColor, backgroundColorContainer, children, showHeader = true, title, enableTitleMarquee = false, totalItems, displayedItemsCount, toolbar, padding = '5px', isVisible = true, panelID = 'tmpanel', isActive, // Questa prop determinerà la modalità
|
|
213
|
+
onRefresh, isRefreshing, onActivate, onBack, backCaption = SDKUI_Localizator.Back, onClose, onHeaderDoubleClick, onMaximize, onActiveChanged }, ref) => {
|
|
108
214
|
const [isMaximized, setIsMaximized] = useState(false);
|
|
215
|
+
const [isRefreshingInternal, setIsRefreshingInternal] = useState(false);
|
|
216
|
+
// Il loader compare sia per il refresh dalla testata sia per i caricamenti segnalati dal contenuto
|
|
217
|
+
const isBusy = isRefreshing || isRefreshingInternal;
|
|
218
|
+
const handleRefresh = useCallback(async () => {
|
|
219
|
+
if (isRefreshingInternal)
|
|
220
|
+
return;
|
|
221
|
+
setIsRefreshingInternal(true);
|
|
222
|
+
// Il finally garantisce che loader e rotellina si fermino anche se il ricaricamento fallisce
|
|
223
|
+
try {
|
|
224
|
+
await onRefresh?.();
|
|
225
|
+
}
|
|
226
|
+
catch (ex) {
|
|
227
|
+
TMExceptionBoxManager.show({ exception: ex });
|
|
228
|
+
}
|
|
229
|
+
finally {
|
|
230
|
+
setIsRefreshingInternal(false);
|
|
231
|
+
}
|
|
232
|
+
}, [isRefreshingInternal, onRefresh]);
|
|
109
233
|
// Detect device type (e.g., mobile or desktop)
|
|
110
234
|
const deviceType = useDeviceType();
|
|
111
235
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
@@ -157,6 +281,7 @@ onActivate, onBack, onClose, onHeaderDoubleClick, onMaximize, onActiveChanged },
|
|
|
157
281
|
handleFocusUncontrolled();
|
|
158
282
|
}
|
|
159
283
|
};
|
|
284
|
+
const titleMarqueeKey = enableTitleMarquee && (typeof title === 'string' || typeof title === 'number') ? String(title) : undefined;
|
|
160
285
|
// handler for external maximize management
|
|
161
286
|
const handleMaximize = () => {
|
|
162
287
|
setIsMaximized(prevState => {
|
|
@@ -188,31 +313,19 @@ onActivate, onBack, onClose, onHeaderDoubleClick, onMaximize, onActiveChanged },
|
|
|
188
313
|
flexDirection: 'row',
|
|
189
314
|
alignItems: 'center',
|
|
190
315
|
flexShrink: 0
|
|
191
|
-
}, children: _jsxs(StyledBackButton, { "$isActive": currentIsActive, onClick: () => onBack ? onBack() : null, title:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
minWidth: 0,
|
|
197
|
-
overflow: 'hidden',
|
|
198
|
-
padding: '0 8px'
|
|
199
|
-
}, children: _jsxs("div", { style: {
|
|
200
|
-
whiteSpace: 'nowrap',
|
|
201
|
-
overflow: 'hidden',
|
|
202
|
-
textOverflow: 'ellipsis',
|
|
203
|
-
margin: 0
|
|
204
|
-
}, children: [title, isPositiveNumber(displayedItemsCount) && isPositiveNumber(totalItems)
|
|
205
|
-
? ` (${displayedItemsCount} / ${totalItems})`
|
|
206
|
-
: isPositiveNumber(totalItems)
|
|
207
|
-
? ` (${totalItems})`
|
|
208
|
-
: ''] }) }), _jsxs("div", { style: {
|
|
316
|
+
}, children: _jsxs(StyledBackButton, { "$isActive": currentIsActive, onClick: () => onBack ? onBack() : null, title: backCaption, children: [_jsx(IconArrowLeft, {}), !isMobile && _jsx("span", { children: backCaption })] }) }), _jsx(StyledPanelTitleViewport, { children: _jsx(StyledPanelTitleTrack, { "$marquee": enableTitleMarquee, children: _jsxs(StyledPanelTitle, { "$marquee": enableTitleMarquee, children: [title, isPositiveNumber(displayedItemsCount) && isPositiveNumber(totalItems)
|
|
317
|
+
? ` (${displayedItemsCount} / ${totalItems})`
|
|
318
|
+
: isPositiveNumber(totalItems)
|
|
319
|
+
? ` (${totalItems})`
|
|
320
|
+
: ''] }) }, titleMarqueeKey) }), _jsxs("div", { style: {
|
|
209
321
|
display: 'flex',
|
|
210
322
|
flexDirection: 'row',
|
|
211
323
|
alignItems: 'center',
|
|
212
324
|
gap: '5px',
|
|
213
325
|
flexShrink: 0
|
|
214
|
-
}, children: [toolbar, allowMaximize && _jsx(TMButton, { color: 'primaryOutline', caption: isMaximized ? SDKUI_Localizator.Minimize : SDKUI_Localizator.Maximize, icon: isMaximized
|
|
326
|
+
}, children: [toolbar, onRefresh && _jsx(TMButton, { color: 'primaryOutline', caption: SDKUI_Localizator.Refresh, disabled: isBusy, icon: _jsx(StyledRefreshIcon, { "$isSpinning": isBusy, children: _jsx(IconRefresh, {}) }), btnStyle: 'icon', onClick: handleRefresh }), allowMaximize && _jsx(TMButton, { color: 'primaryOutline', caption: isMaximized ? SDKUI_Localizator.Minimize : SDKUI_Localizator.Maximize, icon: isMaximized
|
|
215
327
|
? _jsx(IconWindowMinimize, { fontSize: 16 })
|
|
216
|
-
: _jsx(IconWindowMaximize, { fontSize: 16 }), btnStyle: 'icon', onClick: handleMaximize }), onClose && _jsx(TMButton, { color: 'primaryOutline', caption: SDKUI_Localizator.Close, icon: _jsx(IconClearButton, {}), btnStyle: 'icon', onClick: () => { setIsMaximized(false); onClose?.(); } })] })] }) }),
|
|
328
|
+
: _jsx(IconWindowMaximize, { fontSize: 16 }), btnStyle: 'icon', onClick: handleMaximize }), onClose && _jsx(TMButton, { color: 'primaryOutline', caption: SDKUI_Localizator.Close, icon: _jsx(IconClearButton, {}), btnStyle: 'icon', onClick: () => { setIsMaximized(false); onClose?.(); } })] })] }) }), _jsxs(StyledPanelContent, { "$height": showHeader ? "calc(100% - 40px)" : "100%", "$padding": padding, "$backgroundColor": backgroundColorContainer ?? `#FFFFFF`, children: [children, isBusy &&
|
|
329
|
+
_jsxs(StyledPanelLoaderOverlay, { children: [_jsx(LoadIndicator, { height: 40, width: 40 }), _jsx("div", { children: SDKUI_Localizator.Loading })] })] })] }));
|
|
217
330
|
});
|
|
218
331
|
export default TMPanel;
|
|
@@ -60,6 +60,9 @@ export const sanitizeException = (exception) => {
|
|
|
60
60
|
catch {
|
|
61
61
|
return exception;
|
|
62
62
|
}
|
|
63
|
+
if (plain && typeof plain === 'object' && !Array.isArray(plain) && plain.message === undefined && typeof exception.message === 'string') {
|
|
64
|
+
plain.message = exception.message;
|
|
65
|
+
}
|
|
63
66
|
return redactSensitiveValue(plain);
|
|
64
67
|
};
|
|
65
68
|
const StyledExeptionToolbar = styled.div `
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface ITMSpinner {
|
|
2
3
|
backgroundColor?: string;
|
|
3
4
|
fontSize?: string;
|
|
@@ -7,7 +8,7 @@ interface ITMSpinner {
|
|
|
7
8
|
onCancel?: () => void;
|
|
8
9
|
cancelText?: string;
|
|
9
10
|
}
|
|
10
|
-
declare const Spinner: ({ backgroundColor, description, fontSize, width, flat, onCancel, cancelText }: ITMSpinner) =>
|
|
11
|
+
declare const Spinner: ({ backgroundColor, description, fontSize, width, flat, onCancel, cancelText }: ITMSpinner) => React.JSX.Element;
|
|
11
12
|
declare class TMSpinner {
|
|
12
13
|
static show({ description, backgroundColor, fontSize, flat, onCancel, cancelText }?: ITMSpinner): void;
|
|
13
14
|
static hide(): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
export interface ITMTabProps {
|
|
3
4
|
title: string;
|
|
@@ -7,14 +8,14 @@ export declare const TMTab: ({ label, propsToBeValidated, children }: {
|
|
|
7
8
|
label?: string;
|
|
8
9
|
propsToBeValidated?: string[] | undefined;
|
|
9
10
|
children?: any;
|
|
10
|
-
}) =>
|
|
11
|
+
}) => React.JSX.Element;
|
|
11
12
|
export declare const TMTabItemBadge: ({ vil }: {
|
|
12
13
|
vil: ValidationItem[];
|
|
13
|
-
}) =>
|
|
14
|
+
}) => React.JSX.Element;
|
|
14
15
|
declare const TMTabGroup: ({ children, fontSize, validationItems, onTabIndexChanged }: {
|
|
15
16
|
onTabIndexChanged?: (e: number) => void;
|
|
16
17
|
children: any;
|
|
17
18
|
fontSize?: string;
|
|
18
19
|
validationItems?: ValidationItem[];
|
|
19
|
-
}) =>
|
|
20
|
+
}) => React.JSX.Element;
|
|
20
21
|
export default TMTabGroup;
|
|
@@ -9,6 +9,7 @@ interface ITMTooltipProps extends ITooltipOptions {
|
|
|
9
9
|
hideAfterDelay?: boolean;
|
|
10
10
|
parentStyle?: React.CSSProperties;
|
|
11
11
|
childStyle?: React.CSSProperties;
|
|
12
|
+
allowContentInteraction?: boolean;
|
|
12
13
|
}
|
|
13
|
-
declare const TMTooltip: ({ children, position, content, hideAfterDelay, parentStyle, childStyle }: ITMTooltipProps) =>
|
|
14
|
+
declare const TMTooltip: ({ children, position, content, hideAfterDelay, parentStyle, childStyle, allowContentInteraction }: ITMTooltipProps) => React.JSX.Element;
|
|
14
15
|
export default TMTooltip;
|
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { Tooltip } from 'devextreme-react/tooltip';
|
|
4
4
|
import { genUniqueId } from '../../helper';
|
|
5
5
|
import { DeviceType, useDeviceType } from './TMDeviceProvider';
|
|
6
|
-
|
|
6
|
+
/** Tempo per spostare il mouse dall'elemento al contenuto del tooltip, quando è interattivo */
|
|
7
|
+
const HIDE_DELAY_MS = 400;
|
|
8
|
+
const TMTooltip = ({ children, position, content, hideAfterDelay, parentStyle, childStyle, allowContentInteraction = false }) => {
|
|
7
9
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
8
|
-
const [id
|
|
9
|
-
|
|
10
|
+
const [id] = useState(() => genUniqueId());
|
|
11
|
+
const hideTimerRef = useRef();
|
|
10
12
|
useEffect(() => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
const hide = () => setShowTooltip(false);
|
|
14
|
+
window.addEventListener('click', hide);
|
|
15
|
+
return () => window.removeEventListener('click', hide);
|
|
13
16
|
}, []);
|
|
17
|
+
useEffect(() => { return () => clearTimeout(hideTimerRef.current); }, []);
|
|
14
18
|
const deviceType = useDeviceType();
|
|
15
|
-
|
|
19
|
+
const cancelHide = () => clearTimeout(hideTimerRef.current);
|
|
20
|
+
const show = () => { cancelHide(); setShowTooltip(true); };
|
|
21
|
+
const hide = () => {
|
|
22
|
+
cancelHide();
|
|
23
|
+
if (!allowContentInteraction) {
|
|
24
|
+
setShowTooltip(false);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
hideTimerRef.current = setTimeout(() => setShowTooltip(false), HIDE_DELAY_MS);
|
|
28
|
+
};
|
|
29
|
+
return (_jsxs("div", { style: parentStyle, children: [_jsx("div", { id: `idContainerTooltip${id}`, style: { display: 'flex', alignItems: 'center', height: 'max-content', width: 'max-content', ...childStyle }, onMouseEnter: show, onMouseLeave: hide, onTouchStart: show, onClick: () => { if (deviceType === DeviceType.DESKTOP || !hideAfterDelay)
|
|
16
30
|
return; setTimeout(() => { setShowTooltip(false); }, 1500); }, onTouchEnd: () => { if (deviceType === DeviceType.DESKTOP || !hideAfterDelay)
|
|
17
31
|
return; setTimeout(() => { setShowTooltip(false); }, 1500); }, children: children }), content &&
|
|
18
|
-
_jsx(Tooltip, { target: `#idContainerTooltip${id}`, hideOnOutsideClick: true, visible: showTooltip, position: position ?? 'bottom', onHidden: () => setShowTooltip(false), children:
|
|
32
|
+
_jsx(Tooltip, { target: `#idContainerTooltip${id}`, hideOnOutsideClick: true, visible: showTooltip, position: position ?? 'bottom', onHidden: () => setShowTooltip(false), children: allowContentInteraction
|
|
33
|
+
? _jsx("div", { style: { pointerEvents: 'all' }, onMouseEnter: cancelHide, onMouseLeave: hide, children: content })
|
|
34
|
+
: content })] }));
|
|
19
35
|
};
|
|
20
36
|
export default TMTooltip;
|
|
@@ -29,13 +29,19 @@ interface ITMTreeViewProps {
|
|
|
29
29
|
showLoadMoreButton?: boolean;
|
|
30
30
|
enableVirtualization?: boolean;
|
|
31
31
|
}
|
|
32
|
-
declare const TMTreeView: ({ dataSource, focusedItem, selectedItems, allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, onItemContextMenu, autoSelectChildren, itemsPerPage, showLoadMoreButton, enableVirtualization }: ITMTreeViewProps) =>
|
|
32
|
+
declare const TMTreeView: ({ dataSource, focusedItem, selectedItems, allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, onItemContextMenu, autoSelectChildren, itemsPerPage, showLoadMoreButton, enableVirtualization }: ITMTreeViewProps) => React.JSX.Element;
|
|
33
33
|
export default TMTreeView;
|
|
34
|
-
export declare const StyledTreeContainer: import("styled-components/dist/types").IStyledComponentBase<"web",
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
export declare const StyledTreeContainer: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
35
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
36
|
+
}> & string;
|
|
37
|
+
export declare const StyledItemContent: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
38
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
39
|
+
}> & string;
|
|
40
|
+
export declare const StyledTreeNode: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
41
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
42
|
+
}, {
|
|
37
43
|
$isSelected?: boolean;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
}>> & string;
|
|
45
|
+
export declare const StyledStickyPaginator: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
46
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
47
|
+
}> & string;
|