@topconsultnpm/sdkui-react 6.19.0-dev2.3 → 6.19.0-dev2.30

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 (100) hide show
  1. package/lib/components/NewComponents/ContextMenu/TMContextMenu.d.ts +4 -0
  2. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +187 -0
  3. package/lib/components/NewComponents/ContextMenu/hooks.d.ts +11 -0
  4. package/lib/components/NewComponents/ContextMenu/hooks.js +48 -0
  5. package/lib/components/NewComponents/ContextMenu/index.d.ts +2 -0
  6. package/lib/components/NewComponents/ContextMenu/index.js +1 -0
  7. package/lib/components/NewComponents/ContextMenu/styles.d.ts +27 -0
  8. package/lib/components/NewComponents/ContextMenu/styles.js +308 -0
  9. package/lib/components/NewComponents/ContextMenu/types.d.ts +26 -0
  10. package/lib/components/NewComponents/ContextMenu/types.js +1 -0
  11. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.d.ts +4 -0
  12. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +370 -0
  13. package/lib/components/NewComponents/FloatingMenuBar/index.d.ts +2 -0
  14. package/lib/components/NewComponents/FloatingMenuBar/index.js +2 -0
  15. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +38 -0
  16. package/lib/components/NewComponents/FloatingMenuBar/styles.js +267 -0
  17. package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +30 -0
  18. package/lib/components/NewComponents/FloatingMenuBar/types.js +1 -0
  19. package/lib/components/NewComponents/Notification/Notification.d.ts +4 -0
  20. package/lib/components/NewComponents/Notification/Notification.js +60 -0
  21. package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +8 -0
  22. package/lib/components/NewComponents/Notification/NotificationContainer.js +33 -0
  23. package/lib/components/NewComponents/Notification/index.d.ts +2 -0
  24. package/lib/components/NewComponents/Notification/index.js +2 -0
  25. package/lib/components/NewComponents/Notification/styles.d.ts +21 -0
  26. package/lib/components/NewComponents/Notification/styles.js +180 -0
  27. package/lib/components/NewComponents/Notification/types.d.ts +18 -0
  28. package/lib/components/NewComponents/Notification/types.js +1 -0
  29. package/lib/components/base/TMCustomButton.js +79 -26
  30. package/lib/components/base/TMDataGridExportForm.d.ts +1 -1
  31. package/lib/components/base/TMDataGridExportForm.js +9 -3
  32. package/lib/components/base/TMFileManager.js +12 -3
  33. package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
  34. package/lib/components/base/TMFileManagerDataGridView.js +11 -2
  35. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
  36. package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
  37. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
  38. package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
  39. package/lib/components/base/TMTooltip.d.ts +1 -1
  40. package/lib/components/base/TMTooltip.js +1 -1
  41. package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
  42. package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
  43. package/lib/components/choosers/TMMetadataChooser.js +28 -7
  44. package/lib/components/editors/TMDateBox.d.ts +1 -1
  45. package/lib/components/features/documents/TMDcmtForm.js +312 -56
  46. package/lib/components/features/documents/TMRelationViewer.js +56 -23
  47. package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
  48. package/lib/components/features/search/TMSearch.js +2 -2
  49. package/lib/components/features/search/TMSearchQueryEditor.js +1 -1
  50. package/lib/components/features/search/TMSearchQueryPanel.js +8 -25
  51. package/lib/components/features/search/TMSearchResult.js +91 -10
  52. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
  53. package/lib/components/features/search/TMSearchResultsMenuItems.js +97 -51
  54. package/lib/components/features/tasks/TMTaskForm.js +5 -4
  55. package/lib/components/features/tasks/TMTasksAgenda.js +4 -4
  56. package/lib/components/features/tasks/TMTasksCalendar.js +2 -2
  57. package/lib/components/features/tasks/TMTasksHeader.js +1 -1
  58. package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -1
  59. package/lib/components/features/tasks/TMTasksUtils.js +18 -3
  60. package/lib/components/features/tasks/TMTasksUtilsView.js +26 -4
  61. package/lib/components/features/tasks/TMTasksView.js +12 -6
  62. package/lib/components/features/workflow/TMWorkflowPopup.js +3 -3
  63. package/lib/components/features/workflow/diagram/DiagramItemForm.js +11 -6
  64. package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
  65. package/lib/components/forms/TMResultDialog.js +8 -2
  66. package/lib/components/grids/TMBlogsPost.d.ts +1 -0
  67. package/lib/components/grids/TMBlogsPost.js +20 -4
  68. package/lib/components/grids/TMBlogsPostUtils.js +5 -3
  69. package/lib/components/grids/TMRecentsManager.js +1 -1
  70. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
  71. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +2 -2
  72. package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
  73. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -1
  74. package/lib/components/layout/panelManager/types.d.ts +1 -0
  75. package/lib/components/pages/TMPage.js +1 -1
  76. package/lib/components/query/TMQuerySummary.d.ts +1 -0
  77. package/lib/components/query/TMQuerySummary.js +3 -3
  78. package/lib/components/settings/SettingsAppearance.js +5 -5
  79. package/lib/components/viewers/TMDataListItemViewer.d.ts +1 -1
  80. package/lib/components/viewers/TMMidViewer.d.ts +1 -1
  81. package/lib/components/viewers/TMTidViewer.d.ts +1 -1
  82. package/lib/helper/GlobalStyles.d.ts +2 -0
  83. package/lib/helper/GlobalStyles.js +10 -0
  84. package/lib/helper/Globalization.d.ts +1 -0
  85. package/lib/helper/Globalization.js +30 -0
  86. package/lib/helper/SDKUI_Localizator.d.ts +34 -2
  87. package/lib/helper/SDKUI_Localizator.js +342 -22
  88. package/lib/helper/TMCustomSearchBar.js +1 -1
  89. package/lib/helper/TMIcons.d.ts +2 -1
  90. package/lib/helper/TMIcons.js +4 -1
  91. package/lib/helper/TMUtils.d.ts +1 -4
  92. package/lib/helper/TMUtils.js +18 -23
  93. package/lib/helper/dcmtsHelper.d.ts +2 -1
  94. package/lib/helper/dcmtsHelper.js +19 -13
  95. package/lib/helper/helpers.js +2 -1
  96. package/lib/helper/index.d.ts +1 -0
  97. package/lib/helper/index.js +1 -0
  98. package/lib/hooks/useRelatedDocuments.js +35 -26
  99. package/lib/ts/types.d.ts +1 -1
  100. package/package.json +8 -8
@@ -5,7 +5,7 @@ import TMDataGrid from "./TMDataGrid";
5
5
  import TMDcmtIcon from "../features/documents/TMDcmtIcon";
6
6
  import TMTooltip from "./TMTooltip";
7
7
  const TMFileManagerDataGridView = (props) => {
8
- const { items, focusedFile, handleFocusedFile, selectedFiles, handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler } = props;
8
+ const { items, allUsers, focusedFile, handleFocusedFile, selectedFiles, handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler } = props;
9
9
  // State hook to store the currently focused row key, initially set to undefined
10
10
  const [focusedRowKey, setFocusedRowKey] = useState(focusedFile?.id);
11
11
  // State to store selected row keys
@@ -16,6 +16,15 @@ const TMFileManagerDataGridView = (props) => {
16
16
  useEffect(() => {
17
17
  setSelectedRowKeys(selectedFiles.map(selectedFile => selectedFile.id));
18
18
  }, [selectedFiles]);
19
+ const findCheckOutUserName = useCallback((checkOutUserName, checkOutUserID) => {
20
+ if (checkOutUserName) {
21
+ return checkOutUserName;
22
+ }
23
+ else {
24
+ let checkOutUser = allUsers.find(user => user.id === checkOutUserID);
25
+ return checkOutUser ? checkOutUser.name : '-';
26
+ }
27
+ }, [allUsers]);
19
28
  // DataGrid Callback
20
29
  // Handles focus change in the data grid
21
30
  const onFocusedRowChanged = useCallback((e) => {
@@ -58,7 +67,7 @@ const TMFileManagerDataGridView = (props) => {
58
67
  const checkoutUsedId = checkOutUserID;
59
68
  const editMode = checkoutDate && checkoutUsedId && userID && userID === checkoutUsedId;
60
69
  const lockMode = checkoutDate && checkoutUsedId && userID && userID !== checkoutUsedId;
61
- const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", checkOutUserName ?? '-', " (ID: ", checkOutUserID, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", version ?? 1] }) }), _jsx("hr", {}), _jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Type }), ": ", ext] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.CreationTime }), ": ", Globalization.getDateTimeDisplayValue(creationTime?.toString())] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.LastUpdateTime }), ": ", Globalization.getDateTimeDisplayValue(lastUpdateTime?.toString())] })] })] })] });
70
+ const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", findCheckOutUserName(checkOutUserName, checkOutUserID) ?? '-', " (ID: ", checkOutUserID, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", version ?? 1] }) }), _jsx("hr", {}), _jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Type }), ": ", ext] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.CreationTime }), ": ", Globalization.getDateTimeDisplayValue(creationTime?.toString())] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.LastUpdateTime }), ": ", Globalization.getDateTimeDisplayValue(lastUpdateTime?.toString())] })] })] })] });
62
71
  return _jsxs("div", { style: { display: "inline-flex", alignItems: "center", gap: "4px" }, children: [editMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-edit" }) }), lockMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-lock" }) }), renderHighlightedText(cellData.value, searchText, false)] });
63
72
  }, [searchText]);
64
73
  const cellExtRender = useCallback((cellData) => {
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { FileItem } from './TMFileManagerUtils';
3
+ import { UserDescriptor } from '@topconsultnpm/sdk-ts';
3
4
  export interface TMFileManagerThumbnailItemsProps {
4
5
  items: Array<FileItem>;
6
+ allUsers: Array<UserDescriptor>;
5
7
  paginatedItems: Array<FileItem>;
6
8
  focusedFile: FileItem | undefined;
7
9
  handleFocusedFile: (fileItem: FileItem | undefined) => void;
@@ -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, paginatedItems, selectedFiles, searchText, userID, onDoubleClick, handleSelectedFiles, handleFocusedFile, setDraftThumbViewAnchor } = props;
9
+ const { items, allUsers, paginatedItems, selectedFiles, searchText, userID, onDoubleClick, handleSelectedFiles, handleFocusedFile, setDraftThumbViewAnchor } = 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
@@ -112,6 +112,16 @@ const TMFileManagerThumbnailItems = (props) => {
112
112
  setDraftThumbViewAnchor(e.currentTarget);
113
113
  handleFocusedFile(item);
114
114
  }, []);
115
+ const findCheckOutUserName = useCallback((item) => {
116
+ if (item.checkOutUserName) {
117
+ return item.checkOutUserName;
118
+ }
119
+ else {
120
+ const checkOutUserID = item.checkOutUserID;
121
+ let checkOutUser = allUsers.find(user => user.id === checkOutUserID);
122
+ return checkOutUser ? checkOutUser.name : '-';
123
+ }
124
+ }, [allUsers]);
115
125
  return _jsx("div", { style: { width: "100%", height: "100%" }, children: paginatedItems.map(item => {
116
126
  const isSelected = selectedFiles?.map(file => file.id).includes(item.id) ?? false;
117
127
  const checkoutDate = item.checkoutDate;
@@ -130,7 +140,7 @@ const TMFileManagerThumbnailItems = (props) => {
130
140
  bgColor = isSelected ? colors.PRIMARY_BLUE : backgroundColors.lockMode;
131
141
  bgHoverColor = isSelected ? colors.PRIMARY_BLUE : "#fff59d";
132
142
  }
133
- const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", item.checkOutUserName ?? '-', " (ID: ", item.checkOutUserID, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(item.checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", item.version ?? 1] }) }), _jsx("hr", {}), _jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Type }), ": ", item.ext] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.CreationTime }), ": ", Globalization.getDateTimeDisplayValue(item.creationTime?.toString())] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.LastUpdateTime }), ": ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime?.toString())] })] })] })] });
143
+ const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", findCheckOutUserName(item) ?? '-', " (ID: ", item.checkOutUserID, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(item.checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", item.version ?? 1] }) }), _jsx("hr", {}), _jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Type }), ": ", item.ext] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.CreationTime }), ": ", Globalization.getDateTimeDisplayValue(item.creationTime?.toString())] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.LastUpdateTime }), ": ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime?.toString())] })] })] })] });
134
144
  const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", item.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", item.did ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", item.tid ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", item.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", item.updaterName ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", item.version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(item.size ?? 0)] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.creationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime)] })] }));
135
145
  return _jsx(TMFileItemContainer, { className: "tm-file-manager-thumbnail-items", ref: containerRef, id: "tm-file-manager-thumbnail-item-" + item.id.toString(), "$backgroundColor": bgColor, "$bgHoverColor": bgHoverColor, "$textColor": textColor, onDoubleClick: () => onDoubleClickHandler(item), onContextMenu: (e) => onContextMenu(e, item), onClick: (e) => onClickHandler(e, item), tabIndex: 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', width: '100%' }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', flex: 1, minWidth: 0 }, children: [_jsxs("div", { style: { marginRight: '16px', flexShrink: 0 }, children: [_jsx(TMDcmtIcon, { tid: item.tid, did: item.did, fileExtension: item.ext, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }), editMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: !isSelected ? colors.MEDIUM_GREEN : '#fff', fontWeight: "bold" }, className: "dx-icon-edit" }) }), lockMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: !isSelected ? colors.MEDIUM_GREEN : '#fff', fontWeight: "bold" }, className: "dx-icon-lock" }) })] }), _jsxs("div", { style: { overflow: 'hidden', minWidth: 0 }, children: [_jsx("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block', fontSize: '1rem', fontWeight: "bold" }, children: _jsx(TMTooltip, { parentStyle: { overflow: 'hidden' }, childStyle: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block' }, children: renderHighlightedText(item.name, searchText, isSelected) }) }), _jsx("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block', fontSize: 'calc(1rem - 1px)' }, children: formatBytes(item.size ?? 0) })] })] }), item.version && (_jsx("div", { style: { flexShrink: 0, marginLeft: '12px', whiteSpace: 'nowrap' }, children: _jsx(TMTooltip, { content: SDKUI_Localizator.Version, children: _jsx("div", { style: { border: "2px solid #28a745", backgroundColor: "#28a745", color: "#ffffff", borderRadius: '50%', width: '30px', height: '30px', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '12px', fontWeight: 'bold' }, children: item.version }) }) }))] }) }, "tm-file-manager-thumbnail-item-" + item.id);
136
146
  }) });
@@ -1,7 +1,9 @@
1
1
  import React from "react";
2
2
  import { FileItem, TMFileManagerContextMenuItem } from "./TMFileManagerUtils";
3
+ import { UserDescriptor } from "@topconsultnpm/sdk-ts";
3
4
  interface TMFileManagerThumbnailsViewProps {
4
5
  items: Array<FileItem>;
6
+ allUsers: Array<UserDescriptor>;
5
7
  focusedFile: FileItem | undefined;
6
8
  handleFocusedFile: (fileItem: FileItem | undefined) => void;
7
9
  selectedFiles: Array<FileItem>;
@@ -5,7 +5,7 @@ import { ContextMenu, Pagination, ScrollView } from "devextreme-react";
5
5
  import TMFileManagerThumbnailItems from "./TMFileManagerThumbnailItems";
6
6
  import { SDKUI_Localizator } from "../../helper";
7
7
  const TMFileManagerThumbnailsView = (props) => {
8
- const { items, focusedFile, handleFocusedFile, selectedFiles = [], handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler, draftThumbViewAnchor, setDraftThumbViewAnchor } = props;
8
+ const { items, allUsers, focusedFile, handleFocusedFile, selectedFiles = [], handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler, draftThumbViewAnchor, setDraftThumbViewAnchor } = props;
9
9
  const PAGE_SIZES = [TMFileManagerPageSize.Small, TMFileManagerPageSize.Medium, TMFileManagerPageSize.Large];
10
10
  const initPageSize = TMFileManagerPageSize.Small;
11
11
  const showPagination = (items?.length ?? 0) > initPageSize;
@@ -39,7 +39,7 @@ const TMFileManagerThumbnailsView = (props) => {
39
39
  handleSelectedFiles?.([]);
40
40
  };
41
41
  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, 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 })] })
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 })] })
43
43
  :
44
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 })] });
45
45
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ITooltipOptions } from 'devextreme-react/cjs/tooltip';
2
+ import { ITooltipOptions } from 'devextreme-react/tooltip';
3
3
  import { Position } from 'devextreme/common';
4
4
  import { PositionConfig } from 'devextreme/animation/position';
5
5
  interface ITMTooltipProps extends ITooltipOptions {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
- import { Tooltip } from 'devextreme-react/cjs/tooltip';
3
+ import { Tooltip } from 'devextreme-react/tooltip';
4
4
  import { genUniqueId } from '../../helper';
5
5
  import { DeviceType, useDeviceType } from './TMDeviceProvider';
6
6
  const TMTooltip = ({ children, position, content, hideAfterDelay, parentStyle, childStyle }) => {
@@ -23,7 +23,7 @@ const TMDcmtTypeChooser = ({ tmSession, dataSource, disabled, backgroundColor, f
23
23
  export default TMDcmtTypeChooser;
24
24
  const cellRenderIcon = (data) => _jsx(TMDcmtTypeIcon, { dtd: data.data });
25
25
  const cellRenderNameAndDesc = (data) => _jsx("p", { style: { textAlign: 'left', color: data.data.isView ? 'red' : '' }, children: data.value });
26
- export const TMDcmtTypeChooserForm = ({ tmSession, allowMultipleSelection, width, height, selectedIDs, dataSource, ShowOnlyDcmtTypes, ShowOnlySAP, filterTemplateTID, accessFilter = 'all', filter, onClose, onChoose }) => {
26
+ export const TMDcmtTypeChooserForm = ({ tmSession, allowMultipleSelection, width, height, selectedIDs, dataSource, ShowOnlyDcmtTypes, ShowOnlySAP, filterTemplateTID, accessFilter = 'all', startWithShowOnlySelectedItems = true, filter, onClose, onChoose }) => {
27
27
  const isPermitted = (accessLevel) => accessLevel === AccessLevelsEx.Yes || accessLevel === AccessLevelsEx.Mixed;
28
28
  const getItems = async (refreshCache) => {
29
29
  let tms = tmSession ?? SDK_Globals.tmSession;
@@ -57,5 +57,5 @@ export const TMDcmtTypeChooserForm = ({ tmSession, allowMultipleSelection, width
57
57
  return false;
58
58
  return true;
59
59
  };
60
- return (_jsx(TMChooserForm, { title: SDK_Localizator.ListDcmtTypeOrView, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, width: width, height: height, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, cellRenderNameAndDesc: cellRenderNameAndDesc, dataSource: dataSource, getItems: getItems, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
60
+ return (_jsx(TMChooserForm, { title: SDK_Localizator.ListDcmtTypeOrView, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, startWithShowOnlySelectedItems: startWithShowOnlySelectedItems, width: width, height: height, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, cellRenderNameAndDesc: cellRenderNameAndDesc, dataSource: dataSource, getItems: getItems, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
61
61
  };
@@ -2,6 +2,9 @@ import React from 'react';
2
2
  import { MetadataDescriptor, QueryDescriptor, ValidationItem } from '@topconsultnpm/sdk-ts';
3
3
  import { ITMChooserFormProps, ITMChooserProps, TID_MID } from '../../ts';
4
4
  import { TID_Alias } from '../../helper/queryHelper';
5
+ type MetadataDescriptorWithKey = MetadataDescriptor & {
6
+ uniqueKey: string;
7
+ };
5
8
  interface ITMMetadataChooserProps extends ITMChooserProps {
6
9
  /** Allows you to view system metadata */
7
10
  allowSysMetadata?: boolean;
@@ -32,7 +35,7 @@ interface ITMMetadataChooserProps extends ITMChooserProps {
32
35
  }
33
36
  declare const TMMetadataChooser: React.FunctionComponent<ITMMetadataChooserProps>;
34
37
  export default TMMetadataChooser;
35
- interface ITMMetadataChooserFormProps extends ITMChooserFormProps<MetadataDescriptor> {
38
+ interface ITMMetadataChooserFormProps extends ITMChooserFormProps<MetadataDescriptorWithKey> {
36
39
  /** Allows you to view system metadata */
37
40
  allowSysMetadata?: boolean;
38
41
  /** TIDs of document types to retrieve metadata from */
@@ -38,7 +38,18 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
38
38
  if (checkProps)
39
39
  throw Error('Le props qd | tids | dataSource devono essere in alternativa');
40
40
  try {
41
- if (qd) {
41
+ if (dataSource) {
42
+ // Se ho dataSource, aggiungo tutti i suoi metadati con uniqueKey
43
+ dataSource.forEach((md) => {
44
+ const mdWithKey = md;
45
+ mdWithKey.uniqueKey = `${mdWithKey.customData1 ?? 0}_${md.id}_${mdWithKey.customData2 ?? ''}`;
46
+ metadata.push(mdWithKey);
47
+ });
48
+ setDcmtTypes(dtdList);
49
+ setHasSysMetadata(allowSysMetadata && metadata.findIndex(md => md.isSystem == 1) >= 0);
50
+ return showSysMetadata ? metadata : metadata.filter(o => o.isSystem != 1);
51
+ }
52
+ else if (qd) {
42
53
  let tids = getTIDsByQd(qd);
43
54
  let inputTIDs = tids.map((item) => item.tid);
44
55
  TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.DcmtType} ...` });
@@ -50,15 +61,19 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
50
61
  dtd.customData2 = alias;
51
62
  if (!qdShowOnlySelectItems) {
52
63
  dtd.metadata?.forEach((md) => {
53
- md.customData1 = dtd.id;
54
- md.customData2 = alias;
64
+ const mdWithKey = md;
65
+ mdWithKey.customData1 = dtd.id;
66
+ mdWithKey.customData2 = alias;
67
+ mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${alias}`;
55
68
  });
56
69
  }
57
70
  else {
58
71
  let newMetadata = dtd.metadata?.filter(o => qd.select?.some(s => s.tid == dtd.id && s.mid == o.id && ((s.alias ?? '') == alias)));
59
72
  newMetadata?.forEach((md) => {
60
- md.customData1 = dtd.id;
61
- md.customData2 = alias;
73
+ const mdWithKey = md;
74
+ mdWithKey.customData1 = dtd.id;
75
+ mdWithKey.customData2 = alias;
76
+ mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${alias}`;
62
77
  });
63
78
  }
64
79
  let mds = filterMetadata ? dtd.metadata?.filter(filterMetadata) : dtd.metadata;
@@ -81,7 +96,11 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
81
96
  continue;
82
97
  }
83
98
  let mds = filterMetadata ? dtd.metadata?.filter(filterMetadata) : dtd.metadata;
84
- mds?.forEach((md) => { md.customData1 = dtd?.id; });
99
+ mds?.forEach((md) => {
100
+ const mdWithKey = md;
101
+ mdWithKey.customData1 = dtd?.id;
102
+ mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${md.customData2 ?? ''}`;
103
+ });
85
104
  dtdList.push({ ...dtd, metadata: mds });
86
105
  }
87
106
  }
@@ -130,5 +149,7 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
130
149
  const cellRenderNameAndDesc = useCallback((data) => {
131
150
  return _jsx("p", { style: { textAlign: 'left', color: data.data.isRequired == 1 ? 'red' : '' }, children: data.value });
132
151
  }, []);
133
- return (_jsx(TMChooserForm, { title: SDK_Localizator.Metadatas, allowMultipleSelection: allowMultipleSelection, allowSorting: false, allowGrouping: dcmtTypes.length > 1, width: width, height: height, selectedIDs: selectedIDs?.map((item) => item.mid), convertID: convertID, cellRenderIcon: cellRenderIcon, cellRenderNameAndDesc: cellRenderNameAndDesc, dataSource: dataSource, getItems: getItems, customButtons: renderCustomButtons(), columns: dataColumns, summaryItems: renderSummaryItems, onClose: onClose, onChoose: (IDs) => { onChoose?.(IDs); } }));
152
+ return (_jsx(TMChooserForm, { title: SDK_Localizator.Metadatas, allowMultipleSelection: allowMultipleSelection, allowSorting: false, allowGrouping: dcmtTypes.length > 1, width: width, height: height, keyName: 'uniqueKey', selectedIDs: selectedIDs?.map((item) => `${item.tid}_${item.mid}_${item.aliasTID ?? ''}`), convertID: convertID, cellRenderIcon: cellRenderIcon, cellRenderNameAndDesc: cellRenderNameAndDesc,
153
+ // dataSource={dataSource}
154
+ getItems: getItems, customButtons: renderCustomButtons(), columns: dataColumns, summaryItems: renderSummaryItems, onClose: onClose, onChoose: (IDs) => { onChoose?.(IDs); } }));
134
155
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ValidationItem } from '@topconsultnpm/sdk-ts';
3
- import { IDateBoxOptions } from 'devextreme-react/cjs/date-box';
3
+ import { IDateBoxOptions } from 'devextreme-react/date-box';
4
4
  import { DateDisplayTypes } from '../../helper';
5
5
  interface ITMDateBoxProps extends IDateBoxOptions {
6
6
  dateDisplayType?: DateDisplayTypes;