@topconsultnpm/sdkui-react 6.20.0-dev1.13 → 6.20.0-dev1.130

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 (202) hide show
  1. package/lib/assets/Toppy-help-center.png +0 -0
  2. package/lib/assets/headergradient.svg +87 -0
  3. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +322 -30
  4. package/lib/components/NewComponents/ContextMenu/hooks.d.ts +8 -1
  5. package/lib/components/NewComponents/ContextMenu/hooks.js +80 -8
  6. package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
  7. package/lib/components/NewComponents/ContextMenu/index.js +2 -0
  8. package/lib/components/NewComponents/ContextMenu/styles.d.ts +9 -1
  9. package/lib/components/NewComponents/ContextMenu/styles.js +146 -47
  10. package/lib/components/NewComponents/ContextMenu/types.d.ts +22 -3
  11. package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
  12. package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
  13. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +620 -125
  14. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +25 -5
  15. package/lib/components/NewComponents/FloatingMenuBar/styles.js +215 -59
  16. package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +12 -3
  17. package/lib/components/base/TMAccordionNew.js +35 -14
  18. package/lib/components/base/TMButton.js +6 -0
  19. package/lib/components/base/TMClosableList.js +4 -0
  20. package/lib/components/base/TMCustomButton.js +61 -17
  21. package/lib/components/base/TMDataGrid.d.ts +7 -4
  22. package/lib/components/base/TMDataGrid.js +153 -11
  23. package/lib/components/base/TMDropDownMenu.js +21 -18
  24. package/lib/components/base/TMFileManager.d.ts +4 -3
  25. package/lib/components/base/TMFileManager.js +32 -24
  26. package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
  27. package/lib/components/base/TMFileManagerDataGridView.js +1 -11
  28. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
  29. package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
  30. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
  31. package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
  32. package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
  33. package/lib/components/base/TMListView.js +33 -15
  34. package/lib/components/base/TMPanel.d.ts +1 -1
  35. package/lib/components/base/TMPanel.js +4 -2
  36. package/lib/components/base/TMPopUp.js +6 -0
  37. package/lib/components/base/TMToolbarCard.js +2 -0
  38. package/lib/components/base/TMTreeView.d.ts +2 -1
  39. package/lib/components/base/TMTreeView.js +33 -26
  40. package/lib/components/choosers/TMDataListItemChooser.d.ts +2 -0
  41. package/lib/components/choosers/TMDataListItemChooser.js +8 -2
  42. package/lib/components/choosers/TMDcmtTypeChooser.d.ts +1 -0
  43. package/lib/components/choosers/TMDcmtTypeChooser.js +11 -3
  44. package/lib/components/choosers/TMDistinctValues.js +2 -2
  45. package/lib/components/choosers/TMDynDataListItemChooser.d.ts +2 -0
  46. package/lib/components/choosers/TMDynDataListItemChooser.js +8 -2
  47. package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
  48. package/lib/components/choosers/TMMetadataChooser.d.ts +2 -0
  49. package/lib/components/choosers/TMMetadataChooser.js +19 -4
  50. package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
  51. package/lib/components/choosers/TMUserChooser.d.ts +2 -5
  52. package/lib/components/choosers/TMUserChooser.js +33 -47
  53. package/lib/components/editors/TMCheckBox.js +2 -0
  54. package/lib/components/editors/TMDateBox.js +18 -9
  55. package/lib/components/editors/TMEditorStyled.js +7 -0
  56. package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
  57. package/lib/components/editors/TMLocalizedTextBox.js +16 -14
  58. package/lib/components/editors/TMMetadataEditor.d.ts +1 -0
  59. package/lib/components/editors/TMMetadataEditor.js +4 -4
  60. package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
  61. package/lib/components/editors/TMMetadataTextBox.js +92 -0
  62. package/lib/components/editors/TMMetadataValues.d.ts +2 -0
  63. package/lib/components/editors/TMMetadataValues.js +26 -8
  64. package/lib/components/editors/TMRadioButton.js +2 -0
  65. package/lib/components/editors/TMTextArea.js +18 -30
  66. package/lib/components/editors/TMTextBox.d.ts +1 -1
  67. package/lib/components/editors/TMTextBox.js +29 -4
  68. package/lib/components/editors/TMTextExpression.js +6 -91
  69. package/lib/components/features/archive/TMArchive.js +2 -2
  70. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
  71. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +462 -0
  72. package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
  73. package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
  74. package/lib/components/features/documents/TMDcmtBlog.js +1 -1
  75. package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
  76. package/lib/components/features/documents/TMDcmtForm.js +576 -292
  77. package/lib/components/features/documents/TMDcmtPreview.js +42 -155
  78. package/lib/components/features/documents/TMDcmtTasks.js +9 -9
  79. package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
  80. package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
  81. package/lib/components/features/documents/TMRelationViewer.js +2 -2
  82. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
  83. package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +2 -2
  84. package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
  85. package/lib/components/features/search/TMSearch.d.ts +3 -0
  86. package/lib/components/features/search/TMSearch.js +50 -11
  87. package/lib/components/features/search/TMSearchQueryEditor.d.ts +1 -0
  88. package/lib/components/features/search/TMSearchQueryEditor.js +10 -10
  89. package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
  90. package/lib/components/features/search/TMSearchQueryPanel.js +40 -25
  91. package/lib/components/features/search/TMSearchResult.d.ts +3 -0
  92. package/lib/components/features/search/TMSearchResult.js +370 -252
  93. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
  94. package/lib/components/features/search/TMSearchResultsMenuItems.js +227 -171
  95. package/lib/components/features/search/TMSignSettingsForm.js +1 -1
  96. package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
  97. package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
  98. package/lib/components/features/search/TMViewHistoryDcmt.js +47 -52
  99. package/lib/components/features/tasks/TMTaskForm.js +75 -25
  100. package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
  101. package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
  102. package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
  103. package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
  104. package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
  105. package/lib/components/features/tasks/TMTasksUtils.js +57 -37
  106. package/lib/components/features/tasks/TMTasksView.js +28 -19
  107. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
  108. package/lib/components/features/workflow/TMWorkflowPopup.js +140 -34
  109. package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
  110. package/lib/components/features/workflow/diagram/DiagramItemComponent.js +14 -7
  111. package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
  112. package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
  113. package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
  114. package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
  115. package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
  116. package/lib/components/forms/Login/LoginValidatorService.js +7 -2
  117. package/lib/components/forms/Login/TMLoginForm.js +35 -7
  118. package/lib/components/forms/TMChooserForm.js +1 -1
  119. package/lib/components/grids/TMBlogsPost.js +56 -31
  120. package/lib/components/grids/TMRecentsManager.js +20 -10
  121. package/lib/components/grids/TMValidationItemsList.js +6 -0
  122. package/lib/components/index.d.ts +6 -3
  123. package/lib/components/index.js +6 -3
  124. package/lib/components/layout/panelManager/TMPanelManagerContext.js +13 -5
  125. package/lib/components/query/TMQueryEditor.d.ts +6 -1
  126. package/lib/components/query/TMQueryEditor.js +105 -101
  127. package/lib/components/settings/SettingsAppearance.d.ts +2 -1
  128. package/lib/components/settings/SettingsAppearance.js +99 -30
  129. package/lib/components/sidebar/TMHeader.js +11 -7
  130. package/lib/components/sidebar/TMSidebar.d.ts +0 -1
  131. package/lib/components/sidebar/TMSidebar.js +16 -44
  132. package/lib/components/sidebar/TMSidebarItem.js +36 -17
  133. package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
  134. package/lib/components/viewers/TMDataListItemViewer.js +35 -71
  135. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
  136. package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
  137. package/lib/css/tm-sdkui.css +1 -1
  138. package/lib/helper/SDKUI_Globals.d.ts +22 -0
  139. package/lib/helper/SDKUI_Globals.js +10 -1
  140. package/lib/helper/SDKUI_Localizator.d.ts +21 -3
  141. package/lib/helper/SDKUI_Localizator.js +196 -10
  142. package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
  143. package/lib/helper/TMCommandsContextMenu.js +15 -4
  144. package/lib/helper/TMIcons.d.ts +4 -0
  145. package/lib/helper/TMIcons.js +13 -3
  146. package/lib/helper/TMPdfViewer.d.ts +8 -0
  147. package/lib/helper/TMPdfViewer.js +373 -0
  148. package/lib/helper/TMToppyMessage.js +4 -0
  149. package/lib/helper/checkinCheckoutManager.d.ts +31 -1
  150. package/lib/helper/checkinCheckoutManager.js +112 -30
  151. package/lib/helper/devextremeCustomMessages.d.ts +30 -0
  152. package/lib/helper/devextremeCustomMessages.js +30 -0
  153. package/lib/helper/helpers.d.ts +30 -2
  154. package/lib/helper/helpers.js +132 -4
  155. package/lib/helper/index.d.ts +2 -0
  156. package/lib/helper/index.js +2 -0
  157. package/lib/helper/queryHelper.d.ts +2 -2
  158. package/lib/helper/queryHelper.js +80 -24
  159. package/lib/helper/workItemsHelper.d.ts +6 -0
  160. package/lib/helper/workItemsHelper.js +230 -0
  161. package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
  162. package/lib/hooks/useCheckInOutOperations.js +223 -0
  163. package/lib/hooks/useDataListItem.d.ts +12 -0
  164. package/lib/hooks/useDataListItem.js +132 -0
  165. package/lib/hooks/useDataUserIdItem.d.ts +10 -0
  166. package/lib/hooks/useDataUserIdItem.js +96 -0
  167. package/lib/hooks/useFloatingBarPinnedItems.d.ts +11 -0
  168. package/lib/hooks/useFloatingBarPinnedItems.js +54 -0
  169. package/lib/hooks/useMetadataExpression.d.ts +19 -0
  170. package/lib/hooks/useMetadataExpression.js +99 -0
  171. package/lib/hooks/useSettingsFeedback.d.ts +11 -0
  172. package/lib/hooks/useSettingsFeedback.js +38 -0
  173. package/lib/hooks/useWorkflowApprove.d.ts +4 -0
  174. package/lib/hooks/useWorkflowApprove.js +14 -1
  175. package/lib/index.d.ts +1 -0
  176. package/lib/index.js +3 -2
  177. package/lib/services/platform_services.d.ts +3 -3
  178. package/lib/ts/types.d.ts +61 -1
  179. package/lib/utils/theme.d.ts +1 -1
  180. package/lib/utils/theme.js +1 -1
  181. package/package.json +6 -5
  182. package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
  183. package/lib/components/NewComponents/Notification/Notification.js +0 -60
  184. package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
  185. package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
  186. package/lib/components/NewComponents/Notification/index.d.ts +0 -2
  187. package/lib/components/NewComponents/Notification/index.js +0 -2
  188. package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
  189. package/lib/components/NewComponents/Notification/styles.js +0 -180
  190. package/lib/components/NewComponents/Notification/types.d.ts +0 -18
  191. package/lib/components/NewComponents/Notification/types.js +0 -1
  192. package/lib/components/base/TMContextMenu.d.ts +0 -25
  193. package/lib/components/base/TMContextMenu.js +0 -109
  194. package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
  195. package/lib/components/base/TMContextMenuOLD.js +0 -56
  196. package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
  197. package/lib/components/base/TMFloatingToolbar.js +0 -101
  198. package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
  199. package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
  200. package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
  201. package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
  202. package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
@@ -0,0 +1,92 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import TMTextBox from './TMTextBox';
4
+ import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
5
+ import { useMetadataExpression } from '../../hooks/useMetadataExpression';
6
+ const TMMetadataTextBox = (props) => {
7
+ const { metadatas_Info_Source, Expression_IDs2Names, Expression_Names2IDs } = useMetadataExpression({
8
+ qd: props.qd,
9
+ tid: props.tid
10
+ });
11
+ const insertAtCursor = (textToInsert) => {
12
+ const currentValue = Expression_IDs2Names(props.value) || '';
13
+ let newValue = currentValue;
14
+ let cursorPosition = currentValue.length;
15
+ const activeElement = document.activeElement;
16
+ if (activeElement && activeElement.tagName === 'INPUT' && activeElement.selectionStart !== null) {
17
+ const start = activeElement.selectionStart || 0;
18
+ const end = activeElement.selectionEnd || 0;
19
+ newValue =
20
+ currentValue.substring(0, start) +
21
+ textToInsert +
22
+ currentValue.substring(end);
23
+ cursorPosition = start + textToInsert.length;
24
+ }
25
+ else {
26
+ newValue = currentValue + textToInsert;
27
+ cursorPosition = newValue.length;
28
+ }
29
+ const syntheticEvent = {
30
+ target: { value: Expression_Names2IDs(newValue) }
31
+ };
32
+ props.onValueChanged?.(syntheticEvent);
33
+ setTimeout(() => {
34
+ const activeElement = document.activeElement;
35
+ if (activeElement && activeElement.tagName === 'INPUT') {
36
+ activeElement.setSelectionRange(cursorPosition, cursorPosition);
37
+ activeElement.focus();
38
+ }
39
+ }, 0);
40
+ };
41
+ // Crea i menu items per il context menu
42
+ const contextMenuItems = useMemo(() => {
43
+ // Separa metadati di sistema (Mid < 100) da quelli normali
44
+ const systemMetadata = metadatas_Info_Source.filter(mh => mh.Mid < 100);
45
+ const normalMetadata = metadatas_Info_Source.filter(mh => mh.Mid >= 100);
46
+ const items = [];
47
+ // Aggiungi metadati normali
48
+ normalMetadata.forEach(mh => {
49
+ items.push({
50
+ name: mh.MetadataName,
51
+ onClick: () => insertAtCursor(`{@${mh.MetadataName}}`)
52
+ });
53
+ });
54
+ // Aggiungi sottomenu per metadati di sistema se presenti
55
+ if (systemMetadata.length > 0) {
56
+ items.push({
57
+ name: 'Metadati di sistema',
58
+ beginGroup: normalMetadata.length > 0, // Separatore se ci sono anche metadati normali
59
+ submenu: systemMetadata.map(mh => ({
60
+ name: mh.MetadataName,
61
+ onClick: () => insertAtCursor(`{@${mh.MetadataName}}`)
62
+ }))
63
+ });
64
+ }
65
+ return items;
66
+ }, [metadatas_Info_Source, props.value]);
67
+ const renderButtons = () => {
68
+ const customButtons = [];
69
+ // Aggiungi eventuali bottoni custom passati via props
70
+ if (props.buttons) {
71
+ customButtons.push(...props.buttons);
72
+ }
73
+ return customButtons;
74
+ };
75
+ const handleValueChanged = (e) => {
76
+ const syntheticEvent = {
77
+ ...e,
78
+ target: {
79
+ ...e.target,
80
+ value: Expression_Names2IDs(e.target.value) || ''
81
+ }
82
+ };
83
+ props.onValueChanged?.(syntheticEvent);
84
+ };
85
+ // Se non ci sono metadati (qd o tid non specificati), usa TMTextBox normale
86
+ if (!props.qd && !props.tid) {
87
+ return (_jsx(TMTextBox, { ...props, buttons: renderButtons(), value: Expression_IDs2Names(props.value) ?? '', onValueChanged: handleValueChanged }));
88
+ }
89
+ // Altrimenti, wrappa TMTextBox con TMContextMenu
90
+ return (_jsx(TMContextMenu, { items: contextMenuItems, trigger: "right", children: _jsx(TMTextBox, { ...props, buttons: renderButtons(), value: Expression_IDs2Names(props.value) ?? '', onValueChanged: handleValueChanged }) }));
91
+ };
92
+ export default TMMetadataTextBox;
@@ -41,6 +41,8 @@ interface ITMMetadataValuesProps extends DeviceContextProps {
41
41
  onAdvancedMenuClick?: (e: AdvancedMenuClickEventArgs) => void;
42
42
  onValueChanged?: (mid: MetadataValueDescriptorEx[]) => void;
43
43
  onFocusedItemChanged?: (mid: MetadataValueDescriptorEx | undefined) => void;
44
+ updateIsModalOpen?: (isOpen: boolean) => void;
45
+ isReadOnlyOrigin?: boolean;
44
46
  }
45
47
  declare const TMMetadataValues: React.FC<ITMMetadataValuesProps>;
46
48
  export default TMMetadataValues;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, 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
- import { AccessLevels, DcmtTypeListCacheService, LayoutGroupBorderStyles, LayoutGroupOrientations, LayoutItemTypes, LayoutModes, MetadataDataDomains, MetadataDataTypes, SDK_Globals, SystemMIDsAsNumber, SystemTIDs, TemplateTIDs, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
5
- import { IconUndo, IconPencil, IconFunction, IconMenuVertical, IconDataList, SDKUI_Localizator, IconNull, stringIsNullOrEmpty, deepCompare, SDKUI_Globals, IconDcmtTypeSys } from "../../helper";
4
+ import { AccessLevels, DcmtTypeListCacheService, LayoutGroupBorderStyles, LayoutGroupOrientations, LayoutItemTypes, LayoutModes, MetadataDataDomains, MetadataDataTypes, SDK_Globals, SystemMIDsAsNumber, SystemTIDs, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
5
+ import { IconUndo, IconPencil, IconFunction, IconMenuVertical, IconDataList, SDKUI_Localizator, IconNull, stringIsNullOrEmpty, deepCompare, SDKUI_Globals, IconDcmtTypeSys, isApprovalWorkflowView } from "../../helper";
6
6
  import { TMColors } from "../../utils/theme";
7
7
  import TMButton from "../base/TMButton";
8
8
  import TMDropDownMenu from "../base/TMDropDownMenu";
@@ -27,7 +27,7 @@ export var AdvancedMenuButtons;
27
27
  AdvancedMenuButtons[AdvancedMenuButtons["FormulaEditor"] = 2] = "FormulaEditor";
28
28
  AdvancedMenuButtons[AdvancedMenuButtons["DistinctValues"] = 3] = "DistinctValues";
29
29
  })(AdvancedMenuButtons || (AdvancedMenuButtons = {}));
30
- const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerms = true, isReadOnly = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, customMenuItems = [], showNullValueCheckBoxes, isOpenDistinctValues = false, openChooserBySingleClick, selectedMID, onFocusedItemChanged, layoutMode = LayoutModes.Update, metadataValues = [], metadataValuesOrig = [], TID, onValueChanged, onAdvancedMenuClick, validationItems, inputMids = [], layout }) => {
30
+ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerms = true, isReadOnly = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, customMenuItems = [], showNullValueCheckBoxes, isOpenDistinctValues = false, openChooserBySingleClick, selectedMID, onFocusedItemChanged, layoutMode = LayoutModes.Update, metadataValues = [], metadataValuesOrig = [], TID, onValueChanged, onAdvancedMenuClick, validationItems, inputMids = [], layout, updateIsModalOpen, isReadOnlyOrigin = false }) => {
31
31
  const [dynDataListsToBeRefreshed, setDynDataListsToBeRefreshed] = useState([]);
32
32
  const [currentDTD, setCurrentDTD] = useState();
33
33
  const [isEditableList, addOrRemoveEditableList] = useMetadataEditableList();
@@ -280,7 +280,7 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
280
280
  mdItem.value = item.value;
281
281
  }
282
282
  onValueChanged?.(newMetadata);
283
- } }), FormulaHelper.isFormula(item.value)
283
+ }, updateIsModalOpen: updateIsModalOpen }), FormulaHelper.isFormula(item.value)
284
284
  ? _jsx(IconFunction, { color: "#1a89d3", fontSize: 14, style: { position: "absolute", top: item.md?.dataType === MetadataDataTypes.DateTime ? '3px' : '5px', left: '14px' } })
285
285
  : (isEditable(item.mid) || item.isEditable)
286
286
  ? _jsx(IconPencil, { color: "#138603", fontSize: 14, style: { position: "absolute", top: item.md?.dataType === MetadataDataTypes.DateTime ? '3px' : '5px', left: '16px' } })
@@ -298,7 +298,7 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
298
298
  mvd.isSelected = !stringIsNullOrEmpty(mvd.value);
299
299
  }
300
300
  onValueChanged?.(newValues);
301
- } }) }), !isReadOnly && _jsx("div", { style: { marginTop: item.md?.dataType === MetadataDataTypes.DateTime ? '12px' : '18px' }, onClick: () => { handleMetadataValueSelection(item); }, children: _jsx(TMDropDownMenu, { backgroundColor: 'white', color: TMColors.button_icon, borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconMenuVertical, {}), showTooltip: false }), disabled: item.isLexProt === 1, items: getAdvancedMenuItems(item) }) })] }, item.mid)), [TID, showCheckBoxes, showNullValueCheckBoxes, isReadOnly, layoutMode, selectedMID, isOpenDistinctValues, openChooserBySingleClick, dynDataListsToBeRefreshed, metadataValues, metadataValuesOrig, validationItems, onValueChanged, handleMetadataValueSelection, getAdvancedMenuItems, onChangeHandler, editorValidationHandler, isEditable]);
301
+ } }) }), (!isReadOnly && !isReadOnlyOrigin) && _jsx("div", { style: { marginTop: item.md?.dataType === MetadataDataTypes.DateTime ? '12px' : '18px' }, onClick: () => { handleMetadataValueSelection(item); }, children: _jsx(TMDropDownMenu, { backgroundColor: 'white', color: TMColors.button_icon, borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconMenuVertical, {}), showTooltip: false }), disabled: item.isLexProt === 1, items: getAdvancedMenuItems(item) }) })] }, item.mid)), [TID, showCheckBoxes, showNullValueCheckBoxes, isReadOnly, isReadOnlyOrigin, layoutMode, selectedMID, isOpenDistinctValues, openChooserBySingleClick, dynDataListsToBeRefreshed, metadataValues, metadataValuesOrig, validationItems, onValueChanged, handleMetadataValueSelection, getAdvancedMenuItems, onChangeHandler, editorValidationHandler, isEditable]);
302
302
  const layoutWorkItem = useMemo(() => {
303
303
  const workItemData = [];
304
304
  const technicalWorkItemData = [];
@@ -389,17 +389,35 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
389
389
  return (_jsxs("div", { style: { width: '100%' }, children: [draftData.length > 0 && _jsx(TMAccordion, { title: SDKUI_Localizator.Draft, children: draftData.map(item => renderMetadataItem(item, isReadOnly)) }), checkOutData.length > 0 && _jsx(TMAccordion, { title: `${SDKUI_Localizator.CheckIn}/${SDKUI_Localizator.CheckOut}`, children: checkOutData.map(item => renderMetadataItem(item, true)) })] }));
390
390
  }, [metadataValues, showCheckBoxes, showNullValueCheckBoxes, isReadOnly, dynDataListsToBeRefreshed, validationItems, selectedMID, isOpenDistinctValues, openChooserBySingleClick, metadataValuesOrig]);
391
391
  const layoutChronology = useMemo(() => {
392
- const chronologyData = [];
392
+ // Definiamo l'ordine desiderato: Version, Tipo, Dimensione, Autore, Data Ultima modifica
393
+ const desiredChronologyOrder = [
394
+ ChronologyMIDs.Ver,
395
+ SystemMIDsAsNumber.FileExt,
396
+ SystemMIDsAsNumber.FileSize,
397
+ ChronologyMIDs.AuthorID,
398
+ ChronologyMIDs.CheckInTime,
399
+ ];
400
+ const tempChronologyDataMap = {};
393
401
  metadataValues.forEach(item => {
394
402
  switch (item.md?.id) {
395
403
  case ChronologyMIDs.Ver:
396
404
  case ChronologyMIDs.AuthorID:
397
- chronologyData.push(item);
405
+ case ChronologyMIDs.CheckInTime:
406
+ case SystemMIDsAsNumber.FileExt:
407
+ case SystemMIDsAsNumber.FileSize:
408
+ tempChronologyDataMap[item.md.id] = item;
398
409
  break;
399
410
  default:
400
411
  break;
401
412
  }
402
413
  });
414
+ // Visualizziamo nell'ordine desiderato
415
+ const chronologyData = [];
416
+ desiredChronologyOrder.forEach(id => {
417
+ if (tempChronologyDataMap[id]) {
418
+ chronologyData.push(tempChronologyDataMap[id]);
419
+ }
420
+ });
403
421
  return (_jsx("div", { style: { width: '100%' }, children: chronologyData.length > 0 && chronologyData.map(item => renderMetadataItem(item, isReadOnly)) }));
404
422
  }, [metadataValues, showCheckBoxes, showNullValueCheckBoxes, isReadOnly, dynDataListsToBeRefreshed, validationItems, selectedMID, isOpenDistinctValues, openChooserBySingleClick, metadataValuesOrig]);
405
423
  const layoutDsAttachs = useMemo(() => {
@@ -550,7 +568,7 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
550
568
  if (allSystem) {
551
569
  return metadataValues.map((item) => renderMetadataItem(item, true));
552
570
  }
553
- if (currentDTD?.templateTID === TemplateTIDs.WF_WIApprView && !isReadOnly) {
571
+ if (isApprovalWorkflowView(currentDTD) && !isReadOnly) {
554
572
  return layoutWorkItem;
555
573
  }
556
574
  switch (currentDTD?.id) {
@@ -39,6 +39,8 @@ const StyledradioButtonLabel = styled.label `
39
39
  font-size: ${props => props.$fontSize};
40
40
  color: ${props => !props.$disabled ? props.$isModifiedWhen ? TMColors.isModified : TMColors.text_normal : TMColors.disabled};
41
41
  user-select: none;
42
+ -webkit-touch-callout: none;
43
+ -webkit-user-select: none;
42
44
  width: 100%;
43
45
  cursor: ${props => !props.$disabled && 'pointer'};
44
46
  &:focus{
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import { useState, useEffect, useRef } from 'react';
3
3
  import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, StyledTextareaEditor } from './TMEditorStyled';
4
4
  import { FontSize, TMColors } from '../../utils/theme';
5
- import TMContextMenu, { useContextMenu } from '../base/TMContextMenuOLD';
5
+ import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
6
6
  import { TMExceptionBoxManager } from '../base/TMPopUp';
7
7
  import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
8
8
  import TMVilViewer from '../base/TMVilViewer';
@@ -35,14 +35,10 @@ const TMTextArea = (props) => {
35
35
  const [isFocused, setIsFocused] = useState(false);
36
36
  // Stores the current value of the textarea
37
37
  const [currentValue, setCurrentValue] = useState(value);
38
- // Stores the items for the context menu
39
- const [formulaMenuItems, setFormulaMenuItems] = useState([]);
40
38
  // Stores the calculated number of rows for the textarea
41
39
  const [calculatedRows, setCalculatedRows] = useState(rows ?? 1);
42
40
  //Show chooserForm formulaItems
43
41
  const [showFormulaItemsChooser, setShowFormulaItemsChooser] = useState(false);
44
- // Manages the state for the custom context menu
45
- const { clicked, setClicked, points, setPoints } = useContextMenu();
46
42
  const deviceType = useDeviceType();
47
43
  // Attach a `ResizeObserver` to the textarea to monitor changes in width: dynamically updates rows based on textarea content and width
48
44
  useEffect(() => {
@@ -69,16 +65,15 @@ const TMTextArea = (props) => {
69
65
  setCalculatedRows(newRowCount);
70
66
  }
71
67
  }, [currentValue, autoCalculateRows]);
72
- // Populate the formula menu items whenever the `formulaItems` prop changes
73
- useEffect(() => {
74
- if (formulaItems && formulaItems.length > 0) {
75
- let menuItems = [];
76
- for (const formula of formulaItems) {
77
- menuItems.push({ text: formula });
78
- }
79
- setFormulaMenuItems(menuItems);
80
- }
81
- }, [formulaItems]);
68
+ // Build context menu items for formulas
69
+ const getFormulaMenuItems = () => {
70
+ if (!formulaItems || formulaItems.length === 0)
71
+ return [];
72
+ return formulaItems.map(formula => ({
73
+ name: formula,
74
+ onClick: () => insertText(formula)
75
+ }));
76
+ };
82
77
  function getFormulaDataSorce() {
83
78
  let fiarray = [];
84
79
  if (!formulaItems)
@@ -153,20 +148,8 @@ const TMTextArea = (props) => {
153
148
  };
154
149
  // Renders the textarea
155
150
  const renderTextArea = () => {
156
- return _jsxs(_Fragment, { children: [_jsx(StyledTextareaEditor, { ref: inputRef, autoFocus: autoFocus, readOnly: readOnly, disabled: disabled, value: currentValue, placeholder: placeHolder, rows: calculatedRows, maxLength: maxLength, spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
157
- onBlur?.(currentValue); }, onChange: (e) => { setCurrentValue(e.target.value); onValueChanged?.(e); }, onContextMenu: (e) => {
158
- if (formulaItems.length <= 0)
159
- return;
160
- // prevent default right click behavior
161
- e.preventDefault();
162
- // set our click state to true when a user right clicks
163
- setClicked(true);
164
- const bounds = e.currentTarget.getBoundingClientRect();
165
- const x = e.clientX - bounds.left;
166
- const y = e.clientY - bounds.top;
167
- // set the x and y coordinates of our users right click
168
- setPoints({ x, y });
169
- }, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: calculatedRows === 1 ? (label.length > 0 ? '20px' : '7px') : (label.length > 0 ? '22px' : '7px'), pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
151
+ const textareaElement = _jsxs(_Fragment, { children: [_jsx(StyledTextareaEditor, { ref: inputRef, autoFocus: autoFocus, readOnly: readOnly, disabled: disabled, value: currentValue, placeholder: placeHolder, rows: calculatedRows, maxLength: maxLength, spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
152
+ onBlur?.(currentValue); }, onChange: (e) => { setCurrentValue(e.target.value); onValueChanged?.(e); }, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: calculatedRows === 1 ? (label.length > 0 ? '20px' : '7px') : (label.length > 0 ? '22px' : '7px'), pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
170
153
  _jsx(StyledTextAreaEditorButton, { onClick: () => {
171
154
  setShowFormulaItemsChooser(true);
172
155
  }, children: _jsx(IconDataList, {}) }), showClearButton && currentValue &&
@@ -178,7 +161,12 @@ const TMTextArea = (props) => {
178
161
  onBlur?.(undefined);
179
162
  }, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
180
163
  return (_jsx(StyledTextAreaEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
181
- })] }), openFormulaItemsChooser(), formulaItems.length > 0 && clicked && (_jsx(TMContextMenu, { menuData: formulaMenuItems, top: points.y, left: points.x, onMenuItemClick: (formula) => insertText(formula) })), _jsx(TMVilViewer, { vil: validationItems })] });
164
+ })] }), openFormulaItemsChooser(), _jsx(TMVilViewer, { vil: validationItems })] });
165
+ // Wrap with context menu if formula items exist
166
+ if (formulaItems.length > 0) {
167
+ return (_jsx(TMContextMenu, { items: getFormulaMenuItems(), trigger: "right", children: textareaElement }));
168
+ }
169
+ return textareaElement;
182
170
  };
183
171
  // Layout for the textarea with a left-aligned label
184
172
  const renderedLeftLabelTextArea = () => {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ITMEditorBase } from '../base/TMEditorBase';
3
3
  export type TextBoxType = 'text' | 'email' | 'password' | 'number' | 'secureText';
4
- interface ITMTextBox extends ITMEditorBase {
4
+ export interface ITMTextBox extends ITMEditorBase {
5
5
  autoFocus?: boolean;
6
6
  formulaItems?: string[];
7
7
  maxValue?: number;
@@ -9,7 +9,7 @@ import { TMExceptionBoxManager } from '../base/TMPopUp';
9
9
  import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
10
10
  import TMVilViewer from '../base/TMVilViewer';
11
11
  import TMTooltip from '../base/TMTooltip';
12
- import { ContextMenu } from 'devextreme-react';
12
+ import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
13
13
  import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
14
14
  import TMChooserForm from '../forms/TMChooserForm';
15
15
  import { FormulaItemHelper } from './TMTextExpression';
@@ -94,7 +94,10 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
94
94
  if (formulaItems && formulaItems.length > 0) {
95
95
  let menuItems = [];
96
96
  for (const formula of formulaItems) {
97
- menuItems.push({ text: formula });
97
+ menuItems.push({
98
+ name: formula,
99
+ onClick: () => insertText(formula)
100
+ });
98
101
  }
99
102
  setFormulaMenuItems(menuItems);
100
103
  }
@@ -253,13 +256,35 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
253
256
  ? bulletEntity.repeat(currentValue?.length ?? 0)
254
257
  : currentValue ?? '')
255
258
  : currentValue ?? '';
259
+ // Calcola il padding-right necessario per evitare sovrapposizione con i bottoni
260
+ const calculateRightPadding = () => {
261
+ if (initialType === 'password')
262
+ return 10; // Solo l'icona show/hide password
263
+ let buttonCount = 0;
264
+ if (formulaItems.length > 0)
265
+ buttonCount++; // IconDataList
266
+ if (showClearButton && currentValue)
267
+ buttonCount++; // IconClearButton
268
+ buttonCount += buttons.length; // Custom buttons
269
+ if (currentType === 'number') {
270
+ // Per i number, non aggiungiamo padding-right perché le freccette native
271
+ // occupano già spazio. Se ci sono bottoni custom a sinistra delle freccette,
272
+ // il loro posizionamento assoluto (right: 25px) li gestisce correttamente
273
+ return 4; // Padding minimo
274
+ }
275
+ else {
276
+ // Per gli altri tipi, calcolo normale
277
+ const buttonWidth = 28;
278
+ return 6 + (buttonCount * buttonWidth) + 8;
279
+ }
280
+ };
256
281
  return (_jsxs("div", { style: { width: '100%', height: 'fit-content' }, id: `text-${id}`, children: [_jsx(StyledEditor, { ref: inputRef, id: `text-${label}-${id}`, name: label, autoFocus: autoFocus, readOnly: readOnly, type: currentType, disabled: disabled, value: displayedValue, width: width || '100%', placeholder: placeHolder, maxLength: maxLength, autoComplete: 'off', spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
257
282
  onBlur?.(currentValue); }, onChange: handleInputChange, onKeyDown: (e) => {
258
283
  if (currentType === 'number') {
259
284
  if (!scale && (e.key == "." || e.key == ","))
260
285
  e.preventDefault();
261
286
  }
262
- }, "$isMobile": deviceType === DeviceType.MOBILE, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType, "$borderRadius": borderRadius }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' &&
287
+ }, "$isMobile": deviceType === DeviceType.MOBILE, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType, "$borderRadius": borderRadius, style: { paddingRight: `${calculateRightPadding()}px` } }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' &&
263
288
  _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : '6px', top: label.length > 0 ? '20px' : '3px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
264
289
  _jsx(StyledTextBoxEditorButton, { onClick: () => {
265
290
  setShowFormulaItemsChooser(true);
@@ -269,7 +294,7 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
269
294
  onBlur?.(undefined);
270
295
  }, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
271
296
  return (_jsx(StyledTextBoxEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
272
- })] }), openFormulaItemsChooser(), formulaItems.length > 0 && (_jsx(ContextMenu, { dataSource: formulaMenuItems, target: `#text-${id}`, onItemClick: (e) => { insertText(e.itemData?.text ?? ''); } })), _jsx(TMVilViewer, { vil: validationItems })] }));
297
+ })] }), openFormulaItemsChooser(), formulaItems.length > 0 && (_jsx(TMContextMenu, { items: formulaMenuItems, target: `#text-${id}` })), _jsx(TMVilViewer, { vil: validationItems })] }));
273
298
  };
274
299
  const renderedLeftLabelTextBox = () => {
275
300
  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()] }) })] }));
@@ -1,96 +1,17 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useMemo, useState } from 'react';
3
- import { DcmtTypeListCacheService } from '@topconsultnpm/sdk-ts';
2
+ import { useMemo, useState } from 'react';
4
3
  import { IconClear, IconColumns, SDKUI_Localizator, stringIsNullOrEmpty } from '../../helper';
5
- import { TMExceptionBoxManager } from '../base/TMPopUp';
6
4
  import { TMMetadataChooserForm } from '../choosers/TMMetadataChooser';
7
5
  import TMTextBox from './TMTextBox';
8
6
  import TMTextArea from './TMTextArea';
7
+ import { useMetadataExpression } from '../../hooks/useMetadataExpression';
9
8
  const TMTextExpression = (props) => {
10
- const [metadatas_Info_Source, setMetadatas_Info_Source] = useState([]);
9
+ const { metadatas_Info_Source, Expression_IDs2Names, Expression_Names2IDs } = useMetadataExpression({
10
+ qd: props.qd,
11
+ tid: props.tid
12
+ });
11
13
  const [showMetadataChooser, setShowMetadataChooser] = useState(false);
12
14
  const [showFormulaChooser, setShowFormulaChooser] = useState(false);
13
- useEffect(() => { MetadataInfos_Source_Get_Async(); }, [props.qd]);
14
- useEffect(() => { MetadataInfos_Source_GetByTID_Async(); }, [props.tid]);
15
- async function MetadataInfos_Source_Get_Async() {
16
- if (!props.qd?.select)
17
- return;
18
- let mhs_source = [];
19
- try {
20
- let dtd_source;
21
- let md_source;
22
- let tid_source = -1;
23
- let si;
24
- let sis = props.qd?.select?.slice();
25
- sis = sis.slice().sort((a, b) => a.tid - b.tid);
26
- for (si of sis) {
27
- if (si.tid == undefined || si.mid == undefined)
28
- continue;
29
- if (tid_source != si.tid) {
30
- dtd_source = await DcmtTypeListCacheService.GetAsync(si.tid, true);
31
- if (dtd_source == undefined)
32
- continue;
33
- tid_source = si.tid;
34
- }
35
- if (dtd_source?.metadata == undefined)
36
- continue;
37
- md_source = dtd_source.metadata.find(o => o.id == si.mid);
38
- if (md_source?.name == undefined)
39
- continue;
40
- if (tid_source == undefined)
41
- continue;
42
- mhs_source.push(new MetatadaHelper(si.mid, md_source.name));
43
- }
44
- }
45
- catch (e) {
46
- TMExceptionBoxManager.show({ exception: e, title: 'MetadataInfos_Source_Get_Async' });
47
- }
48
- setMetadatas_Info_Source(mhs_source);
49
- }
50
- async function MetadataInfos_Source_GetByTID_Async() {
51
- if (!props.tid)
52
- return;
53
- let mhs_source = [];
54
- try {
55
- let dtd_source = await DcmtTypeListCacheService.GetAsync(props.tid, true);
56
- if (dtd_source == undefined)
57
- return;
58
- if (dtd_source?.metadata == undefined)
59
- return;
60
- for (let md_source of dtd_source?.metadata) {
61
- if (md_source?.name == undefined)
62
- continue;
63
- if (md_source?.id == undefined)
64
- continue;
65
- mhs_source.push(new MetatadaHelper(md_source.id, md_source.name));
66
- }
67
- }
68
- catch (e) {
69
- TMExceptionBoxManager.show({ exception: e, title: 'MetadataInfos_Source_GetByTID_Async' });
70
- }
71
- setMetadatas_Info_Source(mhs_source);
72
- }
73
- function Expression_IDs2Names(expression) {
74
- if (expression == undefined)
75
- return expression;
76
- let temp = expression.slice();
77
- let mh;
78
- for (mh of metadatas_Info_Source) {
79
- temp = temp.replaceAll(`{@${mh.Mid}}`, `{@${mh.MetadataName}}`);
80
- }
81
- temp = temp.replaceAll("{@1}", "{@DID}");
82
- return temp;
83
- }
84
- function Expression_Names2IDs(expression) {
85
- if (expression == undefined)
86
- return expression;
87
- let temp = expression.slice();
88
- let mh;
89
- for (mh of metadatas_Info_Source)
90
- temp = temp.replaceAll(`{@${mh.MetadataName}}`, `{@${mh.Mid}}`);
91
- temp = temp.replaceAll("{@DID}", "{@1}");
92
- return temp;
93
- }
94
15
  const renderButtons = () => {
95
16
  let buttons = [];
96
17
  if (props.qd || props.tid)
@@ -167,12 +88,6 @@ const TMTextExpression = (props) => {
167
88
  :
168
89
  _jsx(TMTextArea, { buttons: renderButtons(), formulaItems: props.formulaItems, isModifiedWhen: props.value != props.valueOrig, label: props.label, rows: props.rows, resize: false, placeHolder: props.placeHolder, value: Expression_IDs2Names(props.value) ?? '', validationItems: props.validationItems, onValueChanged: (e) => { props.onValueChanged?.(Expression_Names2IDs(e.target.value)); } }), openMetadataChooseForm(), " "] }));
169
90
  };
170
- class MetatadaHelper {
171
- constructor(mid, metadataName) {
172
- this.Mid = mid;
173
- this.MetadataName = metadataName;
174
- }
175
- }
176
91
  export class FormulaItemHelper {
177
92
  constructor() {
178
93
  this.id = 0;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useEffect, useMemo, useState } from 'react';
3
3
  import Logo from '../../../assets/Toppy-generico.png';
4
4
  import { DcmtTypeListCacheService, LayoutModes, SDK_Localizator } from '@topconsultnpm/sdk-ts';
5
- import { IconTree, SDKUI_Globals, SDKUI_Localizator, IconRecentlyViewed, IconPreview, IconShow, IconBoard, IconDcmtTypeSys, removeMruTid } from '../../../helper';
5
+ import { IconTree, SDKUI_Globals, SDKUI_Localizator, IconRecentlyViewed, IconPreview, IconShow, IconBoard, IconDcmtTypeSys, removeMruTid, getMoreInfoTasksForDocument } from '../../../helper';
6
6
  import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
7
7
  import TMLayoutContainer from '../../base/TMLayout';
8
8
  import TMRecentsManager from '../../grids/TMRecentsManager';
@@ -77,7 +77,7 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
77
77
  if (onDcmtTypeSelect)
78
78
  onDcmtTypeSelect(tidToUse);
79
79
  passToSearch(tidToUse, outputMids);
80
- } : undefined, isSharedDcmt: isSharedArchive, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }, currentTID)
80
+ } : undefined, isSharedDcmt: isSharedArchive, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, currentTID, currentTID === inputTID ? inputDID : undefined) }, currentTID)
81
81
  :
82
82
  _jsx(TMPanel, { title: 'Archiviazione', allowMaximize: false, children: _jsxs(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: [_jsx(StyledToppyTextContainer, { children: _jsx(StyledToppyText, { children: SDKUI_Localizator.DcmtTypeSelect }) }), _jsx(StyledToppyImage, { src: Logo, alt: 'Toppy' })] }) }), [currentTID, deviceType, mruTIDs, inputFile, currentInputMids, enableDragDropOverlay, isSharedArchive, allTasks]);
83
83
  const allInitialPanelVisibility = {
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface TMToppyDraggableHelpCenterProps {
3
+ /** Contenuto da visualizzare nella speech bubble */
4
+ content?: React.ReactNode;
5
+ /** Se true, renderizza Toppy nel document.body tramite Portal invece che nel parent */
6
+ usePortal?: boolean;
7
+ /** Allineamento iniziale del componente (destra o sinistra) */
8
+ align?: 'right' | 'left';
9
+ /** Visibilità del componente */
10
+ isVisible?: boolean;
11
+ /** Callback chiamato quando si clicca sull'immagine di Toppy */
12
+ onToppyImageClick?: () => void;
13
+ }
14
+ declare const TMToppyDraggableHelpCenter: (props: TMToppyDraggableHelpCenterProps) => import("react/jsx-runtime").JSX.Element;
15
+ export default TMToppyDraggableHelpCenter;