@topconsultnpm/sdkui-react 6.19.0-dev1.6 → 6.19.0-dev1.60

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 (95) 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/TMTreeView.js +3 -2
  9. package/lib/components/editors/TMHtmlEditor.d.ts +5 -0
  10. package/lib/components/editors/TMHtmlEditor.js +72 -12
  11. package/lib/components/editors/TMMetadataValues.js +90 -40
  12. package/lib/components/features/archive/TMArchive.d.ts +10 -0
  13. package/lib/components/features/archive/TMArchive.js +56 -25
  14. package/lib/components/features/blog/TMBlogCommentForm.d.ts +4 -4
  15. package/lib/components/features/blog/TMBlogCommentForm.js +76 -51
  16. package/lib/components/features/documents/TMDcmtBlog.d.ts +15 -0
  17. package/lib/components/features/documents/TMDcmtBlog.js +21 -33
  18. package/lib/components/features/documents/TMDcmtForm.d.ts +17 -3
  19. package/lib/components/features/documents/TMDcmtForm.js +205 -46
  20. package/lib/components/features/documents/TMDcmtTasks.d.ts +13 -0
  21. package/lib/components/features/documents/TMDcmtTasks.js +24 -0
  22. package/lib/components/features/documents/TMDragDropOverlay.js +2 -1
  23. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +8 -1
  24. package/lib/components/features/documents/TMMasterDetailDcmts.js +6 -6
  25. package/lib/components/features/documents/TMRelationViewer.d.ts +53 -3
  26. package/lib/components/features/documents/TMRelationViewer.js +232 -85
  27. package/lib/components/features/search/TMSearch.d.ts +10 -1
  28. package/lib/components/features/search/TMSearch.js +14 -5
  29. package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -1
  30. package/lib/components/features/search/TMSearchQueryPanel.js +36 -7
  31. package/lib/components/features/search/TMSearchResult.d.ts +10 -1
  32. package/lib/components/features/search/TMSearchResult.js +139 -333
  33. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -2
  34. package/lib/components/features/search/TMSearchResultsMenuItems.js +33 -8
  35. package/lib/components/features/tasks/TMTaskForm.d.ts +37 -0
  36. package/lib/components/features/tasks/TMTaskForm.js +338 -0
  37. package/lib/components/features/tasks/TMTasksAgenda.d.ts +17 -0
  38. package/lib/components/features/tasks/TMTasksAgenda.js +107 -0
  39. package/lib/components/features/tasks/TMTasksCalendar.d.ts +21 -0
  40. package/lib/components/features/tasks/TMTasksCalendar.js +240 -0
  41. package/lib/components/features/tasks/TMTasksHeader.d.ts +14 -0
  42. package/lib/components/features/tasks/TMTasksHeader.js +37 -0
  43. package/lib/components/features/tasks/TMTasksPanelContent.d.ts +20 -0
  44. package/lib/components/features/tasks/TMTasksPanelContent.js +65 -0
  45. package/lib/components/features/tasks/TMTasksUtils.d.ts +132 -0
  46. package/lib/components/features/tasks/TMTasksUtils.js +634 -0
  47. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +32 -0
  48. package/lib/components/features/tasks/TMTasksUtilsView.js +107 -0
  49. package/lib/components/features/tasks/TMTasksView.d.ts +40 -0
  50. package/lib/components/features/tasks/TMTasksView.js +560 -0
  51. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +3 -1
  52. package/lib/components/features/workflow/TMWorkflowPopup.js +19 -6
  53. package/lib/components/forms/TMChooserForm.d.ts +1 -1
  54. package/lib/components/forms/TMChooserForm.js +2 -2
  55. package/lib/components/grids/TMBlogAttachments.d.ts +42 -0
  56. package/lib/components/grids/TMBlogAttachments.js +43 -0
  57. package/lib/components/grids/TMBlogHeader.d.ts +31 -0
  58. package/lib/components/grids/TMBlogHeader.js +41 -0
  59. package/lib/components/grids/{TMBlogs.d.ts → TMBlogsPost.d.ts} +42 -58
  60. package/lib/components/grids/TMBlogsPost.js +628 -0
  61. package/lib/components/grids/{TMBlogsUtils.d.ts → TMBlogsPostUtils.d.ts} +61 -47
  62. package/lib/components/grids/{TMBlogsUtils.js → TMBlogsPostUtils.js} +143 -124
  63. package/lib/components/index.d.ts +14 -1
  64. package/lib/components/index.js +15 -1
  65. package/lib/components/viewers/TMTidViewer.js +28 -3
  66. package/lib/css/tm-sdkui.css +1 -1
  67. package/lib/helper/SDKUI_Globals.d.ts +2 -1
  68. package/lib/helper/SDKUI_Globals.js +1 -0
  69. package/lib/helper/SDKUI_Localizator.d.ts +61 -4
  70. package/lib/helper/SDKUI_Localizator.js +608 -25
  71. package/lib/helper/TMCustomSearchBar.d.ts +8 -0
  72. package/lib/helper/TMCustomSearchBar.js +54 -0
  73. package/lib/helper/TMIcons.d.ts +2 -0
  74. package/lib/helper/TMIcons.js +6 -0
  75. package/lib/helper/TMImageLibrary.d.ts +3 -2
  76. package/lib/helper/TMImageLibrary.js +230 -230
  77. package/lib/helper/TMToppyMessage.d.ts +7 -0
  78. package/lib/helper/TMToppyMessage.js +42 -0
  79. package/lib/helper/TMUtils.d.ts +10 -1
  80. package/lib/helper/TMUtils.js +42 -1
  81. package/lib/helper/dcmtsHelper.d.ts +2 -0
  82. package/lib/helper/dcmtsHelper.js +18 -0
  83. package/lib/helper/index.d.ts +1 -0
  84. package/lib/helper/index.js +1 -0
  85. package/lib/hooks/useRelatedDocuments.d.ts +72 -0
  86. package/lib/hooks/useRelatedDocuments.js +655 -0
  87. package/lib/index.d.ts +1 -0
  88. package/lib/index.js +1 -0
  89. package/lib/stories/TMSDKUI_Localizator.stories.js +1 -1
  90. package/lib/ts/types.d.ts +14 -0
  91. package/lib/ts/types.js +15 -0
  92. package/lib/utils/theme.d.ts +1 -0
  93. package/lib/utils/theme.js +1 -0
  94. package/package.json +2 -2
  95. package/lib/components/grids/TMBlogs.js +0 -721
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled from "styled-components";
3
3
  import { TMTooltip } from '../components';
4
4
  import { IconKey } from './TMIcons';
5
- import { DataListCacheService, MetadataDataDomains } from '@topconsultnpm/sdk-ts';
5
+ import { DataListCacheService, MetadataDataDomains, PdGs } from '@topconsultnpm/sdk-ts';
6
6
  import { SDKUI_Localizator } from './SDKUI_Localizator';
7
7
  const StyledIconFileContainer = styled.div `
8
8
  height: 22px;
@@ -174,3 +174,44 @@ export const isCreateCertificateEnabled = (widgetsString) => {
174
174
  export const isPdfEditorEnabled = (widgetsString) => {
175
175
  return isWidgetEnabled(PDF_EDITOR_ID, widgetsString);
176
176
  };
177
+ export const StyledTabItem = styled.div `
178
+ display: flex;
179
+ align-items: center;
180
+ padding: 6px 12px;
181
+ border-radius: 8px;
182
+ font-weight: ${({ $isSelected }) => ($isSelected ? 'bold' : 'normal')};
183
+ color: ${({ $isSelected }) => ($isSelected ? '#fff' : '#000')};
184
+ background: ${({ $isSelected }) => $isSelected
185
+ ? 'linear-gradient(270deg, #46B5A2 16%, #3BAABC 34%, #3BAABC 34%, #3681AD 54%, #3368A5 72%, #2F549D 88%, #304F99 100%)'
186
+ : 'transparent'};
187
+ transition: background-color 0.2s ease;
188
+ font-size: 1rem;
189
+ &:hover {
190
+ background: ${({ $isSelected }) => ($isSelected ? null : 'rgba(0, 0, 0, 0.05)')};
191
+ }
192
+ `;
193
+ export const StyledTabIcon = styled.i `
194
+ cursor: pointer;
195
+ font-size: 16px;
196
+ color: ${({ $isSelected }) => ($isSelected ? '#fff !important' : '#000 !important')};
197
+ transition: color 0.2s ease;
198
+ `;
199
+ export const TMCountBadge = styled.div ` background-color: #ff5252; color: white; border-radius: 999px; margin-left: 8px; font-size: 0.7rem; line-height: 1; min-height: 20px; min-width: 20px; display: flex ; align-items: center; justify-content: center; `;
200
+ const taskPdgsIconClassMap = () => {
201
+ return new Map([
202
+ [PdGs.None, ""],
203
+ [PdGs.CF, "dx-icon-folder"],
204
+ [PdGs.DT, "dx-icon-file"],
205
+ [PdGs.WF, "dx-icon-box"],
206
+ [PdGs.WG, "dx-icon-group"],
207
+ ]);
208
+ };
209
+ export const getPdgsIconMap = (fontSize = 20) => {
210
+ return new Map([
211
+ [PdGs.None, _jsx("span", {}, "PdGs-None")],
212
+ [PdGs.CF, _jsx("i", { style: { fontSize }, className: taskPdgsIconClassMap().get(PdGs.CF) }, "PdGs-CF")],
213
+ [PdGs.DT, _jsx("i", { style: { fontSize }, className: taskPdgsIconClassMap().get(PdGs.DT) }, "PdGs-DT")],
214
+ [PdGs.WF, _jsx("i", { style: { fontSize }, className: taskPdgsIconClassMap().get(PdGs.WF) }, "PdGs-WF")],
215
+ [PdGs.WG, _jsx("i", { style: { fontSize }, className: taskPdgsIconClassMap().get(PdGs.WG) }, "PdGs-WG")], // <IconUserGroup color="#009700"/>
216
+ ]);
217
+ };
@@ -1,5 +1,7 @@
1
+ import { MetadataValueDescriptorEx } from "../ts";
1
2
  /** Check if dcmtType (mTID) has configured Detail or Many-to-Many relations */
2
3
  export declare const hasDetailRelations: (mTID: number | undefined) => Promise<boolean>;
3
4
  /** Check if dcmtType (mTID) has configured Master or Many-to-Many relations */
4
5
  export declare const hasMasterRelations: (mTID: number | undefined) => Promise<boolean>;
5
6
  export declare const isXMLFileExt: (fileExt: string | undefined) => boolean;
7
+ export declare const processButtonAttributes: (args: string | undefined, formData: MetadataValueDescriptorEx[] | undefined) => Record<string, string | number> | undefined;
@@ -23,3 +23,21 @@ export const isXMLFileExt = (fileExt) => {
23
23
  default: return false;
24
24
  }
25
25
  };
26
+ /*utility functions for TMCustomButton*/
27
+ export const processButtonAttributes = (args, formData) => args && formData ? splitArguments(replaceCustomButtonAttributes(args, formDataMap(formData))) : undefined;
28
+ const replaceCustomButtonAttributes = (input, attributes) => {
29
+ const matches = Array.from(input.matchAll(/@\w+/g));
30
+ return matches
31
+ .map(([match]) => `${match}=${attributes[match.slice(1)] ?? ''}`)
32
+ .join(';') + ';';
33
+ };
34
+ const formDataMap = (data) => data.reduce((acc, md) => {
35
+ const key = md.md?.name;
36
+ if (key && md.value)
37
+ acc[key] = md.value;
38
+ return acc;
39
+ }, {});
40
+ const splitArguments = (input) => Object.fromEntries(Array.from(input.matchAll(/@?(\w+)=([^;]+)/g), ([, key, value]) => [
41
+ key,
42
+ isNaN(Number(value)) ? value : Number(value),
43
+ ]));
@@ -9,3 +9,4 @@ export * from './queryHelper';
9
9
  export * from './TMUtils';
10
10
  export * from './TMCommandsContextMenu';
11
11
  export * from './TMConditionalWrapper';
12
+ export * from './TMToppyMessage';
@@ -9,3 +9,4 @@ export * from './queryHelper';
9
9
  export * from './TMUtils';
10
10
  export * from './TMCommandsContextMenu';
11
11
  export * from './TMConditionalWrapper';
12
+ export * from './TMToppyMessage';
@@ -0,0 +1,72 @@
1
+ import { SearchResultDescriptor, RelationDescriptor } from '@topconsultnpm/sdk-ts';
2
+ import { TMSearchResultFloatingActionConfig } from '../components/features/search/TMSearchResultFloatingActionButton';
3
+ interface UseRelatedDocumentsProps {
4
+ selectedSearchResult: SearchResultDescriptor | undefined;
5
+ currentSearchResults: SearchResultDescriptor[];
6
+ focusedItem: any;
7
+ }
8
+ interface UseRelatedDocumentsReturn {
9
+ relatedDcmts: RelationDescriptor[] | undefined;
10
+ showRelatedDcmtsChooser: boolean;
11
+ archiveType?: 'detail' | 'master';
12
+ isOpenDetails: boolean;
13
+ isOpenMaster: boolean;
14
+ isOpenArchiveRelationForm: boolean;
15
+ archiveRelatedDcmtFormTID: number | undefined;
16
+ archiveRelatedDcmtFormMids: Array<{
17
+ mid: number;
18
+ value: string;
19
+ }>;
20
+ relatedDcmtsChooserDataSource: Array<{
21
+ id: number | undefined;
22
+ name: string | undefined;
23
+ }> | undefined;
24
+ showPairDcmtsModal: boolean;
25
+ isPairingManyToMany: boolean;
26
+ pairedSearchResults: SearchResultDescriptor[] | undefined;
27
+ manyToManyRelations: RelationDescriptor[] | undefined;
28
+ selectedManyToManyRelation: RelationDescriptor | undefined;
29
+ showManyToManyChooser: boolean;
30
+ manyToManyChooserDataSource: Array<{
31
+ id: number | undefined;
32
+ name: string | undefined;
33
+ }> | undefined;
34
+ showPairSearchModal: boolean;
35
+ pairSearchModalTargetTID: number | undefined;
36
+ pairSearchModalParentTID: number | undefined;
37
+ pairSearchModalParentDID: number | undefined;
38
+ pairSearchModalRelation: RelationDescriptor | undefined;
39
+ pairSearchModalInputMids: Array<{
40
+ mid: number;
41
+ value: string;
42
+ }> | undefined;
43
+ currentTIDHasDetailRelations: boolean | undefined;
44
+ currentTIDHasMasterRelations: boolean | undefined;
45
+ canArchiveMasterRelation: boolean;
46
+ canArchiveDetailRelation: boolean;
47
+ hasManyToManyRelation: boolean;
48
+ setIsOpenDetails: (value: boolean) => void;
49
+ setIsOpenMaster: (value: boolean) => void;
50
+ setShowRelatedDcmtsChooser: (value: boolean) => void;
51
+ setShowManyToManyChooser: (value: boolean) => void;
52
+ setShowPairDcmtsModal: (value: boolean) => void;
53
+ setShowPairSearchModal: (value: boolean) => void;
54
+ setIsOpenArchiveRelationForm: (value: boolean) => void;
55
+ setArchiveType: (value: 'detail' | 'master' | undefined) => void;
56
+ setArchiveRelatedDcmtFormTID: (value: number | undefined) => void;
57
+ setArchiveRelatedDcmtFormMids: (value: Array<{
58
+ mid: number;
59
+ value: string;
60
+ }>) => void;
61
+ pairFloatingActionConfig: TMSearchResultFloatingActionConfig;
62
+ pairSearchModalFloatingActionConfig: TMSearchResultFloatingActionConfig;
63
+ archiveMasterDocuments: (tid: number) => Promise<void>;
64
+ archiveDetailDocuments: (tid: number) => Promise<void>;
65
+ pairManyToMany: (isPairing: boolean) => Promise<void>;
66
+ checkRelatedDcmtsArchiveCapability: () => Promise<void>;
67
+ checkManyToManyCapability: () => Promise<void>;
68
+ archiveRelatedDcmtHandler: (relation: RelationDescriptor, type: 'detail' | 'master') => Promise<void>;
69
+ executeManyToManyPairing: (relation: RelationDescriptor, isPairing: boolean) => Promise<void>;
70
+ }
71
+ export declare const useRelatedDocuments: ({ selectedSearchResult, focusedItem, currentSearchResults }: UseRelatedDocumentsProps) => UseRelatedDocumentsReturn;
72
+ export {};