@topconsultnpm/sdkui-react 6.19.0-dev1.9 → 6.19.0-dev2.2

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 (116) hide show
  1. package/lib/components/base/Styled.d.ts +1 -0
  2. package/lib/components/base/Styled.js +40 -0
  3. package/lib/components/base/TMCustomButton.d.ts +11 -0
  4. package/lib/components/base/TMCustomButton.js +63 -0
  5. package/lib/components/base/TMFileManagerDataGridView.js +4 -1
  6. package/lib/components/base/TMLayout.d.ts +2 -1
  7. package/lib/components/base/TMLayout.js +2 -2
  8. package/lib/components/base/TMPopUp.js +5 -18
  9. package/lib/components/base/TMTreeView.js +3 -2
  10. package/lib/components/editors/TMHtmlEditor.d.ts +5 -0
  11. package/lib/components/editors/TMHtmlEditor.js +72 -12
  12. package/lib/components/editors/TMMetadataValues.js +90 -40
  13. package/lib/components/features/archive/TMArchive.d.ts +10 -0
  14. package/lib/components/features/archive/TMArchive.js +56 -25
  15. package/lib/components/features/blog/TMBlogCommentForm.d.ts +4 -4
  16. package/lib/components/features/blog/TMBlogCommentForm.js +76 -51
  17. package/lib/components/features/documents/TMDcmtBlog.d.ts +15 -0
  18. package/lib/components/features/documents/TMDcmtBlog.js +21 -33
  19. package/lib/components/features/documents/TMDcmtForm.d.ts +17 -3
  20. package/lib/components/features/documents/TMDcmtForm.js +205 -46
  21. package/lib/components/features/documents/TMDcmtTasks.d.ts +13 -0
  22. package/lib/components/features/documents/TMDcmtTasks.js +24 -0
  23. package/lib/components/features/documents/TMDragDropOverlay.js +2 -1
  24. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +8 -1
  25. package/lib/components/features/documents/TMMasterDetailDcmts.js +6 -6
  26. package/lib/components/features/documents/TMRelationViewer.d.ts +53 -3
  27. package/lib/components/features/documents/TMRelationViewer.js +232 -85
  28. package/lib/components/features/search/TMSearch.d.ts +10 -1
  29. package/lib/components/features/search/TMSearch.js +14 -5
  30. package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -1
  31. package/lib/components/features/search/TMSearchQueryPanel.js +36 -7
  32. package/lib/components/features/search/TMSearchResult.d.ts +10 -1
  33. package/lib/components/features/search/TMSearchResult.js +140 -422
  34. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -2
  35. package/lib/components/features/search/TMSearchResultsMenuItems.js +33 -8
  36. package/lib/components/features/tasks/TMTaskForm.d.ts +38 -0
  37. package/lib/components/features/tasks/TMTaskForm.js +386 -0
  38. package/lib/components/features/tasks/TMTasksAgenda.d.ts +17 -0
  39. package/lib/components/features/tasks/TMTasksAgenda.js +107 -0
  40. package/lib/components/features/tasks/TMTasksCalendar.d.ts +21 -0
  41. package/lib/components/features/tasks/TMTasksCalendar.js +240 -0
  42. package/lib/components/features/tasks/TMTasksHeader.d.ts +14 -0
  43. package/lib/components/features/tasks/TMTasksHeader.js +37 -0
  44. package/lib/components/features/tasks/TMTasksPanelContent.d.ts +20 -0
  45. package/lib/components/features/tasks/TMTasksPanelContent.js +65 -0
  46. package/lib/components/features/tasks/TMTasksUtils.d.ts +132 -0
  47. package/lib/components/features/tasks/TMTasksUtils.js +634 -0
  48. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +39 -0
  49. package/lib/components/features/tasks/TMTasksUtilsView.js +118 -0
  50. package/lib/components/features/tasks/TMTasksView.d.ts +40 -0
  51. package/lib/components/features/tasks/TMTasksView.js +560 -0
  52. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +3 -1
  53. package/lib/components/features/workflow/TMWorkflowPopup.js +19 -6
  54. package/lib/components/features/workflow/diagram/RecipientList.js +4 -3
  55. package/lib/components/forms/Login/Chooser.js +1 -1
  56. package/lib/components/forms/TMChooserForm.d.ts +1 -1
  57. package/lib/components/forms/TMChooserForm.js +2 -2
  58. package/lib/components/grids/TMBlogAttachments.d.ts +42 -0
  59. package/lib/components/grids/TMBlogAttachments.js +43 -0
  60. package/lib/components/grids/TMBlogHeader.d.ts +31 -0
  61. package/lib/components/grids/TMBlogHeader.js +41 -0
  62. package/lib/components/grids/{TMBlogs.d.ts → TMBlogsPost.d.ts} +42 -58
  63. package/lib/components/grids/TMBlogsPost.js +628 -0
  64. package/lib/components/grids/{TMBlogsUtils.d.ts → TMBlogsPostUtils.d.ts} +61 -47
  65. package/lib/components/grids/{TMBlogsUtils.js → TMBlogsPostUtils.js} +146 -124
  66. package/lib/components/index.d.ts +14 -1
  67. package/lib/components/index.js +15 -1
  68. package/lib/components/layout/panelManager/TMPanelManagerContext.js +7 -0
  69. package/lib/components/settings/SettingsAppearance.js +8 -0
  70. package/lib/components/viewers/TMTidViewer.js +20 -2
  71. package/lib/css/tm-sdkui.css +1 -1
  72. package/lib/helper/SDKUI_Globals.d.ts +4 -1
  73. package/lib/helper/SDKUI_Globals.js +10 -1
  74. package/lib/helper/SDKUI_Localizator.d.ts +62 -4
  75. package/lib/helper/SDKUI_Localizator.js +618 -25
  76. package/lib/helper/TMCustomSearchBar.d.ts +8 -0
  77. package/lib/helper/TMCustomSearchBar.js +54 -0
  78. package/lib/helper/TMIcons.d.ts +2 -0
  79. package/lib/helper/TMIcons.js +6 -0
  80. package/lib/helper/TMImageLibrary.d.ts +3 -2
  81. package/lib/helper/TMImageLibrary.js +230 -230
  82. package/lib/helper/TMToppyMessage.d.ts +7 -0
  83. package/lib/helper/TMToppyMessage.js +42 -0
  84. package/lib/helper/TMUtils.d.ts +10 -1
  85. package/lib/helper/TMUtils.js +42 -1
  86. package/lib/helper/dcmtsHelper.d.ts +2 -0
  87. package/lib/helper/dcmtsHelper.js +18 -0
  88. package/lib/helper/helpers.js +1 -0
  89. package/lib/helper/index.d.ts +1 -0
  90. package/lib/helper/index.js +1 -0
  91. package/lib/hooks/useRelatedDocuments.d.ts +72 -0
  92. package/lib/hooks/useRelatedDocuments.js +655 -0
  93. package/lib/index.d.ts +1 -0
  94. package/lib/index.js +1 -0
  95. package/lib/ts/types.d.ts +14 -0
  96. package/lib/ts/types.js +15 -0
  97. package/lib/utils/theme.d.ts +1 -0
  98. package/lib/utils/theme.js +1 -0
  99. package/package.json +7 -7
  100. package/lib/components/grids/TMBlogs.js +0 -721
  101. package/lib/stories/TMButton.stories.d.ts +0 -4
  102. package/lib/stories/TMButton.stories.js +0 -29
  103. package/lib/stories/TMDataGrid.stories.d.ts +0 -9
  104. package/lib/stories/TMDataGrid.stories.js +0 -310
  105. package/lib/stories/TMHtmlContentDisplay.stories.d.ts +0 -6
  106. package/lib/stories/TMHtmlContentDisplay.stories.js +0 -45
  107. package/lib/stories/TMHtmlEditor.stories.d.ts +0 -6
  108. package/lib/stories/TMHtmlEditor.stories.js +0 -49
  109. package/lib/stories/TMIcons.stories.d.ts +0 -4
  110. package/lib/stories/TMIcons.stories.js +0 -13
  111. package/lib/stories/TMSDKUI_Localizator.stories.d.ts +0 -4
  112. package/lib/stories/TMSDKUI_Localizator.stories.js +0 -123
  113. package/lib/stories/TMStoriesUtils.d.ts +0 -1
  114. package/lib/stories/TMStoriesUtils.js +0 -10
  115. package/lib/stories/TMUserAvatar.stories.d.ts +0 -6
  116. 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
- if (!inputMids || inputMids.length === 0 || !qd || !fromDTD)
52
+ pendingMidsRef.current = inputMids ?? null;
53
+ }, [inputMids]);
54
+ useEffect(() => {
55
+ if (!fromDTD)
52
56
  return;
53
- if (appliedInputMidsRef.current && deepCompare(appliedInputMidsRef.current, inputMids))
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
- appliedInputMidsRef.current = inputMids;
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
- inputMids.forEach(im => {
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
- }, [inputMids, qd, fromDTD]);
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;