@topconsultnpm/sdkui-react 6.22.0-dev2.9 → 6.22.0-dev3.3

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.
Files changed (232) hide show
  1. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +3 -3
  2. package/lib/components/NewComponents/ContextMenu/hooks.d.ts +1 -1
  3. package/lib/components/NewComponents/ContextMenu/styles.d.ts +14 -14
  4. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
  5. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +31 -31
  6. package/lib/components/base/Styled.d.ts +4 -4
  7. package/lib/components/base/TMAccordionNew.js +7 -7
  8. package/lib/components/base/TMAlert.d.ts +32 -32
  9. package/lib/components/base/TMAreaManager.js +1 -1
  10. package/lib/components/base/TMButton.js +4 -4
  11. package/lib/components/base/TMClosableList.js +3 -3
  12. package/lib/components/base/TMCustomButton.js +1 -1
  13. package/lib/components/base/TMDataGrid.d.ts +4 -0
  14. package/lib/components/base/TMDataGrid.js +290 -10
  15. package/lib/components/base/TMDropDownMenu.js +1 -1
  16. package/lib/components/base/TMEditorBase.d.ts +2 -0
  17. package/lib/components/base/TMFileManager.js +5 -3
  18. package/lib/components/base/TMFileManagerDataGridView.js +12 -3
  19. package/lib/components/base/TMFileManagerThumbnailItems.js +20 -10
  20. package/lib/components/base/TMFileManagerUtils.d.ts +4 -2
  21. package/lib/components/base/TMFileManagerUtils.js +37 -1
  22. package/lib/components/base/TMLayout.d.ts +2 -2
  23. package/lib/components/base/TMLayout.js +3 -3
  24. package/lib/components/base/TMList.js +1 -1
  25. package/lib/components/base/TMListView.js +3 -3
  26. package/lib/components/base/TMModal.d.ts +11 -0
  27. package/lib/components/base/TMModal.js +47 -13
  28. package/lib/components/base/TMPanel.d.ts +6 -0
  29. package/lib/components/base/TMPanel.js +141 -28
  30. package/lib/components/base/TMPopUp.js +5 -2
  31. package/lib/components/base/TMResizableMenu.js +2 -2
  32. package/lib/components/base/TMRightSidebar.js +1 -1
  33. package/lib/components/base/TMShowAllOrMaxItemsButton.js +1 -1
  34. package/lib/components/base/TMSpinner.js +2 -2
  35. package/lib/components/base/TMTab.js +2 -2
  36. package/lib/components/base/TMToggleButton.js +2 -2
  37. package/lib/components/base/TMToolbarCard.js +3 -3
  38. package/lib/components/base/TMTooltip.d.ts +2 -1
  39. package/lib/components/base/TMTooltip.js +24 -8
  40. package/lib/components/base/TMTreeView.js +110 -69
  41. package/lib/components/base/TMWaitPanel.js +2 -2
  42. package/lib/components/choosers/TMCultureIDPicker.js +2 -2
  43. package/lib/components/choosers/TMDataListItemChooser.js +1 -1
  44. package/lib/components/choosers/TMDataListItemPicker.js +2 -2
  45. package/lib/components/choosers/TMDcmtTypeChooser.js +5 -4
  46. package/lib/components/choosers/TMDiskChooser.js +1 -1
  47. package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
  48. package/lib/components/choosers/TMDistinctValues.js +157 -141
  49. package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
  50. package/lib/components/choosers/TMImageIDChooser.js +1 -1
  51. package/lib/components/choosers/TMMetadataChooser.js +3 -3
  52. package/lib/components/choosers/TMQuickSearchInfo.d.ts +12 -0
  53. package/lib/components/choosers/TMQuickSearchInfo.js +279 -0
  54. package/lib/components/choosers/TMQuickSearchSettingsForm.d.ts +16 -0
  55. package/lib/components/choosers/TMQuickSearchSettingsForm.js +94 -0
  56. package/lib/components/choosers/TMRelationChooser.js +1 -1
  57. package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
  58. package/lib/components/choosers/TMSelectedValuesSummary.js +89 -0
  59. package/lib/components/choosers/TMUserChooser.js +1 -1
  60. package/lib/components/editors/TMCheckBox.js +1 -1
  61. package/lib/components/editors/TMDropDown.d.ts +3 -0
  62. package/lib/components/editors/TMDropDown.js +197 -5
  63. package/lib/components/editors/TMEditorStyled.d.ts +10 -10
  64. package/lib/components/editors/TMFormulaEditor.js +1 -1
  65. package/lib/components/editors/TMHtmlContentDisplay.js +1 -1
  66. package/lib/components/editors/TMLocalizedTextBox.js +1 -1
  67. package/lib/components/editors/TMMetadataValues.js +2 -2
  68. package/lib/components/editors/TMRadioButton.js +2 -2
  69. package/lib/components/editors/TMSummary.js +3 -3
  70. package/lib/components/editors/TMTextArea.js +3 -3
  71. package/lib/components/editors/TMTextBox.js +3 -3
  72. package/lib/components/editors/TMTextExpression.js +1 -1
  73. package/lib/components/features/archive/TMArchive.js +17 -3
  74. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
  75. package/lib/components/features/assistant/TMToppySpeechBubble.js +1 -1
  76. package/lib/components/features/documents/TMBatchUpdateForm.js +20 -6
  77. package/lib/components/features/documents/TMDcmtBlog.d.ts +3 -0
  78. package/lib/components/features/documents/TMDcmtBlog.js +4 -4
  79. package/lib/components/features/documents/TMDcmtForm.d.ts +7 -0
  80. package/lib/components/features/documents/TMDcmtForm.js +180 -53
  81. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +11 -0
  82. package/lib/components/features/documents/TMDcmtFormActionButtons.js +79 -9
  83. package/lib/components/features/documents/TMDcmtIcon.js +5 -3
  84. package/lib/components/features/documents/TMDcmtPreview.js +12 -8
  85. package/lib/components/features/documents/TMDownloadRelationViewerSection.js +1 -1
  86. package/lib/components/features/documents/TMFileUploader.js +3 -3
  87. package/lib/components/features/documents/TMMasterDetailDcmts.js +96 -34
  88. package/lib/components/features/documents/TMMasterInfoFields.d.ts +19 -0
  89. package/lib/components/features/documents/TMMasterInfoFields.js +184 -0
  90. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
  91. package/lib/components/features/documents/TMMergeToPdfForm.js +30 -5
  92. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +45 -0
  93. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +323 -0
  94. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +370 -0
  95. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +283 -0
  96. package/lib/components/features/documents/TMRelationViewer.d.ts +14 -1
  97. package/lib/components/features/documents/TMRelationViewer.js +71 -22
  98. package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +1 -1
  99. package/lib/components/features/search/TMMetadataOutputForm.js +1 -1
  100. package/lib/components/features/search/TMMetadataSorterForm.js +1 -1
  101. package/lib/components/features/search/TMSavedQuerySelector.js +2 -2
  102. package/lib/components/features/search/TMSearch.js +78 -12
  103. package/lib/components/features/search/TMSearchQueryEditor.js +7 -5
  104. package/lib/components/features/search/TMSearchQueryPanel.d.ts +4 -0
  105. package/lib/components/features/search/TMSearchQueryPanel.js +142 -68
  106. package/lib/components/features/search/TMSearchResult.d.ts +16 -0
  107. package/lib/components/features/search/TMSearchResult.js +431 -110
  108. package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
  109. package/lib/components/features/search/TMTreeSelector.js +109 -64
  110. package/lib/components/features/tasks/TMTaskForm.js +1 -1
  111. package/lib/components/features/tasks/TMTaskFormUtils.js +3 -3
  112. package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
  113. package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
  114. package/lib/components/features/tasks/TMTasksHeader.js +1 -1
  115. package/lib/components/features/tasks/TMTasksUtilsView.js +1 -1
  116. package/lib/components/features/tasks/TMTasksView.js +4 -4
  117. package/lib/components/features/wg/TMWGsCopyMoveForm.js +1 -1
  118. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +10 -0
  119. package/lib/components/features/workflow/TMWorkflowPopup.js +9 -5
  120. package/lib/components/features/workflow/diagram/ConnectionComponent.js +3 -3
  121. package/lib/components/features/workflow/diagram/DiagramItemComponent.js +3 -3
  122. package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
  123. package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +1 -1
  124. package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
  125. package/lib/components/features/workflow/diagram/WFDiagram.js +4 -4
  126. package/lib/components/forms/Login/Menu.js +1 -1
  127. package/lib/components/forms/Login/OTPReader.js +1 -1
  128. package/lib/components/forms/Login/PasswordStrengthChecker.js +1 -1
  129. package/lib/components/forms/Login/RapidAccessLogin.js +2 -2
  130. package/lib/components/forms/Login/RecoverPasswordFlow.js +2 -2
  131. package/lib/components/forms/Login/SelectBox.js +1 -1
  132. package/lib/components/forms/Login/StepIndicator.js +1 -1
  133. package/lib/components/forms/Login/TMLoginForm.js +7 -7
  134. package/lib/components/forms/Login/TextBox.js +1 -1
  135. package/lib/components/forms/TMApplyForm.js +3 -3
  136. package/lib/components/forms/TMChooserForm.js +1 -1
  137. package/lib/components/forms/TMSaveForm.js +3 -3
  138. package/lib/components/grids/TMBlogAttachments.js +14 -3
  139. package/lib/components/grids/TMBlogHeader.js +5 -1
  140. package/lib/components/grids/TMBlogsPost.d.ts +2 -0
  141. package/lib/components/grids/TMBlogsPost.js +31 -4
  142. package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
  143. package/lib/components/grids/TMBlogsPostUtils.js +15 -4
  144. package/lib/components/grids/TMRecentsManager.js +4 -4
  145. package/lib/components/grids/TMValidationItemsList.js +1 -1
  146. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
  147. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +25 -15
  148. package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
  149. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +2 -2
  150. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
  151. package/lib/components/layout/panelManager/TMPanelWrapper.js +3 -3
  152. package/lib/components/layout/panelManager/types.d.ts +3 -0
  153. package/lib/components/layout/panelManager/utils.js +13 -11
  154. package/lib/components/pages/TMPage.js +1 -1
  155. package/lib/components/query/TMQueryCountButton.js +1 -1
  156. package/lib/components/query/TMQueryEditor.js +7 -7
  157. package/lib/components/sidebar/TMCommandsPanel.js +1 -1
  158. package/lib/components/sidebar/TMHeader.js +36 -26
  159. package/lib/components/sidebar/TMSidebar.js +1 -1
  160. package/lib/components/sidebar/TMSidebarItem.js +1 -1
  161. package/lib/components/viewers/TMMidViewer.js +6 -3
  162. package/lib/components/viewers/TMTidViewer.js +89 -28
  163. package/lib/components/wizard/TMStepIndicator.js +3 -3
  164. package/lib/css/tm-sdkui.css +1 -1
  165. package/lib/devextreme-license.d.ts +1 -0
  166. package/lib/devextreme-license.js +3 -0
  167. package/lib/helper/Enum_Localizator.d.ts +4 -4
  168. package/lib/helper/Globalization.d.ts +1 -1
  169. package/lib/helper/SDKUI_Globals.d.ts +110 -0
  170. package/lib/helper/SDKUI_Globals.js +151 -0
  171. package/lib/helper/SDKUI_Localizator.d.ts +731 -687
  172. package/lib/helper/SDKUI_Localizator.js +440 -0
  173. package/lib/helper/TMAppUpdatedModal.d.ts +1 -0
  174. package/lib/helper/TMAppUpdatedModal.js +134 -0
  175. package/lib/helper/TMIcons.d.ts +1 -0
  176. package/lib/helper/TMIcons.js +4 -3
  177. package/lib/helper/TMPdfViewer.js +1 -1
  178. package/lib/helper/TMToppyMessage.js +1 -1
  179. package/lib/helper/TMUtils.d.ts +13 -0
  180. package/lib/helper/TMUtils.js +25 -3
  181. package/lib/helper/checkinCheckoutManager.d.ts +1 -1
  182. package/lib/helper/checkinCheckoutManager.js +1 -1
  183. package/lib/helper/dataGridSearchHelper.d.ts +28 -0
  184. package/lib/helper/dataGridSearchHelper.js +51 -0
  185. package/lib/helper/dcmtsHelper.d.ts +20 -0
  186. package/lib/helper/dcmtsHelper.js +58 -1
  187. package/lib/helper/helpers.d.ts +12 -1
  188. package/lib/helper/helpers.js +27 -3
  189. package/lib/helper/index.d.ts +2 -0
  190. package/lib/helper/index.js +2 -0
  191. package/lib/helper/queryHelper.d.ts +6 -1
  192. package/lib/helper/queryHelper.js +8 -3
  193. package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
  194. package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
  195. package/lib/hooks/useArchiveListForm.d.ts +39 -0
  196. package/lib/hooks/useArchiveListForm.js +46 -0
  197. package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
  198. package/lib/hooks/useCaseFlowApprove.js +157 -0
  199. package/lib/hooks/useDataUserIdItem.d.ts +1 -0
  200. package/lib/hooks/useDataUserIdItem.js +1 -0
  201. package/lib/hooks/useDocumentOperations.d.ts +4 -0
  202. package/lib/hooks/useDocumentOperations.js +53 -11
  203. package/lib/hooks/useInputDialog.js +1 -1
  204. package/lib/hooks/useMultiMasterDetailDcmts.d.ts +113 -0
  205. package/lib/hooks/useMultiMasterDetailDcmts.js +760 -0
  206. package/lib/hooks/useQueryParametersDialog.js +1 -1
  207. package/lib/hooks/useRelatedDocuments.d.ts +1 -0
  208. package/lib/hooks/useRelatedDocuments.js +22 -27
  209. package/lib/hooks/useShowDossiersV5.d.ts +12 -0
  210. package/lib/hooks/useShowDossiersV5.js +37 -0
  211. package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
  212. package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
  213. package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
  214. package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
  215. package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
  216. package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
  217. package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
  218. package/lib/hooks/useTMDistinctValuesSource.js +105 -0
  219. package/lib/index.d.ts +2 -0
  220. package/lib/index.js +5 -2
  221. package/lib/services/caseflow/CaseFlowService.d.ts +247 -0
  222. package/lib/services/caseflow/CaseFlowService.js +720 -0
  223. package/lib/services/caseflow/CaseFlowTemplateCacheService.d.ts +28 -0
  224. package/lib/services/caseflow/CaseFlowTemplateCacheService.js +121 -0
  225. package/lib/services/caseflow/caseFlowNameCache.d.ts +32 -0
  226. package/lib/services/caseflow/caseFlowNameCache.js +116 -0
  227. package/lib/services/caseflow/caseFlowWorkItemUtils.d.ts +61 -0
  228. package/lib/services/caseflow/caseFlowWorkItemUtils.js +113 -0
  229. package/lib/services/index.d.ts +4 -0
  230. package/lib/services/index.js +4 -0
  231. package/lib/services/platform_services.d.ts +4 -4
  232. package/package.json +71 -68
@@ -1,11 +1,13 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import styled from "styled-components";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef, useState } from "react";
3
+ import { createPortal } from "react-dom";
4
+ import styled, { css } from "styled-components";
4
5
  import { FontSize, TMColors } from '../../utils/theme';
5
6
  import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, TMEditorsDefaultBorderRadius, editorColorManager } from "./TMEditorStyled";
6
7
  import TMLayoutContainer, { TMLayoutItem } from "../base/TMLayout";
7
8
  import TMVilViewer from "../base/TMVilViewer";
8
9
  import TMTooltip from "../base/TMTooltip";
10
+ import { SDKUI_Localizator } from "../../helper";
9
11
  const StyledDropDownWrapper = styled.div `
10
12
  position: relative;
11
13
  width: ${props => props.$width};
@@ -54,9 +56,199 @@ const StyledDropDownEditorButton = styled.div `
54
56
  align-items: center;
55
57
  cursor: pointer;
56
58
  `;
57
- const TMDropDown = ({ validationItems = [], disabled = false, elementStyle, isModifiedWhen, labelPosition = 'left', label, icon, width = '100%', fontSize = FontSize.defaultFontSize, dataSource, value, onValueChanged, buttons = [], placeHolder, }) => {
59
+ // Variante filtrabile: un input di testo con la stessa resa grafica della select nativa
60
+ const StyledSearchInput = styled.input `
61
+ width: 100%;
62
+ padding: 5px 35px 3px 9px;
63
+ border: 1px solid;
64
+ border-color: ${props => props.$isModified ? TMColors.isModified : TMColors.border_normal};
65
+ border-bottom: ${props => (props.$vil.length > 0) ? '3px' : '1px'} solid;
66
+ border-bottom-color: ${props => (props.$vil.length === 0) ? !props.$isModified ? TMColors.border_normal : TMColors.isModified : editorColorManager(props.$vil)};
67
+ color: ${props => !props.$disabled ? (props.$vil.length === 0 ? (!props.$isModified ? TMColors.text_normal : TMColors.isModified) : editorColorManager(props.$vil)) : TMColors.disabled};
68
+ border-radius: ${props => props.$borderRadius ?? TMEditorsDefaultBorderRadius};
69
+ font-size: ${props => props.$fontSize};
70
+ background-color: ${props => props.$disabled ? '#F5F5F5' : 'white'};
71
+ text-overflow: ellipsis;
72
+
73
+ &:focus {
74
+ outline: none;
75
+ border: ${props => props.$isModified ? `1px solid ${TMColors.isModified}` : '1px solid rgb(180,180,180)'};
76
+ border-bottom: 2px solid;
77
+ border-bottom-color: ${props => (props.$vil.length === 0) ? !props.$isModified ? TMColors.primary : TMColors.isModified : editorColorManager(props.$vil)};
78
+ }
79
+ `;
80
+ const OPTIONS_PANEL_MAX_HEIGHT = 220;
81
+ const OPTIONS_PANEL_MIN_HEIGHT = 80;
82
+ const OPTIONS_PANEL_MARGIN = 4;
83
+ // L'elenco aperto con usePortal esce dal contenitore dell'editor: deve stare sopra tutto ciò che può trovarsi nella stessa pagina
84
+ const DROPDOWN_OPTIONS_PANEL_Z_INDEX = 100001;
85
+ const optionsPanelCss = css `
86
+ overflow-y: auto;
87
+ background-color: white;
88
+ border: 1px solid ${TMColors.border_normal};
89
+ border-radius: ${TMEditorsDefaultBorderRadius};
90
+ box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
91
+ `;
92
+ // Elenco ancorato all'editor: resta nel flusso del DOM e quindi soggetto al clipping dei contenitori con overflow
93
+ const StyledOptionsPanel = styled.div `
94
+ ${optionsPanelCss}
95
+ position: absolute;
96
+ top: calc(100% + 2px);
97
+ left: 0;
98
+ right: 0;
99
+ z-index: 10001;
100
+ max-height: ${OPTIONS_PANEL_MAX_HEIGHT}px;
101
+ `;
102
+ // Variante usePortal: posizione calcolata rispetto alla finestra, così l'elenco non viene tagliato da nessun contenitore
103
+ const StyledPortalOptionsPanel = styled.div `
104
+ ${optionsPanelCss}
105
+ position: fixed;
106
+ left: ${props => props.$left}px;
107
+ ${props => props.$top !== undefined ? `top: ${props.$top}px;` : ''}
108
+ ${props => props.$bottom !== undefined ? `bottom: ${props.$bottom}px;` : ''}
109
+ width: ${props => props.$width}px;
110
+ z-index: ${DROPDOWN_OPTIONS_PANEL_Z_INDEX};
111
+ max-height: ${props => props.$maxHeight}px;
112
+ `;
113
+ const StyledOption = styled.div `
114
+ padding: 5px 9px;
115
+ font-size: ${props => props.$fontSize};
116
+ cursor: pointer;
117
+ white-space: nowrap;
118
+ overflow: hidden;
119
+ text-overflow: ellipsis;
120
+ font-weight: ${props => props.$isSelected ? 600 : 'normal'};
121
+ background-color: ${props => props.$isHighlighted ? TMColors.primary_container : 'transparent'};
122
+ `;
123
+ const StyledNoOptions = styled.div `
124
+ padding: 5px 9px;
125
+ font-size: ${props => props.$fontSize};
126
+ color: ${TMColors.disabled};
127
+ `;
128
+ // L'elenco si apre sotto l'editor se c'è spazio, altrimenti sopra, e in ogni caso non esce dalla finestra
129
+ const calcOptionsPanelPosition = (rect) => {
130
+ const spaceBelow = window.innerHeight - rect.bottom - OPTIONS_PANEL_MARGIN;
131
+ const spaceAbove = rect.top - OPTIONS_PANEL_MARGIN;
132
+ const openUpwards = spaceBelow < OPTIONS_PANEL_MAX_HEIGHT && spaceAbove > spaceBelow;
133
+ const availableHeight = openUpwards ? spaceAbove : spaceBelow;
134
+ return {
135
+ left: Math.max(OPTIONS_PANEL_MARGIN, Math.min(rect.left, window.innerWidth - rect.width - OPTIONS_PANEL_MARGIN)),
136
+ top: openUpwards ? undefined : rect.bottom + OPTIONS_PANEL_MARGIN,
137
+ bottom: openUpwards ? window.innerHeight - rect.top + OPTIONS_PANEL_MARGIN : undefined,
138
+ width: rect.width,
139
+ maxHeight: Math.max(OPTIONS_PANEL_MIN_HEIGHT, Math.min(OPTIONS_PANEL_MAX_HEIGHT, availableHeight)),
140
+ };
141
+ };
142
+ const TMDropDown = ({ validationItems = [], disabled = false, elementStyle, isModifiedWhen, labelPosition = 'left', label, icon, width = '100%', fontSize = FontSize.defaultFontSize, dataSource, value, searchEnabled = false, usePortal = false, itemRender, onValueChanged, buttons = [], placeHolder, }) => {
58
143
  const [isFocused, setIsFocused] = useState(false);
59
- const renderedLeftLabelTextBox = () => (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, children: label }), _jsxs(StyledDropDownWrapper, { "$width": width, children: [_jsxs(StyledDropDown, { value: value, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), "$disabled": disabled, disabled: disabled, "$fontSize": fontSize, "$isModified": isModifiedWhen, "$vil": validationItems, onChange: onValueChanged, children: [placeHolder && _jsx("option", { value: "", disabled: true, hidden: true, children: placeHolder }), dataSource?.map((data, index) => (_jsx("option", { value: data.value, children: data.display }, index)))] }), buttons.length > 0 && (_jsx(ButtonsContainer, { children: buttons.map((buttonItem) => (_jsx(StyledDropDownEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text))) })), _jsx(CustomArrow, {})] }), _jsx(TMVilViewer, { vil: validationItems })] }) })] }));
144
+ const [isOpen, setIsOpen] = useState(false);
145
+ const [searchText, setSearchText] = useState('');
146
+ const [highlightedIndex, setHighlightedIndex] = useState(-1);
147
+ const [optionsPanelPosition, setOptionsPanelPosition] = useState();
148
+ const optionsPanelRef = useRef(null);
149
+ const dropDownWrapperRef = useRef(null);
150
+ const selectedItem = dataSource?.find(o => String(o.value) === String(value));
151
+ // A elenco chiuso l'input mostra la voce selezionata, ad elenco aperto il testo digitato
152
+ const filteredDataSource = (!isOpen || !searchText) ? (dataSource ?? []) : (dataSource ?? []).filter(o => String(o.display ?? '').toLocaleLowerCase().includes(searchText.toLocaleLowerCase()));
153
+ // Mantiene visibile la voce evidenziata durante la navigazione da tastiera
154
+ useEffect(() => {
155
+ if (!isOpen || highlightedIndex < 0)
156
+ return;
157
+ const option = optionsPanelRef.current?.children[highlightedIndex];
158
+ option?.scrollIntoView({ block: 'nearest' });
159
+ }, [isOpen, highlightedIndex]);
160
+ // Solo nel portal la posizione va ricalcolata: essendo fissa non segue lo scorrimento o il ridimensionamento del contenitore
161
+ useEffect(() => {
162
+ if (!isOpen || !usePortal)
163
+ return;
164
+ const updatePosition = () => updateOptionsPanelPosition();
165
+ window.addEventListener('scroll', updatePosition, true);
166
+ window.addEventListener('resize', updatePosition);
167
+ return () => {
168
+ window.removeEventListener('scroll', updatePosition, true);
169
+ window.removeEventListener('resize', updatePosition);
170
+ };
171
+ }, [isOpen, usePortal]);
172
+ const updateOptionsPanelPosition = () => {
173
+ const rect = dropDownWrapperRef.current?.getBoundingClientRect();
174
+ if (rect)
175
+ setOptionsPanelPosition(calcOptionsPanelPosition(rect));
176
+ };
177
+ const openOptions = () => {
178
+ if (disabled)
179
+ return;
180
+ if (usePortal)
181
+ updateOptionsPanelPosition();
182
+ setIsOpen(true);
183
+ setSearchText('');
184
+ setHighlightedIndex(dataSource?.findIndex(o => String(o.value) === String(value)) ?? -1);
185
+ };
186
+ const closeOptions = () => {
187
+ setIsOpen(false);
188
+ setSearchText('');
189
+ setHighlightedIndex(-1);
190
+ };
191
+ const selectItem = (item) => {
192
+ closeOptions();
193
+ // La select nativa notifica un ChangeEvent: qui viene ricostruito il solo dato letto dai consumatori (target.value)
194
+ onValueChanged?.({ target: { value: String(item.value) } });
195
+ };
196
+ const onSearchKeyDown = (e) => {
197
+ switch (e.key) {
198
+ case 'ArrowDown':
199
+ case 'ArrowUp':
200
+ e.preventDefault();
201
+ if (!isOpen) {
202
+ openOptions();
203
+ return;
204
+ }
205
+ if (filteredDataSource.length <= 0)
206
+ return;
207
+ setHighlightedIndex(prev => {
208
+ const delta = e.key === 'ArrowDown' ? 1 : -1;
209
+ const next = prev + delta;
210
+ if (next < 0)
211
+ return filteredDataSource.length - 1;
212
+ if (next >= filteredDataSource.length)
213
+ return 0;
214
+ return next;
215
+ });
216
+ break;
217
+ case 'Enter': {
218
+ if (!isOpen)
219
+ return;
220
+ e.preventDefault();
221
+ const item = filteredDataSource[highlightedIndex] ?? filteredDataSource[0];
222
+ if (item)
223
+ selectItem(item);
224
+ break;
225
+ }
226
+ case 'Escape':
227
+ if (isOpen) {
228
+ e.preventDefault();
229
+ closeOptions();
230
+ }
231
+ break;
232
+ }
233
+ };
234
+ const renderOptions = () => (filteredDataSource.length > 0
235
+ ? filteredDataSource.map((data, index) => (_jsx(StyledOption, { $fontSize: fontSize, $isSelected: String(data.value) === String(value), $isHighlighted: index === highlightedIndex, onMouseEnter: () => setHighlightedIndex(index), onClick: () => selectItem(data), children: itemRender ? itemRender(data) : data.display }, index)))
236
+ : _jsx(StyledNoOptions, { $fontSize: fontSize, children: SDKUI_Localizator.NoDataToDisplay }));
237
+ // onMouseDown va bloccato: senza preventDefault il blur dell'input chiuderebbe l'elenco prima del click
238
+ const renderOptionsPanel = () => {
239
+ if (!isOpen)
240
+ return null;
241
+ if (!usePortal) {
242
+ return (_jsx(StyledOptionsPanel, { ref: optionsPanelRef, onMouseDown: (e) => e.preventDefault(), children: renderOptions() }));
243
+ }
244
+ if (!optionsPanelPosition)
245
+ return null;
246
+ return createPortal(_jsx(StyledPortalOptionsPanel, { ref: optionsPanelRef, $left: optionsPanelPosition.left, $top: optionsPanelPosition.top, $bottom: optionsPanelPosition.bottom, $width: optionsPanelPosition.width, $maxHeight: optionsPanelPosition.maxHeight, onMouseDown: (e) => e.preventDefault(), children: renderOptions() }), document.body);
247
+ };
248
+ const renderSearchableDropDown = () => (_jsxs(_Fragment, { children: [_jsx(StyledSearchInput, { value: isOpen ? searchText : (selectedItem?.display ?? ''), placeholder: isOpen ? SDKUI_Localizator.Search : placeHolder, readOnly: disabled, disabled: disabled, $disabled: disabled, $fontSize: fontSize, $isModified: isModifiedWhen, $vil: validationItems, onFocus: () => { setIsFocused(true); openOptions(); }, onBlur: () => { setIsFocused(false); closeOptions(); }, onClick: () => { if (!isOpen)
249
+ openOptions(); }, onChange: (e) => { setSearchText(e.target.value); setIsOpen(true); setHighlightedIndex(0); }, onKeyDown: onSearchKeyDown }), renderOptionsPanel()] }));
250
+ const renderNativeDropDown = () => (_jsxs(StyledDropDown, { value: value, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), $disabled: disabled, disabled: disabled, $fontSize: fontSize, $isModified: isModifiedWhen, $vil: validationItems, onChange: onValueChanged, children: [placeHolder && _jsx("option", { value: "", disabled: true, hidden: true, children: placeHolder }), dataSource?.map((data, index) => (_jsx("option", { value: data.value, children: data.display }, index)))] }));
251
+ const renderedLeftLabelTextBox = () => (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { $disabled: disabled, $vil: validationItems, $isModified: isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { $width: width, children: [label && _jsx(StyledEditorLabel, { $isFocused: isFocused, $labelPosition: labelPosition, $disabled: disabled, children: label }), _jsxs(StyledDropDownWrapper, { ref: dropDownWrapperRef, $width: width, children: [searchEnabled ? renderSearchableDropDown() : renderNativeDropDown(), buttons.length > 0 && (_jsx(ButtonsContainer, { children: buttons.map((buttonItem) => (_jsx(StyledDropDownEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.tooltipContent ?? buttonItem.text, children: buttonItem.icon }) }, buttonItem.text))) })), _jsx(CustomArrow, {})] }), _jsx(TMVilViewer, { vil: validationItems })] }) })] }));
60
252
  return _jsx("div", { style: elementStyle, children: renderedLeftLabelTextBox() });
61
253
  };
62
254
  export default TMDropDown;
@@ -7,7 +7,7 @@ export declare const StyledEditorContainer: import("styled-components/dist/types
7
7
  }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$width"> & {
8
8
  $width: string;
9
9
  }, never>>> & string;
10
- export declare const StyledEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$width" | "$borderRadius" | "$fontSize" | "$type" | "$disabled" | "$vil" | "$isModified" | "$maxValue" | "$isMobile"> & {
10
+ export declare const StyledEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$borderRadius" | "$disabled" | "$fontSize" | "$isMobile" | "$isModified" | "$maxValue" | "$type" | "$vil" | "$width"> & {
11
11
  $vil: ValidationItem[];
12
12
  $width: string;
13
13
  $type: string;
@@ -17,7 +17,7 @@ export declare const StyledEditor: import("styled-components/dist/types").IStyle
17
17
  $disabled: boolean;
18
18
  $isMobile?: boolean;
19
19
  $borderRadius?: string;
20
- }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$width" | "$borderRadius" | "$fontSize" | "$type" | "$disabled" | "$vil" | "$isModified" | "$maxValue" | "$isMobile"> & {
20
+ }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$borderRadius" | "$disabled" | "$fontSize" | "$isMobile" | "$isModified" | "$maxValue" | "$type" | "$vil" | "$width"> & {
21
21
  $vil: ValidationItem[];
22
22
  $width: string;
23
23
  $type: string;
@@ -28,29 +28,29 @@ export declare const StyledEditor: import("styled-components/dist/types").IStyle
28
28
  $isMobile?: boolean;
29
29
  $borderRadius?: string;
30
30
  }, never>>> & string;
31
- export declare const StyledEditorIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$disabled" | "$vil" | "$isModified"> & {
31
+ export declare const StyledEditorIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$disabled" | "$isModified" | "$vil"> & {
32
32
  $vil: ValidationItem[];
33
33
  $disabled: boolean;
34
34
  $isModified: boolean;
35
- }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$disabled" | "$vil" | "$isModified"> & {
35
+ }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$disabled" | "$isModified" | "$vil"> & {
36
36
  $vil: ValidationItem[];
37
37
  $disabled: boolean;
38
38
  $isModified: boolean;
39
39
  }, never>>> & string;
40
- export declare const StyledEditorLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$fontSize" | "$disabled" | "$isFocused" | "$labelPosition"> & {
40
+ export declare const StyledEditorLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$disabled" | "$fontSize" | "$isFocused" | "$labelPosition"> & {
41
41
  $isFocused: boolean;
42
- $labelPosition: "right" | "left" | "top";
42
+ $labelPosition: 'right' | 'left' | 'top';
43
43
  $disabled: boolean;
44
44
  $fontSize?: string;
45
45
  $color?: string;
46
- }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$fontSize" | "$disabled" | "$isFocused" | "$labelPosition"> & {
46
+ }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$disabled" | "$fontSize" | "$isFocused" | "$labelPosition"> & {
47
47
  $isFocused: boolean;
48
- $labelPosition: "right" | "left" | "top";
48
+ $labelPosition: 'right' | 'left' | 'top';
49
49
  $disabled: boolean;
50
50
  $fontSize?: string;
51
51
  $color?: string;
52
52
  }, never>>> & string;
53
- export declare const StyledTextareaEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$width" | "$maxHeight" | "$borderRadius" | "$fontSize" | "$disabled" | "$vil" | "$isModified" | "$isMobile" | "$resize"> & {
53
+ export declare const StyledTextareaEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$borderRadius" | "$disabled" | "$fontSize" | "$isMobile" | "$isModified" | "$maxHeight" | "$resize" | "$vil" | "$width"> & {
54
54
  $vil: ValidationItem[];
55
55
  $width: string;
56
56
  $isModified: boolean;
@@ -60,7 +60,7 @@ export declare const StyledTextareaEditor: import("styled-components/dist/types"
60
60
  $maxHeight?: string;
61
61
  $borderRadius?: string;
62
62
  $resize?: boolean;
63
- }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$width" | "$maxHeight" | "$borderRadius" | "$fontSize" | "$disabled" | "$vil" | "$isModified" | "$isMobile" | "$resize"> & {
63
+ }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$borderRadius" | "$disabled" | "$fontSize" | "$isMobile" | "$isModified" | "$maxHeight" | "$resize" | "$vil" | "$width"> & {
64
64
  $vil: ValidationItem[];
65
65
  $width: string;
66
66
  $isModified: boolean;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useRef, useState } from 'react';
3
3
  import { ValidationItem, SDK_Globals, MetadataDataTypes, DBBrands, ResultTypes } from '@topconsultnpm/sdk-ts';
4
4
  import { TreeView } from 'devextreme-react';
@@ -73,6 +73,6 @@ const TMHtmlContentDisplay = (props) => {
73
73
  updatedMarkup = convertLinksToAnchors(updatedMarkup);
74
74
  updatedMarkup = addMentionStyling(updatedMarkup, usersName);
75
75
  updatedMarkup = highlightText(updatedMarkup, searchText);
76
- return (_jsx(Wrapper, { "$isSelected": isSelected, children: _jsx("div", { dangerouslySetInnerHTML: { __html: updatedMarkup } }) }));
76
+ return (_jsx(Wrapper, { $isSelected: isSelected, children: _jsx("div", { dangerouslySetInnerHTML: { __html: updatedMarkup } }) }));
77
77
  };
78
78
  export default TMHtmlContentDisplay;
@@ -122,6 +122,6 @@ const TMLocalizedTextBox = ({ label, value, value_IT, value_EN, value_FR, value_
122
122
  icon: (_jsxs(IconContainer, { children: [_jsx(IconLanguage, {}), localizedCount > 0 && _jsx(Badge, { children: localizedCount })] })),
123
123
  onClick: handleTogglePopover,
124
124
  };
125
- return (_jsxs(LocalizedContainer, { ref: containerRef, children: [(qd || tid) ? (_jsx(TMMetadataTextBox, { type: "text", label: label, value: value, isModifiedWhen: isModifiedWhen, buttons: [localizationButton], validationItems: validationItems, qd: qd, tid: tid, readOnly: readOnly, onValueChanged: (e) => onValueChanged(CultureIDs.None, e.target.value) })) : (_jsx(TMTextBox, { type: "text", label: label, value: value, isModifiedWhen: isModifiedWhen, buttons: [localizationButton], validationItems: validationItems, readOnly: readOnly, onValueChanged: (e) => onValueChanged(CultureIDs.None, e.target.value) })), isPopoverVisible && (_jsx(Portal, { popoverRef: popoverRef, children: _jsx(Popover, { ref: popoverRef, "$isVisible": isPopoverVisible, "$top": popoverPosition.top, "$left": popoverPosition.left, "$width": popoverPosition.width, onMouseDown: (e) => e.stopPropagation(), children: languages.map((lang) => ((qd || tid) ? (_jsx(TMMetadataTextBox, { label: `${lang.label}`, showClearButton: true, icon: _jsx("img", { src: getCultureIDImg(lang.code), alt: "Lang", width: 18, height: 18 }), value: lang.value || '', qd: qd, tid: tid, readOnly: readOnly, onValueChanged: (e) => onValueChanged(lang.code, e.target.value) }, lang.code)) : (_jsx(TMTextBox, { label: `${lang.label}`, showClearButton: true, icon: _jsx("img", { src: getCultureIDImg(lang.code), alt: "Lang", width: 18, height: 18 }), value: lang.value || '', readOnly: readOnly, onValueChanged: (e) => onValueChanged(lang.code, e.target.value) }, lang.code)))) }) }))] }));
125
+ return (_jsxs(LocalizedContainer, { ref: containerRef, children: [(qd || tid) ? (_jsx(TMMetadataTextBox, { type: "text", label: label, value: value, isModifiedWhen: isModifiedWhen, buttons: [localizationButton], validationItems: validationItems, qd: qd, tid: tid, readOnly: readOnly, onValueChanged: (e) => onValueChanged(CultureIDs.None, e.target.value) })) : (_jsx(TMTextBox, { type: "text", label: label, value: value, isModifiedWhen: isModifiedWhen, buttons: [localizationButton], validationItems: validationItems, readOnly: readOnly, onValueChanged: (e) => onValueChanged(CultureIDs.None, e.target.value) })), isPopoverVisible && (_jsx(Portal, { popoverRef: popoverRef, children: _jsx(Popover, { ref: popoverRef, $isVisible: isPopoverVisible, $top: popoverPosition.top, $left: popoverPosition.left, $width: popoverPosition.width, onMouseDown: (e) => e.stopPropagation(), children: languages.map((lang) => ((qd || tid) ? (_jsx(TMMetadataTextBox, { label: `${lang.label}`, showClearButton: true, icon: _jsx("img", { src: getCultureIDImg(lang.code), alt: "Lang", width: 18, height: 18 }), value: lang.value || '', qd: qd, tid: tid, readOnly: readOnly, onValueChanged: (e) => onValueChanged(lang.code, e.target.value) }, lang.code)) : (_jsx(TMTextBox, { label: `${lang.label}`, showClearButton: true, icon: _jsx("img", { src: getCultureIDImg(lang.code), alt: "Lang", width: 18, height: 18 }), value: lang.value || '', readOnly: readOnly, onValueChanged: (e) => onValueChanged(lang.code, e.target.value) }, lang.code)))) }) }))] }));
126
126
  };
127
127
  export default TMLocalizedTextBox;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useCallback, useEffect, useMemo, useState } from "react";
3
3
  import styled from "styled-components";
4
4
  import { AccessLevels, AppModules, DcmtTypeListCacheService, LayoutGroupBorderStyles, LayoutGroupOrientations, LayoutItemTypes, LayoutModes, MetadataDataDomains, MetadataDataTypes, SDK_Globals, SystemMIDsAsNumber, SystemTIDs, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
@@ -754,7 +754,7 @@ const TMLayoutTabPanel = React.memo(({ tabItems }) => {
754
754
  const handleSelectedIndexChange = useCallback((index) => {
755
755
  setActiveTabIndex(index);
756
756
  }, []);
757
- return (_jsx(TabPanel, { width: "100%", height: "100%", animationEnabled: false, swipeEnabled: false, loop: false, showNavButtons: true, repaintChangesOnly: true, stylingMode: "primary", iconPosition: 'start', tabsPosition: 'top', selectedIndex: activeTabIndex, onSelectedIndexChange: handleSelectedIndexChange, children: tabItems.map((tabItem, index) => (_jsx(Item, { title: tabItem.title, tabRender: () => (_jsxs(StyledTabItem, { "$isSelected": activeTabIndex === index, "$activeGradient": getAppModuleGradient(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER), children: [_jsx("span", { children: tabItem.title }), tabItem.errorCount !== undefined && tabItem.errorCount > 0 && (_jsx(TMTooltip, { content: _jsxs("div", { style: {
757
+ return (_jsx(TabPanel, { width: "100%", height: "100%", animationEnabled: false, swipeEnabled: false, loop: false, showNavButtons: true, repaintChangesOnly: true, stylingMode: "primary", iconPosition: 'start', tabsPosition: 'top', selectedIndex: activeTabIndex, onSelectedIndexChange: handleSelectedIndexChange, children: tabItems.map((tabItem, index) => (_jsx(Item, { title: tabItem.title, tabRender: () => (_jsxs(StyledTabItem, { $isSelected: activeTabIndex === index, $activeGradient: getAppModuleGradient(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER), children: [_jsx("span", { children: tabItem.title }), tabItem.errorCount !== undefined && tabItem.errorCount > 0 && (_jsx(TMTooltip, { content: _jsxs("div", { style: {
758
758
  minWidth: '240px',
759
759
  padding: '14px',
760
760
  borderRadius: '10px',
@@ -54,8 +54,8 @@ const StyledradioButtonLabel = styled.label `
54
54
  `;
55
55
  const TMRadioButton = ({ isModifiedWhen, flexBase = 1, elementStyle, label, value, fontSize = FontSize.defaultFontSize, dataSource = [], direction = 'row', onValueChanged, disabled = false }) => {
56
56
  const renderedRadioButtons = () => {
57
- return (_jsx(StyledRadioButtonWrapper, { "$direction": direction, children: dataSource.map((data, index) => (_jsxs(StyledRadioButtoncontainer, { children: [_jsx(StyledRadioButton, { "$disabled": disabled, tabIndex: -1, name: makeID(8), checked: value === data.value ? true : false, onChange: () => onValueChanged(data.value), disabled: disabled, type: 'radio' }), _jsxs(StyledradioButtonLabel, { tabIndex: 0, onKeyDown: (e) => e.code === 'Space' && onValueChanged(data.value), onClick: () => onValueChanged(data.value), "$isModifiedWhen": isModifiedWhen, "$fontSize": fontSize, "$disabled": disabled, children: [" ", data.display, " "] })] }, index))) }));
57
+ return (_jsx(StyledRadioButtonWrapper, { $direction: direction, children: dataSource.map((data, index) => (_jsxs(StyledRadioButtoncontainer, { children: [_jsx(StyledRadioButton, { $disabled: disabled, tabIndex: -1, name: makeID(8), checked: value === data.value ? true : false, onChange: () => onValueChanged(data.value), disabled: disabled, type: 'radio' }), _jsxs(StyledradioButtonLabel, { tabIndex: 0, onKeyDown: (e) => e.code === 'Space' && onValueChanged(data.value), onClick: () => onValueChanged(data.value), $isModifiedWhen: isModifiedWhen, $fontSize: fontSize, $disabled: disabled, children: [" ", data.display, " "] })] }, index))) }));
58
58
  };
59
- return (_jsx("div", { style: elementStyle, children: _jsxs(StyledWrapper, { "$isModifiedWhen": isModifiedWhen, "$direction": direction, "$disabled": disabled, "$fontSize": fontSize, style: { display: 'flex', flexDirection: direction, alignItems: direction === 'row' ? 'center' : 'flex-start', fontSize: fontSize, gap: direction === 'row' ? '20px' : "10px" }, children: [label && _jsx(StyledRadioGroupLabel, { "$flexBase": flexBase, children: label }), _jsx(StyledRadioGroupContainer, { "$flexBase": flexBase, children: renderedRadioButtons() })] }) }));
59
+ return (_jsx("div", { style: elementStyle, children: _jsxs(StyledWrapper, { $isModifiedWhen: isModifiedWhen, $direction: direction, $disabled: disabled, $fontSize: fontSize, style: { display: 'flex', flexDirection: direction, alignItems: direction === 'row' ? 'center' : 'flex-start', fontSize: fontSize, gap: direction === 'row' ? '20px' : "10px" }, children: [label && _jsx(StyledRadioGroupLabel, { $flexBase: flexBase, children: label }), _jsx(StyledRadioGroupContainer, { $flexBase: flexBase, children: renderedRadioButtons() })] }) }));
60
60
  };
61
61
  export default TMRadioButton;
@@ -61,7 +61,7 @@ const TMSummary = forwardRef(({ placeHolder, readOnly, labelColor, hasValue, bor
61
61
  onClearClick?.();
62
62
  };
63
63
  const renderTemplateField = () => {
64
- return (_jsxs(StyledSummaryTemplateInput, { ref: summaryElementRef, "$readOnly": readOnly, tabIndex: 0, "$backgroundColor": backgroundColor, "$borderRadius": borderRadius, "$isModified": isModifiedWhen, "$vil": validationItems, "$disabled": disabled, "$showBorder": showBorder, "$fontSize": fontSize, "$width": width, "$height": height, onChange: onValueChanged, children: [_jsx("div", { onClick: () => { if (openEditorOnSummaryClick && !disabled)
64
+ return (_jsxs(StyledSummaryTemplateInput, { ref: summaryElementRef, $readOnly: readOnly, tabIndex: 0, $backgroundColor: backgroundColor, $borderRadius: borderRadius, $isModified: isModifiedWhen, $vil: validationItems, $disabled: disabled, $showBorder: showBorder, $fontSize: fontSize, $width: width, $height: height, onChange: onValueChanged, children: [_jsx("div", { onClick: () => { if (openEditorOnSummaryClick && !disabled)
65
65
  onEditorClick?.(); }, onDoubleClick: () => { if (!openEditorOnSummaryClick && !disabled)
66
66
  onEditorClick?.(); }, style: {
67
67
  display: 'flex',
@@ -82,10 +82,10 @@ const TMSummary = forwardRef(({ placeHolder, readOnly, labelColor, hasValue, bor
82
82
  })] })] }));
83
83
  };
84
84
  const renderLabel = () => {
85
- return (_jsx(StyledEditorLabel, { "$color": labelColor, "$isFocused": false, "$labelPosition": labelPosition, "$disabled": disabled, children: _jsx("div", { style: { flexDirection: "row", display: "flex", alignItems: "start", justifyContent: "start" }, children: label }) }));
85
+ return (_jsx(StyledEditorLabel, { $color: labelColor, $isFocused: false, $labelPosition: labelPosition, $disabled: disabled, children: _jsx("div", { style: { flexDirection: "row", display: "flex", alignItems: "start", justifyContent: "start" }, children: label }) }));
86
86
  };
87
87
  const renderSummary = () => {
88
- return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: icon && _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && renderLabel(), renderTemplateField(), _jsx(TMVilViewer, { vil: validationItems })] }) })] }));
88
+ return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: icon && _jsx(StyledEditorIcon, { $disabled: disabled, $vil: validationItems, $isModified: isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { $width: width, children: [label && renderLabel(), renderTemplateField(), _jsx(TMVilViewer, { vil: validationItems })] }) })] }));
89
89
  };
90
90
  return (_jsx("div", { style: elementStyle, children: renderSummary() }));
91
91
  });
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useRef, useId } from 'react';
3
3
  import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, StyledTextareaEditor } from './TMEditorStyled';
4
4
  import { FontSize, TMColors } from '../../utils/theme';
@@ -160,7 +160,7 @@ const TMTextArea = (props) => {
160
160
  newValue = newValue.toUpperCase();
161
161
  setCurrentValue(newValue);
162
162
  onValueChanged?.({ ...e, target: { ...e.target, value: newValue } });
163
- }, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize, style: fillHeight ? { flex: 1, height: 0 } : undefined }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: '50%', transform: 'translateY(-50%)', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
163
+ }, $isMobile: deviceType === DeviceType.MOBILE, $maxHeight: maxHeight, $disabled: disabled, $vil: validationItems, $isModified: isModifiedWhen, $fontSize: fontSize, $width: width, $resize: resize, style: fillHeight ? { flex: 1, height: 0 } : undefined }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: '50%', transform: 'translateY(-50%)', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
164
164
  _jsx(StyledTextAreaEditorButton, { onClick: () => {
165
165
  setShowFormulaItemsChooser(true);
166
166
  }, children: _jsx(IconDataList, {}) }), showClearButton && currentValue &&
@@ -181,7 +181,7 @@ const TMTextArea = (props) => {
181
181
  };
182
182
  // Layout for the textarea with a left-aligned label
183
183
  const renderedLeftLabelTextArea = () => {
184
- return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, style: fillHeight ? { height: '100%', display: 'flex', flexDirection: 'column' } : {}, children: [label && _jsx(StyledEditorLabel, { "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, children: label ?? '' }), renderTextArea()] }) })] }));
184
+ return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { $disabled: disabled, $vil: validationItems, $isModified: isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { $width: width, style: fillHeight ? { height: '100%', display: 'flex', flexDirection: 'column' } : {}, children: [label && _jsx(StyledEditorLabel, { $isFocused: isFocused, $labelPosition: labelPosition, $disabled: disabled, children: label ?? '' }), renderTextArea()] }) })] }));
185
185
  };
186
186
  return (_jsx("div", { style: { ...elementStyle, ...(fillHeight ? { height: '100%' } : {}) }, children: renderedLeftLabelTextArea() }));
187
187
  };
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useRef } from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { StyledEditor, StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, editorColorManager } from './TMEditorStyled';
@@ -303,7 +303,7 @@ const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, pre
303
303
  e.preventDefault();
304
304
  }
305
305
  onKeyDown?.(e);
306
- }, "$isMobile": deviceType === DeviceType.MOBILE, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType, "$borderRadius": borderRadius, style: { paddingLeft: `${calculateLeftPadding()}px`, paddingRight: `${calculateRightPadding()}px`, cursor: onClick ? 'pointer' : undefined } }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), (formulaItems.length > 0 || (showClearButton && currentValue) || buttons.length > 0) &&
306
+ }, $isMobile: deviceType === DeviceType.MOBILE, $disabled: disabled, $vil: validationItems, $isModified: isModifiedWhen, $fontSize: fontSize, $maxValue: maxValue, $width: width, $type: currentType, $borderRadius: borderRadius, style: { paddingLeft: `${calculateLeftPadding()}px`, paddingRight: `${calculateRightPadding()}px`, cursor: onClick ? 'pointer' : undefined } }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, $disabled: disabled, $vil: validationItems, $isModified: isModifiedWhen, children: showPasswordIcon() }), (formulaItems.length > 0 || (showClearButton && currentValue) || buttons.length > 0) &&
307
307
  _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : (initialType === 'password' ? '34px' : '6px'), top: '50%', transform: 'translateY(-50%)', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
308
308
  _jsx(StyledTextBoxEditorButton, { onClick: () => {
309
309
  setShowFormulaItemsChooser(true);
@@ -313,7 +313,7 @@ const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, pre
313
313
  })] }), openFormulaItemsChooser(), formulaItems.length > 0 && (_jsx(TMContextMenu, { items: formulaMenuItems, target: `#text-${id}` }))] }), _jsx(TMVilViewer, { vil: validationItems })] }) }));
314
314
  };
315
315
  const renderedLeftLabelTextBox = () => {
316
- return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$color": labelColor, "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, children: label }), renderInputField()] }) })] }));
316
+ return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { $disabled: disabled, $vil: validationItems, $isModified: isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { $width: width, children: [label && _jsx(StyledEditorLabel, { $color: labelColor, $isFocused: isFocused, $labelPosition: labelPosition, $disabled: disabled, children: label }), renderInputField()] }) })] }));
317
317
  };
318
318
  return (_jsx("div", { style: elementStyle, children: renderedLeftLabelTextBox() }));
319
319
  };
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo, useState } from 'react';
3
3
  import { IconClear, IconColumns, SDKUI_Localizator, stringIsNullOrEmpty } from '../../helper';
4
4
  import { TMMetadataChooserForm } from '../choosers/TMMetadataChooser';
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React, { useEffect, useMemo, useState } from 'react';
2
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
3
3
  import Logo from '../../../assets/Toppy-generico.png';
4
4
  import { ArchiveConstraints, DcmtTypeListCacheService, LayoutModes, SDK_Localizator } from '@topconsultnpm/sdk-ts';
5
5
  import { IconTree, SDKUI_Globals, SDKUI_Localizator, IconRecentlyViewed, IconPreview, IconShow, IconBoard, IconDcmtTypeSys, removeMruTid, getMoreInfoTasksForDocument } from '../../../helper';
@@ -56,6 +56,13 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
56
56
  previousTIDRef.current = currentTID;
57
57
  }, [currentTID, onDcmtTypeSelect, isSharedArchive]);
58
58
  const isMobile = deviceType === DeviceType.MOBILE;
59
+ // Scorciatoie: rilegge dal server l'elenco dei tipi documento, così le scorciatoie riflettono
60
+ // quelli aggiunti o rimossi. La nuova identità di mruTIDs fa ricaricare i descrittori a TMRecentsManager.
61
+ const refreshRecentsAsync = useCallback(async () => {
62
+ DcmtTypeListCacheService.RemoveAllWithoutMetadata();
63
+ await DcmtTypeListCacheService.GetAllWithoutMetadataAsync();
64
+ setMruTIDs([...SDKUI_Globals.userSettings.archivingSettings.mruTIDs]);
65
+ }, []);
59
66
  const tmTreeSelectorElement = useMemo(() => _jsx(TMTreeSelectorWrapper, { isMobile: isMobile, isSharedArchive: isSharedArchive, onSelectedTIDChanged: (tid) => {
60
67
  setCurrentTID(tid);
61
68
  if (tid && mruTIDs.includes(tid))
@@ -108,7 +115,14 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
108
115
  {
109
116
  id: 'tmRecentsManager',
110
117
  name: SDKUI_Localizator.Shortcuts,
111
- contentOptions: { component: tmRecentsManagerElement, panelContainer: { title: SDKUI_Localizator.Shortcuts, totalItems: mruTIDs.length } },
118
+ contentOptions: {
119
+ component: tmRecentsManagerElement,
120
+ panelContainer: {
121
+ title: SDKUI_Localizator.Shortcuts,
122
+ totalItems: mruTIDs.length,
123
+ onRefresh: refreshRecentsAsync
124
+ }
125
+ },
112
126
  toolbarOptions: { icon: _jsx(IconRecentlyViewed, { fontSize: 24 }), visible: true, orderNumber: 2, isActive: allInitialPanelVisibility['tmRecentsManager'] }
113
127
  },
114
128
  {
@@ -139,7 +153,7 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
139
153
  }
140
154
  ]
141
155
  },
142
- ], [tmTreeSelectorElement, tmRecentsManagerElement, tmFormElement, currentTID, mruTIDs, isSharedArchive]);
156
+ ], [tmTreeSelectorElement, tmRecentsManagerElement, tmFormElement, currentTID, mruTIDs, isSharedArchive, refreshRecentsAsync]);
143
157
  return (_jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmRecentsManager', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }));
144
158
  };
145
159
  export default TMArchive;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useRef, useState } from 'react';
3
3
  import ReactDOM from 'react-dom';
4
4
  import styled from 'styled-components';
@@ -433,7 +433,7 @@ const TMToppyDraggableHelpCenter = (props) => {
433
433
  window.removeEventListener('resize', handleResize);
434
434
  };
435
435
  }, []);
436
- const toppyContent = (_jsxs(_Fragment, { children: [isDragging && _jsx(DragOverlay, {}), _jsxs(TMToppyButton, { ref: toppyButtonRef, "$align": align, "$isDragging": isDragging, "$isVisible": isVisible, "$isCollapsed": isCollapsed, "$isMobile": isMobile, "$usePortal": usePortal, onContextMenu: (e) => e.preventDefault(), onMouseDown: !isMobile ? handleMouseDown : undefined, onTouchStart: isMobile ? handleTouchStart : undefined, onDoubleClick: !isMobile ? toggleCollapse : undefined, "$x": position?.x, "$y": position?.y, children: [(content && !isCollapsed) && _jsx(TMToppySpeechBubble, { ref: bubbleRef, align: align, onClose: toggleCollapse, children: content }), (content && isCollapsed) && (_jsx(ExpandButton, { onMouseDown: (e) => {
436
+ const toppyContent = (_jsxs(_Fragment, { children: [isDragging && _jsx(DragOverlay, {}), _jsxs(TMToppyButton, { ref: toppyButtonRef, $align: align, $isDragging: isDragging, $isVisible: isVisible, $isCollapsed: isCollapsed, $isMobile: isMobile, $usePortal: usePortal, onContextMenu: (e) => e.preventDefault(), onMouseDown: !isMobile ? handleMouseDown : undefined, onTouchStart: isMobile ? handleTouchStart : undefined, onDoubleClick: !isMobile ? toggleCollapse : undefined, $x: position?.x, $y: position?.y, children: [(content && !isCollapsed) && _jsx(TMToppySpeechBubble, { ref: bubbleRef, align: align, onClose: toggleCollapse, children: content }), (content && isCollapsed) && (_jsx(ExpandButton, { onMouseDown: (e) => {
437
437
  isExpandButtonDraggingRef.current = false;
438
438
  expandButtonMouseDownPosRef.current = { x: e.clientX, y: e.clientY };
439
439
  }, onMouseMove: (e) => {
@@ -120,7 +120,7 @@ const TMToppySpeechBubble = forwardRef((props, ref) => {
120
120
  e.stopPropagation();
121
121
  onClose?.();
122
122
  };
123
- return (_jsx(BubbleContainer, { "$align": align, children: _jsxs(BubbleWrapper, { ref: ref, "$hasCloseButton": !!onClose, children: [onClose && (_jsx(CloseButton, { onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onClick: handleClick, "aria-label": SDKUI_Localizator.Minimize, title: SDKUI_Localizator.Minimize, type: "button", children: _jsx(IconWindowMinimize, {}) })), _jsx(Bubble, { "$align": align, children: _jsx(Content, { children: children }) })] }) }));
123
+ return (_jsx(BubbleContainer, { $align: align, children: _jsxs(BubbleWrapper, { ref: ref, $hasCloseButton: !!onClose, children: [onClose && (_jsx(CloseButton, { onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onClick: handleClick, "aria-label": SDKUI_Localizator.Minimize, title: SDKUI_Localizator.Minimize, type: "button", children: _jsx(IconWindowMinimize, {}) })), _jsx(Bubble, { $align: align, children: _jsx(Content, { children: children }) })] }) }));
124
124
  });
125
125
  TMToppySpeechBubble.displayName = 'TMToppySpeechBubble';
126
126
  export default TMToppySpeechBubble;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
3
  import { AccessLevels, DcmtTypeListCacheService, LayoutModes, MetadataDataDomains, ResultTypes, SDK_Globals, ValidationItem } from '@topconsultnpm/sdk-ts';
4
4
  import { searchResultToMetadataValues, getSystemMetadata, calcIsModified, getListMaxItems, SDKUI_Localizator, SDKUI_Globals } from '../../../helper';
@@ -7,7 +7,7 @@ import { DcmtOperationTypes, FormModes } from '../../../ts';
7
7
  import { StyledToolbarCardContainer, StyledFormButtonsContainer } from '../../base/Styled';
8
8
  import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
9
9
  import { TMSplitterLayout } from '../../base/TMLayout';
10
- import { TMExceptionBoxManager } from '../../base/TMPopUp';
10
+ import { TMExceptionBoxManager, TMMessageBoxManager, ButtonNames } from '../../base/TMPopUp';
11
11
  import TMShowAllOrMaxItemsButton from '../../base/TMShowAllOrMaxItemsButton';
12
12
  import TMSpinner from '../../base/TMSpinner';
13
13
  import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
@@ -114,10 +114,24 @@ const TMBatchUpdateForm = ({ inputDcmts, TID, DID, isExpertMode = SDKUI_Globals.
114
114
  const totalItems = metadataValues.filter(o => o.mid && o.mid > 100).length;
115
115
  const metadataValuesSource = metadataValues.filter(o => o.mid && o.mid > 100).slice(0, showAll ? metadataValues.filter(o => o.mid && o.mid > 100).length : listMaxItems);
116
116
  const metadataValuesSourceOrig = metadataValuesOrig.filter(o => o.mid && o.mid > 100).slice(0, showAll ? metadataValuesOrig.filter(o => o.mid && o.mid > 100).length : listMaxItems);
117
+ /**
118
+ * Chiusura del form: con modifiche pendenti chiede conferma prima di scartarle.
119
+ * Il TMModal è montato con askClosingConfirm, quindi non si auto-nasconde: la chiusura
120
+ * effettiva avviene solo quando onBack smonta il componente.
121
+ */
122
+ const handleClose = () => {
123
+ if (!isModified) {
124
+ onBack?.();
125
+ return;
126
+ }
127
+ TMMessageBoxManager.show({
128
+ title: SDKUI_Localizator.Cancel, message: SDKUI_Localizator.ConfirmOnCancel, buttons: [ButtonNames.YES, ButtonNames.NO],
129
+ onButtonClick: (e) => { if (e === ButtonNames.YES)
130
+ onBack?.(); }
131
+ });
132
+ };
117
133
  const renderContent = () => {
118
- return (_jsx(TMLayoutWaitingContainer, { showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorColor: 'transparent', separatorActiveColor: 'transparent', showSeparator: showFormulaEditor, start: showFormulaEditor ? ['50%', '50%'] : ['100%', '0%'], min: ['0', '0'], children: [_jsx(TMPanel, { title: isModal ? 'Modifica i metadati' : `${SDKUI_Localizator.BatchUpdate} (${inputDcmts.length} documenti selezionati)`, onBack: deviceType === DeviceType.MOBILE ? onBack : undefined,
119
- // onClose={deviceType !== DeviceType.MOBILE ? onBack : undefined}
120
- allowMaximize: !isModal, showHeader: !isModal, children: _jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, isExpertMode: isExpertMode, showCheckBoxes: ShowCheckBoxesMode.Always, showNullValueCheckBoxes: true, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, validationItems: validationItems, isOpenDistinctValues: showDistinctValuesPanel, selectedMID: focusedMetadataValue?.mid, onFocusedItemChanged: (item) => { setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
134
+ return (_jsx(TMLayoutWaitingContainer, { showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorColor: 'transparent', separatorActiveColor: 'transparent', showSeparator: showFormulaEditor, start: showFormulaEditor ? ['50%', '50%'] : ['100%', '0%'], min: ['0', '0'], children: [_jsx(TMPanel, { title: isModal ? 'Modifica i metadati' : `${SDKUI_Localizator.BatchUpdate} (${inputDcmts.length} documenti selezionati)`, onBack: deviceType === DeviceType.MOBILE ? handleClose : undefined, allowMaximize: !isModal, showHeader: !isModal, children: _jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, isExpertMode: isExpertMode, showCheckBoxes: ShowCheckBoxesMode.Always, showNullValueCheckBoxes: true, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, validationItems: validationItems, isOpenDistinctValues: showDistinctValuesPanel, selectedMID: focusedMetadataValue?.mid, onFocusedItemChanged: (item) => { setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
121
135
  setMetadataValues((prevItems) => prevItems.map((item) => {
122
136
  const newItem = newItems.find((newItem) => newItem.tid === item.tid && newItem.mid === item.mid);
123
137
  return newItem ? { ...item, ...newItem } : item;
@@ -153,7 +167,7 @@ const TMBatchUpdateForm = ({ inputDcmts, TID, DID, isExpertMode = SDKUI_Globals.
153
167
  } })] }) })] }) }));
154
168
  };
155
169
  return (_jsx(_Fragment, { children: (isModal && onBack)
156
- ? _jsx(TMModal, { title: titleModal, onClose: onBack, width: widthModal ?? '100%', height: heightModal ?? '100%', hidePopup: false, askClosingConfirm: true, children: _jsx("div", { style: { width: "100%", height: "100%", display: 'block', padding: "4px" }, children: renderContent() }) })
170
+ ? _jsx(TMModal, { title: titleModal, onClose: handleClose, width: widthModal ?? '100%', height: heightModal ?? '100%', hidePopup: false, askClosingConfirm: true, children: _jsx("div", { style: { width: "100%", height: "100%", display: 'block', padding: "4px" }, children: renderContent() }) })
157
171
  : renderContent() }));
158
172
  };
159
173
  export default TMBatchUpdateForm;
@@ -3,7 +3,10 @@ import { HomeBlogPost, TaskDescriptor } from '@topconsultnpm/sdk-ts';
3
3
  interface ITMDcmtBlogProps {
4
4
  tid: number | undefined;
5
5
  did: number | undefined;
6
+ /** Il pannello è aperto. La inietta TMPanelWrapper, non va passata dal chiamante */
6
7
  isVisible?: boolean;
8
+ /** La pagina che contiene il pannello è a video: quelle in secondo piano restano montate e non devono caricare */
9
+ isPageVisible?: boolean;
7
10
  fetchBlogDataTrigger?: number;
8
11
  onRefreshBlogDatagrid?: () => Promise<void>;
9
12
  showFloatingCommentButton?: boolean;