@topconsultnpm/sdkui-react 6.20.0-dev1.10 → 6.20.0-dev1.101

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 (157) 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 +153 -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/TMListView.js +33 -15
  37. package/lib/components/base/TMPanel.d.ts +1 -1
  38. package/lib/components/base/TMPanel.js +1 -1
  39. package/lib/components/choosers/TMDistinctValues.js +1 -1
  40. package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
  41. package/lib/components/choosers/TMMetadataChooser.js +8 -1
  42. package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
  43. package/lib/components/choosers/TMUserChooser.d.ts +0 -5
  44. package/lib/components/choosers/TMUserChooser.js +25 -45
  45. package/lib/components/editors/TMDateBox.js +18 -9
  46. package/lib/components/editors/TMMetadataValues.js +23 -5
  47. package/lib/components/editors/TMTextArea.js +18 -30
  48. package/lib/components/editors/TMTextBox.js +6 -3
  49. package/lib/components/features/archive/TMArchive.js +2 -2
  50. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
  51. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +460 -0
  52. package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
  53. package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
  54. package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
  55. package/lib/components/features/documents/TMDcmtForm.js +457 -206
  56. package/lib/components/features/documents/TMDcmtPreview.js +45 -108
  57. package/lib/components/features/documents/TMDcmtTasks.js +9 -9
  58. package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
  59. package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
  60. package/lib/components/features/documents/TMRelationViewer.js +2 -2
  61. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
  62. package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +2 -2
  63. package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
  64. package/lib/components/features/search/TMSearch.d.ts +3 -0
  65. package/lib/components/features/search/TMSearch.js +50 -11
  66. package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
  67. package/lib/components/features/search/TMSearchQueryPanel.js +29 -21
  68. package/lib/components/features/search/TMSearchResult.d.ts +3 -0
  69. package/lib/components/features/search/TMSearchResult.js +208 -250
  70. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
  71. package/lib/components/features/search/TMSearchResultsMenuItems.js +205 -169
  72. package/lib/components/features/search/TMSignSettingsForm.js +1 -1
  73. package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
  74. package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
  75. package/lib/components/features/search/TMViewHistoryDcmt.js +2 -2
  76. package/lib/components/features/tasks/TMTaskForm.js +20 -1
  77. package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
  78. package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
  79. package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
  80. package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
  81. package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
  82. package/lib/components/features/tasks/TMTasksUtils.js +43 -36
  83. package/lib/components/features/tasks/TMTasksView.js +28 -19
  84. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
  85. package/lib/components/features/workflow/TMWorkflowPopup.js +139 -34
  86. package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
  87. package/lib/components/features/workflow/diagram/DiagramItemComponent.js +12 -7
  88. package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
  89. package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
  90. package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
  91. package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
  92. package/lib/components/forms/Login/LoginValidatorService.js +7 -2
  93. package/lib/components/forms/Login/TMLoginForm.js +34 -6
  94. package/lib/components/forms/TMChooserForm.js +1 -1
  95. package/lib/components/grids/TMBlogsPost.js +56 -31
  96. package/lib/components/grids/TMRecentsManager.js +20 -10
  97. package/lib/components/index.d.ts +5 -3
  98. package/lib/components/index.js +5 -3
  99. package/lib/components/query/TMQueryEditor.d.ts +2 -1
  100. package/lib/components/query/TMQueryEditor.js +92 -92
  101. package/lib/components/settings/SettingsAppearance.d.ts +2 -1
  102. package/lib/components/settings/SettingsAppearance.js +99 -30
  103. package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
  104. package/lib/components/viewers/TMDataListItemViewer.js +35 -71
  105. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
  106. package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
  107. package/lib/css/tm-sdkui.css +1 -1
  108. package/lib/helper/SDKUI_Globals.d.ts +22 -0
  109. package/lib/helper/SDKUI_Globals.js +10 -1
  110. package/lib/helper/SDKUI_Localizator.d.ts +17 -1
  111. package/lib/helper/SDKUI_Localizator.js +167 -1
  112. package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
  113. package/lib/helper/TMCommandsContextMenu.js +15 -4
  114. package/lib/helper/TMIcons.d.ts +4 -0
  115. package/lib/helper/TMIcons.js +13 -3
  116. package/lib/helper/TMPdfViewer.d.ts +8 -0
  117. package/lib/helper/TMPdfViewer.js +373 -0
  118. package/lib/helper/checkinCheckoutManager.d.ts +31 -1
  119. package/lib/helper/checkinCheckoutManager.js +112 -30
  120. package/lib/helper/devextremeCustomMessages.d.ts +30 -0
  121. package/lib/helper/devextremeCustomMessages.js +30 -0
  122. package/lib/helper/helpers.d.ts +3 -1
  123. package/lib/helper/helpers.js +25 -3
  124. package/lib/helper/index.d.ts +2 -0
  125. package/lib/helper/index.js +2 -0
  126. package/lib/helper/queryHelper.d.ts +1 -1
  127. package/lib/helper/queryHelper.js +33 -3
  128. package/lib/helper/workItemsHelper.d.ts +6 -0
  129. package/lib/helper/workItemsHelper.js +230 -0
  130. package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
  131. package/lib/hooks/useCheckInOutOperations.js +223 -0
  132. package/lib/hooks/useDataListItem.d.ts +12 -0
  133. package/lib/hooks/useDataListItem.js +132 -0
  134. package/lib/hooks/useDataUserIdItem.d.ts +10 -0
  135. package/lib/hooks/useDataUserIdItem.js +96 -0
  136. package/lib/hooks/useSettingsFeedback.d.ts +11 -0
  137. package/lib/hooks/useSettingsFeedback.js +38 -0
  138. package/lib/hooks/useWorkflowApprove.d.ts +4 -0
  139. package/lib/hooks/useWorkflowApprove.js +14 -1
  140. package/lib/index.d.ts +1 -0
  141. package/lib/index.js +3 -2
  142. package/lib/services/platform_services.d.ts +3 -3
  143. package/lib/ts/types.d.ts +61 -1
  144. package/lib/utils/theme.d.ts +1 -1
  145. package/lib/utils/theme.js +1 -1
  146. package/package.json +7 -4
  147. package/lib/components/base/TMContextMenu.d.ts +0 -25
  148. package/lib/components/base/TMContextMenu.js +0 -109
  149. package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
  150. package/lib/components/base/TMContextMenuOLD.js +0 -56
  151. package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
  152. package/lib/components/base/TMFloatingToolbar.js +0 -101
  153. package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
  154. package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
  155. package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
  156. package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
  157. 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;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useRef, useState } from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { ObjectClasses } from '@topconsultnpm/sdk-ts';
5
- import TMContextMenu, { useTMContextMenu } from './TMContextMenu';
5
+ import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
6
6
  import { IconApply, IconCloseCircle, IconColumns, IconDown, IconHide, IconShow, IconUp, IconVisible } from '../../helper/TMIcons';
7
7
  import { TMSearchBar } from '../sidebar/TMHeader';
8
8
  import TMTooltip from './TMTooltip';
@@ -26,9 +26,17 @@ const TMListView = ({ customGroupingHeaders, headerBackGroundColor, header, show
26
26
  const [isFocused, setIsFocused] = useState(false);
27
27
  const [showOrderMenu, setShowOrderMenu] = useState(false);
28
28
  const [showOrderOptions, setShowOrderOptions] = useState(false);
29
+ const [contextMenuVisible, setContextMenuVisible] = useState(false);
30
+ const [contextMenuPosition, setContextMenuPosition] = useState({ x: 0, y: 0 });
31
+ const [orderMenuVisible, setOrderMenuVisible] = useState(false);
32
+ const [orderMenuPosition, setOrderMenuPosition] = useState({ x: 0, y: 0 });
29
33
  useEffect(() => { setCurrentDataSource(dataSource); }, [dataSource]);
30
- const openContextMenu = (e) => { setIsFocused(true); };
31
- let [coords, show] = useTMContextMenu(contRef);
34
+ const openContextMenu = (e) => {
35
+ e.preventDefault();
36
+ setIsFocused(true);
37
+ setContextMenuVisible(true);
38
+ setContextMenuPosition({ x: e.clientX, y: e.clientY });
39
+ };
32
40
  useEffect(() => { if (orderBy) {
33
41
  setOrderedBy(orderBy);
34
42
  } }, [orderBy]);
@@ -235,10 +243,10 @@ const TMListView = ({ customGroupingHeaders, headerBackGroundColor, header, show
235
243
  for (let key of searchKeys) {
236
244
  arr.push({
237
245
  disabled: !localShowId && key === exprKey,
238
- isSelected: key === orderedBy,
239
- onItemClick: () => { setOrderedBy(key); setShowOrderOptions(false); },
246
+ onClick: () => { setOrderedBy(key); setShowOrderOptions(false); setOrderMenuVisible(false); },
240
247
  icon: _jsx(IconColumns, { fontSize: 16 }),
241
- text: _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 10 }, children: [key, " ", key === orderedBy && _jsx(IconApply, { fontSize: 14, color: 'gray' })] })
248
+ name: key,
249
+ rightIcon: key === orderedBy ? _jsx(IconApply, { fontSize: 14, color: 'gray' }) : undefined
242
250
  });
243
251
  }
244
252
  }
@@ -328,16 +336,16 @@ const TMListView = ({ customGroupingHeaders, headerBackGroundColor, header, show
328
336
  if (showSearch === undefined) {
329
337
  items.push({
330
338
  icon: localShowSearch ? _jsx(IconHide, { fontSize: 16 }) : _jsx(IconShow, { fontSize: 16 }),
331
- onItemClick: () => setLocalShowSearch(!localShowSearch),
332
- text: localShowSearch ? SDKUI_Localizator.HideSearch : SDKUI_Localizator.ShowSearch
339
+ onClick: () => setLocalShowSearch(!localShowSearch),
340
+ name: localShowSearch ? SDKUI_Localizator.HideSearch : SDKUI_Localizator.ShowSearch
333
341
  });
334
342
  }
335
343
  // Add ID menu item only if showId prop is undefined
336
344
  if (showId === undefined) {
337
345
  items.push({
338
346
  icon: localShowId ? _jsx(IconHide, { fontSize: 16 }) : _jsx(IconShow, { fontSize: 16 }),
339
- onItemClick: () => setLocalShowId(!localShowId),
340
- text: localShowId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show,
347
+ onClick: () => setLocalShowId(!localShowId),
348
+ name: localShowId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show,
341
349
  });
342
350
  }
343
351
  // Add order menu item only if grouping length is zero
@@ -345,21 +353,31 @@ const TMListView = ({ customGroupingHeaders, headerBackGroundColor, header, show
345
353
  items.push({
346
354
  icon: showOrderMenu ? _jsx(IconHide, { fontSize: 16 }) : _jsx(IconShow, { fontSize: 16 }),
347
355
  disabled: searchKeys.length === 0,
348
- onItemClick: () => setShowOrderMenu(!showOrderMenu),
349
- text: showOrderMenu ? 'Nascondi menu di ordinamento' : 'Mostra menu di ordinamento'
356
+ onClick: () => setShowOrderMenu(!showOrderMenu),
357
+ name: showOrderMenu ? 'Nascondi menu di ordinamento' : 'Mostra menu di ordinamento'
350
358
  });
351
359
  }
352
360
  return items;
353
361
  };
354
362
  const contextMenuItems = generateContextMenuItems(localShowSearch, localShowId, showOrderMenu, grouping, searchKeys);
355
- return (_jsxs(StyledListViewContainer, { ref: contRef, onContextMenu: openContextMenu, children: [(show && contextMenuItems.length > 0) && _jsx(TMContextMenu, { coords: coords, items: contextMenuItems }), showOrderOptions &&
356
- _jsx(TMContextMenu, { items: orderMenuItems(), coords: { x: orderRef.current?.getBoundingClientRect().left, y: orderRef.current?.getBoundingClientRect().top - (searchKeys.length * 30) - 10 } }), header && _jsx("div", { style: { width: '100%', height: '40px', backgroundColor: headerBackGroundColor ?? `${customColor}30`, marginBottom: '3px', display: 'flex', alignItems: 'center' }, children: header }), localShowSearch &&
363
+ return (_jsxs(StyledListViewContainer, { ref: contRef, onContextMenu: openContextMenu, children: [contextMenuItems.length > 0 && (_jsx(TMContextMenu, { items: contextMenuItems, externalControl: {
364
+ visible: contextMenuVisible,
365
+ position: contextMenuPosition,
366
+ onClose: () => setContextMenuVisible(false)
367
+ } })), showOrderOptions && orderRef.current && (_jsx(TMContextMenu, { items: orderMenuItems(), externalControl: {
368
+ visible: orderMenuVisible || showOrderOptions,
369
+ position: {
370
+ x: orderRef.current.getBoundingClientRect().left,
371
+ y: orderRef.current.getBoundingClientRect().top - (searchKeys.length * 30) - 10
372
+ },
373
+ onClose: () => { setOrderMenuVisible(false); setShowOrderOptions(false); }
374
+ } })), header && _jsx("div", { style: { width: '100%', height: '40px', backgroundColor: headerBackGroundColor ?? `${customColor}30`, marginBottom: '3px', display: 'flex', alignItems: 'center' }, children: header }), localShowSearch &&
357
375
  _jsx(StyledSearchContainer, { children: _jsxs(StyledSearchContainer, { children: [_jsx(TMSearchBar, { marginLeft: '0px', maxWidth: '300px', searchValue: searchValue, onSearchValueChanged: (e) => setSearchValue(e) }), _jsx(TMTooltip, { content: 'Nascondi ricerca', children: _jsx(IconCloseCircle, { style: { cursor: 'pointer' }, color: 'red', fontSize: 14, onClick: () => { setSearchValue(''); setLocalShowSearch(false); } }) })] }) }), _jsx("div", { ref: listRef, onClick: () => setIsFocused(true), style: { width: '100%', overflow: 'auto', height: listHeight() }, children: currentDataSource.length > 0 ?
358
376
  grouping.length === 0 ? memoList : groupedMemoList :
359
377
  searchValue.length > 0 ? _jsx("div", { style: { width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "No data found" }) :
360
378
  _jsx("div", { style: { width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "No data" }) }), (searchValue.length > 0 || showOrderMenu) &&
361
379
  _jsxs(StyledListViewFooter, { "$bgColor": `${customColor}20`, children: [showOrderMenu &&
362
- _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: 5 }, children: [_jsx("div", { style: { width: 'max-content' }, children: "Ordinato per" }), _jsx("div", { ref: orderRef, onClick: () => { setShowOrderOptions(!showOrderOptions); }, style: { cursor: 'pointer', fontWeight: 'bold' }, children: orderedBy.length > 0 ? orderedBy : 'Nulla' }), orderedBy.length > 0 && _jsxs(TMTooltip, { content: orderDir ? 'ASC' : 'DESC', children: [" ", orderDir ? _jsx(IconUp, { style: { cursor: 'pointer' }, onClick: () => setOrderDir(false), fontSize: 14 }) : _jsx(IconDown, { style: { cursor: 'pointer' }, onClick: () => setOrderDir(true), fontSize: 14 }), " "] }), _jsx(TMTooltip, { content: 'Annulla ordinamento', children: _jsx(IconCloseCircle, { style: { cursor: 'pointer' }, color: 'red', fontSize: 14, onClick: () => { setOrderedBy(''); setShowOrderMenu(false); setShowOrderOptions(false); } }) })] }), searchValue.length > 0 && _jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', justifyContent: 'flex-end', gap: 5 }, children: [_jsx(TMTooltip, { content: 'Visibili', children: _jsx(IconVisible, { fontSize: 14 }) }), currentDataSource.length] })] })] }));
380
+ _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: 5 }, children: [_jsx("div", { style: { width: 'max-content' }, children: "Ordinato per" }), _jsx("div", { ref: orderRef, onClick: () => { setShowOrderOptions(!showOrderOptions); setOrderMenuVisible(!orderMenuVisible); }, style: { cursor: 'pointer', fontWeight: 'bold' }, children: orderedBy.length > 0 ? orderedBy : 'Nulla' }), orderedBy.length > 0 && _jsxs(TMTooltip, { content: orderDir ? 'ASC' : 'DESC', children: [" ", orderDir ? _jsx(IconUp, { style: { cursor: 'pointer' }, onClick: () => setOrderDir(false), fontSize: 14 }) : _jsx(IconDown, { style: { cursor: 'pointer' }, onClick: () => setOrderDir(true), fontSize: 14 }), " "] }), _jsx(TMTooltip, { content: 'Annulla ordinamento', children: _jsx(IconCloseCircle, { style: { cursor: 'pointer' }, color: 'red', fontSize: 14, onClick: () => { setOrderedBy(''); setShowOrderMenu(false); setShowOrderOptions(false); } }) })] }), searchValue.length > 0 && _jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', justifyContent: 'flex-end', gap: 5 }, children: [_jsx(TMTooltip, { content: 'Visibili', children: _jsx(IconVisible, { fontSize: 14 }) }), currentDataSource.length] })] })] }));
363
381
  };
364
382
  export default TMListView;
365
383
  export const CustomListViewHeader = (props) => {
@@ -13,7 +13,7 @@ export interface ITMPanelProps {
13
13
  backgroundColorContainer?: string;
14
14
  children?: React.ReactNode;
15
15
  showHeader?: boolean;
16
- title?: string;
16
+ title?: any;
17
17
  displayedItemsCount?: number;
18
18
  totalItems?: number;
19
19
  toolbar?: any;
@@ -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();
@@ -131,7 +131,7 @@ const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppend
131
131
  return md.dataDomain === undefined || md.dataDomain === MetadataDataDomains.None;
132
132
  };
133
133
  const renderContent = () => {
134
- return (_jsxs(StyledDistinctValues, { children: [isVisibleAppend() && _jsx(TMCheckBox, { elementStyle: { position: 'absolute', right: '15px', top: '15px', zIndex: 10000 }, label: 'Accoda', value: isAppendMode, onValueChanged: () => { setIsAppendMode(!isAppendMode); } }), _jsx(TMDataGrid, { focusedRowKey: focusedItem ? focusedItem.rowIndex : undefined, selection: { showCheckBoxesMode: 'none' }, searchPanel: { highlightCaseSensitive: true, visible: true }, dataColumns: customColumns, dataSource: dataSource, keyExpr: 'rowIndex', height: 'calc(100%)', onFocusedRowChanged: onFocusedRowChanged, paging: { pageSize: 30 }, summary: customSummary })] }));
134
+ return (_jsxs(StyledDistinctValues, { children: [isVisibleAppend() && _jsx(TMCheckBox, { elementStyle: { position: 'absolute', right: '15px', top: '15px', zIndex: 10000 }, label: 'Accoda', value: isAppendMode, onValueChanged: () => { setIsAppendMode(!isAppendMode); } }), _jsx(TMDataGrid, { focusedRowKey: focusedItem ? focusedItem.rowIndex : undefined, selection: { showCheckBoxesMode: 'none' }, searchPanel: { highlightCaseSensitive: true, visible: true }, dataColumns: customColumns, dataSource: dataSource, keyExpr: 'rowIndex', height: 'calc(100%)', onFocusedRowChanged: onFocusedRowChanged, paging: { pageSize: 30 }, summary: customSummary, onRowDblClick: () => !isAppendMode && onClosePanelCallback?.() })] }));
135
135
  };
136
136
  return (_jsx(_Fragment, { children: isModal
137
137
  ? _jsx(TMModal, { title: SDKUI_Localizator.DistinctValues + (md?.nameLoc ? ` (${md?.nameLoc})` : ''), height: '600px', width: '500px', resizable: true, onClose: onClosePanelCallback, children: renderContent() })
@@ -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)
@@ -10,27 +10,36 @@ const TMDateBox = (props) => {
10
10
  let htmlElement = dateBoxRef?.current?.instance().element();
11
11
  if (!htmlElement)
12
12
  return;
13
- let color = props.isModifiedWhen ? TMColors.tertiary : TMColors.border_normal;
13
+ let borderColor = props.isModifiedWhen ? TMColors.tertiary : TMColors.border_normal;
14
+ let textColor = props.isModifiedWhen ? TMColors.isModified : TMColors.text_normal;
14
15
  let inputContainer = htmlElement.getElementsByClassName("dx-texteditor-input-container")[0];
15
16
  if (inputContainer) {
16
17
  inputContainer.style.background = props.readOnly ? 'linear-gradient(white 20%, #d6d6d6 80%)' : '';
17
- inputContainer.style.color = props.readOnly ? '#525252' : 'transparent';
18
+ inputContainer.style.color = props.readOnly ? '#525252' : textColor;
19
+ }
20
+ let input = htmlElement.querySelector(".dx-texteditor-input");
21
+ if (input) {
22
+ if (!props.readOnly) {
23
+ input.style.color = textColor;
24
+ }
25
+ input.style.fontSize = 'var(--base-font-size)';
26
+ input.style.fontFamily = 'var(--base-font-family)';
18
27
  }
19
28
  let label = htmlElement.getElementsByClassName("dx-label")[0];
20
29
  if (label) {
21
- label.style.borderBottomColor = color;
30
+ label.style.borderBottomColor = borderColor;
22
31
  }
23
32
  let labelBefore = htmlElement.getElementsByClassName("dx-label-before")[0];
24
33
  if (labelBefore) {
25
- labelBefore.style.borderBottomColor = color;
26
- labelBefore.style.borderTopColor = color;
27
- labelBefore.style.borderInlineStartColor = color;
34
+ labelBefore.style.borderBottomColor = borderColor;
35
+ labelBefore.style.borderTopColor = borderColor;
36
+ labelBefore.style.borderInlineStartColor = borderColor;
28
37
  }
29
38
  let labelAfter = htmlElement.getElementsByClassName("dx-label-after")[0];
30
39
  if (labelAfter) {
31
- labelAfter.style.borderBottomColor = color;
32
- labelAfter.style.borderTopColor = color;
33
- labelAfter.style.borderInlineEndColor = color;
40
+ labelAfter.style.borderBottomColor = borderColor;
41
+ labelAfter.style.borderTopColor = borderColor;
42
+ labelAfter.style.borderInlineEndColor = borderColor;
34
43
  }
35
44
  }, [props.isModifiedWhen, props.readOnly]);
36
45
  const dateBoxRef = useRef(null);
@@ -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) {