@topconsultnpm/sdkui-react 6.22.0-dev3.9 → 6.22.0-dev4.10
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/styles.d.ts +43 -45
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +60 -67
- package/lib/components/base/Styled.d.ts +77 -93
- package/lib/components/base/TMAlert.js +6 -8
- package/lib/components/base/TMAreaManager.js +53 -55
- package/lib/components/base/TMButton.js +4 -2
- package/lib/components/base/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +4 -3
- package/lib/components/base/TMCounterContainer.js +16 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.js +243 -223
- package/lib/components/base/TMDataGridExportForm.d.ts +1 -2
- package/lib/components/base/TMFileManager.d.ts +1 -2
- package/lib/components/base/TMFileManagerDataGridView.d.ts +1 -2
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -4
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +1 -2
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMPanel.js +173 -170
- package/lib/components/base/TMSpinner.d.ts +3 -3
- package/lib/components/base/TMSpinner.js +9 -7
- package/lib/components/base/TMTab.d.ts +3 -4
- package/lib/components/base/TMTabControl.d.ts +5 -0
- package/lib/components/base/TMTabControl.js +219 -208
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +8 -14
- package/lib/components/base/TMTreeView.js +20 -0
- package/lib/components/base/TMUserAvatar.d.ts +1 -2
- package/lib/components/base/TMVilViewer.d.ts +1 -2
- package/lib/components/base/TMWaitPanel.d.ts +2 -3
- package/lib/components/base/TMWaitPanel.js +1 -1
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +179 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +373 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +57 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +346 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- package/lib/components/choosers/TMDistinctValues.js +3 -3
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +1 -2
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +1 -2
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +1 -2
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +42 -20
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +1 -2
- package/lib/components/editors/TMHtmlEditor.d.ts +1 -2
- package/lib/components/editors/TMTextBox.d.ts +4 -0
- package/lib/components/editors/TMTextBox.js +99 -11
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/archive/TMArchive.js +7 -2
- package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +28 -0
- package/lib/components/features/assistant/TMHelpOnLineChat.js +1231 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +1 -2
- package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
- package/lib/components/features/documents/TMCopyToFolderForm.js +53 -84
- package/lib/components/features/documents/TMDcmtForm.js +50 -61
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -4
- package/lib/components/features/documents/TMDcmtIcon.js +3 -5
- package/lib/components/features/documents/TMDcmtPreview.d.ts +6 -8
- package/lib/components/features/documents/TMDcmtPreview.js +5 -3
- package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -2
- package/lib/components/features/documents/TMDcmtTasks.js +2 -9
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +5 -5
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +53 -148
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +1 -2
- package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +52 -56
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +1 -2
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +5 -5
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +3 -3
- package/lib/components/features/documents/TMRelationViewer.d.ts +13 -14
- package/lib/components/features/documents/TMRelationViewer.js +206 -143
- package/lib/components/features/documents/relationTreeState.d.ts +32 -0
- package/lib/components/features/documents/relationTreeState.js +89 -0
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +1 -2
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +1 -2
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +1 -2
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.d.ts +1 -2
- package/lib/components/features/search/TMSearch.js +3 -4
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -9
- package/lib/components/features/search/TMSearchQueryPanel.js +0 -4
- package/lib/components/features/search/TMSearchResult.d.ts +5 -0
- package/lib/components/features/search/TMSearchResult.js +129 -102
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +1 -2
- package/lib/components/features/search/TMTreeSelector.js +23 -27
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +1 -2
- package/lib/components/features/search/TMViewHistoryDcmt.js +15 -26
- 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/tasks/TMTasksView.js +97 -90
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +2 -3
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +95 -91
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +7 -8
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -3
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -3
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/TMChooserForm.d.ts +1 -2
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +1 -2
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.js +93 -97
- package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
- package/lib/components/grids/TMValidationItemsList.d.ts +1 -2
- package/lib/components/index.d.ts +5 -1
- package/lib/components/index.js +4 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -2
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +4 -3
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +3 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +5 -1
- package/lib/components/layout/panelManager/TMPanelManagerLoader.d.ts +5 -0
- package/lib/components/layout/panelManager/TMPanelManagerLoader.js +18 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +6 -5
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +4 -8
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +2 -1
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/pages/TMPage.js +32 -31
- package/lib/components/query/TMQueryEditor.d.ts +13 -14
- package/lib/components/query/TMQueryEditor.js +2 -1
- package/lib/components/settings/SettingsAppearance.d.ts +1 -2
- package/lib/components/sidebar/TMAboutApp.d.ts +1 -2
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMHeader.d.ts +4 -3
- package/lib/components/sidebar/TMHeader.js +2 -2
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -3
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +2 -3
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/SDKUI_Globals.d.ts +7 -2
- package/lib/helper/SDKUI_Globals.js +7 -2
- package/lib/helper/SDKUI_Localizator.d.ts +31 -6
- package/lib/helper/SDKUI_Localizator.js +301 -51
- package/lib/helper/TMAppUpdatedModal.d.ts +1 -2
- package/lib/helper/TMAppUpdatedModal.js +93 -93
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +280 -280
- package/lib/helper/TMPdfViewer.d.ts +1 -2
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +4 -10
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/dcmtsHelper.d.ts +2 -0
- package/lib/helper/dcmtsHelper.js +3 -1
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +14 -34
- package/lib/hooks/useDcmtOperations.d.ts +3 -19
- package/lib/hooks/useDcmtOperations.js +174 -227
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +14 -25
- package/lib/hooks/useInputDialog.d.ts +1 -2
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
- package/lib/hooks/useMultiMasterDetailDcmts.js +70 -68
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/caseflow/CaseFlowService.d.ts +69 -9
- package/lib/services/caseflow/CaseFlowService.js +126 -58
- package/lib/services/platform_services.d.ts +2 -3
- package/package.json +2 -2
|
@@ -18,10 +18,11 @@ import { getAppModuleButtonColors, getAppModuleGradient, IconAdd, IconCloseOutli
|
|
|
18
18
|
// I tab non attivi restano sempre montati e solo spostati fuori schermo: nulla si ricarica ne perde stato.
|
|
19
19
|
// onTabClose -> mostra la 'x' sui tab e la voce Chiudi nel menu contestuale.
|
|
20
20
|
// onTabRename -> doppio clic (o voce Rinomina) per modificare il titolo in linea.
|
|
21
|
-
// onTabReorder -> tab spostabili con il trascinamento.
|
|
21
|
+
// onTabReorder -> tab spostabili con il trascinamento; il singolo tab si blocca con movable={false}.
|
|
22
22
|
// tabMenuItems -> voci del chiamante nel menu del tasto destro sul tab, prima di Rinomina e Chiudi.
|
|
23
23
|
// contentAnimation -> effetto del contenuto al cambio tab: 'fade' (default), 'slide', 'zoom' o 'none'.
|
|
24
24
|
// swipeEnabled -> su touch si cambia tab trascinando il contenuto di lato.
|
|
25
|
+
// toolbar -> contenuto del chiamante in coda alla barra, a destra dei tab (azioni di pagina).
|
|
25
26
|
//
|
|
26
27
|
// Da tastiera, con il focus sulla barra: frecce destra/giu al tab successivo, sinistra/su al precedente,
|
|
27
28
|
// Home ed End al primo e all'ultimo. I tab disabilitati vengono saltati.
|
|
@@ -90,97 +91,107 @@ const VARIANTS = {
|
|
|
90
91
|
joins: false
|
|
91
92
|
})
|
|
92
93
|
};
|
|
93
|
-
/** Contenitore della barra: frecce ai lati
|
|
94
|
-
const TabsHeader = styled.div `
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: flex-end;
|
|
97
|
-
width: 100%;
|
|
98
|
-
flex-shrink: 0;
|
|
99
|
-
padding: 4px 4px 0 4px;
|
|
100
|
-
background: ${({ $v }) => $v.stripBg};
|
|
94
|
+
/** Contenitore della barra: frecce ai lati, striscia dei tab in mezzo ed eventuale toolbar in coda. */
|
|
95
|
+
const TabsHeader = styled.div `
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: flex-end;
|
|
98
|
+
width: 100%;
|
|
99
|
+
flex-shrink: 0;
|
|
100
|
+
padding: 4px 4px 0 4px;
|
|
101
|
+
background: ${({ $v }) => $v.stripBg};
|
|
101
102
|
`;
|
|
102
103
|
/** Striscia scorrevole dei tab: la scrollbar resta nascosta, si scorre con le frecce. */
|
|
103
|
-
const TabsStrip = styled.div `
|
|
104
|
-
display: flex;
|
|
105
|
-
align-items: flex-end;
|
|
106
|
-
flex: 1;
|
|
107
|
-
min-width: 0;
|
|
108
|
-
gap: ${({ $v }) => $v.tabGap};
|
|
109
|
-
padding: ${({ $v }) => $v.stripPadding};
|
|
110
|
-
overflow-x: auto;
|
|
111
|
-
scroll-behavior: smooth;
|
|
112
|
-
scrollbar-width: none;
|
|
113
|
-
-ms-overflow-style: none;
|
|
114
|
-
&::-webkit-scrollbar { display: none; }
|
|
104
|
+
const TabsStrip = styled.div `
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: flex-end;
|
|
107
|
+
flex: 1;
|
|
108
|
+
min-width: 0;
|
|
109
|
+
gap: ${({ $v }) => $v.tabGap};
|
|
110
|
+
padding: ${({ $v }) => $v.stripPadding};
|
|
111
|
+
overflow-x: auto;
|
|
112
|
+
scroll-behavior: smooth;
|
|
113
|
+
scrollbar-width: none;
|
|
114
|
+
-ms-overflow-style: none;
|
|
115
|
+
&::-webkit-scrollbar { display: none; }
|
|
115
116
|
`;
|
|
116
117
|
/** Freccia di scorrimento: compare solo se i tab non entrano nella barra. */
|
|
117
|
-
const NavButton = styled.button `
|
|
118
|
-
display: flex;
|
|
119
|
-
align-items: center;
|
|
120
|
-
justify-content: center;
|
|
121
|
-
width: 26px;
|
|
122
|
-
height: 28px;
|
|
123
|
-
margin-bottom: 3px;
|
|
124
|
-
flex-shrink: 0;
|
|
125
|
-
padding: 0;
|
|
126
|
-
border: none;
|
|
127
|
-
border-radius: 50%;
|
|
128
|
-
background: transparent;
|
|
129
|
-
color: ${({ $v }) => $v.idleTextColor};
|
|
130
|
-
cursor: pointer;
|
|
131
|
-
transition: background 0.18s ease-out, color 0.18s ease-out;
|
|
132
|
-
&:hover { background: ${({ $v }) => $v.buttonHover}; color: ${TEXT_ACTIVE}; }
|
|
133
|
-
&:focus, &:focus-visible { outline: none; }
|
|
118
|
+
const NavButton = styled.button `
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: center;
|
|
122
|
+
width: 26px;
|
|
123
|
+
height: 28px;
|
|
124
|
+
margin-bottom: 3px;
|
|
125
|
+
flex-shrink: 0;
|
|
126
|
+
padding: 0;
|
|
127
|
+
border: none;
|
|
128
|
+
border-radius: 50%;
|
|
129
|
+
background: transparent;
|
|
130
|
+
color: ${({ $v }) => $v.idleTextColor};
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
transition: background 0.18s ease-out, color 0.18s ease-out;
|
|
133
|
+
&:hover { background: ${({ $v }) => $v.buttonHover}; color: ${TEXT_ACTIVE}; }
|
|
134
|
+
&:focus, &:focus-visible { outline: none; }
|
|
134
135
|
`;
|
|
135
136
|
/** Pulsante '+' subito dopo l'ultimo tab, come il nuovo tab del browser. */
|
|
136
|
-
const AddButton = styled.button `
|
|
137
|
-
display: flex;
|
|
138
|
-
align-items: center;
|
|
139
|
-
justify-content: center;
|
|
140
|
-
width: 28px;
|
|
141
|
-
height: 28px;
|
|
142
|
-
margin: 0 0 3px 4px;
|
|
143
|
-
flex-shrink: 0;
|
|
144
|
-
padding: 0;
|
|
145
|
-
border: none;
|
|
146
|
-
border-radius: 50%;
|
|
147
|
-
background: transparent;
|
|
148
|
-
color: ${({ $v }) => $v.idleTextColor};
|
|
149
|
-
cursor: pointer;
|
|
150
|
-
transition: background 0.18s ease-out, color 0.18s ease-out;
|
|
151
|
-
&:hover { background: ${({ $v }) => $v.buttonHover}; color: ${TEXT_ACTIVE}; }
|
|
152
|
-
&:active { background: ${({ $v }) => $v.buttonActive}; }
|
|
153
|
-
&:focus, &:focus-visible { outline: none; }
|
|
137
|
+
const AddButton = styled.button `
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
justify-content: center;
|
|
141
|
+
width: 28px;
|
|
142
|
+
height: 28px;
|
|
143
|
+
margin: 0 0 3px 4px;
|
|
144
|
+
flex-shrink: 0;
|
|
145
|
+
padding: 0;
|
|
146
|
+
border: none;
|
|
147
|
+
border-radius: 50%;
|
|
148
|
+
background: transparent;
|
|
149
|
+
color: ${({ $v }) => $v.idleTextColor};
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
transition: background 0.18s ease-out, color 0.18s ease-out;
|
|
152
|
+
&:hover { background: ${({ $v }) => $v.buttonHover}; color: ${TEXT_ACTIVE}; }
|
|
153
|
+
&:active { background: ${({ $v }) => $v.buttonActive}; }
|
|
154
|
+
&:focus, &:focus-visible { outline: none; }
|
|
155
|
+
`;
|
|
156
|
+
/** Contenuto libero del chiamante in coda alla barra: azioni di pagina allineate a destra dei tab.
|
|
157
|
+
E' position: relative cosi un menu a tendina del chiamante puo posizionarsi rispetto a quest'area. */
|
|
158
|
+
const TabsToolbar = styled.div `
|
|
159
|
+
display: flex;
|
|
160
|
+
align-items: center;
|
|
161
|
+
flex-shrink: 0;
|
|
162
|
+
margin-bottom: 3px;
|
|
163
|
+
padding-left: 8px;
|
|
164
|
+
position: relative;
|
|
154
165
|
`;
|
|
155
166
|
/** Area del contenuto: fa da riferimento ai pannelli nascosti, che restano montati ma non impaginati. */
|
|
156
|
-
const ContentArea = styled.div `
|
|
157
|
-
position: relative;
|
|
158
|
-
display: flex;
|
|
159
|
-
flex-direction: column;
|
|
160
|
-
flex: 1;
|
|
161
|
-
min-height: 0;
|
|
167
|
+
const ContentArea = styled.div `
|
|
168
|
+
position: relative;
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
flex: 1;
|
|
172
|
+
min-height: 0;
|
|
162
173
|
`;
|
|
163
|
-
const ANIM_FADE = keyframes `
|
|
164
|
-
from { opacity: 0; transform: translate3d(0, 10px, 0); }
|
|
165
|
-
50% { opacity: 1; }
|
|
166
|
-
to { opacity: 1; transform: translate3d(0, 0, 0); }
|
|
174
|
+
const ANIM_FADE = keyframes `
|
|
175
|
+
from { opacity: 0; transform: translate3d(0, 10px, 0); }
|
|
176
|
+
50% { opacity: 1; }
|
|
177
|
+
to { opacity: 1; transform: translate3d(0, 0, 0); }
|
|
167
178
|
`;
|
|
168
179
|
// Entra appena piu piccolo e leggermente piu in basso: sembra posarsi al suo posto invece di comparire
|
|
169
|
-
const ANIM_ZOOM = keyframes `
|
|
170
|
-
from { opacity: 0; transform: translate3d(0, 6px, 0) scale3d(0.985, 0.985, 1); }
|
|
171
|
-
50% { opacity: 1; }
|
|
172
|
-
to { opacity: 1; transform: translate3d(0, 0, 0) scale3d(1, 1, 1); }
|
|
180
|
+
const ANIM_ZOOM = keyframes `
|
|
181
|
+
from { opacity: 0; transform: translate3d(0, 6px, 0) scale3d(0.985, 0.985, 1); }
|
|
182
|
+
50% { opacity: 1; }
|
|
183
|
+
to { opacity: 1; transform: translate3d(0, 0, 0) scale3d(1, 1, 1); }
|
|
173
184
|
`;
|
|
174
185
|
// Lo scorrimento segue il verso dello spostamento: da destra andando avanti, da sinistra tornando indietro
|
|
175
|
-
const ANIM_SLIDE_FORWARD = keyframes `
|
|
176
|
-
from { opacity: 0; transform: translate3d(24px, 0, 0); }
|
|
177
|
-
50% { opacity: 1; }
|
|
178
|
-
to { opacity: 1; transform: translate3d(0, 0, 0); }
|
|
186
|
+
const ANIM_SLIDE_FORWARD = keyframes `
|
|
187
|
+
from { opacity: 0; transform: translate3d(24px, 0, 0); }
|
|
188
|
+
50% { opacity: 1; }
|
|
189
|
+
to { opacity: 1; transform: translate3d(0, 0, 0); }
|
|
179
190
|
`;
|
|
180
|
-
const ANIM_SLIDE_BACK = keyframes `
|
|
181
|
-
from { opacity: 0; transform: translate3d(-24px, 0, 0); }
|
|
182
|
-
50% { opacity: 1; }
|
|
183
|
-
to { opacity: 1; transform: translate3d(0, 0, 0); }
|
|
191
|
+
const ANIM_SLIDE_BACK = keyframes `
|
|
192
|
+
from { opacity: 0; transform: translate3d(-24px, 0, 0); }
|
|
193
|
+
50% { opacity: 1; }
|
|
194
|
+
to { opacity: 1; transform: translate3d(0, 0, 0); }
|
|
184
195
|
`;
|
|
185
196
|
const pickAnimation = (animation, forward) => {
|
|
186
197
|
switch (animation) {
|
|
@@ -191,141 +202,141 @@ const pickAnimation = (animation, forward) => {
|
|
|
191
202
|
}
|
|
192
203
|
};
|
|
193
204
|
/** Contenitore di un singolo tab: l'animazione parte da sola perche il pannello inattivo non ne ha nessuna. */
|
|
194
|
-
const ContentPane = styled.div `
|
|
195
|
-
${({ $active, $anim, $duration, $phase }) => $active && $anim && $phase !== 'done' && css `
|
|
196
|
-
/* Livello grafico dedicato creato subito, mentre il pannello e ancora trasparente: quando il
|
|
197
|
-
movimento parte non resta nulla da ridisegnare e l'effetto scorre senza perdere fotogrammi */
|
|
198
|
-
will-change: opacity, transform;
|
|
199
|
-
backface-visibility: hidden;
|
|
200
|
-
transform: translateZ(0);
|
|
201
|
-
opacity: 0;
|
|
202
|
-
|
|
203
|
-
/* Decelerazione lunga e continua: parte deciso e si posa, senza strappi ne rimbalzi */
|
|
204
|
-
${$phase === 'run' && css `animation: ${$anim} ${$duration}ms cubic-bezier(0.32, 0.72, 0, 1) both;`}
|
|
205
|
-
|
|
206
|
-
/* Chi ha chiesto meno animazioni nel sistema vede il cambio tab immediato */
|
|
207
|
-
@media (prefers-reduced-motion: reduce) { animation: none; opacity: 1; transform: none; }
|
|
208
|
-
`}
|
|
205
|
+
const ContentPane = styled.div `
|
|
206
|
+
${({ $active, $anim, $duration, $phase }) => $active && $anim && $phase !== 'done' && css `
|
|
207
|
+
/* Livello grafico dedicato creato subito, mentre il pannello e ancora trasparente: quando il
|
|
208
|
+
movimento parte non resta nulla da ridisegnare e l'effetto scorre senza perdere fotogrammi */
|
|
209
|
+
will-change: opacity, transform;
|
|
210
|
+
backface-visibility: hidden;
|
|
211
|
+
transform: translateZ(0);
|
|
212
|
+
opacity: 0;
|
|
213
|
+
|
|
214
|
+
/* Decelerazione lunga e continua: parte deciso e si posa, senza strappi ne rimbalzi */
|
|
215
|
+
${$phase === 'run' && css `animation: ${$anim} ${$duration}ms cubic-bezier(0.32, 0.72, 0, 1) both;`}
|
|
216
|
+
|
|
217
|
+
/* Chi ha chiesto meno animazioni nel sistema vede il cambio tab immediato */
|
|
218
|
+
@media (prefers-reduced-motion: reduce) { animation: none; opacity: 1; transform: none; }
|
|
219
|
+
`}
|
|
209
220
|
`;
|
|
210
|
-
const TabSeparator = styled.div `
|
|
211
|
-
width: 1px;
|
|
212
|
-
height: 18px;
|
|
213
|
-
margin-bottom: 8px;
|
|
214
|
-
flex-shrink: 0;
|
|
215
|
-
background: ${({ $v }) => $v.divider};
|
|
221
|
+
const TabSeparator = styled.div `
|
|
222
|
+
width: 1px;
|
|
223
|
+
height: 18px;
|
|
224
|
+
margin-bottom: 8px;
|
|
225
|
+
flex-shrink: 0;
|
|
226
|
+
background: ${({ $v }) => $v.divider};
|
|
216
227
|
`;
|
|
217
|
-
const DropMark = styled.div `
|
|
218
|
-
position: absolute;
|
|
219
|
-
top: 2px;
|
|
220
|
-
bottom: 0;
|
|
221
|
-
width: 3px;
|
|
222
|
-
border-radius: 2px;
|
|
223
|
-
background: ${ACCENT};
|
|
224
|
-
left: ${({ $side }) => ($side === 'left' ? '-2px' : 'auto')};
|
|
225
|
-
right: ${({ $side }) => ($side === 'right' ? '-2px' : 'auto')};
|
|
228
|
+
const DropMark = styled.div `
|
|
229
|
+
position: absolute;
|
|
230
|
+
top: 2px;
|
|
231
|
+
bottom: 0;
|
|
232
|
+
width: 3px;
|
|
233
|
+
border-radius: 2px;
|
|
234
|
+
background: ${ACCENT};
|
|
235
|
+
left: ${({ $side }) => ($side === 'left' ? '-2px' : 'auto')};
|
|
236
|
+
right: ${({ $side }) => ($side === 'right' ? '-2px' : 'auto')};
|
|
226
237
|
`;
|
|
227
|
-
const TabItem = styled.div `
|
|
228
|
-
position: relative;
|
|
229
|
-
display: inline-flex;
|
|
230
|
-
align-items: center;
|
|
231
|
-
gap: 2px;
|
|
232
|
-
height: 32px;
|
|
233
|
-
padding: 0 6px 0 12px;
|
|
234
|
-
max-width: 330px;
|
|
235
|
-
user-select: none;
|
|
236
|
-
border-radius: ${({ $v }) => $v.tabRadius};
|
|
237
|
-
background: ${({ $active, $v }) => ($active ? $v.tabBg : $v.idleTabBg)};
|
|
238
|
-
/* Stile card: ombra verso l'alto, sotto il tab poggia sul contenuto */
|
|
239
|
-
box-shadow: ${({ $active, $v }) => ($active ? $v.tabShadow : 'none')};
|
|
240
|
-
opacity: ${({ $dragging }) => ($dragging ? 0.4 : 1)};
|
|
241
|
-
z-index: ${({ $active }) => ($active ? 2 : 1)};
|
|
242
|
-
transition: background 0.18s ease-out, box-shadow 0.18s ease-out, opacity 0.18s ease-out;
|
|
243
|
-
&:hover { background: ${({ $active, $v }) => ($active ? $v.tabBg : $v.tabHover)}; }
|
|
244
|
-
&::before, &::after {
|
|
245
|
-
content: '';
|
|
246
|
-
position: absolute;
|
|
247
|
-
bottom: 0;
|
|
248
|
-
width: ${TAB_RADIUS}px;
|
|
249
|
-
height: ${TAB_RADIUS}px;
|
|
250
|
-
display: ${({ $active, $v }) => ($active && $v.joins ? 'block' : 'none')};
|
|
251
|
-
}
|
|
252
|
-
&::before {
|
|
253
|
-
left: -${TAB_RADIUS}px;
|
|
254
|
-
background: ${({ $v }) => $v.joins ? `radial-gradient(circle at 0 0, transparent ${TAB_RADIUS - 0.5}px, ${$v.tabBg} ${TAB_RADIUS}px)` : 'none'};
|
|
255
|
-
}
|
|
256
|
-
&::after {
|
|
257
|
-
right: -${TAB_RADIUS}px;
|
|
258
|
-
background: ${({ $v }) => $v.joins ? `radial-gradient(circle at ${TAB_RADIUS}px 0, transparent ${TAB_RADIUS - 0.5}px, ${$v.tabBg} ${TAB_RADIUS}px)` : 'none'};
|
|
259
|
-
}
|
|
238
|
+
const TabItem = styled.div `
|
|
239
|
+
position: relative;
|
|
240
|
+
display: inline-flex;
|
|
241
|
+
align-items: center;
|
|
242
|
+
gap: 2px;
|
|
243
|
+
height: 32px;
|
|
244
|
+
padding: 0 6px 0 12px;
|
|
245
|
+
max-width: 330px;
|
|
246
|
+
user-select: none;
|
|
247
|
+
border-radius: ${({ $v }) => $v.tabRadius};
|
|
248
|
+
background: ${({ $active, $v }) => ($active ? $v.tabBg : $v.idleTabBg)};
|
|
249
|
+
/* Stile card: ombra verso l'alto, sotto il tab poggia sul contenuto */
|
|
250
|
+
box-shadow: ${({ $active, $v }) => ($active ? $v.tabShadow : 'none')};
|
|
251
|
+
opacity: ${({ $dragging }) => ($dragging ? 0.4 : 1)};
|
|
252
|
+
z-index: ${({ $active }) => ($active ? 2 : 1)};
|
|
253
|
+
transition: background 0.18s ease-out, box-shadow 0.18s ease-out, opacity 0.18s ease-out;
|
|
254
|
+
&:hover { background: ${({ $active, $v }) => ($active ? $v.tabBg : $v.tabHover)}; }
|
|
255
|
+
&::before, &::after {
|
|
256
|
+
content: '';
|
|
257
|
+
position: absolute;
|
|
258
|
+
bottom: 0;
|
|
259
|
+
width: ${TAB_RADIUS}px;
|
|
260
|
+
height: ${TAB_RADIUS}px;
|
|
261
|
+
display: ${({ $active, $v }) => ($active && $v.joins ? 'block' : 'none')};
|
|
262
|
+
}
|
|
263
|
+
&::before {
|
|
264
|
+
left: -${TAB_RADIUS}px;
|
|
265
|
+
background: ${({ $v }) => $v.joins ? `radial-gradient(circle at 0 0, transparent ${TAB_RADIUS - 0.5}px, ${$v.tabBg} ${TAB_RADIUS}px)` : 'none'};
|
|
266
|
+
}
|
|
267
|
+
&::after {
|
|
268
|
+
right: -${TAB_RADIUS}px;
|
|
269
|
+
background: ${({ $v }) => $v.joins ? `radial-gradient(circle at ${TAB_RADIUS}px 0, transparent ${TAB_RADIUS - 0.5}px, ${$v.tabBg} ${TAB_RADIUS}px)` : 'none'};
|
|
270
|
+
}
|
|
260
271
|
`;
|
|
261
|
-
const TabButton = styled.button `
|
|
262
|
-
display: inline-flex;
|
|
263
|
-
align-items: center;
|
|
264
|
-
gap: 6px;
|
|
265
|
-
max-width: 290px;
|
|
266
|
-
height: 100%;
|
|
267
|
-
padding: 0 8px 0 0;
|
|
268
|
-
border: none;
|
|
269
|
-
background: none;
|
|
270
|
-
font-family: inherit;
|
|
271
|
-
font-size: 13px;
|
|
272
|
-
font-weight: ${({ $active }) => ($active ? 600 : 500)};
|
|
273
|
-
/* !important perche contenitori come l'intestazione del TMPanel impongono il proprio colore
|
|
274
|
-
a tutti i discendenti con '*, & { color: ... !important }': senza, il titolo lo eredita da li */
|
|
275
|
-
color: ${({ $active, $textColor, $idleColor }) => ($active ? $textColor : $idleColor)} !important;
|
|
276
|
-
white-space: nowrap;
|
|
277
|
-
overflow: hidden;
|
|
278
|
-
text-overflow: ellipsis;
|
|
279
|
-
cursor: pointer;
|
|
280
|
-
&:disabled { color: #BDBDBD !important; cursor: default; }
|
|
281
|
-
&:focus, &:focus-visible { outline: none; }
|
|
272
|
+
const TabButton = styled.button `
|
|
273
|
+
display: inline-flex;
|
|
274
|
+
align-items: center;
|
|
275
|
+
gap: 6px;
|
|
276
|
+
max-width: 290px;
|
|
277
|
+
height: 100%;
|
|
278
|
+
padding: 0 8px 0 0;
|
|
279
|
+
border: none;
|
|
280
|
+
background: none;
|
|
281
|
+
font-family: inherit;
|
|
282
|
+
font-size: 13px;
|
|
283
|
+
font-weight: ${({ $active }) => ($active ? 600 : 500)};
|
|
284
|
+
/* !important perche contenitori come l'intestazione del TMPanel impongono il proprio colore
|
|
285
|
+
a tutti i discendenti con '*, & { color: ... !important }': senza, il titolo lo eredita da li */
|
|
286
|
+
color: ${({ $active, $textColor, $idleColor }) => ($active ? $textColor : $idleColor)} !important;
|
|
287
|
+
white-space: nowrap;
|
|
288
|
+
overflow: hidden;
|
|
289
|
+
text-overflow: ellipsis;
|
|
290
|
+
cursor: pointer;
|
|
291
|
+
&:disabled { color: #BDBDBD !important; cursor: default; }
|
|
292
|
+
&:focus, &:focus-visible { outline: none; }
|
|
282
293
|
`;
|
|
283
294
|
/** Pulsante 'x' per chiudere il tab: stesso colore del titolo accanto. */
|
|
284
|
-
const CloseButton = styled.button `
|
|
285
|
-
display: flex;
|
|
286
|
-
align-items: center;
|
|
287
|
-
justify-content: center;
|
|
288
|
-
width: 18px;
|
|
289
|
-
height: 18px;
|
|
290
|
-
flex-shrink: 0;
|
|
291
|
-
padding: 0;
|
|
292
|
-
border: none;
|
|
293
|
-
border-radius: 4px;
|
|
294
|
-
background: none;
|
|
295
|
-
color: ${({ $color }) => $color} !important;
|
|
296
|
-
font-size: 14px;
|
|
297
|
-
line-height: 1;
|
|
298
|
-
font-family: inherit;
|
|
299
|
-
cursor: pointer;
|
|
300
|
-
|
|
301
|
-
&:hover { background: rgba(0, 0, 0, 0.15); }
|
|
302
|
-
&:focus, &:focus-visible { outline: none; }
|
|
295
|
+
const CloseButton = styled.button `
|
|
296
|
+
display: flex;
|
|
297
|
+
align-items: center;
|
|
298
|
+
justify-content: center;
|
|
299
|
+
width: 18px;
|
|
300
|
+
height: 18px;
|
|
301
|
+
flex-shrink: 0;
|
|
302
|
+
padding: 0;
|
|
303
|
+
border: none;
|
|
304
|
+
border-radius: 4px;
|
|
305
|
+
background: none;
|
|
306
|
+
color: ${({ $color }) => $color} !important;
|
|
307
|
+
font-size: 14px;
|
|
308
|
+
line-height: 1;
|
|
309
|
+
font-family: inherit;
|
|
310
|
+
cursor: pointer;
|
|
311
|
+
|
|
312
|
+
&:hover { background: rgba(0, 0, 0, 0.15); }
|
|
313
|
+
&:focus, &:focus-visible { outline: none; }
|
|
303
314
|
`;
|
|
304
315
|
/** Casella di testo mostrata al posto del titolo durante la rinomina. */
|
|
305
|
-
const RenameInput = styled.input `
|
|
306
|
-
margin: 4px 2px 4px 10px;
|
|
307
|
-
padding: 2px 4px;
|
|
308
|
-
width: 130px;
|
|
309
|
-
font-family: inherit;
|
|
310
|
-
font-size: 13px;
|
|
311
|
-
font-weight: 600;
|
|
312
|
-
color: ${TEXT_ACTIVE};
|
|
313
|
-
background: ${TAB_BG};
|
|
314
|
-
border: 1px solid ${ACCENT};
|
|
315
|
-
border-radius: 4px;
|
|
316
|
-
outline: none;
|
|
316
|
+
const RenameInput = styled.input `
|
|
317
|
+
margin: 4px 2px 4px 10px;
|
|
318
|
+
padding: 2px 4px;
|
|
319
|
+
width: 130px;
|
|
320
|
+
font-family: inherit;
|
|
321
|
+
font-size: 13px;
|
|
322
|
+
font-weight: 600;
|
|
323
|
+
color: ${TEXT_ACTIVE};
|
|
324
|
+
background: ${TAB_BG};
|
|
325
|
+
border: 1px solid ${ACCENT};
|
|
326
|
+
border-radius: 4px;
|
|
327
|
+
outline: none;
|
|
317
328
|
`;
|
|
318
329
|
/** Badge numerico a pillola accanto al titolo (es. conteggio errori). */
|
|
319
|
-
const TabBadge = styled.span `
|
|
320
|
-
background: ${({ $color }) => $color};
|
|
321
|
-
color: #fff !important;
|
|
322
|
-
font-size: 11px;
|
|
323
|
-
font-weight: 700;
|
|
324
|
-
line-height: 16px;
|
|
325
|
-
min-width: 16px;
|
|
326
|
-
padding: 0 5px;
|
|
327
|
-
border-radius: 999em;
|
|
328
|
-
text-align: center;
|
|
330
|
+
const TabBadge = styled.span `
|
|
331
|
+
background: ${({ $color }) => $color};
|
|
332
|
+
color: #fff !important;
|
|
333
|
+
font-size: 11px;
|
|
334
|
+
font-weight: 700;
|
|
335
|
+
line-height: 16px;
|
|
336
|
+
min-width: 16px;
|
|
337
|
+
padding: 0 5px;
|
|
338
|
+
border-radius: 999em;
|
|
339
|
+
text-align: center;
|
|
329
340
|
`;
|
|
330
341
|
const MAX_LABEL_CHARS = 30;
|
|
331
342
|
const LABEL_COUNTER = /\s*\(\d+\)$/;
|
|
@@ -341,7 +352,7 @@ const shortenLabel = (label) => {
|
|
|
341
352
|
/** Contenitore dichiarativo di un tab: figlio diretto di TMTabControl, non renderizza nulla di suo. */
|
|
342
353
|
export const TMTabPanel = ({ children }) => _jsx(_Fragment, { children: children });
|
|
343
354
|
const TMTabControl = (props) => {
|
|
344
|
-
const { selectedId, defaultSelectedId, onSelectedIdChange, hideBarWhenSingle = false, onTabClose, closableWhenSingle = false, onTabRename, onTabReorder, onTabAdd, tabMenuItems, addCaption = SDKUI_Localizator.AddTab, renameCaption = SDKUI_Localizator.Rename, closeCaption = SDKUI_Localizator.Close, closeOtherCaption = SDKUI_Localizator.CloseOtherTabs, variant = 'module', textColor, idleTextColor, contentAnimation = 'none', animationDuration = 300, swipeEnabled = true, contentStyle, style, children } = props;
|
|
355
|
+
const { selectedId, defaultSelectedId, onSelectedIdChange, hideBarWhenSingle = false, onTabClose, closableWhenSingle = false, onTabRename, onTabReorder, onTabAdd, tabMenuItems, addCaption = SDKUI_Localizator.AddTab, renameCaption = SDKUI_Localizator.Rename, closeCaption = SDKUI_Localizator.Close, closeOtherCaption = SDKUI_Localizator.CloseOtherTabs, variant = 'module', textColor, idleTextColor, contentAnimation = 'none', animationDuration = 300, swipeEnabled = true, contentStyle, style, toolbar, children } = props;
|
|
345
356
|
const v = useMemo(() => VARIANTS[variant](), [variant]);
|
|
346
357
|
const titleColor = textColor ?? v.textColor;
|
|
347
358
|
const titleIdleColor = idleTextColor ?? v.idleTextColor;
|
|
@@ -578,11 +589,11 @@ const TMTabControl = (props) => {
|
|
|
578
589
|
tabIndex: isActive ? 0 : -1,
|
|
579
590
|
// Con il titolo accorciato il nome per esteso lo mostra gia il tooltip
|
|
580
591
|
title: canRename && !shortLabel ? 'Doppio clic per rinominare' : undefined, $active: isActive, $textColor: titleColor, $idleColor: titleIdleColor, disabled: p.props.disabled, onClick: () => handleSelect(p.props.id), onDoubleClick: () => canRename && setEditingId(p.props.id), children: [shortLabel ?? p.props.label, (p.props.badge ?? 0) > 0 && _jsx(TabBadge, { $color: p.props.badgeColor ?? '#E53935', children: p.props.badge })] }));
|
|
581
|
-
return (_jsxs(React.Fragment, { children: [showSeparator && _jsx(TabSeparator, { $v: v }), _jsxs(TabItem, { "data-tab-id": p.props.id, $v: v, $active: isActive, $dragging: dragId === p.props.id, draggable: !!onTabReorder && editingId !== p.props.id,
|
|
592
|
+
return (_jsxs(React.Fragment, { children: [showSeparator && _jsx(TabSeparator, { $v: v }), _jsxs(TabItem, { "data-tab-id": p.props.id, $v: v, $active: isActive, $dragging: dragId === p.props.id, draggable: !!onTabReorder && p.props.movable !== false && editingId !== p.props.id,
|
|
582
593
|
// Tipo MIME privato invece di 'text/plain': il tab non e rilasciabile fuori dalla barra
|
|
583
594
|
// (barra indirizzi, campi di ricerca, altre applicazioni) scrivendoci dentro il suo id
|
|
584
|
-
onDragStart: (e) => { setDragId(p.props.id); e.dataTransfer.effectAllowed = 'move'; e.dataTransfer.setData(TAB_DRAG_MIME, p.props.id); }, onDragOver: (e) => { if (!dragId || dragId === p.props.id)
|
|
585
|
-
return; e.preventDefault(); e.dataTransfer.dropEffect = 'move'; setDropId(p.props.id); }, onDragLeave: () => setDropId(prev => prev === p.props.id ? undefined : prev), onDrop: (e) => { e.preventDefault(); if (dragId && dragId !== p.props.id)
|
|
595
|
+
onDragStart: (e) => { setDragId(p.props.id); e.dataTransfer.effectAllowed = 'move'; e.dataTransfer.setData(TAB_DRAG_MIME, p.props.id); }, onDragOver: (e) => { if (!dragId || dragId === p.props.id || p.props.movable === false)
|
|
596
|
+
return; e.preventDefault(); e.dataTransfer.dropEffect = 'move'; setDropId(p.props.id); }, onDragLeave: () => setDropId(prev => prev === p.props.id ? undefined : prev), onDrop: (e) => { e.preventDefault(); if (dragId && dragId !== p.props.id && p.props.movable !== false)
|
|
586
597
|
onTabReorder?.(dragId, p.props.id); setDragId(undefined); setDropId(undefined); }, onDragEnd: () => { setDragId(undefined); setDropId(undefined); }, onContextMenu: (e) => openMenu(e, p.props.id), children: [editingId === p.props.id
|
|
587
598
|
// In rinomina: Invio conferma, Esc annulla, uscendo dal campo si conferma
|
|
588
599
|
? _jsx(RenameInput, { autoFocus: true, defaultValue: String(p.props.label), onFocus: (e) => e.currentTarget.select(), onBlur: (e) => commitRename(p.props.id, e.currentTarget.value), onKeyDown: (e) => {
|
|
@@ -595,7 +606,7 @@ const TMTabControl = (props) => {
|
|
|
595
606
|
// width: auto annulla il max-content del tooltip, che impedirebbe al titolo di restringersi
|
|
596
607
|
? _jsx(TMTooltip, { content: labelText, parentStyle: { display: 'flex', minWidth: 0 }, childStyle: { width: 'auto', minWidth: 0 }, children: tabButton })
|
|
597
608
|
: tabButton, canClose && _jsx(CloseButton, { $color: isActive ? v.textColor : v.idleTextColor, type: 'button', tabIndex: isActive ? 0 : -1, title: closeCaption, onClick: () => onTabClose?.(p.props.id), children: "\u00D7" }), isDropTarget && _jsx(DropMark, { $side: draggedIndex > index ? 'left' : 'right' })] })] }, p.props.id));
|
|
598
|
-
}), onTabAdd && _jsx(AddButton, { $v: v, type: 'button', title: addCaption, onClick: onTabAdd, children: _jsx(IconAdd, { fontSize: 18 }) })] }), arrows.right && _jsx(NavButton, { $v: v, type: 'button', tabIndex: -1, onClick: () => scrollTabs(1), children: _jsx(IconRight, { fontSize: 18 }) })] }), menu.visible && menuItems.length > 0 &&
|
|
609
|
+
}), onTabAdd && _jsx(AddButton, { $v: v, type: 'button', title: addCaption, onClick: onTabAdd, children: _jsx(IconAdd, { fontSize: 18 }) })] }), arrows.right && _jsx(NavButton, { $v: v, type: 'button', tabIndex: -1, onClick: () => scrollTabs(1), children: _jsx(IconRight, { fontSize: 18 }) }), toolbar && _jsx(TabsToolbar, { children: toolbar })] }), menu.visible && menuItems.length > 0 &&
|
|
599
610
|
_jsx(TMContextMenu, { items: menuItems, externalControl: { visible: menu.visible, position: menu.position, onClose: closeMenu } }), _jsx(ContentArea, { onTouchStart: handleTouchStart, onTouchEnd: handleTouchEnd, children: mountedPanels.map(p => {
|
|
600
611
|
const isActive = p.props.id === activeId;
|
|
601
612
|
return (_jsx(ContentPane, { role: 'tabpanel', "aria-hidden": !isActive, $active: isActive, $anim: animation, $duration: animationDuration, $phase: animPhase,
|
|
@@ -11,5 +11,5 @@ interface ITMTooltipProps extends ITooltipOptions {
|
|
|
11
11
|
childStyle?: React.CSSProperties;
|
|
12
12
|
allowContentInteraction?: boolean;
|
|
13
13
|
}
|
|
14
|
-
declare const TMTooltip: ({ children, position, content, hideAfterDelay, parentStyle, childStyle, allowContentInteraction }: ITMTooltipProps) =>
|
|
14
|
+
declare const TMTooltip: ({ children, position, content, hideAfterDelay, parentStyle, childStyle, allowContentInteraction }: ITMTooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export default TMTooltip;
|
|
@@ -29,19 +29,13 @@ 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) => import("react/jsx-runtime").JSX.Element;
|
|
33
33
|
export default TMTreeView;
|
|
34
|
-
export declare const StyledTreeContainer: import("styled-components/dist/types").IStyledComponentBase<"web",
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
}, {
|
|
34
|
+
export declare const StyledTreeContainer: 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;
|
|
35
|
+
export declare const StyledItemContent: 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;
|
|
36
|
+
export declare const StyledTreeNode: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isSelected"> & {
|
|
43
37
|
$isSelected?: boolean;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isSelected"> & {
|
|
39
|
+
$isSelected?: boolean;
|
|
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;
|
|
@@ -4,6 +4,17 @@ import { List } from 'react-window';
|
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { IconArrowLeft, IconArrowRight, IconChevronDown, IconChevronRight, SDKUI_Localizator } from '../../helper';
|
|
6
6
|
import TMButton from './TMButton';
|
|
7
|
+
// Campi in cui frecce, +, - e spazio servono alla digitazione (checkbox e bottoni esclusi)
|
|
8
|
+
const NON_TEXT_INPUT_TYPES = new Set(['checkbox', 'radio', 'button', 'submit', 'reset', 'image', 'file', 'color', 'range']);
|
|
9
|
+
const isEditableElement = (el) => {
|
|
10
|
+
if (el.isContentEditable)
|
|
11
|
+
return true;
|
|
12
|
+
if (el instanceof HTMLTextAreaElement || el instanceof HTMLSelectElement)
|
|
13
|
+
return true;
|
|
14
|
+
if (el instanceof HTMLInputElement)
|
|
15
|
+
return !NON_TEXT_INPUT_TYPES.has(el.type);
|
|
16
|
+
return false;
|
|
17
|
+
};
|
|
7
18
|
// Componente riga virtualizzata memoizzato
|
|
8
19
|
const VirtualRowComponent = memo(({ ariaAttributes, index, style, flattenedItems, focusedItemKey, selectedItemKeys, allowMultipleSelection, hasVisibleItems, handleNodeToggle, handleNodeClick, handleCheckboxChange, hasPartialChildSelection, itemRender, onItemContextMenu }) => {
|
|
9
20
|
const item = flattenedItems[index];
|
|
@@ -184,6 +195,9 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
|
|
|
184
195
|
const handleKeyDown = (event) => {
|
|
185
196
|
if (!focusedItem)
|
|
186
197
|
return;
|
|
198
|
+
// Non rubare i tasti ai campi editabili (es. input di un pannello sovrapposto)
|
|
199
|
+
if (event.target instanceof HTMLElement && isEditableElement(event.target))
|
|
200
|
+
return;
|
|
187
201
|
let newFocusedItem = null;
|
|
188
202
|
let handled = false;
|
|
189
203
|
switch (event.key) {
|
|
@@ -459,6 +473,12 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
|
|
|
459
473
|
return selectedCount > 0 && selectedCount < childKeys.length;
|
|
460
474
|
}, [flattenTree]);
|
|
461
475
|
const hasVisibleItems = useCallback((node) => {
|
|
476
|
+
// Nodo già caricato: conta i figli visibili (isExpandible è solo una stima a priori)
|
|
477
|
+
if (node.isLoaded) {
|
|
478
|
+
if (!node.items)
|
|
479
|
+
return false;
|
|
480
|
+
return node.items.filter(o => !o.hidden).length > 0;
|
|
481
|
+
}
|
|
462
482
|
// If node has explicit isExpandible value, use that
|
|
463
483
|
if (node.isExpandible !== undefined) {
|
|
464
484
|
return node.isExpandible;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
interface TMUserAvatarProps {
|
|
3
2
|
displayName: string;
|
|
4
3
|
nameForColorCalculation: string;
|
|
5
4
|
tooltipName?: string;
|
|
6
5
|
returnType?: 'jsx' | 'svg';
|
|
7
6
|
}
|
|
8
|
-
declare const TMUserAvatar: (props: TMUserAvatarProps) => string |
|
|
7
|
+
declare const TMUserAvatar: (props: TMUserAvatarProps) => string | import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default TMUserAvatar;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
3
2
|
declare const TMVilViewer: ({ vil }: {
|
|
4
3
|
vil?: ValidationItem[];
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
5
|
export default TMVilViewer;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ITMLayoutContainerProps } from './TMLayout';
|
|
3
2
|
interface ITMWaitPanelProps {
|
|
4
3
|
title?: string;
|
|
@@ -15,7 +14,7 @@ interface ITMWaitPanelProps {
|
|
|
15
14
|
onAbortClick?: (abortController: AbortController | undefined) => void;
|
|
16
15
|
useHighZIndex?: boolean;
|
|
17
16
|
}
|
|
18
|
-
export declare const TMWaitPanel: (props: ITMWaitPanelProps) =>
|
|
17
|
+
export declare const TMWaitPanel: (props: ITMWaitPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
18
|
interface ITMLayoutWaitingContainerProps extends ITMLayoutContainerProps {
|
|
20
19
|
showWaitPanel?: boolean;
|
|
21
20
|
waitPanelTitle?: string;
|
|
@@ -31,5 +30,5 @@ interface ITMLayoutWaitingContainerProps extends ITMLayoutContainerProps {
|
|
|
31
30
|
abortController?: AbortController;
|
|
32
31
|
usePortal?: boolean;
|
|
33
32
|
}
|
|
34
|
-
export declare const TMLayoutWaitingContainer: ({ showWaitPanel, showWaitPanelPrimary, showWaitPanelSecondary, waitPanelTitle, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, isCancelable, abortController, usePortal, gap, onClick, justifyContent, alignItems, children, direction }: ITMLayoutWaitingContainerProps) =>
|
|
33
|
+
export declare const TMLayoutWaitingContainer: ({ showWaitPanel, showWaitPanelPrimary, showWaitPanelSecondary, waitPanelTitle, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, isCancelable, abortController, usePortal, gap, onClick, justifyContent, alignItems, children, direction }: ITMLayoutWaitingContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
34
|
export {};
|
|
@@ -34,7 +34,7 @@ const StyledTitle = styled.h2 ` margin: 0; font-size: 1.5em; color: #333; `;
|
|
|
34
34
|
const StyledProgressBarContainer = styled.div ` width: 100%; height: 20px; background: #e0e0e0; border-radius: 10px; overflow: hidden; margin: 20px 0; `;
|
|
35
35
|
const StyledProgressBar = styled.div ` height: 100%; background: #4caf50; transition: width 0.3s ease; `;
|
|
36
36
|
const StyledProgressText = styled.p ` font-weight: bold; color: #333; margin: 0; `;
|
|
37
|
-
const StyledMessage = styled.p ` color: #666; font-size: 0.9em; margin-top: 10px; `;
|
|
37
|
+
const StyledMessage = styled.p ` color: #666; font-size: 0.9em; margin-top: 10px; white-space: pre-line; `;
|
|
38
38
|
const StyledAbortButton = styled.button ` background: #ff4d4d; color: white; border: none; border-radius: 5px; padding: 10px 20px; font-size: 1em; cursor: pointer; margin-top: 20px; &:hover { background: #ff6666; } `;
|
|
39
39
|
export const TMWaitPanel = (props) => {
|
|
40
40
|
const { title, showPrimary, textPrimary, valuePrimary, maxValuePrimary, showSecondary, textSecondary, valueSecondary, maxValueSecondary, isCancelable, abortController, onAbortClick, useHighZIndex } = props;
|