@topconsultnpm/sdkui-react 6.19.0-dev2.9 → 6.19.0-test2

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 (97) hide show
  1. package/lib/components/base/TMAccordionNew.d.ts +28 -0
  2. package/lib/components/base/TMAccordionNew.js +326 -0
  3. package/lib/components/base/TMButton.d.ts +1 -0
  4. package/lib/components/base/TMButton.js +6 -6
  5. package/lib/components/base/TMCustomButton.d.ts +1 -1
  6. package/lib/components/base/TMCustomButton.js +83 -28
  7. package/lib/components/base/TMDataGridExportForm.js +9 -3
  8. package/lib/components/base/TMFileManager.js +11 -2
  9. package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
  10. package/lib/components/base/TMFileManagerDataGridView.js +12 -3
  11. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
  12. package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
  13. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
  14. package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
  15. package/lib/components/base/TMModal.d.ts +2 -0
  16. package/lib/components/base/TMModal.js +48 -3
  17. package/lib/components/base/TMPopUp.js +74 -5
  18. package/lib/components/base/TMWaitPanel.js +8 -2
  19. package/lib/components/choosers/TMDataListItemChooser.js +1 -1
  20. package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
  21. package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
  22. package/lib/components/choosers/TMMetadataChooser.js +31 -8
  23. package/lib/components/choosers/TMUserChooser.d.ts +4 -0
  24. package/lib/components/choosers/TMUserChooser.js +21 -5
  25. package/lib/components/editors/TMMetadataValues.js +45 -4
  26. package/lib/components/editors/TMTextArea.d.ts +1 -0
  27. package/lib/components/editors/TMTextArea.js +44 -10
  28. package/lib/components/editors/TMTextBox.js +34 -4
  29. package/lib/components/editors/TMTextExpression.js +36 -28
  30. package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +30 -0
  31. package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +471 -0
  32. package/lib/components/features/assistant/ToppySpeechBubble.d.ts +9 -0
  33. package/lib/components/features/assistant/ToppySpeechBubble.js +117 -0
  34. package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -0
  35. package/lib/components/features/blog/TMBlogCommentForm.js +18 -6
  36. package/lib/components/features/documents/TMDcmtBlog.js +1 -1
  37. package/lib/components/features/documents/TMDcmtForm.js +290 -31
  38. package/lib/components/features/documents/TMDcmtIcon.js +9 -4
  39. package/lib/components/features/documents/TMDcmtPreview.js +45 -8
  40. package/lib/components/features/documents/TMRelationViewer.js +55 -22
  41. package/lib/components/features/search/TMSearch.js +2 -2
  42. package/lib/components/features/search/TMSearchQueryEditor.js +1 -1
  43. package/lib/components/features/search/TMSearchQueryPanel.js +10 -28
  44. package/lib/components/features/search/TMSearchResult.js +102 -33
  45. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
  46. package/lib/components/features/search/TMSearchResultsMenuItems.js +67 -28
  47. package/lib/components/features/search/TMSignSettingsForm.d.ts +9 -0
  48. package/lib/components/features/search/TMSignSettingsForm.js +621 -0
  49. package/lib/components/features/tasks/TMTaskForm.js +10 -4
  50. package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
  51. package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
  52. package/lib/components/features/tasks/TMTasksUtils.d.ts +1 -0
  53. package/lib/components/features/tasks/TMTasksUtils.js +17 -2
  54. package/lib/components/features/tasks/TMTasksUtilsView.js +26 -4
  55. package/lib/components/features/tasks/TMTasksView.js +11 -5
  56. package/lib/components/features/workflow/TMWorkflowPopup.js +3 -3
  57. package/lib/components/features/workflow/diagram/WFDiagram.js +19 -1
  58. package/lib/components/forms/TMSaveForm.js +3 -11
  59. package/lib/components/grids/TMBlogAttachments.d.ts +0 -14
  60. package/lib/components/grids/TMBlogAttachments.js +10 -5
  61. package/lib/components/grids/TMBlogsPost.d.ts +8 -3
  62. package/lib/components/grids/TMBlogsPost.js +100 -39
  63. package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
  64. package/lib/components/grids/TMBlogsPostUtils.js +27 -6
  65. package/lib/components/index.d.ts +2 -1
  66. package/lib/components/index.js +2 -1
  67. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
  68. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +2 -2
  69. package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
  70. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -1
  71. package/lib/components/layout/panelManager/types.d.ts +1 -0
  72. package/lib/components/settings/SettingsAppearance.js +5 -5
  73. package/lib/helper/GlobalStyles.d.ts +2 -0
  74. package/lib/helper/GlobalStyles.js +10 -0
  75. package/lib/helper/Globalization.d.ts +1 -0
  76. package/lib/helper/Globalization.js +30 -0
  77. package/lib/helper/SDKUI_Localizator.d.ts +41 -1
  78. package/lib/helper/SDKUI_Localizator.js +410 -10
  79. package/lib/helper/TMIcons.d.ts +4 -1
  80. package/lib/helper/TMIcons.js +13 -1
  81. package/lib/helper/TMToppyMessage.d.ts +1 -0
  82. package/lib/helper/TMToppyMessage.js +4 -3
  83. package/lib/helper/TMUtils.d.ts +42 -4
  84. package/lib/helper/TMUtils.js +190 -23
  85. package/lib/helper/dcmtsHelper.d.ts +2 -1
  86. package/lib/helper/dcmtsHelper.js +56 -17
  87. package/lib/helper/helpers.d.ts +1 -1
  88. package/lib/helper/helpers.js +12 -17
  89. package/lib/helper/index.d.ts +1 -0
  90. package/lib/helper/index.js +1 -0
  91. package/lib/hooks/useDcmtOperations.d.ts +1 -1
  92. package/lib/hooks/useDcmtOperations.js +10 -6
  93. package/lib/hooks/useRelatedDocuments.js +35 -26
  94. package/lib/ts/types.d.ts +2 -0
  95. package/package.json +8 -8
  96. package/lib/components/features/assistant/ToppyHelpCenter.d.ts +0 -12
  97. package/lib/components/features/assistant/ToppyHelpCenter.js +0 -173
@@ -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) => {
@@ -87,6 +96,6 @@ const TMFileManagerDataGridView = (props) => {
87
96
  { dataField: "creationTime", caption: SDKUI_Localizator.CreationTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
88
97
  ];
89
98
  }, [searchText]);
90
- 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 });
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);
91
100
  };
92
101
  export default TMFileManagerDataGridView;
@@ -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
  };
@@ -8,9 +8,11 @@ interface ITMModal {
8
8
  fontSize?: string;
9
9
  isModal?: boolean;
10
10
  resizable?: boolean;
11
+ expandable?: boolean;
11
12
  onClose?: () => void;
12
13
  hidePopup?: boolean;
13
14
  askClosingConfirm?: boolean;
15
+ showCloseButton?: boolean;
14
16
  }
15
17
  declare const TMModal: React.FC<ITMModal>;
16
18
  export default TMModal;
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useState, useEffect } from 'react';
2
+ import { useState, useEffect, useRef } from 'react';
3
3
  import { Popup } from 'devextreme-react';
4
4
  import styled from 'styled-components';
5
5
  import TMLayoutContainer, { TMCard, TMLayoutItem } from './TMLayout';
6
6
  import { FontSize, TMColors } from '../../utils/theme';
7
+ import { IconWindowMaximize, IconWindowMinimize, svgToString } from '../../helper';
7
8
  const StyledModal = styled.div `
8
9
  width: ${props => props.$width};
9
10
  height: ${props => props.$height};
@@ -38,11 +39,46 @@ const StyledModalContext = styled.div `
38
39
  overflow: auto;
39
40
  height: 100%;
40
41
  `;
41
- const TMModal = ({ resizable = true, isModal = true, title = '', toolbar, onClose, children, width = '100%', height = '100%', fontSize = FontSize.defaultFontSize, hidePopup = true, askClosingConfirm = false }) => {
42
+ const TMModal = ({ resizable = true, expandable = false, isModal = true, title = '', toolbar, onClose, children, width = '100%', height = '100%', fontSize = FontSize.defaultFontSize, hidePopup = true, askClosingConfirm = false, showCloseButton = true }) => {
43
+ const popupRef = useRef(null);
42
44
  const [initialWidth, setInitialWidth] = useState(width);
43
45
  const [initialHeight, setInitialHeight] = useState(height);
44
46
  const [showPopup, setShowPopup] = useState(false);
45
47
  const [isResizing, setIsResizing] = useState(false);
48
+ const [isFullScreen, setIsFullScreen] = useState(false);
49
+ // Dimensioni minime di default per il popup
50
+ const DEFAULT_MIN_WIDTH = 500;
51
+ const DEFAULT_MIN_HEIGHT = 400;
52
+ const [minWidth, setMinWidth] = useState(0);
53
+ const [minHeight, setMinHeight] = useState(0);
54
+ /**
55
+ * Gestore chiamato quando il popup viene mostrato.
56
+ * Calcola e imposta le dimensioni minime del popup in base allo spazio disponibile.
57
+ * Le dimensioni minime sono il valore più piccolo tra le dimensioni effettive del parent e le dimensioni minime di default
58
+ */
59
+ const handleShown = () => {
60
+ // Usa requestAnimationFrame per attendere il completamento del rendering
61
+ requestAnimationFrame(() => {
62
+ if (popupRef.current && popupRef.current.instance) {
63
+ const instance = popupRef.current.instance();
64
+ if (instance) {
65
+ // Ottiene l'elemento content del popup
66
+ const element = instance.content();
67
+ if (element) {
68
+ const parentElement = element.parentElement;
69
+ if (parentElement) {
70
+ // Legge le dimensioni effettive del contenitore parent
71
+ const widthPx = parentElement.offsetWidth;
72
+ const heightPx = parentElement.offsetHeight;
73
+ // Imposta le dimensioni minime usando il valore più piccolo tra le dimensioni disponibili e quelle di default
74
+ setMinWidth(widthPx < DEFAULT_MIN_WIDTH ? widthPx : DEFAULT_MIN_WIDTH);
75
+ setMinHeight(heightPx < DEFAULT_MIN_HEIGHT ? heightPx : DEFAULT_MIN_HEIGHT);
76
+ }
77
+ }
78
+ }
79
+ }
80
+ });
81
+ };
46
82
  useEffect(() => {
47
83
  setShowPopup(isModal);
48
84
  }, [isModal]);
@@ -65,6 +101,15 @@ const TMModal = ({ resizable = true, isModal = true, title = '', toolbar, onClos
65
101
  setShowPopup(false);
66
102
  onClose && onClose();
67
103
  };
68
- return (_jsx(_Fragment, { children: isModal ? (_jsx(Popup, { showCloseButton: true, animation: undefined, maxHeight: '95%', maxWidth: '95%', dragEnabled: !isResizing, resizeEnabled: resizable, width: initialWidth, height: initialHeight, title: title, visible: showPopup, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd, onHiding: onHiding, children: _jsxs(TMLayoutContainer, { children: [toolbar && (_jsx(TMLayoutItem, { height: "40px", children: _jsx(StyledModalToolbar, { children: toolbar }) })), _jsx(TMLayoutItem, { height: toolbar ? 'calc(100% - 50px)' : 'calc(100% - 10px)', children: _jsx(TMCard, { showBorder: false, padding: false, scrollY: true, children: children }) })] }) })) : (_jsxs(StyledModal, { "$isModal": isModal, className: "temp-modal", "$fontSize": fontSize, "$width": initialWidth, "$height": initialHeight, children: [toolbar ? _jsx(StyledModalToolbar, { children: toolbar }) : _jsx(_Fragment, {}), _jsx(StyledModalContext, { children: children })] })) }));
104
+ return (_jsx(_Fragment, { children: isModal ? (_jsx(Popup, { ref: popupRef, showCloseButton: showCloseButton, animation: undefined, minWidth: minWidth, minHeight: minHeight, maxHeight: '95%', maxWidth: '95%', dragEnabled: !isResizing, resizeEnabled: resizable, width: expandable && isFullScreen ? '95%' : initialWidth, height: expandable && isFullScreen ? '95%' : initialHeight, title: title, visible: showPopup, onShown: handleShown, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd, onHiding: onHiding, toolbarItems: expandable ? [
105
+ {
106
+ widget: 'dxButton',
107
+ location: 'after',
108
+ options: {
109
+ icon: isFullScreen ? svgToString(_jsx(IconWindowMinimize, {})) : svgToString(_jsx(IconWindowMaximize, {})),
110
+ onClick: () => setIsFullScreen(!isFullScreen)
111
+ }
112
+ }
113
+ ] : undefined, children: _jsxs(TMLayoutContainer, { children: [toolbar && (_jsx(TMLayoutItem, { height: "40px", children: _jsx(StyledModalToolbar, { children: toolbar }) })), _jsx(TMLayoutItem, { height: toolbar ? 'calc(100% - 40px)' : '100%', children: _jsx(TMCard, { showBorder: false, padding: false, scrollY: true, children: children }) })] }) })) : (_jsxs(StyledModal, { "$isModal": isModal, className: "temp-modal", "$fontSize": fontSize, "$width": initialWidth, "$height": initialHeight, children: [toolbar ? _jsx(StyledModalToolbar, { children: toolbar }) : _jsx(_Fragment, {}), _jsx(StyledModalContext, { children: children })] })) }));
69
114
  };
70
115
  export default TMModal;
@@ -20,6 +20,9 @@ export var ButtonNames;
20
20
  ButtonNames["OK"] = "OK";
21
21
  ButtonNames["CANCEL"] = "Cancel";
22
22
  })(ButtonNames || (ButtonNames = {}));
23
+ // Dimensioni minime di default per i popup
24
+ const DEFAULT_MIN_WIDTH = 500;
25
+ const DEFAULT_MIN_HEIGHT = 400;
23
26
  const StyledExeptionToolbar = styled.div `
24
27
  display: flex;
25
28
  flex-direction: row;
@@ -33,7 +36,8 @@ const StyledExeptionToolbar = styled.div `
33
36
  background-color: white;
34
37
  `;
35
38
  const StyledMessageToolbar = styled.div `
36
- position: relative;
39
+ position: sticky;
40
+ bottom: 0;
37
41
  display: flex;
38
42
  flex-direction: row;
39
43
  justify-content: flex-end;
@@ -43,7 +47,7 @@ const StyledMessageToolbar = styled.div `
43
47
  user-select: none;
44
48
  border-top: 1px solid #f3f3f3;
45
49
  background-color: #ffffff;
46
- z-index: 100;
50
+ z-index: 1;
47
51
  flex-wrap: wrap;
48
52
 
49
53
  @media (max-width: 200px) {
@@ -95,6 +99,7 @@ const ResponsiveMessageContainer = styled.div `
95
99
  height: 100%;
96
100
  width: 100%;
97
101
  background-color: #ffffff;
102
+ overflow: hidden;
98
103
  `;
99
104
  const ResponsiveMessageContent = styled.div `
100
105
  flex: 1;
@@ -105,6 +110,7 @@ const ResponsiveMessageContent = styled.div `
105
110
  gap: clamp(8px, 2vw, 20px);
106
111
  padding: clamp(8px, 3vw, 25px) clamp(5px, 2vw, 30px);
107
112
  min-height: clamp(80px, 15vh, 120px);
113
+ overflow: auto;
108
114
 
109
115
  @media (min-width: 300px) {
110
116
  flex-direction: ${props => props.$isMobile ? 'column' : 'row'};
@@ -163,8 +169,11 @@ const ResponsiveMessageBody = ({ message, isMobile, MessageToolbar, showToppy })
163
169
  const TMMessageBox = ({ resizable = false, onButtonClick, title = 'TopMedia', message = '', buttons, onClose, confirmOnEnter = false, showToppy = true, initialWidth = 'clamp(100px, 90vw, 400px)', initialHeight = 'auto' }) => {
164
170
  let deviceType = useDeviceType();
165
171
  const isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
172
+ const popupRef = useRef(null);
166
173
  const [width, setWidth] = useState(initialWidth);
167
174
  const [height, setHeight] = useState(initialHeight);
175
+ const [minWidth, setMinWidth] = useState(0);
176
+ const [minHeight, setMinHeight] = useState(0);
168
177
  const [isVisible, setIsVisible] = useState(true);
169
178
  const [btns, setBtns] = useState(buttons || []);
170
179
  useEffect(() => {
@@ -176,6 +185,34 @@ const TMMessageBox = ({ resizable = false, onButtonClick, title = 'TopMedia', me
176
185
  setBtns(arr);
177
186
  }
178
187
  }, [buttons]);
188
+ /**
189
+ * Gestore chiamato quando il popup viene mostrato.
190
+ * Calcola e imposta le dimensioni minime del popup in base allo spazio disponibile.
191
+ * Le dimensioni minime sono il valore più piccolo tra le dimensioni effettive del parent e le dimensioni minime di default
192
+ */
193
+ const handleShown = () => {
194
+ // Usa requestAnimationFrame per attendere il completamento del rendering
195
+ requestAnimationFrame(() => {
196
+ if (popupRef.current && popupRef.current.instance) {
197
+ const instance = popupRef.current.instance();
198
+ if (instance) {
199
+ // Ottiene l'elemento content del popup
200
+ const element = instance.content();
201
+ if (element) {
202
+ const parentElement = element.parentElement;
203
+ if (parentElement) {
204
+ // Legge le dimensioni effettive del contenitore parent
205
+ const widthPx = parentElement.offsetWidth;
206
+ const heightPx = parentElement.offsetHeight;
207
+ // Imposta le dimensioni minime usando il valore più piccolo tra le dimensioni disponibili e quelle di default
208
+ setMinWidth(widthPx < DEFAULT_MIN_WIDTH ? widthPx : DEFAULT_MIN_WIDTH);
209
+ setMinHeight(heightPx < DEFAULT_MIN_HEIGHT ? heightPx : DEFAULT_MIN_HEIGHT);
210
+ }
211
+ }
212
+ }
213
+ }
214
+ });
215
+ };
179
216
  const handleKeyDown = useCallback((e) => {
180
217
  if (confirmOnEnter && e.key === 'Enter') {
181
218
  e.preventDefault();
@@ -210,19 +247,51 @@ const TMMessageBox = ({ resizable = false, onButtonClick, title = 'TopMedia', me
210
247
  setWidth(e.width.toString());
211
248
  setHeight(e.height.toString());
212
249
  };
213
- return (_jsx(Popup, { animation: undefined, visible: isVisible, showCloseButton: true, width: width, height: height, minHeight: 'clamp(100px, 20vh, 180px)', title: title, onHidden: () => { onClose?.(); setIsVisible(false); }, resizeEnabled: resizable, onResizeEnd: handleResizeEnd, wrapperAttr: { id: 'tm-messagebox-wrapper' }, onShown: () => {
250
+ return (_jsx(Popup, { ref: popupRef, animation: undefined, visible: isVisible, showCloseButton: true, width: width, height: height, minWidth: minWidth, minHeight: minHeight || 'clamp(100px, 20vh, 180px)', maxHeight: '95%', maxWidth: '95%', title: title, onHidden: () => { onClose?.(); setIsVisible(false); }, resizeEnabled: resizable, onShown: () => {
251
+ handleShown();
214
252
  const el = document.getElementById('tm-messagebox-wrapper');
215
253
  if (el)
216
254
  el.style.zIndex = '20000';
217
- }, children: _jsx(ResponsiveMessageBody, { message: message, isMobile: isMobile, MessageToolbar: MessageToolbar, showToppy: showToppy }) }));
255
+ }, onResizeEnd: handleResizeEnd, wrapperAttr: { id: 'tm-messagebox-wrapper' }, children: _jsx(ResponsiveMessageBody, { message: message, isMobile: isMobile, MessageToolbar: MessageToolbar, showToppy: showToppy }) }));
218
256
  };
219
257
  const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.appModule} v. ${SDK_Globals.appVersion}`, onClose }) => {
258
+ const popupRef = useRef(null);
220
259
  const [isVisible, setIsVisible] = useState(true);
260
+ const [minWidth, setMinWidth] = useState(0);
261
+ const [minHeight, setMinHeight] = useState(0);
221
262
  let d = new Date();
222
263
  let dateString = d.getDate() + '/' + d.getMonth() + 1 + '/' + d.getFullYear();
223
264
  let timeString = d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds() + ':' + d.getMilliseconds();
224
265
  let message = getExceptionMessage(exception);
225
266
  let deviceType = useDeviceType();
267
+ /**
268
+ * Gestore chiamato quando il popup viene mostrato.
269
+ * Calcola e imposta le dimensioni minime del popup in base allo spazio disponibile.
270
+ * Le dimensioni minime sono il valore più piccolo tra le dimensioni effettive del parent e le dimensioni minime di default
271
+ */
272
+ const handleShown = () => {
273
+ // Usa requestAnimationFrame per attendere il completamento del rendering
274
+ requestAnimationFrame(() => {
275
+ if (popupRef.current && popupRef.current.instance) {
276
+ const instance = popupRef.current.instance();
277
+ if (instance) {
278
+ // Ottiene l'elemento content del popup
279
+ const element = instance.content();
280
+ if (element) {
281
+ const parentElement = element.parentElement;
282
+ if (parentElement) {
283
+ // Legge le dimensioni effettive del contenitore parent
284
+ const widthPx = parentElement.offsetWidth;
285
+ const heightPx = parentElement.offsetHeight;
286
+ // Imposta le dimensioni minime usando il valore più piccolo tra le dimensioni disponibili e quelle di default
287
+ setMinWidth(widthPx < DEFAULT_MIN_WIDTH ? widthPx : DEFAULT_MIN_WIDTH);
288
+ setMinHeight(heightPx < DEFAULT_MIN_HEIGHT ? heightPx : DEFAULT_MIN_HEIGHT);
289
+ }
290
+ }
291
+ }
292
+ }
293
+ });
294
+ };
226
295
  const getFullMessage = () => {
227
296
  let fullMessage = '';
228
297
  fullMessage += `${d}\n${'-' + JSON.stringify(exception)}\n` + `-${SDK_Globals.appModule}: ${SDK_Globals.appVersion}\n` + `-SDKUI: ${SDK_Globals.sdkuiVersion}\n` + `-SDK: ${SDK_Globals.sdkVersion}\n`;
@@ -235,7 +304,7 @@ const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.a
235
304
  const ExceptionToolbar = () => {
236
305
  return (_jsxs(StyledExeptionToolbar, { children: [_jsx(TMButton, { color: 'primaryOutline', btnStyle: 'text', onClick: () => copyToClipBoard(getFullMessage()), caption: SDKUI_Localizator.CopyToClipboard, showTooltip: false }), _jsx(TMButton, { btnStyle: 'text', onClick: () => { onClose?.(); setIsVisible(false); }, caption: SDKUI_Localizator.Close, showTooltip: false, color: 'error' })] }));
237
306
  };
238
- return (_jsx(Popup, { resizeEnabled: resizable, visible: isVisible, onHidden: () => { onClose?.(); setIsVisible(false); }, showCloseButton: true, width: calcResponsiveSizes(deviceType, '600px', '400px', '350px'), height: '350px', title: title, children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { height: 'calc(100% - 50px)', children: _jsxs(TMTabGroup, { validationItems: [], children: [_jsxs(TMTab, { label: SDKUI_Localizator.Error, children: [_jsxs(TabContextContainer, { style: { height: 'calc(100% - 68px )', paddingRight: '40px' }, children: [_jsxs("p", { children: [" ", _jsx("span", { style: { color: TMColors.primary }, children: "Messaggio: " }), " ", message] }), _jsx("div", { style: { display: 'flex', flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'flex-start', gap: '5px', marginTop: '5px' }, children: _jsxs("div", { children: [_jsxs("span", { style: { color: TMColors.primary }, children: [SDKUI_Localizator.Date, " ", SDKUI_Localizator.Time.toLowerCase(), ": "] }), d.toString()] }) })] }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(`Date: ${dateString}\nTime: ${timeString}\nMessage: ${message}`), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] }), _jsxs(TMTab, { label: SDKUI_Localizator.CompleteError, children: [_jsx(TabContextContainer, { style: { paddingRight: '40px' }, children: JSON.stringify(exception).replaceAll('{', '').replaceAll('}', '').split(`,"`).map((t, index) => (_jsxs("div", { style: { padding: '5px', borderBottom: '1px solid rgb(180,180,180)' }, children: ["\u261B", ' ' + (t.toLowerCase().includes('detail') ? (t.replaceAll(`"`, '').replaceAll(`:`, ': ').replaceAll(String.fromCharCode(92), '')) : (t.replaceAll(`"`, '').replaceAll(`:`, ': ')))] }, index))) }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(JSON.stringify(exception).replaceAll('{', '').replaceAll('}', '').replaceAll(',', '\n')), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] }), _jsxs(TMTab, { label: SDKUI_Localizator.Details, children: [_jsxs(TabContextContainer, { children: [_jsxs(StyledAppVersionText, { "$color": TMColors.primary, children: [SDK_Globals.appModule, " ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.appVersion })] }), _jsxs(StyledAppVersionText, { "$color": TMColors.tertiary, children: ["SDKUI: ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.sdkuiVersion })] }), _jsxs(StyledAppVersionText, { "$color": TMColors.success, children: ["SDK : ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.sdkVersion })] })] }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(`-${SDK_Globals.appModule}: ${SDK_Globals.appVersion}\n` + `-SDKUI: ${SDK_Globals.sdkuiVersion}\n` + `-SDK: ${SDK_Globals.sdkVersion}\n`), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] })] }) }), _jsx(TMLayoutItem, { height: '40px', children: _jsx(ExceptionToolbar, {}) })] }) }));
307
+ return (_jsx(Popup, { ref: popupRef, resizeEnabled: resizable, visible: isVisible, onHidden: () => { onClose?.(); setIsVisible(false); }, onShown: handleShown, showCloseButton: true, width: calcResponsiveSizes(deviceType, '600px', '400px', '350px'), height: '350px', minWidth: minWidth, minHeight: minHeight, maxHeight: '95%', maxWidth: '95%', title: title, children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { height: 'calc(100% - 50px)', children: _jsxs(TMTabGroup, { validationItems: [], children: [_jsxs(TMTab, { label: SDKUI_Localizator.Error, children: [_jsxs(TabContextContainer, { style: { height: 'calc(100% - 68px )', paddingRight: '40px' }, children: [_jsxs("p", { children: [" ", _jsx("span", { style: { color: TMColors.primary }, children: "Messaggio: " }), " ", message] }), _jsx("div", { style: { display: 'flex', flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'flex-start', gap: '5px', marginTop: '5px' }, children: _jsxs("div", { children: [_jsxs("span", { style: { color: TMColors.primary }, children: [SDKUI_Localizator.Date, " ", SDKUI_Localizator.Time.toLowerCase(), ": "] }), d.toString()] }) })] }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(`Date: ${dateString}\nTime: ${timeString}\nMessage: ${message}`), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] }), _jsxs(TMTab, { label: SDKUI_Localizator.CompleteError, children: [_jsx(TabContextContainer, { style: { paddingRight: '40px' }, children: JSON.stringify(exception).replaceAll('{', '').replaceAll('}', '').split(`,"`).map((t, index) => (_jsxs("div", { style: { padding: '5px', borderBottom: '1px solid rgb(180,180,180)' }, children: ["\u261B", ' ' + (t.toLowerCase().includes('detail') ? (t.replaceAll(`"`, '').replaceAll(`:`, ': ').replaceAll(String.fromCharCode(92), '')) : (t.replaceAll(`"`, '').replaceAll(`:`, ': ')))] }, index))) }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(JSON.stringify(exception).replaceAll('{', '').replaceAll('}', '').replaceAll(',', '\n')), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] }), _jsxs(TMTab, { label: SDKUI_Localizator.Details, children: [_jsxs(TabContextContainer, { children: [_jsxs(StyledAppVersionText, { "$color": TMColors.primary, children: [SDK_Globals.appModule, " ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.appVersion })] }), _jsxs(StyledAppVersionText, { "$color": TMColors.tertiary, children: ["SDKUI: ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.sdkuiVersion })] }), _jsxs(StyledAppVersionText, { "$color": TMColors.success, children: ["SDK : ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.sdkVersion })] })] }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(`-${SDK_Globals.appModule}: ${SDK_Globals.appVersion}\n` + `-SDKUI: ${SDK_Globals.sdkuiVersion}\n` + `-SDK: ${SDK_Globals.sdkVersion}\n`), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] })] }) }), _jsx(TMLayoutItem, { height: '40px', children: _jsx(ExceptionToolbar, {}) })] }) }));
239
308
  };
240
309
  class TMExceptionBoxManager {
241
310
  static show({ title, exception, onClose }) {
@@ -33,8 +33,14 @@ const StyledProgressText = styled.p ` font-weight: bold; color: #333; margin: 0;
33
33
  const StyledMessage = styled.p ` color: #666; font-size: 0.9em; margin-top: 10px; `;
34
34
  const StyledAbortButton = styled.button ` background: #ff4d4d; color: white; border: none; border-radius: 5px; padding: 10px 20px; font-size: 1em; cursor: pointer; margin-top: 20px; &:hover { background: #ff6666; } `;
35
35
  export const TMWaitPanel = (props) => {
36
- let progressValue1 = 100 * (((props.valuePrimary ?? 0) / (props.maxValuePrimary ?? 0)) || 0);
37
- let progressValue2 = 100 * (((props.valueSecondary ?? 0) / (props.maxValueSecondary ?? 0)) || 0);
36
+ const calculateProgress = (value = 0, maxValue = 0) => {
37
+ if (maxValue === 0)
38
+ return 0;
39
+ const progress = (value / maxValue) * 100;
40
+ return Number.isFinite(progress) ? progress : 0;
41
+ };
42
+ let progressValue1 = calculateProgress(props.valuePrimary, props.maxValuePrimary);
43
+ let progressValue2 = calculateProgress(props.valueSecondary, props.maxValueSecondary);
38
44
  return (_jsx(StyledWaitPanelOverlay, { children: _jsxs(StyledWaitPanel, { "$height": (props.showPrimary && props.showSecondary) ? '350px' : '250px', children: [_jsx(StyledTitle, { children: props.title }), props.showPrimary &&
39
45
  _jsxs("div", { style: { width: '100%', height: '100px' }, children: [_jsx(StyledProgressBarContainer, { children: _jsx(StyledProgressBar, { style: { width: `${progressValue1.toFixed(2)}%` } }) }), _jsxs(StyledProgressText, { children: [progressValue1.toFixed(2), "%"] }), _jsx(StyledMessage, { children: props.textPrimary })] }), props.showSecondary &&
40
46
  _jsxs("div", { style: { width: '100%', height: '100px' }, children: [_jsx(StyledProgressBarContainer, { children: _jsx(StyledProgressBar, { style: { width: `${progressValue2.toFixed(2)}%` } }) }), _jsxs(StyledProgressText, { children: [progressValue2.toFixed(2), "%"] }), _jsx(StyledMessage, { children: props.textSecondary })] }), props.isCancelable && _jsx(StyledAbortButton, { onClick: () => props.onAbortClick?.(props.abortController), children: SDKUI_Localizator.Abort })] }) }));
@@ -33,7 +33,7 @@ export const TMDataListItemChooserForm = (props) => {
33
33
  if (!props.dataListId)
34
34
  return [];
35
35
  if (refreshCache)
36
- DataListCacheService.RemoveAll();
36
+ DataListCacheService.Remove();
37
37
  TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.DataList} ...` });
38
38
  let dataList = await DataListCacheService.GetAsync(props.dataListId);
39
39
  TMSpinner.hide();
@@ -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} ...` });
@@ -48,20 +59,26 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
48
59
  dtd.init({ ...dtds[i] });
49
60
  const alias = tids?.[i].alias ?? '';
50
61
  dtd.customData2 = alias;
62
+ let mds;
51
63
  if (!qdShowOnlySelectItems) {
52
64
  dtd.metadata?.forEach((md) => {
53
- md.customData1 = dtd.id;
54
- md.customData2 = alias;
65
+ const mdWithKey = md;
66
+ mdWithKey.customData1 = dtd.id;
67
+ mdWithKey.customData2 = alias;
68
+ mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${alias}`;
55
69
  });
70
+ mds = filterMetadata ? dtd.metadata?.filter(filterMetadata) : dtd.metadata;
56
71
  }
57
72
  else {
58
73
  let newMetadata = dtd.metadata?.filter(o => qd.select?.some(s => s.tid == dtd.id && s.mid == o.id && ((s.alias ?? '') == alias)));
59
74
  newMetadata?.forEach((md) => {
60
- md.customData1 = dtd.id;
61
- md.customData2 = alias;
75
+ const mdWithKey = md;
76
+ mdWithKey.customData1 = dtd.id;
77
+ mdWithKey.customData2 = alias;
78
+ mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${alias}`;
62
79
  });
80
+ mds = filterMetadata ? newMetadata?.filter(filterMetadata) : newMetadata;
63
81
  }
64
- let mds = filterMetadata ? dtd.metadata?.filter(filterMetadata) : dtd.metadata;
65
82
  dtdList.push({ ...dtd, metadata: mds });
66
83
  }
67
84
  }
@@ -81,7 +98,11 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
81
98
  continue;
82
99
  }
83
100
  let mds = filterMetadata ? dtd.metadata?.filter(filterMetadata) : dtd.metadata;
84
- mds?.forEach((md) => { md.customData1 = dtd?.id; });
101
+ mds?.forEach((md) => {
102
+ const mdWithKey = md;
103
+ mdWithKey.customData1 = dtd?.id;
104
+ mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${md.customData2 ?? ''}`;
105
+ });
85
106
  dtdList.push({ ...dtd, metadata: mds });
86
107
  }
87
108
  }
@@ -130,5 +151,7 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
130
151
  const cellRenderNameAndDesc = useCallback((data) => {
131
152
  return _jsx("p", { style: { textAlign: 'left', color: data.data.isRequired == 1 ? 'red' : '' }, children: data.value });
132
153
  }, []);
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); } }));
154
+ 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,
155
+ // dataSource={dataSource}
156
+ getItems: getItems, customButtons: renderCustomButtons(), columns: dataColumns, summaryItems: renderSummaryItems, onClose: onClose, onChoose: (IDs) => { onChoose?.(IDs); } }));
134
157
  };
@@ -14,6 +14,8 @@ interface ITMUserChooserProps extends ITMChooserProps {
14
14
  hideShowId?: boolean;
15
15
  /** Initial value for showChooser */
16
16
  initialShowChooser?: boolean;
17
+ /** Allow showing all users with toggle button */
18
+ allowShowAllUsers?: boolean;
17
19
  }
18
20
  declare const TMUserChooser: React.FunctionComponent<ITMUserChooserProps>;
19
21
  export default TMUserChooser;
@@ -24,6 +26,8 @@ interface ITMUserChooserFormProps extends ITMChooserFormProps<UserDescriptor> {
24
26
  hideRefresh?: boolean;
25
27
  /** Nascondi pulsante mostra ID */
26
28
  hideShowId?: boolean;
29
+ /** Allow showing all users with toggle button */
30
+ allowShowAllUsers?: boolean;
27
31
  }
28
32
  export declare const TMUserChooserForm: React.FunctionComponent<ITMUserChooserFormProps>;
29
33
  export declare const TMUserIdViewer: ({ userId, showIcon, noneSelectionText }: {