@topconsultnpm/sdkui-react 6.19.0-dev1.9 → 6.19.0-dev2.10
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.
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.d.ts +4 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +187 -0
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +11 -0
- package/lib/components/NewComponents/ContextMenu/hooks.js +48 -0
- package/lib/components/NewComponents/ContextMenu/index.d.ts +2 -0
- package/lib/components/NewComponents/ContextMenu/index.js +1 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +27 -0
- package/lib/components/NewComponents/ContextMenu/styles.js +308 -0
- package/lib/components/NewComponents/ContextMenu/types.d.ts +26 -0
- package/lib/components/NewComponents/ContextMenu/types.js +1 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.d.ts +4 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +370 -0
- package/lib/components/NewComponents/FloatingMenuBar/index.d.ts +2 -0
- package/lib/components/NewComponents/FloatingMenuBar/index.js +2 -0
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +38 -0
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +267 -0
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +30 -0
- package/lib/components/NewComponents/FloatingMenuBar/types.js +1 -0
- package/lib/components/NewComponents/Notification/Notification.d.ts +4 -0
- package/lib/components/NewComponents/Notification/Notification.js +60 -0
- package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +8 -0
- package/lib/components/NewComponents/Notification/NotificationContainer.js +33 -0
- package/lib/components/NewComponents/Notification/index.d.ts +2 -0
- package/lib/components/NewComponents/Notification/index.js +2 -0
- package/lib/components/NewComponents/Notification/styles.d.ts +21 -0
- package/lib/components/NewComponents/Notification/styles.js +180 -0
- package/lib/components/NewComponents/Notification/types.d.ts +18 -0
- package/lib/components/NewComponents/Notification/types.js +1 -0
- package/lib/components/base/Styled.d.ts +1 -0
- package/lib/components/base/Styled.js +40 -0
- package/lib/components/base/TMCustomButton.d.ts +11 -0
- package/lib/components/base/TMCustomButton.js +63 -0
- package/lib/components/base/TMFileManagerDataGridView.js +4 -1
- package/lib/components/base/TMLayout.d.ts +2 -1
- package/lib/components/base/TMLayout.js +2 -2
- package/lib/components/base/TMPopUp.js +5 -18
- package/lib/components/base/TMTreeView.js +3 -2
- package/lib/components/editors/TMHtmlEditor.d.ts +5 -0
- package/lib/components/editors/TMHtmlEditor.js +72 -12
- package/lib/components/editors/TMMetadataValues.js +90 -40
- package/lib/components/features/archive/TMArchive.d.ts +10 -0
- package/lib/components/features/archive/TMArchive.js +56 -25
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +4 -4
- package/lib/components/features/blog/TMBlogCommentForm.js +76 -51
- package/lib/components/features/documents/TMDcmtBlog.d.ts +15 -0
- package/lib/components/features/documents/TMDcmtBlog.js +21 -33
- package/lib/components/features/documents/TMDcmtForm.d.ts +17 -3
- package/lib/components/features/documents/TMDcmtForm.js +205 -46
- package/lib/components/features/documents/TMDcmtTasks.d.ts +13 -0
- package/lib/components/features/documents/TMDcmtTasks.js +24 -0
- package/lib/components/features/documents/TMDragDropOverlay.js +2 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +8 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.js +6 -6
- package/lib/components/features/documents/TMRelationViewer.d.ts +53 -3
- package/lib/components/features/documents/TMRelationViewer.js +232 -85
- package/lib/components/features/search/TMSearch.d.ts +10 -1
- package/lib/components/features/search/TMSearch.js +14 -5
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -1
- package/lib/components/features/search/TMSearchQueryPanel.js +36 -7
- package/lib/components/features/search/TMSearchResult.d.ts +10 -1
- package/lib/components/features/search/TMSearchResult.js +140 -422
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -2
- package/lib/components/features/search/TMSearchResultsMenuItems.js +40 -15
- package/lib/components/features/tasks/TMTaskForm.d.ts +38 -0
- package/lib/components/features/tasks/TMTaskForm.js +386 -0
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +17 -0
- package/lib/components/features/tasks/TMTasksAgenda.js +107 -0
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +21 -0
- package/lib/components/features/tasks/TMTasksCalendar.js +240 -0
- package/lib/components/features/tasks/TMTasksHeader.d.ts +14 -0
- package/lib/components/features/tasks/TMTasksHeader.js +37 -0
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +20 -0
- package/lib/components/features/tasks/TMTasksPanelContent.js +65 -0
- package/lib/components/features/tasks/TMTasksUtils.d.ts +132 -0
- package/lib/components/features/tasks/TMTasksUtils.js +634 -0
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +39 -0
- package/lib/components/features/tasks/TMTasksUtilsView.js +118 -0
- package/lib/components/features/tasks/TMTasksView.d.ts +40 -0
- package/lib/components/features/tasks/TMTasksView.js +560 -0
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +3 -1
- package/lib/components/features/workflow/TMWorkflowPopup.js +19 -6
- package/lib/components/features/workflow/diagram/RecipientList.js +4 -3
- package/lib/components/forms/Login/Chooser.js +1 -1
- package/lib/components/forms/TMChooserForm.d.ts +1 -1
- package/lib/components/forms/TMChooserForm.js +2 -2
- package/lib/components/grids/TMBlogAttachments.d.ts +42 -0
- package/lib/components/grids/TMBlogAttachments.js +43 -0
- package/lib/components/grids/TMBlogHeader.d.ts +31 -0
- package/lib/components/grids/TMBlogHeader.js +41 -0
- package/lib/components/grids/{TMBlogs.d.ts → TMBlogsPost.d.ts} +42 -58
- package/lib/components/grids/TMBlogsPost.js +628 -0
- package/lib/components/grids/{TMBlogsUtils.d.ts → TMBlogsPostUtils.d.ts} +61 -47
- package/lib/components/grids/{TMBlogsUtils.js → TMBlogsPostUtils.js} +146 -124
- package/lib/components/index.d.ts +14 -1
- package/lib/components/index.js +15 -1
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +7 -0
- package/lib/components/settings/SettingsAppearance.js +9 -1
- package/lib/components/viewers/TMTidViewer.js +20 -2
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +4 -1
- package/lib/helper/SDKUI_Globals.js +10 -1
- package/lib/helper/SDKUI_Localizator.d.ts +87 -4
- package/lib/helper/SDKUI_Localizator.js +868 -25
- package/lib/helper/TMCustomSearchBar.d.ts +8 -0
- package/lib/helper/TMCustomSearchBar.js +54 -0
- package/lib/helper/TMIcons.d.ts +3 -0
- package/lib/helper/TMIcons.js +9 -0
- package/lib/helper/TMImageLibrary.d.ts +3 -2
- package/lib/helper/TMImageLibrary.js +230 -230
- package/lib/helper/TMToppyMessage.d.ts +7 -0
- package/lib/helper/TMToppyMessage.js +42 -0
- package/lib/helper/TMUtils.d.ts +10 -1
- package/lib/helper/TMUtils.js +42 -1
- package/lib/helper/dcmtsHelper.d.ts +2 -0
- package/lib/helper/dcmtsHelper.js +18 -0
- package/lib/helper/helpers.js +1 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useRelatedDocuments.d.ts +72 -0
- package/lib/hooks/useRelatedDocuments.js +655 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/ts/types.d.ts +14 -0
- package/lib/ts/types.js +15 -0
- package/lib/utils/theme.d.ts +1 -0
- package/lib/utils/theme.js +1 -0
- package/package.json +7 -7
- package/lib/components/grids/TMBlogs.js +0 -721
- package/lib/stories/TMButton.stories.d.ts +0 -4
- package/lib/stories/TMButton.stories.js +0 -29
- package/lib/stories/TMDataGrid.stories.d.ts +0 -9
- package/lib/stories/TMDataGrid.stories.js +0 -310
- package/lib/stories/TMHtmlContentDisplay.stories.d.ts +0 -6
- package/lib/stories/TMHtmlContentDisplay.stories.js +0 -45
- package/lib/stories/TMHtmlEditor.stories.d.ts +0 -6
- package/lib/stories/TMHtmlEditor.stories.js +0 -49
- package/lib/stories/TMIcons.stories.d.ts +0 -4
- package/lib/stories/TMIcons.stories.js +0 -13
- package/lib/stories/TMSDKUI_Localizator.stories.d.ts +0 -4
- package/lib/stories/TMSDKUI_Localizator.stories.js +0 -123
- package/lib/stories/TMStoriesUtils.d.ts +0 -1
- package/lib/stories/TMStoriesUtils.js +0 -10
- package/lib/stories/TMUserAvatar.stories.d.ts +0 -6
- package/lib/stories/TMUserAvatar.stories.js +0 -20
|
@@ -42,24 +42,53 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
42
42
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
43
43
|
let initialMaxItems = deviceType === DeviceType.MOBILE ? 8 : 12;
|
|
44
44
|
const appliedInputMidsRef = useRef(null);
|
|
45
|
+
const pendingMidsRef = useRef(null);
|
|
45
46
|
useEffect(() => {
|
|
46
47
|
if (!SQD)
|
|
47
48
|
return;
|
|
48
49
|
setDataAsync(SQD);
|
|
49
50
|
}, [SQD]);
|
|
50
51
|
useEffect(() => {
|
|
51
|
-
|
|
52
|
+
pendingMidsRef.current = inputMids ?? null;
|
|
53
|
+
}, [inputMids]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (!fromDTD)
|
|
52
56
|
return;
|
|
53
|
-
|
|
57
|
+
// Reset appliedInputMidsRef when TID changes so pending mids can be applied to new TID
|
|
58
|
+
appliedInputMidsRef.current = null;
|
|
59
|
+
const initQd = async () => {
|
|
60
|
+
// Only initialize if qd doesn't exist or is for a different TID
|
|
61
|
+
if (!qd || qd.from?.tid !== fromDTD.id) {
|
|
62
|
+
const newQd = await getQD(fromDTD.id, false);
|
|
63
|
+
if (newQd) {
|
|
64
|
+
setQd(newQd);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
initQd();
|
|
69
|
+
}, [fromDTD?.id]);
|
|
70
|
+
// Apply inputMids when qd is ready and matches fromDTD
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (!qd || !fromDTD || qd.from?.tid !== fromDTD.id)
|
|
54
73
|
return;
|
|
55
|
-
|
|
74
|
+
const midsToApply = pendingMidsRef.current;
|
|
75
|
+
if (!midsToApply || midsToApply.length === 0)
|
|
76
|
+
return;
|
|
77
|
+
if (appliedInputMidsRef.current && deepCompare(appliedInputMidsRef.current, midsToApply))
|
|
78
|
+
return;
|
|
79
|
+
appliedInputMidsRef.current = midsToApply;
|
|
56
80
|
const newWhere = qd.where?.map((curItem) => {
|
|
57
81
|
let newWi = new WhereItem();
|
|
58
82
|
newWi.init({ ...curItem, value1: undefined, value2: undefined });
|
|
59
83
|
return newWi;
|
|
60
84
|
}) || [];
|
|
61
|
-
|
|
85
|
+
midsToApply.forEach(im => {
|
|
62
86
|
const md = fromDTD.metadata?.find(m => m.id === im.mid);
|
|
87
|
+
// Skip MIDs that don't belong to this TID
|
|
88
|
+
if (!md) {
|
|
89
|
+
console.warn(`MID ${im.mid} does not belong to TID ${fromDTD.id}, skipping`);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
63
92
|
const defaultOperator = getDefaultOperator(md?.dataDomain, md?.dataType);
|
|
64
93
|
let existingWi = newWhere.find(wi => wi.mid === im.mid);
|
|
65
94
|
if (existingWi) {
|
|
@@ -78,7 +107,7 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
78
107
|
});
|
|
79
108
|
setQd({ ...qd, where: newWhere });
|
|
80
109
|
setShowAllMdWhere(true);
|
|
81
|
-
}, [
|
|
110
|
+
}, [qd, fromDTD, inputMids]);
|
|
82
111
|
// Eseguire la ricerca quando shouldSearch è true e qd è definito
|
|
83
112
|
useEffect(() => {
|
|
84
113
|
if (shouldSearch && qd) {
|
|
@@ -193,8 +222,8 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
193
222
|
const outputMids = qd.where
|
|
194
223
|
.filter(wi => wi.mid && wi.value1 && wi.value1.length > 0)
|
|
195
224
|
.map(wi => ({ mid: wi.mid, value: wi.value1 }));
|
|
196
|
-
passToArchiveCallback(outputMids);
|
|
197
|
-
}, [passToArchiveCallback, qd?.where]);
|
|
225
|
+
passToArchiveCallback(outputMids, fromDTD?.id);
|
|
226
|
+
}, [passToArchiveCallback, qd?.where, fromDTD?.id]);
|
|
198
227
|
const handleCloseFiltersConfig = useCallback(() => setShowFiltersConfig(false), []);
|
|
199
228
|
const handleChooseFilters = useCallback((tid_mids) => {
|
|
200
229
|
if (!fromDTD?.metadata)
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SearchResultDescriptor, DcmtTypeDescriptor, TaskDescriptor, WorkingGroupDescriptor } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { SearchResultDescriptor, DcmtTypeDescriptor, TaskDescriptor, WorkingGroupDescriptor, ObjectRef, HomeBlogPost } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { DcmtInfo, SearchResultContext, TaskContext } from '../../../ts';
|
|
4
4
|
import { TMSearchResultFloatingActionConfig } from './TMSearchResultFloatingActionButton';
|
|
5
5
|
export declare const getSearchResultCountersSingleCategory: (searchResults: SearchResultDescriptor[]) => string;
|
|
6
6
|
interface ITMSearchResultProps {
|
|
7
|
+
allTasks?: Array<TaskDescriptor>;
|
|
8
|
+
getAllTasks?: () => Promise<void>;
|
|
9
|
+
deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
10
|
+
addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
11
|
+
editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
12
|
+
handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
|
|
13
|
+
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
7
14
|
context?: SearchResultContext;
|
|
8
15
|
title?: string;
|
|
9
16
|
searchResults: SearchResultDescriptor[] | undefined;
|
|
@@ -15,6 +22,7 @@ interface ITMSearchResultProps {
|
|
|
15
22
|
showSearchResultSidebar?: boolean;
|
|
16
23
|
showSelector?: boolean;
|
|
17
24
|
showToolbarHeader?: boolean;
|
|
25
|
+
showBackButton?: boolean;
|
|
18
26
|
groupId?: string;
|
|
19
27
|
selectedSearchResultTID?: number;
|
|
20
28
|
workingGroupContext?: WorkingGroupDescriptor;
|
|
@@ -39,6 +47,7 @@ interface ITMSearchResultProps {
|
|
|
39
47
|
value: string;
|
|
40
48
|
}>, tid?: number) => void;
|
|
41
49
|
showTodoDcmtForm?: boolean;
|
|
50
|
+
onReferenceClick?: (ref: ObjectRef) => void;
|
|
42
51
|
}
|
|
43
52
|
declare const TMSearchResult: React.FC<ITMSearchResultProps>;
|
|
44
53
|
export default TMSearchResult;
|