@topconsultnpm/sdkui-react 6.22.0-t1 → 6.22.0-t3

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 (286) 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 +45 -43
  4. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
  5. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +80 -73
  6. package/lib/components/base/Styled.d.ts +92 -76
  7. package/lib/components/base/Styled.js +7 -5
  8. package/lib/components/base/TMAccordionNew.js +7 -7
  9. package/lib/components/base/TMAlert.d.ts +32 -32
  10. package/lib/components/base/TMAlert.js +6 -8
  11. package/lib/components/base/TMAreaManager.js +53 -55
  12. package/lib/components/base/TMButton.d.ts +13 -0
  13. package/lib/components/base/TMButton.js +139 -7
  14. package/lib/components/base/TMClosableList.js +3 -3
  15. package/lib/components/base/TMCustomButton.js +40 -48
  16. package/lib/components/base/TMDataGrid.d.ts +4 -0
  17. package/lib/components/base/TMDataGrid.js +292 -12
  18. package/lib/components/base/TMDataGridExportForm.js +39 -30
  19. package/lib/components/base/TMDropDownMenu.js +1 -1
  20. package/lib/components/base/TMEditorBase.d.ts +2 -0
  21. package/lib/components/base/TMFileManager.js +5 -3
  22. package/lib/components/base/TMFileManagerDataGridView.js +12 -3
  23. package/lib/components/base/TMFileManagerThumbnailItems.js +20 -10
  24. package/lib/components/base/TMFileManagerUtils.d.ts +6 -6
  25. package/lib/components/base/TMFileManagerUtils.js +37 -1
  26. package/lib/components/base/TMLayout.d.ts +2 -2
  27. package/lib/components/base/TMLayout.js +3 -3
  28. package/lib/components/base/TMList.js +1 -1
  29. package/lib/components/base/TMListView.js +3 -3
  30. package/lib/components/base/TMModal.d.ts +11 -0
  31. package/lib/components/base/TMModal.js +47 -13
  32. package/lib/components/base/TMPanel.d.ts +6 -0
  33. package/lib/components/base/TMPanel.js +141 -28
  34. package/lib/components/base/TMPopUp.js +5 -2
  35. package/lib/components/base/TMResizableMenu.js +2 -2
  36. package/lib/components/base/TMRightSidebar.js +1 -1
  37. package/lib/components/base/TMShowAllOrMaxItemsButton.js +1 -1
  38. package/lib/components/base/TMSpinner.d.ts +2 -1
  39. package/lib/components/base/TMSpinner.js +9 -7
  40. package/lib/components/base/TMTab.js +2 -2
  41. package/lib/components/base/TMTabControl.d.ts +106 -0
  42. package/lib/components/base/TMTabControl.js +664 -0
  43. package/lib/components/base/TMToggleButton.js +2 -2
  44. package/lib/components/base/TMToolbarCard.js +3 -3
  45. package/lib/components/base/TMTooltip.d.ts +2 -1
  46. package/lib/components/base/TMTooltip.js +24 -8
  47. package/lib/components/base/TMTreeView.d.ts +13 -7
  48. package/lib/components/base/TMTreeView.js +143 -70
  49. package/lib/components/base/TMWaitPanel.js +3 -3
  50. package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
  51. package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
  52. package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +169 -0
  53. package/lib/components/base/waitPanel/TMWaitPanelManager.js +320 -0
  54. package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +53 -0
  55. package/lib/components/base/waitPanel/TMWaitPanelView.js +274 -0
  56. package/lib/components/base/waitPanel/index.d.ts +1 -0
  57. package/lib/components/base/waitPanel/index.js +1 -0
  58. package/lib/components/choosers/TMCultureIDPicker.js +2 -2
  59. package/lib/components/choosers/TMDataListItemChooser.js +1 -1
  60. package/lib/components/choosers/TMDataListItemPicker.js +2 -2
  61. package/lib/components/choosers/TMDcmtTypeChooser.js +5 -4
  62. package/lib/components/choosers/TMDiskChooser.js +1 -1
  63. package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
  64. package/lib/components/choosers/TMDistinctValues.js +157 -141
  65. package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
  66. package/lib/components/choosers/TMImageIDChooser.js +1 -1
  67. package/lib/components/choosers/TMMetadataChooser.js +3 -3
  68. package/lib/components/choosers/TMPathChooser.js +17 -34
  69. package/lib/components/choosers/TMQuickSearchInfo.d.ts +13 -0
  70. package/lib/components/choosers/TMQuickSearchInfo.js +279 -0
  71. package/lib/components/choosers/TMQuickSearchSettingsForm.d.ts +16 -0
  72. package/lib/components/choosers/TMQuickSearchSettingsForm.js +94 -0
  73. package/lib/components/choosers/TMRelationChooser.js +1 -1
  74. package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
  75. package/lib/components/choosers/TMSelectedValuesSummary.js +89 -0
  76. package/lib/components/choosers/TMUserChooser.js +1 -1
  77. package/lib/components/editors/TMCheckBox.js +1 -1
  78. package/lib/components/editors/TMDateBox.d.ts +16 -1
  79. package/lib/components/editors/TMDateBox.js +90 -22
  80. package/lib/components/editors/TMDropDown.d.ts +3 -0
  81. package/lib/components/editors/TMDropDown.js +197 -5
  82. package/lib/components/editors/TMEditorStyled.d.ts +21 -43
  83. package/lib/components/editors/TMFormulaEditor.js +1 -1
  84. package/lib/components/editors/TMHtmlContentDisplay.js +1 -1
  85. package/lib/components/editors/TMLocalizedTextBox.js +1 -1
  86. package/lib/components/editors/TMMetadataEditor.d.ts +5 -1
  87. package/lib/components/editors/TMMetadataEditor.js +27 -23
  88. package/lib/components/editors/TMMetadataValues.js +6 -6
  89. package/lib/components/editors/TMRadioButton.js +2 -2
  90. package/lib/components/editors/TMSummary.js +3 -3
  91. package/lib/components/editors/TMTextArea.d.ts +1 -0
  92. package/lib/components/editors/TMTextArea.js +25 -17
  93. package/lib/components/editors/TMTextBox.d.ts +2 -0
  94. package/lib/components/editors/TMTextBox.js +32 -21
  95. package/lib/components/editors/TMTextExpression.js +1 -1
  96. package/lib/components/features/archive/TMArchive.js +24 -5
  97. package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +29 -0
  98. package/lib/components/features/assistant/TMHelpOnLineChat.js +1384 -0
  99. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +4 -4
  100. package/lib/components/features/assistant/TMToppySpeechBubble.js +1 -1
  101. package/lib/components/features/assistant/dataset/Designer-Suggested-Questions.json +102 -0
  102. package/lib/components/features/assistant/dataset/Login-Suggested-Questions.json +32 -0
  103. package/lib/components/features/assistant/dataset/Surfer-Suggested-Questions.json +102 -0
  104. package/lib/components/features/documents/TMBatchUpdateForm.js +22 -9
  105. package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
  106. package/lib/components/features/documents/TMDcmtBlog.d.ts +3 -0
  107. package/lib/components/features/documents/TMDcmtBlog.js +4 -4
  108. package/lib/components/features/documents/TMDcmtForm.d.ts +7 -0
  109. package/lib/components/features/documents/TMDcmtForm.js +281 -113
  110. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +11 -0
  111. package/lib/components/features/documents/TMDcmtFormActionButtons.js +79 -9
  112. package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -3
  113. package/lib/components/features/documents/TMDcmtIcon.js +8 -8
  114. package/lib/components/features/documents/TMDcmtPreview.d.ts +7 -5
  115. package/lib/components/features/documents/TMDcmtPreview.js +16 -10
  116. package/lib/components/features/documents/TMDcmtTasks.js +2 -9
  117. package/lib/components/features/documents/TMDownloadRelationViewerSection.js +1 -1
  118. package/lib/components/features/documents/TMFileUploader.js +7 -7
  119. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
  120. package/lib/components/features/documents/TMMasterDetailDcmts.js +95 -108
  121. package/lib/components/features/documents/TMMasterInfoFields.d.ts +20 -0
  122. package/lib/components/features/documents/TMMasterInfoFields.js +185 -0
  123. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
  124. package/lib/components/features/documents/TMMergeToPdfForm.js +83 -56
  125. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +46 -0
  126. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +320 -0
  127. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +370 -0
  128. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +283 -0
  129. package/lib/components/features/documents/TMRelationViewer.d.ts +29 -9
  130. package/lib/components/features/documents/TMRelationViewer.js +310 -208
  131. package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +1 -1
  132. package/lib/components/features/documents/relationTreeState.d.ts +32 -0
  133. package/lib/components/features/documents/relationTreeState.js +89 -0
  134. package/lib/components/features/search/TMMetadataOutputForm.js +1 -1
  135. package/lib/components/features/search/TMMetadataSorterForm.js +1 -1
  136. package/lib/components/features/search/TMSavedQuerySelector.js +2 -2
  137. package/lib/components/features/search/TMSearch.d.ts +1 -1
  138. package/lib/components/features/search/TMSearch.js +172 -34
  139. package/lib/components/features/search/TMSearchQueryEditor.js +7 -5
  140. package/lib/components/features/search/TMSearchQueryPanel.d.ts +14 -4
  141. package/lib/components/features/search/TMSearchQueryPanel.js +153 -62
  142. package/lib/components/features/search/TMSearchResult.d.ts +21 -0
  143. package/lib/components/features/search/TMSearchResult.js +461 -152
  144. package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
  145. package/lib/components/features/search/TMTreeSelector.js +130 -83
  146. package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
  147. package/lib/components/features/tasks/TMTaskForm.js +1 -1
  148. package/lib/components/features/tasks/TMTaskFormUtils.js +3 -3
  149. package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
  150. package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
  151. package/lib/components/features/tasks/TMTasksHeader.js +1 -1
  152. package/lib/components/features/tasks/TMTasksUtilsView.js +1 -1
  153. package/lib/components/features/tasks/TMTasksView.js +97 -102
  154. package/lib/components/features/wg/TMWGsCopyMoveForm.js +92 -92
  155. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +10 -0
  156. package/lib/components/features/workflow/TMWorkflowPopup.js +9 -5
  157. package/lib/components/features/workflow/diagram/ConnectionComponent.js +3 -3
  158. package/lib/components/features/workflow/diagram/DiagramItemComponent.js +3 -3
  159. package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
  160. package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +1 -1
  161. package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
  162. package/lib/components/features/workflow/diagram/WFDiagram.js +4 -4
  163. package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
  164. package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
  165. package/lib/components/forms/Login/Menu.js +1 -1
  166. package/lib/components/forms/Login/OTPReader.js +1 -1
  167. package/lib/components/forms/Login/PasswordStrengthChecker.js +1 -1
  168. package/lib/components/forms/Login/RapidAccessLogin.js +2 -2
  169. package/lib/components/forms/Login/RecoverPasswordFlow.js +2 -2
  170. package/lib/components/forms/Login/SelectBox.js +1 -1
  171. package/lib/components/forms/Login/StepIndicator.js +1 -1
  172. package/lib/components/forms/Login/TMLoginForm.js +7 -7
  173. package/lib/components/forms/Login/TextBox.js +1 -1
  174. package/lib/components/forms/TMApplyForm.js +3 -3
  175. package/lib/components/forms/TMChooserForm.js +1 -1
  176. package/lib/components/forms/TMResultDialog.js +1 -1
  177. package/lib/components/forms/TMSaveForm.js +3 -3
  178. package/lib/components/grids/TMBlogAttachments.js +14 -3
  179. package/lib/components/grids/TMBlogHeader.js +5 -1
  180. package/lib/components/grids/TMBlogsPost.d.ts +2 -0
  181. package/lib/components/grids/TMBlogsPost.js +122 -99
  182. package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
  183. package/lib/components/grids/TMBlogsPostUtils.js +15 -4
  184. package/lib/components/grids/TMRecentsManager.js +4 -4
  185. package/lib/components/grids/TMValidationItemsList.js +1 -1
  186. package/lib/components/index.d.ts +6 -0
  187. package/lib/components/index.js +5 -0
  188. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
  189. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +25 -15
  190. package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
  191. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +4 -5
  192. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
  193. package/lib/components/layout/panelManager/TMPanelWrapper.js +3 -3
  194. package/lib/components/layout/panelManager/types.d.ts +3 -0
  195. package/lib/components/layout/panelManager/utils.js +13 -11
  196. package/lib/components/pages/TMPage.js +30 -32
  197. package/lib/components/query/TMQueryCountButton.js +1 -1
  198. package/lib/components/query/TMQueryEditor.d.ts +17 -10
  199. package/lib/components/query/TMQueryEditor.js +9 -8
  200. package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
  201. package/lib/components/sidebar/TMCommandsPanel.js +1 -1
  202. package/lib/components/sidebar/TMHeader.d.ts +1 -0
  203. package/lib/components/sidebar/TMHeader.js +37 -27
  204. package/lib/components/sidebar/TMSidebar.js +1 -1
  205. package/lib/components/sidebar/TMSidebarItem.js +1 -1
  206. package/lib/components/viewers/TMMidViewer.js +6 -3
  207. package/lib/components/viewers/TMTidViewer.js +89 -28
  208. package/lib/components/wizard/TMStepIndicator.js +3 -3
  209. package/lib/css/tm-sdkui.css +1 -1
  210. package/lib/devextreme-license.d.ts +1 -0
  211. package/lib/devextreme-license.js +3 -0
  212. package/lib/helper/Enum_Localizator.d.ts +4 -4
  213. package/lib/helper/Enum_Localizator.js +1 -0
  214. package/lib/helper/Globalization.d.ts +1 -1
  215. package/lib/helper/SDKUI_Globals.d.ts +110 -0
  216. package/lib/helper/SDKUI_Globals.js +151 -0
  217. package/lib/helper/SDKUI_Localizator.d.ts +756 -677
  218. package/lib/helper/SDKUI_Localizator.js +790 -0
  219. package/lib/helper/TMAppUpdatedModal.d.ts +2 -0
  220. package/lib/helper/TMAppUpdatedModal.js +134 -0
  221. package/lib/helper/TMIcons.d.ts +1 -0
  222. package/lib/helper/TMIcons.js +4 -3
  223. package/lib/helper/TMPdfViewer.js +1 -1
  224. package/lib/helper/TMToppyMessage.js +1 -1
  225. package/lib/helper/TMUtils.d.ts +51 -4
  226. package/lib/helper/TMUtils.js +273 -12
  227. package/lib/helper/ZipManager.d.ts +1 -1
  228. package/lib/helper/ZipManager.js +2 -1
  229. package/lib/helper/checkinCheckoutManager.d.ts +1 -1
  230. package/lib/helper/checkinCheckoutManager.js +1 -1
  231. package/lib/helper/dataGridSearchHelper.d.ts +28 -0
  232. package/lib/helper/dataGridSearchHelper.js +51 -0
  233. package/lib/helper/dcmtsHelper.d.ts +22 -0
  234. package/lib/helper/dcmtsHelper.js +60 -1
  235. package/lib/helper/helpers.d.ts +24 -2
  236. package/lib/helper/helpers.js +59 -3
  237. package/lib/helper/index.d.ts +2 -0
  238. package/lib/helper/index.js +2 -0
  239. package/lib/helper/queryHelper.d.ts +6 -1
  240. package/lib/helper/queryHelper.js +8 -3
  241. package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
  242. package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
  243. package/lib/hooks/useArchiveListForm.d.ts +39 -0
  244. package/lib/hooks/useArchiveListForm.js +46 -0
  245. package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
  246. package/lib/hooks/useCaseFlowApprove.js +157 -0
  247. package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
  248. package/lib/hooks/useCheckInOutOperations.js +14 -34
  249. package/lib/hooks/useDataUserIdItem.d.ts +1 -0
  250. package/lib/hooks/useDataUserIdItem.js +1 -0
  251. package/lib/hooks/useDcmtOperations.d.ts +3 -12
  252. package/lib/hooks/useDcmtOperations.js +187 -179
  253. package/lib/hooks/useDocumentOperations.d.ts +5 -0
  254. package/lib/hooks/useDocumentOperations.js +64 -33
  255. package/lib/hooks/useInputDialog.js +1 -1
  256. package/lib/hooks/useMultiMasterDetailDcmts.d.ts +98 -0
  257. package/lib/hooks/useMultiMasterDetailDcmts.js +758 -0
  258. package/lib/hooks/usePreventFileDrop.js +9 -0
  259. package/lib/hooks/useQueryParametersDialog.js +1 -1
  260. package/lib/hooks/useRelatedDocuments.d.ts +1 -0
  261. package/lib/hooks/useRelatedDocuments.js +22 -27
  262. package/lib/hooks/useShowDossiersV5.d.ts +12 -0
  263. package/lib/hooks/useShowDossiersV5.js +37 -0
  264. package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
  265. package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
  266. package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
  267. package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
  268. package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
  269. package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
  270. package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
  271. package/lib/hooks/useTMDistinctValuesSource.js +105 -0
  272. package/lib/hooks/useWorkflowApprove.js +33 -17
  273. package/lib/index.d.ts +2 -0
  274. package/lib/index.js +5 -2
  275. package/lib/services/caseflow/CaseFlowService.d.ts +277 -0
  276. package/lib/services/caseflow/CaseFlowService.js +761 -0
  277. package/lib/services/caseflow/CaseFlowTemplateCacheService.d.ts +28 -0
  278. package/lib/services/caseflow/CaseFlowTemplateCacheService.js +121 -0
  279. package/lib/services/caseflow/caseFlowNameCache.d.ts +32 -0
  280. package/lib/services/caseflow/caseFlowNameCache.js +116 -0
  281. package/lib/services/caseflow/caseFlowWorkItemUtils.d.ts +61 -0
  282. package/lib/services/caseflow/caseFlowWorkItemUtils.js +113 -0
  283. package/lib/services/index.d.ts +4 -0
  284. package/lib/services/index.js +4 -0
  285. package/lib/services/platform_services.d.ts +4 -4
  286. package/package.json +16 -13
@@ -3,6 +3,17 @@ import { ITMEditorBase } from './TMEditorBase';
3
3
  export type ButtonColors = 'error' | 'warning' | 'success' | 'info' | 'primary' | 'secondary' | 'tertiary' | 'standard' | 'primaryOutline' | 'secondaryOutline' | 'tertiaryOutline' | 'errorOutline' | 'warningOutline' | 'successOutline' | 'infoOutline';
4
4
  export type ButtonStyle = 'normal' | 'toolbar' | 'icon' | 'text' | 'advanced';
5
5
  export type AdvancedButtonType = 'success' | 'error' | 'tertiary' | 'primary';
6
+ /** Azione secondaria mostrata nel dropdown "split button" (freccia a destra) */
7
+ export interface ITMButtonSecondaryAction {
8
+ /** Etichetta mostrata nella voce di menu */
9
+ name: string;
10
+ /** Icona opzionale a sinistra della voce */
11
+ icon?: React.ReactNode;
12
+ /** Callback al click della voce */
13
+ onClick?: () => void;
14
+ /** Disabilita la singola voce */
15
+ disabled?: boolean;
16
+ }
6
17
  export interface ITMButton extends ITMEditorBase {
7
18
  color?: ButtonColors;
8
19
  btnStyle?: ButtonStyle;
@@ -17,6 +28,8 @@ export interface ITMButton extends ITMEditorBase {
17
28
  showTooltip?: boolean;
18
29
  onClick?: VoidFunction;
19
30
  onMouseDown?: (e: any) => any;
31
+ /** Azioni secondarie: se valorizzate, il bottone mostra una freccia a destra che apre un dropdown con queste azioni */
32
+ secondaryActions?: ITMButtonSecondaryAction[];
20
33
  }
21
34
  declare const TMButton: React.ForwardRefExoticComponent<ITMButton & React.RefAttributes<HTMLButtonElement>>;
22
35
  export default TMButton;
@@ -1,7 +1,8 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useState, forwardRef } from 'react';
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, forwardRef, useRef, useEffect } from 'react';
3
+ import { createPortal } from 'react-dom';
3
4
  import styled from 'styled-components';
4
- import { getColor } from '../../helper';
5
+ import { getColor, IconChevronDown } from '../../helper';
5
6
  import { FontSize, TMColors } from '../../utils/theme';
6
7
  import TMTooltip from './TMTooltip';
7
8
  const StyledNormalButton = styled.button.withConfig({ shouldForwardProp: prop => !['text'].includes(prop) }) `
@@ -149,10 +150,132 @@ const StyledAdvancedButtonText = styled.div `
149
150
  border-top-right-radius: 10px;
150
151
  border-bottom-right-radius: 10px;
151
152
  padding: 5px;
153
+ padding-right: ${props => props.$reserveArrow ? '26px' : '5px'};
154
+ `;
155
+ const StyledSplitContainer = styled.div `
156
+ display: inline-flex;
157
+ align-items: stretch;
158
+ position: relative;
159
+ `;
160
+ const StyledSplitArrow = styled.button `
161
+ position: absolute;
162
+ right: 4px;
163
+ top: 50%;
164
+ transform: translateY(-50%);
165
+ z-index: 2;
166
+ display: flex;
167
+ align-items: center;
168
+ justify-content: center;
169
+ width: 20px;
170
+ height: 20px;
171
+ padding: 0;
172
+ border: none;
173
+ border-radius: 6px;
174
+ cursor: ${props => props.$isDisabled ? 'default' : 'pointer'};
175
+ color: white;
176
+ background-color: rgba(255, 255, 255, 0.22);
177
+ transition: background-color ease 150ms;
178
+ &:hover { background-color: ${props => props.$isDisabled ? 'rgba(255, 255, 255, 0.22)' : 'rgba(255, 255, 255, 0.38)'}; }
179
+ & svg {
180
+ transition: transform ease 150ms;
181
+ transform: rotate(${props => props.$isOpen ? '180deg' : '0deg'});
182
+ }
183
+ `;
184
+ const StyledDropdown = styled.div `
185
+ position: fixed;
186
+ left: ${props => props.$left}px;
187
+ top: ${props => props.$top}px;
188
+ transform: translateY(-100%);
189
+ transform-origin: bottom left;
190
+ min-width: ${props => props.$minWidth}px;
191
+ background: #ffffff;
192
+ border-radius: 14px;
193
+ box-shadow: 0 10px 30px rgba(20, 40, 80, 0.20);
194
+ border: 1px solid rgba(74, 150, 210, 0.18);
195
+ padding: 5px;
196
+ z-index: 100000;
197
+ display: flex;
198
+ flex-direction: column;
199
+ gap: 2px;
200
+ animation: tmSplitDropdownIn cubic-bezier(0.2, 0.8, 0.2, 1) 150ms;
201
+ @keyframes tmSplitDropdownIn {
202
+ from { opacity: 0; transform: translateY(calc(-100% + 8px)); }
203
+ to { opacity: 1; transform: translateY(-100%); }
204
+ }
205
+ `;
206
+ const StyledDropdownItem = styled.button `
207
+ display: flex;
208
+ align-items: center;
209
+ gap: 9px;
210
+ width: 100%;
211
+ padding: 5px 9px;
212
+ border: none;
213
+ border-radius: 8px;
214
+ background: transparent;
215
+ text-align: left;
216
+ font-size: ${FontSize.defaultFontSize};
217
+ font-weight: 500;
218
+ color: ${props => props.$disabled ? '#b4b4b4' : '#2c3e50'};
219
+ cursor: ${props => props.$disabled ? 'default' : 'pointer'};
220
+ transition: background ease 150ms, color ease 150ms;
221
+ &:hover {
222
+ background: ${props => props.$disabled ? 'transparent' : 'linear-gradient(135deg, rgba(74, 150, 210, 0.16) 0%, rgba(37, 89, 165, 0.16) 100%)'};
223
+ color: ${props => props.$disabled ? '#b4b4b4' : '#2559A5'};
224
+ }
225
+ & > .tm-split-item-icon {
226
+ display: flex;
227
+ align-items: center;
228
+ justify-content: center;
229
+ width: 22px;
230
+ height: 22px;
231
+ flex-shrink: 0;
232
+ border-radius: 6px;
233
+ background: rgba(74, 150, 210, 0.14);
234
+ color: #4A96D2;
235
+ transition: background ease 150ms, color ease 150ms;
236
+ }
237
+ &:hover > .tm-split-item-icon {
238
+ background: ${props => props.$disabled ? 'rgba(74, 150, 210, 0.14)' : '#4A96D2'};
239
+ color: ${props => props.$disabled ? '#4A96D2' : '#ffffff'};
240
+ }
152
241
  `;
153
242
  const TMButton = forwardRef((props, ref) => {
154
- const { width, height, keyGesture, btnStyle = 'normal', advancedColor, advancedType = 'primary', color = 'primary', fontSize = FontSize.defaultFontSize, disabled = false, showTooltip = true, caption, icon, description, padding, elementStyle, onClick = () => { }, onMouseDown = () => { } } = props;
243
+ const { width, height, keyGesture, btnStyle = 'normal', advancedColor, advancedType = 'primary', color = 'primary', fontSize = FontSize.defaultFontSize, disabled = false, showTooltip = true, caption, icon, description, padding, elementStyle, onClick = () => { }, onMouseDown = () => { }, secondaryActions } = props;
155
244
  const [isHovered, setIsHovered] = useState(false);
245
+ const [isDropdownOpen, setIsDropdownOpen] = useState(false);
246
+ const [dropdownPos, setDropdownPos] = useState({ left: 0, top: 0, minWidth: 200 });
247
+ const splitContainerRef = useRef(null);
248
+ const dropdownRef = useRef(null);
249
+ const hasSecondaryActions = !!secondaryActions && secondaryActions.length > 0;
250
+ useEffect(() => {
251
+ if (!isDropdownOpen)
252
+ return;
253
+ const handlePointerDown = (e) => {
254
+ const target = e.target;
255
+ if (splitContainerRef.current?.contains(target) || dropdownRef.current?.contains(target))
256
+ return;
257
+ setIsDropdownOpen(false);
258
+ };
259
+ const handleKeyDown = (e) => { if (e.key === 'Escape')
260
+ setIsDropdownOpen(false); };
261
+ document.addEventListener('mousedown', handlePointerDown);
262
+ document.addEventListener('touchstart', handlePointerDown);
263
+ document.addEventListener('keydown', handleKeyDown);
264
+ return () => {
265
+ document.removeEventListener('mousedown', handlePointerDown);
266
+ document.removeEventListener('touchstart', handlePointerDown);
267
+ document.removeEventListener('keydown', handleKeyDown);
268
+ };
269
+ }, [isDropdownOpen]);
270
+ const toggleDropdown = () => {
271
+ if (disabled)
272
+ return;
273
+ if (!isDropdownOpen && splitContainerRef.current) {
274
+ const rect = splitContainerRef.current.getBoundingClientRect();
275
+ setDropdownPos({ left: rect.left, top: rect.top - 6, minWidth: Math.max(rect.width, 200) });
276
+ }
277
+ setIsDropdownOpen(prev => !prev);
278
+ };
156
279
  const renderedButton = () => {
157
280
  if (btnStyle === 'normal') {
158
281
  return (_jsx(StyledNormalButton, { ref: ref, width: width, height: height, color: color, caption: caption, disabled: disabled, fontSize: fontSize, onClick: onClick, onMouseDown: (e) => !disabled && onMouseDown?.(e), children: caption }));
@@ -164,7 +287,7 @@ const TMButton = forwardRef((props, ref) => {
164
287
  return (_jsx(StyledIconButton, { ref: ref, color: color, caption: caption, disabled: disabled, fontSize: fontSize, padding: padding, onClick: onClick, onMouseDown: (e) => !disabled && onMouseDown?.(e), children: icon }));
165
288
  }
166
289
  else if (btnStyle === 'advanced') {
167
- return (_jsxs(StyledAdvancedButton, { ref: ref, "$width": width ?? '90px', "$height": height ?? '30px', onMouseOver: () => !disabled && setIsHovered(true), onMouseOut: () => setIsHovered(false), "$isDisabled": disabled, "$isPrimaryOutline": advancedType === 'primary' && (advancedColor === 'primaryOutline' || color === 'primaryOutline'), onClick: () => !disabled && onClick?.(), onMouseDown: (e) => !disabled && onMouseDown?.(e), children: [_jsx(StyledAdvancedButtonIcon, { "$color": advancedColor, "$isVisible": isHovered, "$isDisabled": disabled, "$type": advancedType, children: icon }), _jsx(StyledAdvancedButtonText, { "$color": advancedColor, "$isDisabled": disabled, "$type": advancedType, children: caption })] }));
290
+ return (_jsxs(StyledAdvancedButton, { ref: ref, $width: width ?? '90px', $height: height ?? '30px', onMouseOver: () => !disabled && setIsHovered(true), onMouseOut: () => setIsHovered(false), $isDisabled: disabled, $isPrimaryOutline: advancedType === 'primary' && (advancedColor === 'primaryOutline' || color === 'primaryOutline'), onClick: () => !disabled && onClick?.(), onMouseDown: (e) => !disabled && onMouseDown?.(e), children: [_jsx(StyledAdvancedButtonIcon, { $color: advancedColor, $isVisible: isHovered, $isDisabled: disabled, $type: advancedType, children: icon }), _jsx(StyledAdvancedButtonText, { $color: advancedColor, $isDisabled: disabled, $type: advancedType, $reserveArrow: hasSecondaryActions, children: caption })] }));
168
291
  }
169
292
  else {
170
293
  return (_jsx(StyledTextButton, { ref: ref, color: color, caption: caption, disabled: disabled, fontSize: fontSize, onClick: onClick, onMouseDown: (e) => !disabled && onMouseDown?.(e), children: caption }));
@@ -173,8 +296,17 @@ const TMButton = forwardRef((props, ref) => {
173
296
  const renderTooltip = () => {
174
297
  return (showTooltip &&
175
298
  _jsxs(_Fragment, { children: [caption &&
176
- _jsx(StyledButtonTooltipHeader, { "$description": description, children: _jsx(StyledButtonTooltipItem, { "$color": color, children: caption }) }), description && _jsx(StyledButtonTooltipItem, { children: description })] }));
299
+ _jsx(StyledButtonTooltipHeader, { $description: description, children: _jsx(StyledButtonTooltipItem, { $color: color, children: caption }) }), description && _jsx(StyledButtonTooltipItem, { children: description })] }));
177
300
  };
178
- return (_jsx("div", { style: elementStyle, children: showTooltip ? _jsx(TMTooltip, { hideAfterDelay: true, content: renderTooltip(), children: renderedButton() }) : renderedButton() }));
301
+ const buttonWithTooltip = showTooltip
302
+ ? _jsx(TMTooltip, { hideAfterDelay: true, content: renderTooltip(), children: renderedButton() })
303
+ : renderedButton();
304
+ const renderSplitButton = () => (_jsxs(StyledSplitContainer, { ref: splitContainerRef, children: [buttonWithTooltip, _jsx(StyledSplitArrow, { type: 'button', $isDisabled: disabled, $isOpen: isDropdownOpen, "aria-haspopup": 'menu', "aria-expanded": isDropdownOpen, onClick: (e) => { e.stopPropagation(); toggleDropdown(); }, onMouseDown: (e) => e.stopPropagation(), children: _jsx(IconChevronDown, { fontSize: 14 }) }), isDropdownOpen && createPortal(_jsx(StyledDropdown, { ref: dropdownRef, role: 'menu', $left: dropdownPos.left, $top: dropdownPos.top, $minWidth: dropdownPos.minWidth, children: secondaryActions.map((action, idx) => (_jsxs(StyledDropdownItem, { type: 'button', role: 'menuitem', $disabled: action.disabled, disabled: action.disabled, onClick: () => {
305
+ if (action.disabled)
306
+ return;
307
+ setIsDropdownOpen(false);
308
+ action.onClick?.();
309
+ }, children: [action.icon && _jsx("span", { className: 'tm-split-item-icon', children: action.icon }), _jsx("span", { children: action.name })] }, `${action.name}-${idx}`))) }), document.body)] }));
310
+ return (_jsx("div", { style: elementStyle, children: hasSecondaryActions ? renderSplitButton() : buttonWithTooltip }));
179
311
  });
180
312
  export default TMButton;
@@ -67,8 +67,8 @@ const TMClosableList = ({ dataSource, visibility = false, label, inline = false,
67
67
  const renderedItems = () => {
68
68
  return (dataSource.map((item, index) => (_jsx(StyledClosableItem, { children: item }, index))));
69
69
  };
70
- return (_jsxs(StyledClosableContainer, { "$isMobile": devicrType === DeviceType.TABLET, "$padding": hasPadding ? '5px' : '0', children: [_jsxs(StyledClosableContext, { children: [label && _jsxs(StyledClosableLabel, { "$isMobile": devicrType === DeviceType.MOBILE, "$inline": inline, children: [label, ":"] }), status ?
71
- _jsxs(StyledClosableItems, { "$isMobile": devicrType === DeviceType.MOBILE, "$inline": inline, children: [" ", renderedItems(), " "] }) :
72
- _jsxs(StyledClosableItems, { "$isMobile": devicrType === DeviceType.MOBILE, "$inline": inline, children: [" ", _jsxs(StyledClosableItem, { children: [" ", dataSource[0], " "] }), " "] })] }), dataSource.length > 1 && _jsxs(StyledClosabelIcon, { onClick: () => setStatus(!status), children: [!status && _jsxs(StyledClosableItemsCount, { children: [" (", _jsx("span", { children: "+" }), " ", dataSource.length - 1, " ", dataSource.length === 2 ? SDKUI_Localizator.OneMore : SDKUI_Localizator.More, ") "] }), !status ? _jsx(IconRight, { fontSize: 14 }) : _jsx(IconDown, { fontSize: 14 })] })] }));
70
+ return (_jsxs(StyledClosableContainer, { $isMobile: devicrType === DeviceType.TABLET, $padding: hasPadding ? '5px' : '0', children: [_jsxs(StyledClosableContext, { children: [label && _jsxs(StyledClosableLabel, { $isMobile: devicrType === DeviceType.MOBILE, $inline: inline, children: [label, ":"] }), status ?
71
+ _jsxs(StyledClosableItems, { $isMobile: devicrType === DeviceType.MOBILE, $inline: inline, children: [" ", renderedItems(), " "] }) :
72
+ _jsxs(StyledClosableItems, { $isMobile: devicrType === DeviceType.MOBILE, $inline: inline, children: [" ", _jsxs(StyledClosableItem, { children: [" ", dataSource[0], " "] }), " "] })] }), dataSource.length > 1 && _jsxs(StyledClosabelIcon, { onClick: () => setStatus(!status), children: [!status && _jsxs(StyledClosableItemsCount, { children: [" (", _jsx("span", { children: "+" }), " ", dataSource.length - 1, " ", dataSource.length === 2 ? SDKUI_Localizator.OneMore : SDKUI_Localizator.More, ") "] }), !status ? _jsx(IconRight, { fontSize: 14 }) : _jsx(IconDown, { fontSize: 14 })] })] }));
73
73
  };
74
74
  export default TMClosableList;
@@ -1,10 +1,11 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef, useState, useMemo } from 'react';
3
3
  import TMModal from './TMModal';
4
4
  import styled from 'styled-components';
5
- import { SDKUI_Localizator, TMLayoutWaitingContainer } from '../..';
5
+ import { SDKUI_Localizator } from '../..';
6
6
  import { getButtonAttributes, getSelectedItem } from '../../helper/dcmtsHelper';
7
7
  import { DeviceType, useDeviceType } from './TMDeviceProvider';
8
+ import TMWaitPanelManager from './waitPanel/TMWaitPanelManager';
8
9
  const IframeContainer = styled.div `
9
10
  display: flex;
10
11
  height: 100%;
@@ -53,12 +54,6 @@ const TMCustomButton = (props) => {
53
54
  const [loading, setLoading] = useState(true);
54
55
  const [error, setError] = useState(false);
55
56
  const itemsToProcess = useMemo(() => selectedItems && selectedItems.length > 0 ? selectedItems : [attributes], [selectedItems, attributes]);
56
- // Stati per il wait panel
57
- const [showWaitPanel, setShowWaitPanel] = useState(itemsToProcess.length > 0 && !RunOnce);
58
- const [waitPanelText, setWaitPanelText] = useState(SDKUI_Localizator.CustomButtonActions.replaceParams(1, itemsToProcess.length));
59
- const [waitPanelValue, setWaitPanelValue] = useState(0);
60
- const [waitPanelMaxValue, setWaitPanelMaxValue] = useState(itemsToProcess.length);
61
- const [abortController, setAbortController] = useState(undefined);
62
57
  // Aggiungi timestamp all'URL per evitare cache
63
58
  const iframeUrl = useMemo(() => {
64
59
  if (!scriptUrl)
@@ -83,41 +78,45 @@ const TMCustomButton = (props) => {
83
78
  setLoading(false);
84
79
  setError(true);
85
80
  };
86
- const executeSequentially = async (controller) => {
81
+ const executeSequentially = async () => {
87
82
  if (!itemsToProcess)
88
83
  return;
89
- for (const [index, item] of itemsToProcess.entries()) {
90
- if (controller.signal.aborted)
91
- break;
92
- setWaitPanelText(SDKUI_Localizator.CustomButtonActions.replaceParams(index + 1, itemsToProcess.length));
93
- setWaitPanelValue(index);
94
- // Attendi che l'iframe sia pronto e invia il messaggio
95
- await new Promise((resolve) => {
96
- const checkIframe = setInterval(() => {
97
- if (iframeRef.current?.contentWindow) {
98
- clearInterval(checkIframe);
99
- if (selectedItems && selectedItems.length > 0) {
100
- //devo convertire item in formData
101
- const processedItem = getSelectedItem(args, formData, item);
102
- postMessageIframe(processedItem);
103
- }
104
- else {
105
- postMessageIframe(item);
84
+ const waitPanel = TMWaitPanelManager.show({
85
+ title: SDKUI_Localizator.CustomButtonAction,
86
+ max: itemsToProcess.length,
87
+ cancelable: true,
88
+ showCounters: false,
89
+ });
90
+ try {
91
+ for (const [index, item] of itemsToProcess.entries()) {
92
+ if (waitPanel.aborted)
93
+ break;
94
+ waitPanel.setSubtitle(SDKUI_Localizator.CustomButtonActions.replaceParams(index + 1, itemsToProcess.length));
95
+ // Attendi che l'iframe sia pronto e invia il messaggio
96
+ await new Promise((resolve) => {
97
+ const checkIframe = setInterval(() => {
98
+ if (iframeRef.current?.contentWindow) {
99
+ clearInterval(checkIframe);
100
+ if (selectedItems && selectedItems.length > 0) {
101
+ //devo convertire item in formData
102
+ const processedItem = getSelectedItem(args, formData, item);
103
+ postMessageIframe(processedItem);
104
+ }
105
+ else {
106
+ postMessageIframe(item);
107
+ }
108
+ // Attendi prima di passare al prossimo
109
+ setTimeout(resolve, 500);
106
110
  }
107
- //imposta 100% se sono all'ultimo item
108
- if (index === itemsToProcess.length - 1)
109
- setWaitPanelValue(index + 1);
110
- // Attendi prima di passare al prossimo
111
- setTimeout(() => {
112
- setWaitPanelValue(index + 1);
113
- resolve();
114
- }, 500);
115
- }
116
- }, 100);
117
- });
111
+ }, 100);
112
+ });
113
+ await waitPanel.step();
114
+ }
115
+ }
116
+ finally {
117
+ waitPanel.close();
118
+ onClose?.();
118
119
  }
119
- setShowWaitPanel(false);
120
- onClose?.();
121
120
  };
122
121
  const postMessageIframe = (data) => {
123
122
  console.log("TMCustomButton - postMessageIframe - data:", data);
@@ -130,14 +129,7 @@ const TMCustomButton = (props) => {
130
129
  return;
131
130
  if (!RunOnce && itemsToProcess.length > 0) {
132
131
  // esegui per ogni item selezionato
133
- const controller = new AbortController();
134
- controller.signal.addEventListener('abort', () => {
135
- setShowWaitPanel(false);
136
- onClose?.();
137
- });
138
- setAbortController(controller);
139
- setWaitPanelMaxValue(itemsToProcess.length);
140
- executeSequentially(controller);
132
+ executeSequentially();
141
133
  }
142
134
  else {
143
135
  // Modalità RunOnce: invia dati all'iframe quando è caricato
@@ -157,6 +149,6 @@ const TMCustomButton = (props) => {
157
149
  }
158
150
  }, []);
159
151
  const iframeContent = (_jsxs(IframeContainer, { style: !RunOnce ? { visibility: 'hidden' } : {}, children: [loading && _jsx(LoadingOverlay, {}), error && _jsx("div", { children: "Si \u00E8 verificato un errore nel caricamento del contenuto." }), !error && _jsx(StyledIframe, { ref: iframeRef, loading: 'lazy', onLoad: handleLoad, onError: handleError, src: iframeUrl })] }));
160
- return isModal && RunOnce ? (_jsx(TMModal, { title: button.title, width: isMobile ? '95%' : '60%', height: isMobile ? '95%' : '70%', resizable: isMobile ? false : true, expandable: isMobile ? false : true, onClose: onClose, children: iframeContent })) : !RunOnce && (_jsxs(_Fragment, { children: [_jsx(TMLayoutWaitingContainer, { showWaitPanel: showWaitPanel, waitPanelTitle: SDKUI_Localizator.CustomButtonAction, showWaitPanelPrimary: true, waitPanelTextPrimary: waitPanelText, waitPanelValuePrimary: waitPanelValue, waitPanelMaxValuePrimary: waitPanelMaxValue, showWaitPanelSecondary: false, isCancelable: true, abortController: abortController, children: undefined }), iframeContent] }));
152
+ return isModal && RunOnce ? (_jsx(TMModal, { title: button.title, width: isMobile ? '95%' : '60%', height: isMobile ? '95%' : '70%', resizable: isMobile ? false : true, expandable: isMobile ? false : true, onClose: onClose, children: iframeContent })) : !RunOnce && iframeContent;
161
153
  };
162
154
  export default TMCustomButton;
@@ -34,6 +34,8 @@ export interface TMDataGridProps<T> extends IDataGridOptions {
34
34
  searchPanelToolbarPosition?: 'before' | 'default';
35
35
  /** Trigger to set focus on SearchPanel (only if visible) - change the number to trigger focus */
36
36
  searchPanelFocusTrigger?: number;
37
+ /** Riporta il fuoco nella casella di ricerca dopo che la griglia ha applicato il testo digitato, così si può continuare a scrivere */
38
+ keepSearchPanelFocus?: boolean;
37
39
  /** Show the header filter */
38
40
  showHeaderFilter?: boolean;
39
41
  /** Show the filter panel */
@@ -46,6 +48,8 @@ export interface TMDataGridProps<T> extends IDataGridOptions {
46
48
  showSearchPanel?: boolean;
47
49
  /** Show the group panel */
48
50
  showGroupPanel?: boolean;
51
+ /** Rende il paginatore compatto (meno alto, font e pulsanti ridotti, page numbers sostituiti da "pagina / totale"): utile quando la griglia è dentro pannelli bassi */
52
+ compactPager?: boolean;
49
53
  /** Counter configuration */
50
54
  counterConfig?: ITMCounterContainerProps;
51
55
  /** Master Detail */