@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.
- 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 +33 -8
- 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 +8 -0
- 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 +62 -4
- package/lib/helper/SDKUI_Localizator.js +618 -25
- package/lib/helper/TMCustomSearchBar.d.ts +8 -0
- package/lib/helper/TMCustomSearchBar.js +54 -0
- package/lib/helper/TMIcons.d.ts +2 -0
- package/lib/helper/TMIcons.js +6 -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
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import { BlogPost, BlogPostAttachment, DcmtTypeDescriptor, DossierDescriptor, HomeBlogPost, TID_DID, WorkingGroupDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
|
-
import {
|
|
4
|
-
import { ContextMenuRef } from 'devextreme-react/cjs/context-menu';
|
|
5
|
-
import { FileItem } from '../base/TMFileManagerUtils';
|
|
3
|
+
import { FileItem } from "../base/TMFileManagerUtils";
|
|
6
4
|
export declare const DRAFT_TYPE_TID = 6;
|
|
7
5
|
export type TMBlogContextDescriptor = {
|
|
8
6
|
engine: 'WorkingGroupEngine';
|
|
@@ -14,15 +12,28 @@ export type TMBlogContextDescriptor = {
|
|
|
14
12
|
engine: 'DossierEngine';
|
|
15
13
|
object?: DossierDescriptor;
|
|
16
14
|
};
|
|
17
|
-
export declare
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
export declare enum TMBlogsFilterCategoryId {
|
|
16
|
+
PublishedBlogs = 1,
|
|
17
|
+
SystemBlogs = 2,
|
|
18
|
+
DeletedBlogs = 3
|
|
19
|
+
}
|
|
20
|
+
export type TMBlogsFilterCategoryIdDataSource = {
|
|
21
|
+
id: number;
|
|
22
|
+
label: string;
|
|
23
|
+
value: string;
|
|
24
|
+
categoryId?: number;
|
|
25
|
+
expanded?: boolean;
|
|
26
|
+
tooltipContent?: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
export type TMBlogsPostHeader = {
|
|
29
|
+
/** Flag to display the view mode toggle */
|
|
30
|
+
showViewMode: boolean;
|
|
31
|
+
/** Flag to display filter options */
|
|
32
|
+
showFilters: boolean;
|
|
33
|
+
/** Flag to display the search bar */
|
|
34
|
+
showSearchBar: boolean;
|
|
35
|
+
/** Flag to display a dropdown menu for selecting posts */
|
|
36
|
+
showPostsDropDown: boolean;
|
|
26
37
|
};
|
|
27
38
|
export interface TMBlogContextMenuItem {
|
|
28
39
|
text: string;
|
|
@@ -36,26 +47,22 @@ export interface TMBlogContextMenuItem {
|
|
|
36
47
|
tooltip?: string;
|
|
37
48
|
visible?: boolean;
|
|
38
49
|
}
|
|
39
|
-
export declare
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
$paddingBottom?: string;
|
|
52
|
-
$paddingLeft?: string;
|
|
53
|
-
}
|
|
54
|
-
export declare const BlogPostContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, BlogPostContainerProps>> & string;
|
|
55
|
-
export declare const getTooltipContent: (title: string | undefined, content: JSX.Element) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare const getCompactEllipsisStyle: (layoutMode: "compact" | "extended") => {
|
|
51
|
+
whiteSpace?: undefined;
|
|
52
|
+
overflow?: undefined;
|
|
53
|
+
textOverflow?: undefined;
|
|
54
|
+
display?: undefined;
|
|
55
|
+
} | {
|
|
56
|
+
whiteSpace: string;
|
|
57
|
+
overflow: string;
|
|
58
|
+
textOverflow: string;
|
|
59
|
+
display: string;
|
|
60
|
+
};
|
|
61
|
+
export declare const findFileItemByDraftID: (tree: FileItem | undefined, draftID: number | undefined) => FileItem | null;
|
|
56
62
|
export declare const highlightText: (text: string, searchText: string, isSelected: boolean) => string | (string | import("react/jsx-runtime").JSX.Element)[];
|
|
57
63
|
export declare const lightenColor: (hex: string, amount: number) => string;
|
|
58
|
-
export declare const
|
|
64
|
+
export declare const OwnerInitialsBadge: (blogPost: BlogPost | HomeBlogPost) => import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
export declare const getTooltipContent: (title: string | undefined, content: JSX.Element) => import("react/jsx-runtime").JSX.Element;
|
|
59
66
|
export declare const getAttachmentInfo: (attachment: BlogPostAttachment, treeFs: FileItem | undefined, draftLatestInfoMap: Map<number, {
|
|
60
67
|
latestVersion: number;
|
|
61
68
|
folderId: number;
|
|
@@ -67,7 +74,7 @@ export declare const getAttachmentInfo: (attachment: BlogPostAttachment, treeFs:
|
|
|
67
74
|
did: number;
|
|
68
75
|
fileExt: string;
|
|
69
76
|
fileSize: string;
|
|
70
|
-
}> | undefined, dcmtTypeDescriptors: Map<number, DcmtTypeDescriptor>, isSelected: boolean, searchText: string
|
|
77
|
+
}> | undefined, dcmtTypeDescriptors: Map<number, DcmtTypeDescriptor>, isSelected: boolean, searchText: string) => {
|
|
71
78
|
name: string;
|
|
72
79
|
nameElement: import("react/jsx-runtime").JSX.Element;
|
|
73
80
|
tooltipContent: import("react/jsx-runtime").JSX.Element;
|
|
@@ -76,24 +83,31 @@ export declare const getAttachmentInfo: (attachment: BlogPostAttachment, treeFs:
|
|
|
76
83
|
draftExist: boolean;
|
|
77
84
|
archivedDocumentsExist: boolean;
|
|
78
85
|
};
|
|
79
|
-
export declare const
|
|
80
|
-
|
|
81
|
-
folderId: number;
|
|
82
|
-
folderName: string;
|
|
83
|
-
fileExt: string;
|
|
84
|
-
fileSize: string;
|
|
85
|
-
}> | undefined, archivedDocumentMap: Map<number, {
|
|
86
|
-
tid: number;
|
|
87
|
-
did: number;
|
|
88
|
-
fileExt: string;
|
|
89
|
-
fileSize: string;
|
|
90
|
-
}> | undefined, dcmtTypeDescriptors: Map<number, DcmtTypeDescriptor>, isSelected: boolean, searchText: string, color: string, setShowDcmtForm: React.Dispatch<React.SetStateAction<boolean>>, handleFocusedAttachment: (attachment: DcmtInfo | undefined) => void, setAnchorEl: (value: React.SetStateAction<HTMLElement | null>) => void, contextMenuRef: React.MutableRefObject<ContextMenuRef<any> | null>) => import("react/jsx-runtime").JSX.Element;
|
|
91
|
-
export declare const OwnerInitialsBadge: (blogPost: BlogPost | HomeBlogPost) => import("react/jsx-runtime").JSX.Element;
|
|
92
|
-
export declare const IconAndHeaderElement: (blogPost: BlogPost | HomeBlogPost, iconColor: string, isSelected: boolean, headerClickCallback: () => void, searchText: string) => import("react/jsx-runtime").JSX.Element;
|
|
93
|
-
export declare const findFileItemByDraftID: (tree: FileItem | undefined, draftID: number | undefined) => FileItem | null;
|
|
86
|
+
export declare const getDcmtTypeDescriptor: (blogPosts: Array<BlogPost>) => Promise<Map<number, DcmtTypeDescriptor>>;
|
|
87
|
+
export declare const BlogPostHomeHeader: (header: string | undefined, classId: string | undefined, isSelected: boolean, searchText: string, headerClickCallback: () => void) => import("react/jsx-runtime").JSX.Element;
|
|
94
88
|
export declare const isHeaderFullyHidden: (header: {
|
|
95
89
|
showViewMode: boolean;
|
|
96
90
|
showFilters: boolean;
|
|
97
91
|
showSearchBar: boolean;
|
|
98
92
|
showPostsDropDown: boolean;
|
|
99
93
|
} | undefined) => boolean;
|
|
94
|
+
interface NewBadgeProps {
|
|
95
|
+
layoutMode: "compact" | "extended";
|
|
96
|
+
}
|
|
97
|
+
export declare const NewBadge: ({ layoutMode }: NewBadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
98
|
+
export declare const removeFileExtension: (filename: string) => string;
|
|
99
|
+
interface BlogPostTitleProps {
|
|
100
|
+
displayMode: "chat" | "stacked";
|
|
101
|
+
layoutMode: "compact" | "extended";
|
|
102
|
+
blogPost: BlogPost | HomeBlogPost;
|
|
103
|
+
isSelected: boolean;
|
|
104
|
+
isOwnComment: boolean;
|
|
105
|
+
searchText: string;
|
|
106
|
+
isSys: boolean;
|
|
107
|
+
isHomeBlogPost: boolean;
|
|
108
|
+
showId: boolean;
|
|
109
|
+
handleNavigateToWGs?: (blogPost: BlogPost | HomeBlogPost) => void;
|
|
110
|
+
handleNavigateToDossiers?: (blogPost: BlogPost | HomeBlogPost) => void;
|
|
111
|
+
}
|
|
112
|
+
export declare const BlogPostTitle: (props: BlogPostTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
113
|
+
export {};
|
|
@@ -1,60 +1,48 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { DcmtTypeListCacheService } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { getAvatarColor, extractInitialsFromName, SDKUI_Localizator, formatBytes, IconMenuCAWorkingGroups, IconCADossier, Globalization } from "../../helper";
|
|
4
|
+
import { TMColors } from "../../utils/theme";
|
|
5
5
|
import TMTooltip from "../base/TMTooltip";
|
|
6
|
-
import { TMColors } from '../../utils/theme';
|
|
7
|
-
import TMDcmtIcon from '../features/documents/TMDcmtIcon';
|
|
8
6
|
export const DRAFT_TYPE_TID = 6;
|
|
9
|
-
export const colors = {
|
|
10
|
-
DARK_BLUE: "#1a0dab",
|
|
11
|
-
WHITE: "#fff",
|
|
12
|
-
BLACK: "#000000",
|
|
13
|
-
RED: '#ff0000',
|
|
14
|
-
LIGHT_GRAY: "#f9f9f9",
|
|
15
|
-
PRIMARY_BLUE: "#135596",
|
|
16
|
-
PRIMARY_ORANGE: "#e65b00",
|
|
17
|
-
PRIMARY_GREEN: "#009700"
|
|
18
|
-
};
|
|
19
7
|
export var TMBlogsFilterCategoryId;
|
|
20
8
|
(function (TMBlogsFilterCategoryId) {
|
|
21
9
|
TMBlogsFilterCategoryId[TMBlogsFilterCategoryId["PublishedBlogs"] = 1] = "PublishedBlogs";
|
|
22
10
|
TMBlogsFilterCategoryId[TMBlogsFilterCategoryId["SystemBlogs"] = 2] = "SystemBlogs";
|
|
23
11
|
TMBlogsFilterCategoryId[TMBlogsFilterCategoryId["DeletedBlogs"] = 3] = "DeletedBlogs";
|
|
24
12
|
})(TMBlogsFilterCategoryId || (TMBlogsFilterCategoryId = {}));
|
|
25
|
-
export const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
`;
|
|
51
|
-
export const getTooltipContent = (title, content) => {
|
|
52
|
-
return (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsx("div", { style: { fontWeight: 'bold' }, children: title }), _jsx("hr", {}), content] }));
|
|
13
|
+
export const getCompactEllipsisStyle = (layoutMode) => {
|
|
14
|
+
if (layoutMode !== "compact")
|
|
15
|
+
return {};
|
|
16
|
+
return {
|
|
17
|
+
whiteSpace: "nowrap",
|
|
18
|
+
overflow: "hidden",
|
|
19
|
+
textOverflow: "ellipsis",
|
|
20
|
+
display: "block",
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export const findFileItemByDraftID = (tree, draftID) => {
|
|
24
|
+
if (tree === undefined || draftID === undefined)
|
|
25
|
+
return null;
|
|
26
|
+
if (tree.id === draftID) {
|
|
27
|
+
return tree;
|
|
28
|
+
}
|
|
29
|
+
if (tree.items && tree.items.length > 0) {
|
|
30
|
+
for (const item of tree.items) {
|
|
31
|
+
const found = findFileItemByDraftID(item, draftID);
|
|
32
|
+
if (found) {
|
|
33
|
+
return found;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
53
38
|
};
|
|
54
39
|
export const highlightText = (text, searchText, isSelected) => {
|
|
55
40
|
if (!searchText)
|
|
56
41
|
return text;
|
|
57
|
-
|
|
42
|
+
if (searchText.trim() === '')
|
|
43
|
+
return text;
|
|
44
|
+
const escapedSearchText = searchText.trim().replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
45
|
+
const regex = new RegExp(`(${escapedSearchText})`, 'gi');
|
|
58
46
|
return text.split(regex).map((part, index) => regex.test(part) ? (_jsx("span", { style: { backgroundColor: isSelected ? '#6c9023' : 'yellow' }, children: part }, index)) : (part));
|
|
59
47
|
};
|
|
60
48
|
export const lightenColor = (hex, amount) => {
|
|
@@ -72,10 +60,25 @@ export const lightenColor = (hex, amount) => {
|
|
|
72
60
|
b = Math.min(255, Math.max(0, b));
|
|
73
61
|
return `#${(r << 16 | g << 8 | b).toString(16).padStart(6, '0')}`;
|
|
74
62
|
};
|
|
75
|
-
export const
|
|
76
|
-
return
|
|
63
|
+
export const OwnerInitialsBadge = (blogPost) => {
|
|
64
|
+
return _jsx(TMTooltip, { content: blogPost.ownerName ?? '-', children: _jsx("div", { style: {
|
|
65
|
+
width: "40px",
|
|
66
|
+
height: "40px",
|
|
67
|
+
borderRadius: "50%",
|
|
68
|
+
backgroundColor: getAvatarColor(blogPost.ownerName ?? '-'),
|
|
69
|
+
display: "flex",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
justifyContent: "center",
|
|
72
|
+
marginRight: "10px",
|
|
73
|
+
fontWeight: "bold",
|
|
74
|
+
color: "#ffffff",
|
|
75
|
+
fontSize: "18px",
|
|
76
|
+
}, children: _jsx("span", { style: { fontSize: "12px" }, children: extractInitialsFromName(blogPost.ownerName ?? '-') }) }) });
|
|
77
|
+
};
|
|
78
|
+
export const getTooltipContent = (title, content) => {
|
|
79
|
+
return (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsx("div", { style: { fontWeight: 'bold' }, children: title }), _jsx("hr", {}), content] }));
|
|
77
80
|
};
|
|
78
|
-
export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText
|
|
81
|
+
export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText) => {
|
|
79
82
|
let nameElement = (_jsx("span", { children: `${SDKUI_Localizator.DocumentNotAvailable} (DID: ${attachment.did})` }));
|
|
80
83
|
let folderId = -1;
|
|
81
84
|
let fileExt = '';
|
|
@@ -111,7 +114,7 @@ export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archiv
|
|
|
111
114
|
alignItems: 'center',
|
|
112
115
|
justifyContent: 'center',
|
|
113
116
|
backgroundColor: isSelected ? '#fff' : (latestVersion ? '#28a745' : '#cc7000'),
|
|
114
|
-
color: isSelected ?
|
|
117
|
+
color: isSelected ? "#135596" : '#fff',
|
|
115
118
|
boxShadow: '1px 1px 2px #00000020',
|
|
116
119
|
borderRadius: '30px',
|
|
117
120
|
fontWeight: 'bold',
|
|
@@ -138,85 +141,37 @@ export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archiv
|
|
|
138
141
|
}
|
|
139
142
|
return { name, nameElement, tooltipContent, folderId, fileExt, draftExist, archivedDocumentsExist };
|
|
140
143
|
};
|
|
141
|
-
export const
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const onContextMenu = (e) => {
|
|
152
|
-
const archiveID = SDK_Globals.tmSession?.SessionDescr?.archiveID;
|
|
153
|
-
const fileName = `${removeFileExtension(name)}_${archiveID}_${attachment.tid}_${attachment.did}.${fileExt}`;
|
|
154
|
-
handleFocusedAttachment({ TID: attachment.tid, DID: attachment.did, fileName });
|
|
155
|
-
setAnchorEl(e.currentTarget);
|
|
156
|
-
e.preventDefault();
|
|
157
|
-
e.stopPropagation();
|
|
158
|
-
// Slight delay to ensure state update before showing context menu
|
|
159
|
-
setTimeout(() => {
|
|
160
|
-
contextMenuRef.current?.instance()?.show();
|
|
161
|
-
}, 0);
|
|
162
|
-
};
|
|
163
|
-
return _jsx("div", { onDoubleClick: onDoubleClick, onContextMenu: onContextMenu, style: {
|
|
164
|
-
display: 'inline-flex',
|
|
165
|
-
padding: '4px 8px',
|
|
166
|
-
margin: '4px',
|
|
167
|
-
border: '1px solid #ddd',
|
|
168
|
-
borderRadius: '8px',
|
|
169
|
-
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)',
|
|
170
|
-
backgroundColor: isSelected ? color : colors.WHITE,
|
|
171
|
-
cursor: "pointer",
|
|
172
|
-
fontSize: '0.9rem'
|
|
173
|
-
}, onMouseEnter: (e) => {
|
|
174
|
-
e.currentTarget.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.15)';
|
|
175
|
-
e.currentTarget.style.backgroundColor = isSelected ? lightenColor(color, 40) : '#cfcfcf';
|
|
176
|
-
}, onMouseLeave: (e) => {
|
|
177
|
-
e.currentTarget.style.boxShadow = '0 2px 4px rgba(0, 0, 0, 0.1)';
|
|
178
|
-
e.currentTarget.style.backgroundColor = isSelected ? color : colors.WHITE;
|
|
179
|
-
}, children: _jsxs("div", { style: { alignItems: 'center', display: 'flex' }, children: [fileExt ? _jsx("div", { style: { marginRight: "10px" }, children: _jsx(TMDcmtIcon, { tid: attachment.tid, did: attachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }) }) : _jsx(IconAttachment, { style: { marginRight: "5px" } }), _jsx("span", { children: nameElement })] }) }, attachment.did);
|
|
180
|
-
};
|
|
181
|
-
export const OwnerInitialsBadge = (blogPost) => {
|
|
182
|
-
return _jsx(TMTooltip, { content: blogPost.ownerName ?? '-', children: _jsx("div", { style: {
|
|
183
|
-
width: "40px",
|
|
184
|
-
height: "40px",
|
|
185
|
-
borderRadius: "50%",
|
|
186
|
-
backgroundColor: getAvatarColor(blogPost.ownerName ?? '-'),
|
|
187
|
-
display: "flex",
|
|
188
|
-
alignItems: "center",
|
|
189
|
-
justifyContent: "center",
|
|
190
|
-
marginRight: "10px",
|
|
191
|
-
fontWeight: "bold",
|
|
192
|
-
color: colors.WHITE,
|
|
193
|
-
fontSize: "18px",
|
|
194
|
-
}, children: _jsx("span", { style: { fontSize: "12px" }, children: extractInitialsFromName(blogPost.ownerName ?? '-') }) }) });
|
|
195
|
-
};
|
|
196
|
-
export const IconAndHeaderElement = (blogPost, iconColor, isSelected, headerClickCallback, searchText) => {
|
|
197
|
-
return _jsxs("span", { style: { marginLeft: "5px", cursor: blogPost.classID === 'WG' ? "pointer" : "default", display: "inline-flex", alignItems: "center" }, onClick: headerClickCallback, children: [_jsx(TMTooltip, { content: blogPost.classID === 'DS' ? SDKUI_Localizator.Practice : SDKUI_Localizator.WorkGroup, children: blogPost.classID === "DS" ? (_jsx(IconCADossier, { color: iconColor, fontSize: 28 })) : (_jsx(IconMenuCAWorkingGroups, { color: iconColor, fontSize: 28 })) }), _jsx("span", { style: {
|
|
198
|
-
marginLeft: "5px",
|
|
199
|
-
// textDecoration: (blogPost as HomeBlogPost).classID === "WG" ? "underline" : "none",
|
|
200
|
-
cursor: blogPost.classID === "WG" ? "pointer" : "default",
|
|
201
|
-
color: isSelected ? "#fff" : TMColors.primary,
|
|
202
|
-
display: "inline-block" // Ensure both elements are in a row
|
|
203
|
-
}, onClick: headerClickCallback, children: highlightText(blogPost.header ?? '', searchText, isSelected) })] });
|
|
204
|
-
};
|
|
205
|
-
export const findFileItemByDraftID = (tree, draftID) => {
|
|
206
|
-
if (tree === undefined || draftID === undefined)
|
|
207
|
-
return null;
|
|
208
|
-
if (tree.id === draftID) {
|
|
209
|
-
return tree;
|
|
210
|
-
}
|
|
211
|
-
if (tree.items && tree.items.length > 0) {
|
|
212
|
-
for (const item of tree.items) {
|
|
213
|
-
const found = findFileItemByDraftID(item, draftID);
|
|
214
|
-
if (found) {
|
|
215
|
-
return found;
|
|
144
|
+
export const getDcmtTypeDescriptor = async (blogPosts) => {
|
|
145
|
+
// Create a Map to store tid as key and DcmtTypeDescriptor as value
|
|
146
|
+
const dcmtTypeMap = new Map();
|
|
147
|
+
for (const blogPost of blogPosts) {
|
|
148
|
+
if (blogPost.attachments) {
|
|
149
|
+
for (const attachment of blogPost.attachments) {
|
|
150
|
+
const dcmtTypeDescriptor = await DcmtTypeListCacheService.GetAsync(attachment.tid, true);
|
|
151
|
+
if (dcmtTypeDescriptor && attachment.tid) {
|
|
152
|
+
dcmtTypeMap.set(attachment.tid, dcmtTypeDescriptor);
|
|
153
|
+
}
|
|
216
154
|
}
|
|
217
155
|
}
|
|
218
156
|
}
|
|
219
|
-
return
|
|
157
|
+
return dcmtTypeMap;
|
|
158
|
+
};
|
|
159
|
+
export const BlogPostHomeHeader = (header, classId, isSelected, searchText, headerClickCallback) => {
|
|
160
|
+
const isWorkGroup = classId === 'WG';
|
|
161
|
+
const iconColor = isSelected ? '#ffffff' : isWorkGroup ? '#009700' : '#e65b00';
|
|
162
|
+
return (_jsxs("div", { onClick: headerClickCallback, style: {
|
|
163
|
+
display: "flex",
|
|
164
|
+
alignItems: "center",
|
|
165
|
+
cursor: "pointer",
|
|
166
|
+
fontWeight: "bold",
|
|
167
|
+
color: isSelected ? "#fff" : TMColors.primary,
|
|
168
|
+
gap: "4px",
|
|
169
|
+
}, children: [_jsx(TMTooltip, { content: isWorkGroup ? SDKUI_Localizator.WorkGroup : SDKUI_Localizator.Practice, children: isWorkGroup ? (_jsx(IconMenuCAWorkingGroups, { color: iconColor, fontSize: 28 })) : (_jsx(IconCADossier, { color: iconColor, fontSize: 28 })) }), _jsx("div", { style: {
|
|
170
|
+
whiteSpace: "nowrap",
|
|
171
|
+
overflow: "hidden",
|
|
172
|
+
textOverflow: "ellipsis",
|
|
173
|
+
flex: 1,
|
|
174
|
+
}, children: highlightText(header ?? "", searchText, isSelected) })] }));
|
|
220
175
|
};
|
|
221
176
|
export const isHeaderFullyHidden = (header) => {
|
|
222
177
|
if (!header) {
|
|
@@ -224,3 +179,70 @@ export const isHeaderFullyHidden = (header) => {
|
|
|
224
179
|
}
|
|
225
180
|
return !header.showViewMode && !header.showFilters && !header.showSearchBar && !header.showPostsDropDown;
|
|
226
181
|
};
|
|
182
|
+
export const NewBadge = ({ layoutMode }) => {
|
|
183
|
+
const isCompact = layoutMode === "compact";
|
|
184
|
+
return (_jsxs("div", { style: {
|
|
185
|
+
position: "absolute",
|
|
186
|
+
top: isCompact ? "6px" : "8px",
|
|
187
|
+
right: isCompact ? "6px" : "8px",
|
|
188
|
+
background: "linear-gradient(270deg, #FFD76A 0%, #FFC940 50%, #FFB800 100%)",
|
|
189
|
+
color: TMColors.primary,
|
|
190
|
+
fontSize: isCompact ? "0" : "0.65rem",
|
|
191
|
+
fontWeight: "700",
|
|
192
|
+
letterSpacing: "0.5px",
|
|
193
|
+
padding: isCompact ? "0" : "3px 8px",
|
|
194
|
+
borderRadius: isCompact ? "50%" : "12px",
|
|
195
|
+
width: isCompact ? "10px" : "auto",
|
|
196
|
+
height: isCompact ? "10px" : "auto",
|
|
197
|
+
display: "flex",
|
|
198
|
+
alignItems: "center",
|
|
199
|
+
justifyContent: "center",
|
|
200
|
+
boxShadow: "0 2px 10px rgba(255, 200, 50, 0.45)",
|
|
201
|
+
zIndex: 1,
|
|
202
|
+
animation: "softBlink 2s infinite",
|
|
203
|
+
}, title: SDKUI_Localizator.NewMale, children: [!isCompact && "NEW", _jsx("style", { children: `
|
|
204
|
+
@keyframes softBlink {
|
|
205
|
+
0%, 100% { opacity: 1; }
|
|
206
|
+
50% { opacity: 0.7; }
|
|
207
|
+
}
|
|
208
|
+
` })] }));
|
|
209
|
+
};
|
|
210
|
+
export const removeFileExtension = (filename) => {
|
|
211
|
+
return filename.includes('.') ? filename.substring(0, filename.lastIndexOf('.')) : filename;
|
|
212
|
+
};
|
|
213
|
+
export const BlogPostTitle = (props) => {
|
|
214
|
+
const { displayMode, layoutMode, blogPost, isSelected, isOwnComment, searchText, isSys, isHomeBlogPost, showId, handleNavigateToWGs, handleNavigateToDossiers } = props;
|
|
215
|
+
const showOwnerBadge = (displayMode === "stacked" || !isOwnComment) && layoutMode === "extended";
|
|
216
|
+
let subtitle = "";
|
|
217
|
+
if (isHomeBlogPost) {
|
|
218
|
+
subtitle = blogPost.ownerName ? `${blogPost.ownerName} \u2014 ` : "";
|
|
219
|
+
}
|
|
220
|
+
if (blogPost.creationTime) {
|
|
221
|
+
subtitle += `${Globalization.getDateTimeDisplayValue(blogPost.creationTime)} ${new Date(blogPost.creationTime).toDateString() === new Date().toDateString()
|
|
222
|
+
? `(${SDKUI_Localizator.Today})`
|
|
223
|
+
: ''}`;
|
|
224
|
+
}
|
|
225
|
+
if (showId && blogPost.id !== undefined) {
|
|
226
|
+
subtitle += ` \u2014 ID: ${blogPost.id}`;
|
|
227
|
+
}
|
|
228
|
+
const headerClickCallback = () => {
|
|
229
|
+
if (handleNavigateToWGs && blogPost.id && blogPost.classID === 'WG') {
|
|
230
|
+
handleNavigateToWGs(blogPost);
|
|
231
|
+
}
|
|
232
|
+
if (handleNavigateToDossiers && blogPost.id && blogPost.classID === 'DS') {
|
|
233
|
+
handleNavigateToDossiers(blogPost);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
return _jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [showOwnerBadge && (_jsx("div", { style: { width: "40px", height: "40px", flexShrink: 0 }, children: OwnerInitialsBadge(blogPost) })), _jsxs("div", { style: {
|
|
237
|
+
display: "flex",
|
|
238
|
+
flexDirection: "column",
|
|
239
|
+
width: showOwnerBadge ? "calc(100% - 40px)" : "100%",
|
|
240
|
+
}, children: [(isHomeBlogPost && blogPost.classID) && BlogPostHomeHeader(blogPost.header, blogPost.classID, isSelected, searchText, headerClickCallback), (!isHomeBlogPost && !isOwnComment && blogPost.ownerName && blogPost.ownerName.trim().length > 0) && (_jsx("span", { style: {
|
|
241
|
+
fontWeight: "bold",
|
|
242
|
+
color: isSelected ? "#fff" : !isSys ? TMColors.primary : "#ff0000",
|
|
243
|
+
...getCompactEllipsisStyle(layoutMode),
|
|
244
|
+
}, children: highlightText(blogPost.ownerName, searchText, isSelected) })), subtitle.length > 0 && (_jsx("div", { style: {
|
|
245
|
+
color: isSelected ? "#fff" : !isSys ? TMColors.primary : "#ff0000",
|
|
246
|
+
...getCompactEllipsisStyle(layoutMode)
|
|
247
|
+
}, children: highlightText(subtitle, searchText, isSelected) }))] })] });
|
|
248
|
+
};
|
|
@@ -53,7 +53,9 @@ export * from './choosers/TMOrderRetrieveFormats';
|
|
|
53
53
|
export * from './choosers/TMUserChooser';
|
|
54
54
|
export * from './choosers/TMPathChooser';
|
|
55
55
|
export { default as TMValidationItemsList } from './grids/TMValidationItemsList';
|
|
56
|
-
export { default as
|
|
56
|
+
export { default as TMBlogsPost } from './grids/TMBlogsPost';
|
|
57
|
+
export { default as TMBlogHeader } from './grids/TMBlogHeader';
|
|
58
|
+
export { default as TMBlogAttachments } from './grids/TMBlogAttachments';
|
|
57
59
|
export { default as TMBlogCommentForm } from './features/blog/TMBlogCommentForm';
|
|
58
60
|
export * from './query/TMQueryEditor';
|
|
59
61
|
export * from './query/TMQuerySummary';
|
|
@@ -65,6 +67,14 @@ export * from './features/documents/TMRelationViewer';
|
|
|
65
67
|
export * from './features/archive/TMArchive';
|
|
66
68
|
export * from './features/search/TMSearch';
|
|
67
69
|
export * from './features/search/TMSearchResult';
|
|
70
|
+
export { default as TMTaskForm } from './features/tasks/TMTaskForm';
|
|
71
|
+
export { default as TMTasksAgenda } from './features/tasks/TMTasksAgenda';
|
|
72
|
+
export { default as TMTasksCalendar } from './features/tasks/TMTasksCalendar';
|
|
73
|
+
export { default as TMTasksHeader } from './features/tasks/TMTasksHeader';
|
|
74
|
+
export { default as TMTasksPanelContent } from './features/tasks/TMTasksPanelContent';
|
|
75
|
+
export { default as TMTasksView } from './features/tasks/TMTasksView';
|
|
76
|
+
export * from './features/tasks/TMTasksUtils';
|
|
77
|
+
export * from './features/tasks/TMTasksUtilsView';
|
|
68
78
|
export { default as TMWGsCopyMoveForm } from './features/wg/TMWGsCopyMoveForm';
|
|
69
79
|
export * from './base/TMTab';
|
|
70
80
|
export { default as TMHeader } from "./sidebar/TMHeader";
|
|
@@ -84,6 +94,9 @@ export * from "./viewers/TMDataListItemViewer";
|
|
|
84
94
|
export * from "./base/TMDeviceProvider";
|
|
85
95
|
export { default as TMDataGrid } from "./base/TMDataGrid";
|
|
86
96
|
export { default as TMFileManager } from "./base/TMFileManager";
|
|
97
|
+
export { default as TMFileManagerDataGridView } from "./base/TMFileManagerDataGridView";
|
|
98
|
+
export { default as TMFileManagerThumbnailsView } from "./base/TMFileManagerThumbnailsView";
|
|
99
|
+
export * from "./base/TMFileManagerUtils";
|
|
87
100
|
export * from "./base/TMFileManagerUtils";
|
|
88
101
|
export { default as TMCounterContainer } from "./base/TMCounterContainer";
|
|
89
102
|
export * from "./base/TMCounterContainer";
|
package/lib/components/index.js
CHANGED
|
@@ -58,7 +58,9 @@ export * from './choosers/TMPathChooser';
|
|
|
58
58
|
//grids
|
|
59
59
|
export { default as TMValidationItemsList } from './grids/TMValidationItemsList';
|
|
60
60
|
// blogs
|
|
61
|
-
export { default as
|
|
61
|
+
export { default as TMBlogsPost } from './grids/TMBlogsPost';
|
|
62
|
+
export { default as TMBlogHeader } from './grids/TMBlogHeader';
|
|
63
|
+
export { default as TMBlogAttachments } from './grids/TMBlogAttachments';
|
|
62
64
|
export { default as TMBlogCommentForm } from './features/blog/TMBlogCommentForm';
|
|
63
65
|
//query
|
|
64
66
|
export * from './query/TMQueryEditor';
|
|
@@ -75,6 +77,15 @@ export * from './features/archive/TMArchive';
|
|
|
75
77
|
//search
|
|
76
78
|
export * from './features/search/TMSearch';
|
|
77
79
|
export * from './features/search/TMSearchResult';
|
|
80
|
+
// tasks
|
|
81
|
+
export { default as TMTaskForm } from './features/tasks/TMTaskForm';
|
|
82
|
+
export { default as TMTasksAgenda } from './features/tasks/TMTasksAgenda';
|
|
83
|
+
export { default as TMTasksCalendar } from './features/tasks/TMTasksCalendar';
|
|
84
|
+
export { default as TMTasksHeader } from './features/tasks/TMTasksHeader';
|
|
85
|
+
export { default as TMTasksPanelContent } from './features/tasks/TMTasksPanelContent';
|
|
86
|
+
export { default as TMTasksView } from './features/tasks/TMTasksView';
|
|
87
|
+
export * from './features/tasks/TMTasksUtils';
|
|
88
|
+
export * from './features/tasks/TMTasksUtilsView';
|
|
78
89
|
// wg
|
|
79
90
|
export { default as TMWGsCopyMoveForm } from './features/wg/TMWGsCopyMoveForm';
|
|
80
91
|
//tab
|
|
@@ -102,6 +113,9 @@ export * from "./viewers/TMDataListItemViewer";
|
|
|
102
113
|
export * from "./base/TMDeviceProvider";
|
|
103
114
|
export { default as TMDataGrid } from "./base/TMDataGrid";
|
|
104
115
|
export { default as TMFileManager } from "./base/TMFileManager";
|
|
116
|
+
export { default as TMFileManagerDataGridView } from "./base/TMFileManagerDataGridView";
|
|
117
|
+
export { default as TMFileManagerThumbnailsView } from "./base/TMFileManagerThumbnailsView";
|
|
118
|
+
export * from "./base/TMFileManagerUtils";
|
|
105
119
|
export * from "./base/TMFileManagerUtils";
|
|
106
120
|
export { default as TMCounterContainer } from "./base/TMCounterContainer";
|
|
107
121
|
export * from "./base/TMCounterContainer";
|
|
@@ -106,6 +106,13 @@ export const TMPanelManagerProvider = (props) => {
|
|
|
106
106
|
return adjustPanelVisibilityAndSize(initialMobilePanelId, true, prev);
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
+
else {
|
|
110
|
+
let updated = { ...initialVisibility };
|
|
111
|
+
Object.entries(initialVisibility).forEach(([id, isVisible]) => {
|
|
112
|
+
updated = adjustPanelVisibilityAndSize(id, isVisible, updated);
|
|
113
|
+
});
|
|
114
|
+
setPanelVisibility(updated);
|
|
115
|
+
}
|
|
109
116
|
}, [isMobile]);
|
|
110
117
|
// Function to maximize a panel (and its parent panels)
|
|
111
118
|
const maximizePanel = useCallback((id) => {
|
|
@@ -18,6 +18,10 @@ const fontSizes = [
|
|
|
18
18
|
{ value: "19px", display: "19px" },
|
|
19
19
|
{ value: "20px", display: "20px" }
|
|
20
20
|
];
|
|
21
|
+
const fontFamilies = [
|
|
22
|
+
{ value: "Inter", display: "Inter" },
|
|
23
|
+
{ value: "Roboto", display: "Roboto" }
|
|
24
|
+
];
|
|
21
25
|
const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: true, canSearch: true, dossiersLicense: true, wgGroupLicense: true, workFlowLicense: true } }) => {
|
|
22
26
|
const [, setForceUpdate] = useState(0); // Dummy state to force re-renders
|
|
23
27
|
const triggerUIUpdate = () => setForceUpdate((prev) => prev + 1); // Increment dummy state to re-render
|
|
@@ -47,6 +51,10 @@ const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: t
|
|
|
47
51
|
let newpx = e.target.value;
|
|
48
52
|
SDKUI_Globals.userSettings.themeSettings.fontSize = newpx;
|
|
49
53
|
triggerUIUpdate();
|
|
54
|
+
} }), _jsx(TMDropDown, { label: 'Family', dataSource: fontFamilies, width: '230px', value: SDKUI_Globals.userSettings.themeSettings.fontFamily, onValueChanged: (e) => {
|
|
55
|
+
let newFamily = e.target.value;
|
|
56
|
+
SDKUI_Globals.userSettings.themeSettings.fontFamily = newFamily;
|
|
57
|
+
triggerUIUpdate();
|
|
50
58
|
} }), _jsx("p", { style: { fontSize: '1rem', fontWeight: 'bold', marginTop: '10px', marginBottom: '5px' }, children: SDKUI_Localizator.Grids }), _jsx(TMCheckBox, { label: SDKUI_Localizator.ShowRowSeparatingLines, value: SDKUI_Globals.userSettings.themeSettings.gridSettings.showRowLines, onValueChanged: (newValue) => {
|
|
51
59
|
SDKUI_Globals.userSettings.themeSettings.gridSettings.showRowLines = newValue;
|
|
52
60
|
triggerUIUpdate();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { IconDcmtType, IconDcmtTypeOnlyMetadata, IconLocked, IconView, isCreateCertificateEnabled, isPdfEditorEnabled, isSign4TopEnabled, LocalizeArchiveConstraints, LocalizeParametricFilterTypes, SDKUI_Localizator, TMImageLibrary } from '../../helper';
|
|
4
|
-
import { ArchiveConstraints, DcmtTypeListCacheService, OwnershipLevels, ParametricFilterTypes, SDK_Globals, SDK_Localizator, TemplateTIDs } from '@topconsultnpm/sdk-ts';
|
|
4
|
+
import { AccessLevels, AccessLevelsEx, ArchiveConstraints, DcmtTypeListCacheService, OwnershipLevels, ParametricFilterTypes, SDK_Globals, SDK_Localizator, TemplateTIDs } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
import TMSpinner from '../base/TMSpinner';
|
|
6
6
|
import { StyledDivHorizontal, StyledTooltipContainer, StyledTooltipItem, StyledTooltipSeparatorItem } from '../base/Styled';
|
|
7
7
|
import TMTooltip from '../base/TMTooltip';
|
|
@@ -306,12 +306,30 @@ export const cellRenderTID = (data, noneSelectionText) => {
|
|
|
306
306
|
return (_jsx(TMTidViewer, { tid: data.value, noneSelectionText: noneSelectionText }));
|
|
307
307
|
};
|
|
308
308
|
export const renderDTDTooltipContent = (dtd) => {
|
|
309
|
+
const mapAccessLevelToLocalizedString = (level) => {
|
|
310
|
+
if (level === undefined || level === null)
|
|
311
|
+
return SDKUI_Localizator.No;
|
|
312
|
+
switch (level) {
|
|
313
|
+
case AccessLevelsEx.Yes || AccessLevels.Yes:
|
|
314
|
+
return SDKUI_Localizator.Yes;
|
|
315
|
+
case AccessLevelsEx.No || AccessLevels.No:
|
|
316
|
+
return SDKUI_Localizator.No;
|
|
317
|
+
case AccessLevelsEx.Deny || AccessLevels.Deny:
|
|
318
|
+
return SDKUI_Localizator.Deny;
|
|
319
|
+
case AccessLevelsEx.Mixed:
|
|
320
|
+
return SDKUI_Localizator.Mixed;
|
|
321
|
+
case AccessLevelsEx.None || AccessLevels.None:
|
|
322
|
+
return SDK_Localizator.None;
|
|
323
|
+
default:
|
|
324
|
+
return level.toString();
|
|
325
|
+
}
|
|
326
|
+
};
|
|
309
327
|
return (!dtd ? null
|
|
310
328
|
: _jsxs(StyledTooltipContainer, { children: [_jsx(StyledTooltipItem, { children: `${SDK_Globals.useLocalizedName ? dtd.nameLoc : dtd.name} (${dtd.isView ? 'VID' : 'TID'}: ${dtd.id}, RootTID: ${dtd.rootTID ?? 0})` }), dtd.description && _jsx(StyledTooltipItem, { children: dtd.description }), _jsx(StyledTooltipSeparatorItem, {}), dtd.customData2 === "NOTGRANTED"
|
|
311
329
|
? _jsx(StyledTooltipItem, { style: { fontWeight: 600 }, children: 'Tipo documento NON autorizzato' })
|
|
312
330
|
:
|
|
313
331
|
_jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ArchiveConstraint}: ${LocalizeArchiveConstraints(dtd.archiveConstraint)}` }), dtd.isView && dtd.parametricFilterType != ParametricFilterTypes.None && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ParametricFilter}: ${LocalizeParametricFilterTypes(dtd.parametricFilterType)}` }), dtd.isView && dtd.withCheckOption && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ViewWithCheckOption}: ${SDKUI_Localizator.Yes}` }), dtd.isLexProt && dtd.isLexProt > 0 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes}` }), dtd.isFreeSearchable && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Free}: ${SDKUI_Localizator.Yes}` }), dtd.templateTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Template}: ${dtd.templateTID}` }), dtd.traceTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Tracing}: ${SDKUI_Localizator.Yes} - ${dtd.templateTID == TemplateTIDs.Trace_DcmtType ? SDKUI_Localizator.Destination : SDKUI_Localizator.Source} ${dtd.traceTID < 0 ? SDKUI_Localizator.Disabled : ''}` }), dtd.wfAppr && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.WorkflowApproval}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.BlogCase}: ${SDKUI_Localizator.Yes}` }), dtd.cico && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${SDKUI_Localizator.Yes}` }), dtd.perm ?
|
|
314
|
-
_jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${dtd.perm.canArchive}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${dtd.perm.canView}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${dtd.perm.canSearch}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${dtd.perm.canUpdate}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${dtd.perm.canRetrieveFile}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${dtd.perm.canSubstFile}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${dtd.perm.canLogicalDelete}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${dtd.perm.canPhysicalDelete}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${dtd.perm.canReadBlog}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${dtd.perm.canWriteBlog}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${dtd.perm.canCICO}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${dtd.perm.canDelChron}` })] })
|
|
332
|
+
_jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${mapAccessLevelToLocalizedString(dtd.perm.canArchive)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${mapAccessLevelToLocalizedString(dtd.perm.canView)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${mapAccessLevelToLocalizedString(dtd.perm.canSearch)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${mapAccessLevelToLocalizedString(dtd.perm.canUpdate)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${mapAccessLevelToLocalizedString(dtd.perm.canRetrieveFile)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${mapAccessLevelToLocalizedString(dtd.perm.canSubstFile)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${mapAccessLevelToLocalizedString(dtd.perm.canLogicalDelete)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${mapAccessLevelToLocalizedString(dtd.perm.canPhysicalDelete)}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${mapAccessLevelToLocalizedString(dtd.perm.canReadBlog)}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${mapAccessLevelToLocalizedString(dtd.perm.canWriteBlog)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${mapAccessLevelToLocalizedString(dtd.perm.canCICO)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${mapAccessLevelToLocalizedString(dtd.perm.canDelChron)}` })] })
|
|
315
333
|
: dtd.ownershipLevel == OwnershipLevels.DirectOwner || dtd.ownershipLevel == OwnershipLevels.IndirectOwner ?
|
|
316
334
|
_jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${SDKUI_Localizator.Yes}` })] })
|
|
317
335
|
: _jsx(_Fragment, {}), (dtd.widgets && dtd.widgets.length > 0) ? (() => {
|