@topconsultnpm/sdkui-react 6.20.0-dev1.9 → 6.20.0-dev1.90

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 (143) hide show
  1. package/lib/assets/Toppy-help-center.png +0 -0
  2. package/lib/components/NewComponents/ContextMenu/TMContextMenu.d.ts +4 -0
  3. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +441 -0
  4. package/lib/components/NewComponents/ContextMenu/hooks.d.ts +18 -0
  5. package/lib/components/NewComponents/ContextMenu/hooks.js +120 -0
  6. package/lib/components/NewComponents/ContextMenu/index.d.ts +5 -0
  7. package/lib/components/NewComponents/ContextMenu/index.js +3 -0
  8. package/lib/components/NewComponents/ContextMenu/styles.d.ts +35 -0
  9. package/lib/components/NewComponents/ContextMenu/styles.js +428 -0
  10. package/lib/components/NewComponents/ContextMenu/types.d.ts +39 -0
  11. package/lib/components/NewComponents/ContextMenu/types.js +1 -0
  12. package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
  13. package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
  14. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.d.ts +4 -0
  15. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +821 -0
  16. package/lib/components/NewComponents/FloatingMenuBar/index.d.ts +2 -0
  17. package/lib/components/NewComponents/FloatingMenuBar/index.js +2 -0
  18. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +54 -0
  19. package/lib/components/NewComponents/FloatingMenuBar/styles.js +419 -0
  20. package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +36 -0
  21. package/lib/components/NewComponents/FloatingMenuBar/types.js +1 -0
  22. package/lib/components/base/TMAccordionNew.js +35 -14
  23. package/lib/components/base/TMCustomButton.js +61 -17
  24. package/lib/components/base/TMDataGrid.d.ts +7 -4
  25. package/lib/components/base/TMDataGrid.js +144 -11
  26. package/lib/components/base/TMDropDownMenu.js +19 -18
  27. package/lib/components/base/TMFileManager.d.ts +4 -3
  28. package/lib/components/base/TMFileManager.js +32 -24
  29. package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
  30. package/lib/components/base/TMFileManagerDataGridView.js +1 -11
  31. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
  32. package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
  33. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
  34. package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
  35. package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
  36. package/lib/components/base/TMPanel.js +1 -1
  37. package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
  38. package/lib/components/choosers/TMMetadataChooser.js +8 -1
  39. package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
  40. package/lib/components/choosers/TMUserChooser.d.ts +0 -5
  41. package/lib/components/choosers/TMUserChooser.js +25 -45
  42. package/lib/components/editors/TMMetadataValues.js +23 -5
  43. package/lib/components/editors/TMTextBox.js +6 -3
  44. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
  45. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +460 -0
  46. package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
  47. package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
  48. package/lib/components/features/documents/TMDcmtForm.d.ts +13 -1
  49. package/lib/components/features/documents/TMDcmtForm.js +442 -198
  50. package/lib/components/features/documents/TMDcmtPreview.js +41 -105
  51. package/lib/components/features/documents/TMDcmtTasks.js +9 -9
  52. package/lib/components/features/documents/TMMasterDetailDcmts.js +37 -52
  53. package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
  54. package/lib/components/features/documents/TMRelationViewer.js +2 -2
  55. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
  56. package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +2 -2
  57. package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
  58. package/lib/components/features/search/TMSearch.js +44 -9
  59. package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
  60. package/lib/components/features/search/TMSearchQueryPanel.js +19 -18
  61. package/lib/components/features/search/TMSearchResult.js +187 -247
  62. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
  63. package/lib/components/features/search/TMSearchResultsMenuItems.js +205 -169
  64. package/lib/components/features/search/TMSignSettingsForm.js +1 -1
  65. package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
  66. package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
  67. package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
  68. package/lib/components/features/tasks/TMTaskForm.js +20 -1
  69. package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
  70. package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
  71. package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
  72. package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
  73. package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
  74. package/lib/components/features/tasks/TMTasksUtils.js +43 -36
  75. package/lib/components/features/tasks/TMTasksView.js +28 -19
  76. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
  77. package/lib/components/features/workflow/TMWorkflowPopup.js +139 -34
  78. package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +1 -0
  79. package/lib/components/features/workflow/diagram/DiagramItemComponent.js +2 -3
  80. package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
  81. package/lib/components/features/workflow/diagram/WFDiagram.d.ts +3 -0
  82. package/lib/components/features/workflow/diagram/WFDiagram.js +157 -12
  83. package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
  84. package/lib/components/forms/Login/LoginValidatorService.js +7 -2
  85. package/lib/components/forms/Login/TMLoginForm.js +34 -6
  86. package/lib/components/forms/TMChooserForm.js +1 -1
  87. package/lib/components/grids/TMBlogsPost.js +55 -30
  88. package/lib/components/grids/TMRecentsManager.js +20 -10
  89. package/lib/components/index.d.ts +5 -1
  90. package/lib/components/index.js +5 -1
  91. package/lib/components/query/TMQueryEditor.d.ts +2 -1
  92. package/lib/components/query/TMQueryEditor.js +92 -92
  93. package/lib/components/settings/SettingsAppearance.d.ts +2 -1
  94. package/lib/components/settings/SettingsAppearance.js +99 -30
  95. package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
  96. package/lib/components/viewers/TMDataListItemViewer.js +35 -71
  97. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
  98. package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
  99. package/lib/css/tm-sdkui.css +1 -1
  100. package/lib/helper/SDKUI_Globals.d.ts +19 -0
  101. package/lib/helper/SDKUI_Globals.js +6 -0
  102. package/lib/helper/SDKUI_Localizator.d.ts +16 -1
  103. package/lib/helper/SDKUI_Localizator.js +157 -1
  104. package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
  105. package/lib/helper/TMCommandsContextMenu.js +15 -4
  106. package/lib/helper/TMIcons.d.ts +3 -0
  107. package/lib/helper/TMIcons.js +10 -3
  108. package/lib/helper/TMPdfViewer.d.ts +8 -0
  109. package/lib/helper/TMPdfViewer.js +373 -0
  110. package/lib/helper/checkinCheckoutManager.d.ts +31 -1
  111. package/lib/helper/checkinCheckoutManager.js +112 -30
  112. package/lib/helper/devextremeCustomMessages.d.ts +30 -0
  113. package/lib/helper/devextremeCustomMessages.js +30 -0
  114. package/lib/helper/helpers.d.ts +2 -1
  115. package/lib/helper/helpers.js +14 -3
  116. package/lib/helper/index.d.ts +2 -0
  117. package/lib/helper/index.js +2 -0
  118. package/lib/helper/queryHelper.d.ts +1 -1
  119. package/lib/helper/queryHelper.js +33 -3
  120. package/lib/helper/workItemsHelper.d.ts +6 -0
  121. package/lib/helper/workItemsHelper.js +230 -0
  122. package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
  123. package/lib/hooks/useCheckInOutOperations.js +223 -0
  124. package/lib/hooks/useDataListItem.d.ts +12 -0
  125. package/lib/hooks/useDataListItem.js +131 -0
  126. package/lib/hooks/useDataUserIdItem.d.ts +10 -0
  127. package/lib/hooks/useDataUserIdItem.js +96 -0
  128. package/lib/hooks/useSettingsFeedback.d.ts +11 -0
  129. package/lib/hooks/useSettingsFeedback.js +38 -0
  130. package/lib/hooks/useWorkflowApprove.d.ts +4 -0
  131. package/lib/hooks/useWorkflowApprove.js +14 -1
  132. package/lib/index.d.ts +1 -0
  133. package/lib/index.js +3 -2
  134. package/lib/services/platform_services.d.ts +1 -1
  135. package/lib/ts/types.d.ts +61 -1
  136. package/lib/utils/theme.d.ts +1 -1
  137. package/lib/utils/theme.js +1 -1
  138. package/package.json +7 -4
  139. package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
  140. package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
  141. package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
  142. package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
  143. package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
@@ -1,5 +1,6 @@
1
- import { FileItem, TMFileManagerContextMenuItem } from "./TMFileManagerUtils";
1
+ import { FileItem } from "./TMFileManagerUtils";
2
2
  import { UserDescriptor } from "@topconsultnpm/sdk-ts";
3
+ import { TMContextMenuItemProps } from "../NewComponents/ContextMenu/types";
3
4
  interface TMFileManagerDataGridViewProps {
4
5
  items: Array<FileItem>;
5
6
  allUsers: Array<UserDescriptor>;
@@ -7,7 +8,7 @@ interface TMFileManagerDataGridViewProps {
7
8
  handleFocusedFile: (fileItem: FileItem | undefined) => void;
8
9
  selectedFiles: Array<FileItem>;
9
10
  handleSelectedFiles: (fileItems: Array<FileItem>) => void;
10
- fileContextMenuItems: Array<TMFileManagerContextMenuItem>;
11
+ fileContextMenuItems: Array<TMContextMenuItemProps>;
11
12
  searchText: string;
12
13
  userID?: number;
13
14
  onDoubleClickHandler?: (fileItem: FileItem | undefined) => void;
@@ -48,16 +48,6 @@ const TMFileManagerDataGridView = (props) => {
48
48
  if (onDoubleClickHandler)
49
49
  onDoubleClickHandler(e.data);
50
50
  }, [onDoubleClickHandler]);
51
- const onContextMenuPreparing = (e) => {
52
- if (e === undefined)
53
- return;
54
- if (e.target === 'content') {
55
- if (handleFocusedFile && e.row)
56
- handleFocusedFile(e.row.data);
57
- e.items = e.items || [];
58
- e.items = fileContextMenuItems ? [...fileContextMenuItems] : [];
59
- }
60
- };
61
51
  const cellDefaultRender = useCallback((cellData) => {
62
52
  const value = cellData.value ?? '';
63
53
  return renderHighlightedText(value.toString(), searchText, false);
@@ -96,6 +86,6 @@ const TMFileManagerDataGridView = (props) => {
96
86
  { dataField: "creationTime", caption: SDKUI_Localizator.CreationTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
97
87
  ];
98
88
  }, [searchText]);
99
- return _jsx(TMDataGrid, { dataSource: items ?? [], dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, onFocusedRowChanged: onFocusedRowChanged, onSelectionChanged: onSelectionChanged, onCellDblClick: onCellDblClick, onContextMenuPreparing: onContextMenuPreparing, showSearchPanel: false, noDataText: SDKUI_Localizator.FolderIsEmpty }, items.length);
89
+ return _jsx(TMDataGrid, { dataSource: items ?? [], dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, onFocusedRowChanged: onFocusedRowChanged, onSelectionChanged: onSelectionChanged, onCellDblClick: onCellDblClick, customContextMenuItems: fileContextMenuItems, showSearchPanel: false, noDataText: SDKUI_Localizator.FolderIsEmpty }, items.length);
100
90
  };
101
91
  export default TMFileManagerDataGridView;
@@ -10,7 +10,13 @@ export interface TMFileManagerThumbnailItemsProps {
10
10
  selectedFiles: Array<FileItem>;
11
11
  handleSelectedFiles: (fileItems: Array<FileItem>) => void;
12
12
  searchText: string;
13
- setDraftThumbViewAnchor: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
13
+ setThumbViewContextMenuControl: React.Dispatch<React.SetStateAction<{
14
+ visible: boolean;
15
+ position: {
16
+ x: number;
17
+ y: number;
18
+ };
19
+ }>>;
14
20
  onDoubleClick?: (file: FileItem) => void;
15
21
  userID?: number;
16
22
  }
@@ -6,7 +6,7 @@ import TMTooltip from './TMTooltip';
6
6
  import TMDcmtIcon from '../features/documents/TMDcmtIcon';
7
7
  const TMFileManagerThumbnailItems = (props) => {
8
8
  // Destructuring props for cleaner usage
9
- const { items, allUsers, paginatedItems, selectedFiles, searchText, userID, onDoubleClick, handleSelectedFiles, handleFocusedFile, setDraftThumbViewAnchor } = props;
9
+ const { items, allUsers, paginatedItems, selectedFiles, searchText, userID, onDoubleClick, handleSelectedFiles, handleFocusedFile, setThumbViewContextMenuControl } = props;
10
10
  // Ref for the scrollable container
11
11
  const containerRef = useRef(null);
12
12
  // Stores index of the last selected item for shift selection
@@ -109,7 +109,10 @@ const TMFileManagerThumbnailItems = (props) => {
109
109
  // Right-click to open context menu and set focus
110
110
  const onContextMenu = useCallback((e, item) => {
111
111
  e.preventDefault();
112
- setDraftThumbViewAnchor(e.currentTarget);
112
+ setThumbViewContextMenuControl({
113
+ visible: true,
114
+ position: { x: e.clientX, y: e.clientY }
115
+ });
113
116
  handleFocusedFile(item);
114
117
  }, []);
115
118
  const findCheckOutUserName = useCallback((item) => {
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
- import { FileItem, TMFileManagerContextMenuItem } from "./TMFileManagerUtils";
2
+ import { FileItem } from "./TMFileManagerUtils";
3
3
  import { UserDescriptor } from "@topconsultnpm/sdk-ts";
4
+ import { TMContextMenuItemProps } from '../NewComponents/ContextMenu/types';
4
5
  interface TMFileManagerThumbnailsViewProps {
5
6
  items: Array<FileItem>;
6
7
  allUsers: Array<UserDescriptor>;
@@ -8,12 +9,24 @@ interface TMFileManagerThumbnailsViewProps {
8
9
  handleFocusedFile: (fileItem: FileItem | undefined) => void;
9
10
  selectedFiles: Array<FileItem>;
10
11
  handleSelectedFiles: (fileItems: Array<FileItem>) => void;
11
- fileContextMenuItems: Array<TMFileManagerContextMenuItem>;
12
+ fileContextMenuItems: Array<TMContextMenuItemProps>;
12
13
  searchText: string;
13
14
  userID?: number;
14
15
  onDoubleClickHandler?: (fileItem: FileItem | undefined) => void;
15
- draftThumbViewAnchor: HTMLElement | null;
16
- setDraftThumbViewAnchor: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
16
+ thumbViewContextMenuControl: {
17
+ visible: boolean;
18
+ position: {
19
+ x: number;
20
+ y: number;
21
+ };
22
+ };
23
+ setThumbViewContextMenuControl: React.Dispatch<React.SetStateAction<{
24
+ visible: boolean;
25
+ position: {
26
+ x: number;
27
+ y: number;
28
+ };
29
+ }>>;
17
30
  }
18
31
  declare const TMFileManagerThumbnailsView: (props: TMFileManagerThumbnailsViewProps) => import("react/jsx-runtime").JSX.Element;
19
32
  export default TMFileManagerThumbnailsView;
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useState } from "react";
3
3
  import { TMFileManagerPageSize } from "./TMFileManagerUtils";
4
- import { ContextMenu, Pagination, ScrollView } from "devextreme-react";
4
+ import { Pagination, ScrollView } from "devextreme-react";
5
+ import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
5
6
  import TMFileManagerThumbnailItems from "./TMFileManagerThumbnailItems";
6
7
  import { SDKUI_Localizator } from "../../helper";
7
8
  const TMFileManagerThumbnailsView = (props) => {
8
- const { items, allUsers, focusedFile, handleFocusedFile, selectedFiles = [], handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler, draftThumbViewAnchor, setDraftThumbViewAnchor } = props;
9
+ const { items, allUsers, focusedFile, handleFocusedFile, selectedFiles = [], handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler, thumbViewContextMenuControl, setThumbViewContextMenuControl } = props;
9
10
  const PAGE_SIZES = [TMFileManagerPageSize.Small, TMFileManagerPageSize.Medium, TMFileManagerPageSize.Large];
10
11
  const initPageSize = TMFileManagerPageSize.Small;
11
12
  const showPagination = (items?.length ?? 0) > initPageSize;
@@ -26,7 +27,7 @@ const TMFileManagerThumbnailsView = (props) => {
26
27
  }, []);
27
28
  // Handle closing the context menu
28
29
  const closeViewContextMenu = useCallback(() => {
29
- setDraftThumbViewAnchor(null);
30
+ setThumbViewContextMenuControl(prev => ({ ...prev, visible: false }));
30
31
  }, []);
31
32
  const onBackgroundContextMenu = (event) => {
32
33
  if (event === undefined)
@@ -34,13 +35,24 @@ const TMFileManagerThumbnailsView = (props) => {
34
35
  if (event.target.closest('.tm-file-manager-thumbnail-items'))
35
36
  return;
36
37
  event.preventDefault();
37
- setDraftThumbViewAnchor(event.currentTarget);
38
+ setThumbViewContextMenuControl({
39
+ visible: true,
40
+ position: { x: event.clientX, y: event.clientY }
41
+ });
38
42
  handleFocusedFile?.(undefined);
39
43
  handleSelectedFiles?.([]);
40
44
  };
41
45
  return items.length > 0 ?
42
- _jsxs("div", { style: { width: "100%", height: "100%" }, onContextMenu: onBackgroundContextMenu, children: [_jsx(ScrollView, { width: "100%", height: showPagination ? "calc(100% - 50px)" : "100%", useNative: true, direction: 'vertical', children: _jsx(TMFileManagerThumbnailItems, { items: items, allUsers: allUsers, paginatedItems: paginatedItems, focusedFile: focusedFile, selectedFiles: selectedFiles, userID: userID, searchText: searchText, handleFocusedFile: handleFocusedFile, handleSelectedFiles: handleSelectedFiles, onDoubleClick: handleItemDoubleClick, setDraftThumbViewAnchor: setDraftThumbViewAnchor }) }), showPagination && _jsx(Pagination, { height: "50px", showInfo: true, showNavigationButtons: true, allowedPageSizes: PAGE_SIZES, displayMode: 'compact', itemCount: items.length, pageIndex: pageIndex, pageSize: pageSize, onPageIndexChange: setPageIndex, onPageSizeChange: setPageSize }), draftThumbViewAnchor && _jsx(ContextMenu, { id: 'fileViewContextMenuMobile', dataSource: fileContextMenuItems, target: draftThumbViewAnchor, onHiding: closeViewContextMenu })] })
46
+ _jsxs("div", { id: "file-manager-thumbnails-view", style: { width: "100%", height: "100%" }, onContextMenu: onBackgroundContextMenu, children: [_jsx(ScrollView, { width: "100%", height: showPagination ? "calc(100% - 50px)" : "100%", useNative: true, direction: 'vertical', children: _jsx(TMFileManagerThumbnailItems, { items: items, allUsers: allUsers, paginatedItems: paginatedItems, focusedFile: focusedFile, selectedFiles: selectedFiles, userID: userID, searchText: searchText, handleFocusedFile: handleFocusedFile, handleSelectedFiles: handleSelectedFiles, onDoubleClick: handleItemDoubleClick, setThumbViewContextMenuControl: setThumbViewContextMenuControl }) }), showPagination && _jsx(Pagination, { height: "50px", showInfo: true, showNavigationButtons: true, allowedPageSizes: PAGE_SIZES, displayMode: 'compact', itemCount: items.length, pageIndex: pageIndex, pageSize: pageSize, onPageIndexChange: setPageIndex, onPageSizeChange: setPageSize }), _jsx(TMContextMenu, { items: fileContextMenuItems, target: "#file-manager-thumbnails-view", externalControl: {
47
+ visible: thumbViewContextMenuControl.visible,
48
+ position: thumbViewContextMenuControl.position,
49
+ onClose: closeViewContextMenu
50
+ } })] })
43
51
  :
44
- _jsxs("div", { onContextMenu: onBackgroundContextMenu, style: { width: "100%", height: "100%", display: 'flex', justifyContent: 'center', alignItems: 'center', marginTop: '10px' }, children: [SDKUI_Localizator.FolderIsEmpty, draftThumbViewAnchor && _jsx(ContextMenu, { id: 'fileViewContextMenuMobile', dataSource: fileContextMenuItems, target: draftThumbViewAnchor, onHiding: closeViewContextMenu })] });
52
+ _jsxs("div", { id: "file-manager-thumbnails-view-empty", onContextMenu: onBackgroundContextMenu, style: { width: "100%", height: "100%", display: 'flex', justifyContent: 'center', alignItems: 'center', marginTop: '10px' }, children: [SDKUI_Localizator.FolderIsEmpty, _jsx(TMContextMenu, { items: fileContextMenuItems, target: "#file-manager-thumbnails-view-empty", externalControl: {
53
+ visible: thumbViewContextMenuControl.visible,
54
+ position: thumbViewContextMenuControl.position,
55
+ onClose: closeViewContextMenu
56
+ } })] });
45
57
  };
46
58
  export default TMFileManagerThumbnailsView;
@@ -19,18 +19,6 @@ export interface FileItem {
19
19
  size?: number;
20
20
  version?: number;
21
21
  }
22
- export interface TMFileManagerContextMenuItem {
23
- text: string;
24
- icon: string;
25
- onClick?: (param?: any) => void;
26
- operationType?: 'singleRow' | 'multiRow';
27
- disabled?: boolean;
28
- id?: string;
29
- items?: Array<TMFileManagerContextMenuItem>;
30
- beginGroup?: boolean;
31
- tooltip?: string;
32
- visible?: boolean;
33
- }
34
22
  export interface TMFileManagerTreeViewDirectory {
35
23
  id: number;
36
24
  text: string;
@@ -133,7 +133,7 @@ onActivate, onBack, onClose, onHeaderDoubleClick, onMaximize, onActiveChanged },
133
133
  };
134
134
  return (_jsxs(StyledPanelContainer, { ref: panelRef, "$isMaximized": onMaximize ? false : isMaximized, style: {
135
135
  visibility: isVisible ? 'visible' : 'hidden',
136
- }, tabIndex: -1, onFocus: !isControlled ? handleFocusUncontrolled : undefined, onBlur: !isControlled ? handleBlurUncontrolled : undefined, onClick: handleActivation, children: [showHeader &&
136
+ }, tabIndex: -1, onFocus: !isControlled ? handleFocusUncontrolled : undefined, onBlur: !isControlled ? handleBlurUncontrolled : undefined, onClick: handleActivation, onContextMenu: (e) => e.preventDefault(), children: [showHeader &&
137
137
  _jsx(StyledPanelHeader, { "$backgroundColor": backgroundColor, "$color": color, "$isActive": currentIsActive, onDoubleClick: () => {
138
138
  if (onHeaderDoubleClick)
139
139
  onHeaderDoubleClick();
@@ -17,6 +17,6 @@ const TMInvoiceRetrieveFormats = ({ value, valueOrig, onValueChanged, valuesToEx
17
17
  }
18
18
  return dataSource;
19
19
  };
20
- return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.defultMargin, width: width }, dataSource: getDataSource(), value: value, onValueChanged: (e) => { onValueChanged?.(e.target.value); }, isModifiedWhen: value != valueOrig, width: width }));
20
+ return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.defaultMargin, width: width }, dataSource: getDataSource(), value: value, onValueChanged: (e) => { onValueChanged?.(e.target.value); }, isModifiedWhen: value != valueOrig, width: width }));
21
21
  };
22
22
  export default TMInvoiceRetrieveFormats;
@@ -13,8 +13,15 @@ import TMChooserForm from '../forms/TMChooserForm';
13
13
  import TMSpinner from '../base/TMSpinner';
14
14
  const TMMetadataChooser = ({ tmSession, dataSource, showEditButton = true, buttons = [], disabled, validationItems, getColorIndex, showCompleteMetadataName, qdShowOnlySelectItems, borderRadius = '4px', fontSize = FontSize.defaultFontSize, backgroundColor, openEditorOnSummaryClick, showBorder = true, showId = false, elementStyle, allowMultipleSelection, allowSysMetadata, showSysMetadataDirectly, value, values, isModifiedWhen, tids, label, width, height, showClearButton, qd, placeHolder, filterMetadata, onValueChanged }) => {
15
15
  const [showChooser, setShowChooser] = useState(false);
16
+ const getinputMd = () => {
17
+ if (values && values.length > 0 && values[0].mid && values[0].mid < 0) {
18
+ let md = dataSource?.find((md) => md.id === values[0].mid);
19
+ return md;
20
+ }
21
+ return undefined;
22
+ };
16
23
  const renderTemplate = useMemo(() => {
17
- return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { children: placeHolder })] }));
24
+ return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && values.length > 0 && values[0].mid && values[0].mid > 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 0 && values[0].mid && values[0].mid < 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], inputMd: getinputMd(), showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { children: placeHolder })] }));
18
25
  }, [values, tmSession, showId, showCompleteMetadataName, placeHolder]);
19
26
  return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { label: label, width: width, height: height, disabled: disabled, validationItems: validationItems, backgroundColor: backgroundColor, buttons: buttons, placeHolder: placeHolder, fontSize: fontSize, showBorder: showBorder, borderRadius: borderRadius, hasValue: values && values.length > 0, showClearButton: showClearButton, showEditButton: showEditButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), openEditorOnSummaryClick: openEditorOnSummaryClick, onEditorClick: () => !disabled && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, template: renderTemplate, onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined }), showChooser &&
20
27
  _jsx(TMMetadataChooserForm, { tmSession: tmSession, allowMultipleSelection: allowMultipleSelection, height: '500px', width: '600px', allowSysMetadata: allowSysMetadata, showSysMetadataDirectly: showSysMetadataDirectly, getColorIndex: getColorIndex, dataSource: dataSource, tids: tids, qd: qd, qdShowOnlySelectItems: qdShowOnlySelectItems, filterMetadata: filterMetadata, selectedIDs: values, onClose: () => setShowChooser(false), onChoose: (tid_mids) => { onValueChanged?.(tid_mids); } })] }));
@@ -17,6 +17,6 @@ const TMOrderRetrieveFormats = ({ value, valueOrig, onValueChanged, valuesToExcl
17
17
  }
18
18
  return dataSource;
19
19
  };
20
- return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.defultMargin, width: width }, dataSource: getDataSource(), value: value, isModifiedWhen: value != valueOrig, onValueChanged: (e) => { onValueChanged?.(e.target.value); }, width: width }));
20
+ return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.defaultMargin, width: width }, dataSource: getDataSource(), value: value, isModifiedWhen: value != valueOrig, onValueChanged: (e) => { onValueChanged?.(e.target.value); }, width: width }));
21
21
  };
22
22
  export default TMOrderRetrieveFormats;
@@ -30,11 +30,6 @@ interface ITMUserChooserFormProps extends ITMChooserFormProps<UserDescriptor> {
30
30
  allowShowAllUsers?: boolean;
31
31
  }
32
32
  export declare const TMUserChooserForm: React.FunctionComponent<ITMUserChooserFormProps>;
33
- export declare const TMUserIdViewer: ({ userId, showIcon, noneSelectionText }: {
34
- userId?: number;
35
- showIcon?: boolean;
36
- noneSelectionText?: string;
37
- }) => import("react/jsx-runtime").JSX.Element;
38
33
  export declare const TMUserIcon: ({ ud }: {
39
34
  ud?: UserDescriptor;
40
35
  }) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,15 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { OwnershipLevels, SDK_Localizator, UserLevels, UserListCacheService } from '@topconsultnpm/sdk-ts';
4
- import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator, IconWarning, LocalizeOwnershipLevels, LocalizeUserLevels, IconShowAllUsersOff, IconShowAllUsers } from '../../helper';
5
- import { StyledDivHorizontal, StyledTooltipContainer, StyledTooltipSeparatorItem } from '../base/Styled';
4
+ import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator, LocalizeOwnershipLevels, LocalizeUserLevels, IconShowAllUsersOff, IconShowAllUsers } from '../../helper';
5
+ import { StyledDivHorizontal } from '../base/Styled';
6
6
  import TMSpinner from '../base/TMSpinner';
7
- import TMTooltip from '../base/TMTooltip';
8
7
  import TMSummary from '../editors/TMSummary';
9
8
  import TMChooserForm from '../forms/TMChooserForm';
10
- import { TMColors } from '../../utils/theme';
11
- import { TMExceptionBoxManager } from '../base/TMPopUp';
12
9
  import TMButton from '../base/TMButton';
10
+ import TMDataUserIdItemViewer from '../viewers/TMDataUserIdItemViewer';
13
11
  const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon, width, dataSource, backgroundColor, openChooserBySingleClick, buttons = [], disabled = false, showBorder = true, hideRefresh = false, hideShowId = false, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], onValueChanged, showClearButton, initialShowChooser = false, allowShowAllUsers = false }) => {
14
12
  const [showChooser, setShowChooser] = useState(initialShowChooser);
15
13
  useEffect(() => {
@@ -18,7 +16,7 @@ const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon,
18
16
  const summaryInputRef = useRef(null);
19
17
  const renderTemplate = () => {
20
18
  const isPlaceholder = values?.[0] === placeHolder;
21
- return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [values && values.length > 0 && _jsx(TMUserIdViewer, { userId: values?.[0], showIcon: true, noneSelectionText: '' }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
19
+ return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [values && values.length > 0 && _jsx(TMDataUserIdItemViewer, { userId: values?.[0], showIcon: true }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
22
20
  };
23
21
  return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { ref: summaryInputRef, width: width, disabled: disabled, placeHolder: placeHolder, readOnly: readOnly, labelColor: labelColor, icon: icon, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, openEditorOnSummaryClick: openChooserBySingleClick, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
24
22
  _jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, allowShowAllUsers: allowShowAllUsers, onClose: () => {
@@ -67,40 +65,6 @@ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh
67
65
  const customButton = (allowShowAllUsers && dataSource) ? (_jsx(TMButton, { btnStyle: 'toolbar', caption: showingAllUsers ? SDKUI_Localizator.HideAll : SDKUI_Localizator.ShowAll, onClick: handleToggleAllUsers, icon: showingAllUsers ? _jsx(IconShowAllUsersOff, {}) : _jsx(IconShowAllUsers, {}) })) : undefined;
68
66
  return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: allowMultipleSelection, startWithShowOnlySelectedItems: startWithShowOnlySelectedItems, hasShowOnlySelectedItems: hasShowOnlySelectedItems, width: width, height: height, manageUseLocalizedName: false, columns: columns ?? dataColumns, showDefaultColumns: false, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, dataSource: currentDataSource, getItems: getItems, hasShowId: !hideShowId, hideRefresh: hideRefresh, customButtons: customButton, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
69
67
  };
70
- export const TMUserIdViewer = ({ userId, showIcon = false, noneSelectionText = `<${SDKUI_Localizator.NoneSelection}>` }) => {
71
- const [ud, setUd] = useState();
72
- useEffect(() => {
73
- if (!userId || userId <= 0) {
74
- setUd(undefined);
75
- return;
76
- }
77
- TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.Users} ...` });
78
- UserListCacheService.GetAsync(userId).then((ud) => { setUd(ud); TMSpinner.hide(); }).catch((err) => { TMExceptionBoxManager.show({ exception: err }); });
79
- }, [userId]);
80
- const getIcon = () => {
81
- if (!showIcon)
82
- return null;
83
- if (!userId)
84
- return null;
85
- return ud ?
86
- _jsx(TMUserIcon, { ud: ud })
87
- :
88
- _jsx(TMTooltip, { content: SDKUI_Localizator.ValueNotPresent, children: _jsx(IconWarning, { color: TMColors.warning }) });
89
- };
90
- const getDescription = () => {
91
- if (!userId)
92
- return undefined;
93
- return ud ? getCompleteUserName(ud.domain, ud.name) : userId.toString() ?? noneSelectionText;
94
- };
95
- return (_jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '4px' }, children: [getIcon(), _jsx("span", { children: getDescription() })] })
96
- // <StyledDivHorizontal>
97
- // {getIcon()}
98
- // <p style={{ textAlign: 'left', marginLeft: showIcon ? '5px' : '', opacity: ud ? 1 : 0.5 }}>
99
- // {getDescription()}
100
- // </p>
101
- // </StyledDivHorizontal>
102
- );
103
- };
104
68
  export const TMUserIcon = ({ ud }) => {
105
69
  if (!ud)
106
70
  return null;
@@ -109,12 +73,28 @@ export const TMUserIcon = ({ ud }) => {
109
73
  return (_jsx(TMUserTooltip, { ud: ud, children: icon }));
110
74
  };
111
75
  export const TMUserTooltip = ({ ud, children }) => {
112
- const renderTooltipContent = (ud) => {
113
- let isExpired = User_IsExpired(ud);
114
- return (!ud ? null
115
- : _jsxs(StyledTooltipContainer, { children: [_jsx("div", { children: `ID: ${ud.id}` }), _jsx("div", { children: `${SDKUI_Localizator.Name}: ${getCompleteUserName(ud.domain, ud.name)}` }), ud.description && _jsx("div", { children: `${SDKUI_Localizator.Description}: ${ud.description}` }), ud.type && _jsxs("div", { children: [SDKUI_Localizator.Type, ": ", ud.type] }), ud.level && _jsxs("div", { children: [SDKUI_Localizator.UserLevel, ": ", LocalizeUserLevels(ud.level)] }), _jsxs("div", { children: [SDKUI_Localizator.Valid, ": ", isExpired ? SDKUI_Localizator.No : SDKUI_Localizator.Yes, " - ", SDKUI_Localizator.Disabled, ": ", ud.disabled ? SDKUI_Localizator.Yes : SDKUI_Localizator.No] }), _jsx(StyledTooltipSeparatorItem, {}), _jsxs("div", { children: [SDKUI_Localizator.OwnerName, ": ", ud.ownerName, " (", ud.ownerID, ")"] }), _jsxs("div", { children: [SDKUI_Localizator.OwnershipLevel, ": ", LocalizeOwnershipLevels(ud.ownershipLevel)] }), _jsxs("div", { children: [SDKUI_Localizator.CreationTime, ": ", ud.creationTime?.toDateString()] }), _jsxs("div", { children: [SDKUI_Localizator.LastUpdateTime, ": ", ud.lastUpdateTime?.toDateString()] })] }));
76
+ const buildTitle = (ud) => {
77
+ if (!ud)
78
+ return '';
79
+ const isExpired = User_IsExpired(ud);
80
+ return [
81
+ `ID: ${ud.id ?? ''}`,
82
+ `${SDKUI_Localizator.Name}: ${getCompleteUserName(ud.domain, ud.name) ?? ''}`,
83
+ ud.description && `${SDKUI_Localizator.Description}: ${ud.description}`,
84
+ ud.type && `${SDKUI_Localizator.Type}: ${ud.type}`,
85
+ ud.level && `${SDKUI_Localizator.UserLevel}: ${LocalizeUserLevels(ud.level) ?? ''}`,
86
+ `${SDKUI_Localizator.Valid}: ${isExpired ? SDKUI_Localizator.No : SDKUI_Localizator.Yes}`,
87
+ `${SDKUI_Localizator.Disabled}: ${ud.disabled ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}`,
88
+ `---`,
89
+ `${SDKUI_Localizator.OwnerName}: ${ud.ownerName ?? ''} (${ud.ownerID ?? ''})`,
90
+ `${SDKUI_Localizator.OwnershipLevel}: ${LocalizeOwnershipLevels(ud.ownershipLevel) ?? ''}`,
91
+ `${SDKUI_Localizator.CreationTime}: ${ud.creationTime?.toDateString() ?? ''}`,
92
+ `${SDKUI_Localizator.LastUpdateTime}: ${ud.lastUpdateTime?.toDateString() ?? ''}`
93
+ ]
94
+ .filter(Boolean)
95
+ .join('\n');
116
96
  };
117
- return (_jsx(TMTooltip, { content: renderTooltipContent(ud), children: children }));
97
+ return (_jsx("div", { title: buildTitle(ud), children: children }));
118
98
  };
119
99
  const getCompleteUserName = (domain, name) => {
120
100
  if (!name)
@@ -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";
@@ -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) {
@@ -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
  }
@@ -269,7 +272,7 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
269
272
  onBlur?.(undefined);
270
273
  }, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
271
274
  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 })] }));
275
+ })] }), openFormulaItemsChooser(), formulaItems.length > 0 && (_jsx(TMContextMenu, { items: formulaMenuItems, target: `#text-${id}` })), _jsx(TMVilViewer, { vil: validationItems })] }));
273
276
  };
274
277
  const renderedLeftLabelTextBox = () => {
275
278
  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()] }) })] }));
@@ -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;