@topconsultnpm/sdkui-react 6.22.0-dev2.9 → 6.22.0-dev3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +3 -3
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +1 -1
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +21 -45
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +37 -89
- package/lib/components/base/Styled.d.ts +40 -76
- package/lib/components/base/TMAccordionNew.js +7 -7
- package/lib/components/base/TMAlert.d.ts +32 -32
- package/lib/components/base/TMAreaManager.js +1 -1
- package/lib/components/base/TMButton.js +4 -4
- package/lib/components/base/TMClosableList.js +3 -3
- package/lib/components/base/TMCustomButton.js +1 -1
- package/lib/components/base/TMDataGrid.d.ts +2 -0
- package/lib/components/base/TMDataGrid.js +260 -8
- package/lib/components/base/TMDropDownMenu.js +1 -1
- package/lib/components/base/TMEditorBase.d.ts +2 -0
- package/lib/components/base/TMFileManager.js +5 -3
- package/lib/components/base/TMFileManagerDataGridView.js +12 -3
- package/lib/components/base/TMFileManagerThumbnailItems.js +20 -10
- package/lib/components/base/TMFileManagerUtils.d.ts +4 -6
- package/lib/components/base/TMFileManagerUtils.js +37 -1
- package/lib/components/base/TMLayout.d.ts +2 -2
- package/lib/components/base/TMLayout.js +3 -3
- package/lib/components/base/TMList.js +1 -1
- package/lib/components/base/TMListView.js +3 -3
- package/lib/components/base/TMModal.d.ts +11 -0
- package/lib/components/base/TMModal.js +47 -13
- package/lib/components/base/TMPanel.d.ts +6 -0
- package/lib/components/base/TMPanel.js +141 -28
- package/lib/components/base/TMPopUp.js +5 -2
- package/lib/components/base/TMResizableMenu.js +2 -2
- package/lib/components/base/TMRightSidebar.js +1 -1
- package/lib/components/base/TMShowAllOrMaxItemsButton.js +1 -1
- package/lib/components/base/TMSpinner.js +2 -2
- package/lib/components/base/TMTab.js +2 -2
- package/lib/components/base/TMToggleButton.js +2 -2
- package/lib/components/base/TMToolbarCard.js +3 -3
- package/lib/components/base/TMTooltip.d.ts +2 -1
- package/lib/components/base/TMTooltip.js +24 -8
- package/lib/components/base/TMTreeView.d.ts +5 -7
- package/lib/components/base/TMTreeView.js +110 -69
- package/lib/components/base/TMWaitPanel.js +2 -2
- package/lib/components/choosers/TMCultureIDPicker.js +2 -2
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.js +2 -2
- package/lib/components/choosers/TMDcmtTypeChooser.js +5 -4
- package/lib/components/choosers/TMDiskChooser.js +1 -1
- package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
- package/lib/components/choosers/TMDistinctValues.js +150 -143
- package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMImageIDChooser.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +3 -3
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +12 -0
- package/lib/components/choosers/TMQuickSearchInfo.js +279 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.d.ts +16 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.js +94 -0
- package/lib/components/choosers/TMRelationChooser.js +1 -1
- package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
- package/lib/components/choosers/TMSelectedValuesSummary.js +89 -0
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMCheckBox.js +1 -1
- package/lib/components/editors/TMDropDown.d.ts +3 -0
- package/lib/components/editors/TMDropDown.js +197 -5
- package/lib/components/editors/TMEditorStyled.d.ts +11 -43
- package/lib/components/editors/TMFormulaEditor.js +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.js +1 -1
- package/lib/components/editors/TMLocalizedTextBox.js +1 -1
- package/lib/components/editors/TMMetadataValues.js +2 -2
- package/lib/components/editors/TMRadioButton.js +2 -2
- package/lib/components/editors/TMSummary.js +3 -3
- package/lib/components/editors/TMTextArea.js +3 -3
- package/lib/components/editors/TMTextBox.js +3 -3
- package/lib/components/editors/TMTextExpression.js +1 -1
- package/lib/components/features/archive/TMArchive.js +17 -3
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
- package/lib/components/features/assistant/TMToppySpeechBubble.js +1 -1
- package/lib/components/features/documents/TMBatchUpdateForm.js +20 -6
- 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 +180 -53
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +11 -0
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +79 -9
- package/lib/components/features/documents/TMDcmtIcon.js +5 -3
- package/lib/components/features/documents/TMDcmtPreview.d.ts +3 -5
- package/lib/components/features/documents/TMDcmtPreview.js +12 -8
- package/lib/components/features/documents/TMDownloadRelationViewerSection.js +1 -1
- package/lib/components/features/documents/TMFileUploader.js +3 -3
- package/lib/components/features/documents/TMMasterDetailDcmts.js +96 -34
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +19 -0
- package/lib/components/features/documents/TMMasterInfoFields.js +184 -0
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +30 -5
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +45 -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 +71 -22
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +1 -1
- package/lib/components/features/search/TMMetadataOutputForm.js +1 -1
- package/lib/components/features/search/TMMetadataSorterForm.js +1 -1
- package/lib/components/features/search/TMSavedQuerySelector.js +2 -2
- package/lib/components/features/search/TMSearch.js +78 -12
- package/lib/components/features/search/TMSearchQueryEditor.js +7 -5
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +7 -3
- package/lib/components/features/search/TMSearchQueryPanel.js +142 -68
- package/lib/components/features/search/TMSearchResult.d.ts +16 -0
- package/lib/components/features/search/TMSearchResult.js +431 -110
- package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
- package/lib/components/features/search/TMTreeSelector.js +109 -64
- package/lib/components/features/tasks/TMTaskForm.js +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.js +3 -3
- package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.js +1 -1
- package/lib/components/features/tasks/TMTasksView.js +4 -4
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +1 -1
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +10 -0
- package/lib/components/features/workflow/TMWorkflowPopup.js +9 -5
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +4 -4
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -1
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -1
- package/lib/components/forms/Login/Menu.js +1 -1
- package/lib/components/forms/Login/OTPReader.js +1 -1
- package/lib/components/forms/Login/PasswordStrengthChecker.js +1 -1
- package/lib/components/forms/Login/RapidAccessLogin.js +2 -2
- package/lib/components/forms/Login/RecoverPasswordFlow.js +2 -2
- package/lib/components/forms/Login/SelectBox.js +1 -1
- package/lib/components/forms/Login/StepIndicator.js +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +7 -7
- package/lib/components/forms/Login/TextBox.js +1 -1
- package/lib/components/forms/TMApplyForm.js +3 -3
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/forms/TMSaveForm.js +3 -3
- package/lib/components/grids/TMBlogAttachments.js +14 -3
- package/lib/components/grids/TMBlogHeader.js +5 -1
- package/lib/components/grids/TMBlogsPost.d.ts +2 -0
- package/lib/components/grids/TMBlogsPost.js +31 -4
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +15 -4
- package/lib/components/grids/TMRecentsManager.js +4 -4
- package/lib/components/grids/TMValidationItemsList.js +1 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +25 -15
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +2 -5
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
- package/lib/components/layout/panelManager/TMPanelWrapper.js +3 -3
- package/lib/components/layout/panelManager/types.d.ts +3 -0
- package/lib/components/layout/panelManager/utils.js +13 -11
- package/lib/components/pages/TMPage.js +1 -1
- package/lib/components/query/TMQueryCountButton.js +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +6 -10
- package/lib/components/query/TMQueryEditor.js +7 -7
- package/lib/components/sidebar/TMCommandsPanel.d.ts +2 -4
- package/lib/components/sidebar/TMCommandsPanel.js +1 -1
- package/lib/components/sidebar/TMHeader.js +36 -26
- package/lib/components/sidebar/TMSidebar.js +1 -1
- package/lib/components/sidebar/TMSidebarItem.js +1 -1
- package/lib/components/viewers/TMMidViewer.js +6 -3
- package/lib/components/viewers/TMTidViewer.js +89 -28
- package/lib/components/wizard/TMStepIndicator.js +3 -3
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/devextreme-license.d.ts +1 -0
- package/lib/devextreme-license.js +3 -0
- package/lib/helper/Enum_Localizator.d.ts +4 -4
- package/lib/helper/Globalization.d.ts +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +110 -0
- package/lib/helper/SDKUI_Globals.js +151 -0
- package/lib/helper/SDKUI_Localizator.d.ts +731 -687
- package/lib/helper/SDKUI_Localizator.js +440 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +1 -0
- package/lib/helper/TMAppUpdatedModal.js +134 -0
- package/lib/helper/TMIcons.d.ts +1 -0
- package/lib/helper/TMIcons.js +4 -3
- package/lib/helper/TMPdfViewer.js +1 -1
- package/lib/helper/TMToppyMessage.js +1 -1
- package/lib/helper/TMUtils.d.ts +16 -3
- package/lib/helper/TMUtils.js +25 -3
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +1 -1
- package/lib/helper/dataGridSearchHelper.d.ts +28 -0
- package/lib/helper/dataGridSearchHelper.js +51 -0
- package/lib/helper/dcmtsHelper.d.ts +20 -0
- package/lib/helper/dcmtsHelper.js +58 -1
- package/lib/helper/helpers.d.ts +12 -1
- package/lib/helper/helpers.js +27 -3
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +6 -1
- package/lib/helper/queryHelper.js +8 -3
- package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
- package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
- package/lib/hooks/useArchiveListForm.d.ts +39 -0
- package/lib/hooks/useArchiveListForm.js +46 -0
- package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
- package/lib/hooks/useCaseFlowApprove.js +157 -0
- package/lib/hooks/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 +53 -11
- package/lib/hooks/useInputDialog.js +1 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +113 -0
- package/lib/hooks/useMultiMasterDetailDcmts.js +760 -0
- package/lib/hooks/useQueryParametersDialog.js +1 -1
- package/lib/hooks/useRelatedDocuments.d.ts +1 -0
- package/lib/hooks/useRelatedDocuments.js +22 -27
- package/lib/hooks/useShowDossiersV5.d.ts +12 -0
- package/lib/hooks/useShowDossiersV5.js +37 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
- package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
- package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
- package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
- package/lib/hooks/useTMDistinctValuesSource.js +105 -0
- package/lib/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 -4
- package/package.json +29 -26
|
@@ -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 => {
|
|
@@ -167,15 +292,15 @@ onActivate, onBack, onClose, onHeaderDoubleClick, onMaximize, onActiveChanged },
|
|
|
167
292
|
return newValue;
|
|
168
293
|
});
|
|
169
294
|
};
|
|
170
|
-
return (_jsxs(StyledPanelContainer, { ref: panelRef,
|
|
295
|
+
return (_jsxs(StyledPanelContainer, { ref: panelRef, $isMaximized: onMaximize ? false : isMaximized, style: {
|
|
171
296
|
visibility: isVisible ? 'visible' : 'hidden',
|
|
172
297
|
}, tabIndex: -1, onFocus: !isControlled ? handleFocusUncontrolled : undefined, onBlur: !isControlled ? handleBlurUncontrolled : undefined, onClick: handleActivation, onContextMenu: (e) => e.preventDefault(), children: [showHeader &&
|
|
173
|
-
_jsx(StyledPanelHeader, {
|
|
298
|
+
_jsx(StyledPanelHeader, { $backgroundColor: backgroundColor, $color: color, $isActive: currentIsActive, onDoubleClick: () => {
|
|
174
299
|
if (onHeaderDoubleClick)
|
|
175
300
|
onHeaderDoubleClick();
|
|
176
301
|
else
|
|
177
302
|
allowMaximize && handleMaximize();
|
|
178
|
-
},
|
|
303
|
+
}, $activeGradient: getAppModuleGradient(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER), children: _jsxs("div", { style: {
|
|
179
304
|
display: 'flex',
|
|
180
305
|
flexDirection: 'row',
|
|
181
306
|
alignItems: 'center',
|
|
@@ -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, {
|
|
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 `
|
|
@@ -209,7 +212,7 @@ const ResponsiveButton = (props) => {
|
|
|
209
212
|
return _jsx(TMButton, { fontSize: customFontSize || 'clamp(12px, 2vw, 1.1rem)', padding: "clamp(2px, 1vw, 8px) clamp(4px, 2vw, 12px)", width: "clamp(30px, 10vw, 60px)", ...otherProps });
|
|
210
213
|
};
|
|
211
214
|
const ResponsiveMessageBody = ({ message, isMobile, MessageToolbar, showToppy }) => {
|
|
212
|
-
return (_jsxs(ResponsiveMessageContainer, { children: [_jsxs(ResponsiveMessageContent, {
|
|
215
|
+
return (_jsxs(ResponsiveMessageContainer, { children: [_jsxs(ResponsiveMessageContent, { $isMobile: isMobile, children: [showToppy && _jsx(ResponsiveToppyImage, { $isMobile: isMobile, src: toppy, alt: "Toppy" }), _jsx(ResponsiveMessageText, { $isMobile: isMobile, children: typeof message === 'string' ? _jsx(Message, { msg: message }) : message })] }), _jsx(MessageToolbar, {})] }));
|
|
213
216
|
};
|
|
214
217
|
const TMMessageBox = ({ resizable = false, onButtonClick, title = 'TopMedia', message = '', buttons, onClose, confirmOnEnter = false, showToppy = true, initialWidth = 'clamp(100px, 90vw, 400px)', initialHeight = 'auto' }) => {
|
|
215
218
|
let deviceType = useDeviceType();
|
|
@@ -371,7 +374,7 @@ const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.a
|
|
|
371
374
|
const ExceptionToolbar = () => {
|
|
372
375
|
return (_jsxs(StyledExeptionToolbar, { children: [_jsx(TMButton, { color: 'primaryOutline', btnStyle: 'text', onClick: () => copyToClipBoard(getFullMessage()), caption: SDKUI_Localizator.CopyToClipboard, showTooltip: false }), _jsx(TMButton, { btnStyle: 'text', onClick: () => { onClose?.(); setIsVisible(false); }, caption: SDKUI_Localizator.Close, showTooltip: false, color: 'error' })] }));
|
|
373
376
|
};
|
|
374
|
-
return (_jsx(Popup, { ref: popupRef, resizeEnabled: resizable, visible: isVisible, onHidden: () => { onClose?.(); setIsVisible(false); }, onShown: handleShown, showCloseButton: true, width: calcResponsiveSizes(deviceType, '600px', '400px', '350px'), height: '350px', minWidth: minWidth, minHeight: minHeight, maxHeight: '95%', maxWidth: '95%', title: title, children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { height: 'calc(100% - 50px)', children: _jsxs(TMTabGroup, { validationItems: [], children: [_jsxs(TMTab, { label: SDKUI_Localizator.Error, children: [_jsxs(TabContextContainer, { style: { height: 'calc(100% - 68px )', paddingRight: '40px' }, children: [_jsxs("p", { children: [" ", _jsx("span", { style: { color: TMColors.primary }, children: "Messaggio: " }), " ", message] }), _jsx("div", { style: { display: 'flex', flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'flex-start', gap: '5px', marginTop: '5px' }, children: _jsxs("div", { children: [_jsxs("span", { style: { color: TMColors.primary }, children: [SDKUI_Localizator.Date, " ", SDKUI_Localizator.Time.toLowerCase(), ": "] }), d.toString()] }) })] }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(`Date: ${dateString}\nTime: ${timeString}\nMessage: ${message}`), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] }), _jsxs(TMTab, { label: SDKUI_Localizator.CompleteError, children: [_jsx(TabContextContainer, { style: { paddingRight: '40px' }, children: JSON.stringify(safeException).replaceAll('{', '').replaceAll('}', '').split(`,"`).map((t, index) => (_jsxs("div", { style: { padding: '5px', borderBottom: '1px solid rgb(180,180,180)' }, children: ["\u261B", ' ' + (t.toLowerCase().includes('detail') ? (t.replaceAll(`"`, '').replaceAll(`:`, ': ').replaceAll(String.fromCharCode(92), '')) : (t.replaceAll(`"`, '').replaceAll(`:`, ': ')))] }, index))) }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(JSON.stringify(safeException).replaceAll('{', '').replaceAll('}', '').replaceAll(',', '\n')), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] }), _jsxs(TMTab, { label: SDKUI_Localizator.Details, children: [_jsxs(TabContextContainer, { children: [_jsxs(StyledAppVersionText, {
|
|
377
|
+
return (_jsx(Popup, { ref: popupRef, resizeEnabled: resizable, visible: isVisible, onHidden: () => { onClose?.(); setIsVisible(false); }, onShown: handleShown, showCloseButton: true, width: calcResponsiveSizes(deviceType, '600px', '400px', '350px'), height: '350px', minWidth: minWidth, minHeight: minHeight, maxHeight: '95%', maxWidth: '95%', title: title, children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { height: 'calc(100% - 50px)', children: _jsxs(TMTabGroup, { validationItems: [], children: [_jsxs(TMTab, { label: SDKUI_Localizator.Error, children: [_jsxs(TabContextContainer, { style: { height: 'calc(100% - 68px )', paddingRight: '40px' }, children: [_jsxs("p", { children: [" ", _jsx("span", { style: { color: TMColors.primary }, children: "Messaggio: " }), " ", message] }), _jsx("div", { style: { display: 'flex', flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'flex-start', gap: '5px', marginTop: '5px' }, children: _jsxs("div", { children: [_jsxs("span", { style: { color: TMColors.primary }, children: [SDKUI_Localizator.Date, " ", SDKUI_Localizator.Time.toLowerCase(), ": "] }), d.toString()] }) })] }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(`Date: ${dateString}\nTime: ${timeString}\nMessage: ${message}`), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] }), _jsxs(TMTab, { label: SDKUI_Localizator.CompleteError, children: [_jsx(TabContextContainer, { style: { paddingRight: '40px' }, children: JSON.stringify(safeException).replaceAll('{', '').replaceAll('}', '').split(`,"`).map((t, index) => (_jsxs("div", { style: { padding: '5px', borderBottom: '1px solid rgb(180,180,180)' }, children: ["\u261B", ' ' + (t.toLowerCase().includes('detail') ? (t.replaceAll(`"`, '').replaceAll(`:`, ': ').replaceAll(String.fromCharCode(92), '')) : (t.replaceAll(`"`, '').replaceAll(`:`, ': ')))] }, index))) }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(JSON.stringify(safeException).replaceAll('{', '').replaceAll('}', '').replaceAll(',', '\n')), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] }), _jsxs(TMTab, { label: SDKUI_Localizator.Details, children: [_jsxs(TabContextContainer, { children: [_jsxs(StyledAppVersionText, { $color: TMColors.primary, children: [SDK_Globals.appModule, " ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.appVersion })] }), _jsxs(StyledAppVersionText, { $color: TMColors.tertiary, children: ["SDKUI: ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.sdkuiVersion })] }), _jsxs(StyledAppVersionText, { $color: TMColors.success, children: ["SDK : ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.sdkVersion })] })] }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(`-${SDK_Globals.appModule}: ${SDK_Globals.appVersion}\n` + `-SDKUI: ${SDK_Globals.sdkuiVersion}\n` + `-SDK: ${SDK_Globals.sdkVersion}\n`), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] })] }) }), _jsx(TMLayoutItem, { height: '40px', children: _jsx(ExceptionToolbar, {}) })] }) }));
|
|
375
378
|
};
|
|
376
379
|
class TMExceptionBoxManager {
|
|
377
380
|
static show({ title, exception, onClose }) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useRef, useEffect, useImperativeHandle, forwardRef } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
@@ -55,7 +55,7 @@ export const TMResizableMenu = forwardRef(({ isVisible, onClose, top, left, bott
|
|
|
55
55
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
56
56
|
};
|
|
57
57
|
}, [onClose]);
|
|
58
|
-
const menuContent = (_jsxs(_Fragment, { children: [_jsxs(MenuContainer, { ref: menuRef,
|
|
58
|
+
const menuContent = (_jsxs(_Fragment, { children: [_jsxs(MenuContainer, { ref: menuRef, $display: isVisible ? 'block' : 'none', style: { top, left, bottom, right, width, height, position: 'fixed' }, $maxWidth: maxWidth, $maxHeight: maxHeight, $minHeight: minHeight, $minWidth: minWidth, $padding: padding, children: [children, resizable && _jsx(ResizeHandle, { onMouseDown: (e) => {
|
|
59
59
|
e.preventDefault();
|
|
60
60
|
document.body.style.pointerEvents = 'none';
|
|
61
61
|
isResizingRef.current = true;
|
|
@@ -32,7 +32,7 @@ const TMRightSidebar = ({ items = [], onItemClick, selectedItem, showPanel = fal
|
|
|
32
32
|
onItemClick && onItemClick(item.id, activeItems.has(item.id));
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
return (_jsx(SidebarContainer, { children: items.map((item, index) => (item.visible !== false && (_jsxs(StyledMenuItem, {
|
|
35
|
+
return (_jsx(SidebarContainer, { children: items.map((item, index) => (item.visible !== false && (_jsxs(StyledMenuItem, { $disabled: item.disabled, style: { paddingTop: '10px', borderTop: item.beginGroup ? '2px solid #9c9c9c' : 'none' }, $isHovered: hoveredItem === item.id, $isSelected: item.isActive, onMouseEnter: () => setHoveredItem(item.id), onMouseLeave: () => setHoveredItem(null), onClick: () => !item.disabled && (item.onClick?.() ?? onClickHandler(item)), children: [_jsx(StyledAnimatedComponentScaleColor, { $delay: `${(index * 150) + 650}ms`, children: item.icon }), _jsx("span", { children: item.visibleName })] }, item.id)))) }));
|
|
36
36
|
};
|
|
37
37
|
export default TMRightSidebar;
|
|
38
38
|
// Styled Components
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getListMaxItems, SDKUI_Localizator } from '../../helper';
|
|
3
3
|
import { TMColors } from '../../utils/theme';
|
|
4
4
|
import TMButton from './TMButton';
|
|
@@ -158,12 +158,12 @@ const StyledCancelButton = styled.button `
|
|
|
158
158
|
}
|
|
159
159
|
`;
|
|
160
160
|
const Spinner = ({ backgroundColor = 'transparent', description = '', fontSize = FontSize.defaultFontSize, width = 'fit-content', flat = false, onCancel, cancelText = 'Annulla' }) => {
|
|
161
|
-
return (_jsx(StyledSpinnerContainer, {
|
|
161
|
+
return (_jsx(StyledSpinnerContainer, { $backgroundColor: backgroundColor, children: _jsxs(StyledSpinnerWrapper, { $width: width, $flat: flat, $hasCancel: !!onCancel, children: [_jsxs("div", { style: { position: 'relative', width: '80px', height: '80px' }, children: [_jsx("img", { style: {
|
|
162
162
|
position: 'absolute',
|
|
163
163
|
top: '50%',
|
|
164
164
|
left: '50%',
|
|
165
165
|
transform: 'translate(-54%, -54%)'
|
|
166
|
-
}, src: six, width: 35, alt: "" }), _jsxs(StyledSpinnerAnimation, { children: [_jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {})] })] }), _jsx(StyledSpinnerDescription, {
|
|
166
|
+
}, src: six, width: 35, alt: "" }), _jsxs(StyledSpinnerAnimation, { children: [_jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {})] })] }), _jsx(StyledSpinnerDescription, { $fontSize: fontSize, children: description }), onCancel && (_jsx(StyledCancelButton, { onClick: onCancel, children: cancelText }))] }) }));
|
|
167
167
|
};
|
|
168
168
|
class TMSpinner {
|
|
169
169
|
static show({ description, backgroundColor, fontSize, flat, onCancel, cancelText } = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import TabPanel, { Item } from "devextreme-react/tab-panel";
|
|
@@ -22,7 +22,7 @@ const renderTabItems = (tabItemProps, tabs, vil) => {
|
|
|
22
22
|
return (_jsxs(StyledDivHorizontal, { style: { fontSize: '1rem', fontWeight: '600' }, children: [_jsx("span", { children: tabItemProps.title }), tabs.map((tab, index) => { return (_jsx("div", { style: { display: 'flex' }, children: tabItemProps.title == tab.title && _jsx(TMTabItemBadge, { vil: vil?.filter(o => tab.propsToBeValidated?.some((s) => o.PropertyName == s || o.PropertyScopes.includes(s))) ?? [] }) }, index)); })] }));
|
|
23
23
|
};
|
|
24
24
|
export const TMTabItemBadge = ({ vil }) => {
|
|
25
|
-
return (_jsxs(_Fragment, { children: [" ", vil.length > 0 && _jsx(StyledTabItemResultType, {
|
|
25
|
+
return (_jsxs(_Fragment, { children: [" ", vil.length > 0 && _jsx(StyledTabItemResultType, { $backgroundColor: editorColorManager(vil), children: vil.length }), " "] }));
|
|
26
26
|
};
|
|
27
27
|
const TMTabGroup = ({ children, fontSize, validationItems = [], onTabIndexChanged }) => {
|
|
28
28
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
@@ -52,7 +52,7 @@ const TMToggleButton = ({ color = 'primary', value, label, elementStyle, fontSiz
|
|
|
52
52
|
setCurrentColor(isModifiedWhen ? 'tertiary' : color);
|
|
53
53
|
}, [isModifiedWhen, color]);
|
|
54
54
|
const renderTooltip = () => { return (showTooltip && _jsx("div", { children: label })); };
|
|
55
|
-
return (_jsx(TMTooltip, { hideAfterDelay: true, content: renderTooltip(), children: _jsxs(StyledToggleButtonWrapper, { children: [_jsx(StyledToggleButtonContainer, {
|
|
56
|
-
_jsx(StyledToggleButtonLabel, {
|
|
55
|
+
return (_jsx(TMTooltip, { hideAfterDelay: true, content: renderTooltip(), children: _jsxs(StyledToggleButtonWrapper, { children: [_jsx(StyledToggleButtonContainer, { $value: value, $color: currentColor, style: elementStyle, onClick: onValueChanged, children: _jsx(StyledToggleButtonSwitch, { $value: value, children: _jsx(StyledToggleValue, { children: value ? 'ON' : 'OFF' }) }) }), !showTooltip && label &&
|
|
56
|
+
_jsx(StyledToggleButtonLabel, { $color: isModifiedWhen ? Colors.tertiary : Colors.primary, children: label })] }) }));
|
|
57
57
|
};
|
|
58
58
|
export default TMToggleButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import TMRightSidebar from './TMRightSidebar';
|
|
4
4
|
import { IconArrowLeft, SDKUI_Localizator } from '../../helper';
|
|
@@ -46,8 +46,8 @@ const StyledSearchCardContent = styled.div `
|
|
|
46
46
|
-webkit-user-select: none;
|
|
47
47
|
`;
|
|
48
48
|
const TMToolbarCard = ({ items = [], onItemClick, selectedItem, showPanel, color = TMColors.colorHeader, backgroundColor = TMColors.backgroundColorHeader, backgroundColorContainer, children, showHeader = true, title, totalItems, displayedItemsCount, toolbar, padding = '3px', onBack, onClose, onHeaderDoubleClick }) => {
|
|
49
|
-
return (_jsxs(StyledSearchCard, { children: [showHeader && _jsx(StyledSearchCardHeader, {
|
|
50
|
-
onHeaderDoubleClick(); }, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', width: '100%' }, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '8px' }, children: [onBack && _jsx(TMButton, { btnStyle: 'icon', icon: _jsx("div", { style: { backgroundColor: 'white', minWidth: '24px', minHeight: '24px', borderRadius: '24px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx(IconArrowLeft, { color: TMColors.primaryColor }) }), caption: SDKUI_Localizator.Back, onClick: onBack }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center' }, children: [_jsx("p", { children: title }), Boolean(displayedItemsCount && displayedItemsCount > 0) && (_jsxs(_Fragment, { children: [_jsx(StyledBadge, {
|
|
49
|
+
return (_jsxs(StyledSearchCard, { children: [showHeader && _jsx(StyledSearchCardHeader, { $backgroundColor: backgroundColor, $color: color, onDoubleClick: () => { if (onHeaderDoubleClick)
|
|
50
|
+
onHeaderDoubleClick(); }, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', width: '100%' }, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '8px' }, children: [onBack && _jsx(TMButton, { btnStyle: 'icon', icon: _jsx("div", { style: { backgroundColor: 'white', minWidth: '24px', minHeight: '24px', borderRadius: '24px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx(IconArrowLeft, { color: TMColors.primaryColor }) }), caption: SDKUI_Localizator.Back, onClick: onBack }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center' }, children: [_jsx("p", { children: title }), Boolean(displayedItemsCount && displayedItemsCount > 0) && (_jsxs(_Fragment, { children: [_jsx(StyledBadge, { $backgroundColor: '#679CE8', children: displayedItemsCount }), Boolean(totalItems && totalItems > 0) && _jsx("span", { children: "\u00A0\u00A0/\u00A0" })] })), Boolean(totalItems && totalItems > 0) && _jsx(StyledBadge, { $backgroundColor: '#679CE8', children: totalItems })] })] }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '5px' }, children: [toolbar, onClose && _jsx(TMButton, { color: 'primaryOutline', caption: SDKUI_Localizator.Close, icon: _jsx("i", { className: 'dx-icon-remove', style: { color: "white" } }), btnStyle: 'icon', onClick: () => onClose?.() })] })] }) }), _jsxs(StyledSearchCardContent, { $height: showHeader ? "calc(100% - 35px)" : "100%", $padding: padding, $backgroundColor: backgroundColorContainer ?? `${TMColors.backgroundColorHeader}12`, children: [_jsx("div", { style: { width: items.length > 0 ? 'calc(100% - 30px)' : '100%' }, children: children }), items.length > 0 &&
|
|
51
51
|
_jsx(TMRightSidebar, { items: items, onItemClick: onItemClick, selectedItem: selectedItem, showPanel: showPanel })] })] }));
|
|
52
52
|
};
|
|
53
53
|
export default TMToolbarCard;
|
|
@@ -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) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const TMTooltip: ({ children, position, content, hideAfterDelay, parentStyle, childStyle, allowContentInteraction }: ITMTooltipProps) => import("react/jsx-runtime").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;
|
|
@@ -31,11 +31,9 @@ interface ITMTreeViewProps {
|
|
|
31
31
|
}
|
|
32
32
|
declare const TMTreeView: ({ dataSource, focusedItem, selectedItems, allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, onItemContextMenu, autoSelectChildren, itemsPerPage, showLoadMoreButton, enableVirtualization }: ITMTreeViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
33
|
export default TMTreeView;
|
|
34
|
-
export declare const StyledTreeContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never
|
|
35
|
-
export declare const StyledItemContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never
|
|
36
|
-
export declare const StyledTreeNode: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
34
|
+
export declare const StyledTreeContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
35
|
+
export declare const StyledItemContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
36
|
+
export declare const StyledTreeNode: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
37
37
|
$isSelected?: boolean;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
}, never>>> & string;
|
|
41
|
-
export declare const StyledStickyPaginator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
38
|
+
}>> & string;
|
|
39
|
+
export declare const StyledStickyPaginator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|