@topconsultnpm/sdkui-react-beta 6.12.36 → 6.12.38
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 +12 -0
- package/lib/components/base/Styled.js +49 -3
- package/lib/components/base/TMFloatingToolbar.d.ts +9 -0
- package/lib/components/base/TMFloatingToolbar.js +99 -0
- package/lib/components/base/TMRightSidebar.d.ts +0 -4
- package/lib/components/base/TMRightSidebar.js +2 -10
- package/lib/components/base/TMShowAllOrMaxItemsButton.d.ts +8 -0
- package/lib/components/base/TMShowAllOrMaxItemsButton.js +14 -0
- package/lib/components/base/TMTreeView.d.ts +27 -0
- package/lib/components/base/TMTreeView.js +199 -0
- package/lib/components/grids/TMBlogs.d.ts +84 -0
- package/lib/components/grids/TMBlogs.js +566 -0
- package/lib/components/grids/TMBlogsUtils.d.ts +83 -0
- package/lib/components/grids/TMBlogsUtils.js +258 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/query/TMBatchUpdateForm.d.ts +12 -0
- package/lib/components/query/TMBatchUpdateForm.js +149 -0
- package/lib/components/query/TMDcmtBlog.d.ts +7 -0
- package/lib/components/query/TMDcmtBlog.js +33 -0
- package/lib/components/query/TMDcmtForm.d.ts +32 -0
- package/lib/components/query/TMDcmtForm.js +544 -0
- package/lib/components/query/TMDcmtIcon.d.ts +10 -0
- package/lib/components/query/TMDcmtIcon.js +52 -0
- package/lib/components/query/TMDcmtPreview.d.ts +26 -0
- package/lib/components/query/TMDcmtPreview.js +200 -0
- package/lib/components/query/TMFileUploader.d.ts +11 -0
- package/lib/components/query/TMFileUploader.js +101 -0
- package/lib/components/query/TMMasterDetailDcmts.d.ts +23 -0
- package/lib/components/query/TMMasterDetailDcmts.js +475 -0
- package/lib/components/query/TMQueryEditor.js +2 -2
- package/lib/components/query/TMQueryResultForm.d.ts +1 -7
- package/lib/components/query/TMQueryResultForm.js +1 -9
- package/lib/components/query/TMWorkflowPopup.d.ts +29 -0
- package/lib/components/query/TMWorkflowPopup.js +131 -0
- package/lib/components/search/TMSearchResult.d.ts +31 -0
- package/lib/components/search/TMSearchResult.js +727 -0
- package/lib/components/search/TMSearchResultsMenuItems.d.ts +6 -0
- package/lib/components/search/TMSearchResultsMenuItems.js +376 -0
- package/lib/helper/Enum_Localizator.d.ts +2 -1
- package/lib/helper/Enum_Localizator.js +20 -1
- package/lib/helper/SDKUI_Localizator.d.ts +24 -0
- package/lib/helper/SDKUI_Localizator.js +240 -0
- package/lib/helper/dcmtsHelper.d.ts +4 -0
- package/lib/helper/dcmtsHelper.js +15 -0
- package/lib/helper/helpers.d.ts +2 -1
- package/lib/helper/helpers.js +74 -1
- package/lib/helper/queryHelper.d.ts +7 -1
- package/lib/helper/queryHelper.js +105 -1
- package/lib/hooks/useDcmtOperations.d.ts +24 -0
- package/lib/hooks/useDcmtOperations.js +387 -0
- package/lib/hooks/useInputDialog.d.ts +5 -0
- package/lib/hooks/useInputDialog.js +73 -0
- package/lib/hooks/usePreventFileDrop.d.ts +3 -0
- package/lib/hooks/usePreventFileDrop.js +37 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/services/platform_services.d.ts +1 -1
- package/lib/ts/types.d.ts +54 -1
- package/lib/ts/types.js +34 -0
- package/package.json +1 -1
@@ -0,0 +1,566 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
3
|
+
import { DcmtTypeListCacheService, ResultTypes, SDK_Globals, WorkingGroupEngine } from "@topconsultnpm/sdk-ts-beta";
|
4
|
+
import { ContextMenu, ScrollView } from 'devextreme-react';
|
5
|
+
import { SDKUI_Localizator, IconAttachment, getExceptionMessage, Globalization, IconBoard, SDKUI_Globals } from '../../helper';
|
6
|
+
import TMDataGrid from '../base/TMDataGrid';
|
7
|
+
import { useDeviceType, DeviceType } from '../base/TMDeviceProvider';
|
8
|
+
import { TMMessageBoxManager, ButtonNames } from '../base/TMPopUp';
|
9
|
+
import TMTooltip from '../base/TMTooltip';
|
10
|
+
import { TMLayoutWaitingContainer } from '../base/TMWaitPanel';
|
11
|
+
import TMDropDown from '../editors/TMDropDown';
|
12
|
+
import TMHtmlContentDisplay from '../editors/TMHtmlContentDisplay';
|
13
|
+
import TMTreeDropDown from '../editors/TMTreeDropDown';
|
14
|
+
import { TMResultManager } from '../forms/TMResultDialog';
|
15
|
+
import { TMSearchBar } from '../sidebar/TMHeader';
|
16
|
+
import { AttachmentElement, BlogPostContainer, colors, findFileItemByDraftID, highlightText, IconAndHeaderElement, isHeaderFullyHidden, OwnerInitialsBadge, TMBlogsFilterCategoryId } from './TMBlogsUtils';
|
17
|
+
import { useDcmtOperations } from '../../hooks/useDcmtOperations';
|
18
|
+
let abortController = new AbortController();
|
19
|
+
const TMBlogs = (props) => {
|
20
|
+
const { id, allData, showExtendedAttachments = true, treeFs, draftLatestInfoMap, archivedDocumentMap, updateVisualizedBlogCallback, handleClickAttachmentFolderFileCallback, height, width, scrollToBottom = true, viewMode = 'thumbnails', header, showIconHeader = true, color = colors.PRIMARY_BLUE, handleNavigateToWGs, showId, setShowId, currentWorkingGroup, contextMenuParams = {
|
21
|
+
isShowHideFilterEnabled: true,
|
22
|
+
isShowHideIDEnaled: true,
|
23
|
+
isCommentEnabled: false,
|
24
|
+
isDeleteEnabled: false,
|
25
|
+
isRestoreEnabled: false,
|
26
|
+
isRefreshEnabled: false,
|
27
|
+
isCreateContextualTask: false,
|
28
|
+
}, refreshCallback, newPosts = [], showCommentFormCallback, showTaskFormCallback } = props;
|
29
|
+
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
30
|
+
const deviceType = useDeviceType();
|
31
|
+
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
32
|
+
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
33
|
+
// State to manage the current rendering mode of the component (either 'thumbnails' or 'details')
|
34
|
+
const [renderMode, setRenderMode] = useState('thumbnails');
|
35
|
+
// State to store an array of blog posts, which can be either BlogPost or HomeBlogPost type
|
36
|
+
const [blogPosts, setBlogPosts] = useState([]);
|
37
|
+
// State to manage the data source for a tree component
|
38
|
+
const [treeDataSource, setTreeDataSource] = useState([]);
|
39
|
+
// State to store the user's search input for filtering or searching posts/messages
|
40
|
+
const [searchText, setSearchText] = useState('');
|
41
|
+
// State to manage the number of posts to display, with a default value of 30
|
42
|
+
const [postsToShow, setPostsToShow] = useState(30);
|
43
|
+
// State that holds an array of filter category IDs
|
44
|
+
const [appliedGlobalFilters, setAppliedGlobalFilters] = useState([TMBlogsFilterCategoryId.PublishedBlogs]);
|
45
|
+
// State to manage the focused file
|
46
|
+
const [focusedBlog, setFocusedBlog] = useState(undefined);
|
47
|
+
// State to manage the focused file
|
48
|
+
const [dcmtTypeDescriptors, setDcmtTypeDescriptors] = useState(new Map());
|
49
|
+
// State to store context menu items for file manager actions
|
50
|
+
const [menuItems, setMenuItems] = useState([]);
|
51
|
+
// State to manage the anchor element for context menu positioning
|
52
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
53
|
+
// State to store the current header value. Initialized with the provided 'header' prop.
|
54
|
+
const [currentHeader, setCurrentHeader] = useState(header);
|
55
|
+
// State to track whether the header is fully hidden based on the current header value
|
56
|
+
const [isHeaderHidden, setIsHeaderHidden] = useState(isHeaderFullyHidden(currentHeader));
|
57
|
+
// showId is a state variable that determines whether an ID-related component or feature should be displayed
|
58
|
+
const [localShowId, setLocalShowId] = useState(false);
|
59
|
+
// State variable to track the number of new posts
|
60
|
+
const [newPostCount, setNewPostCount] = useState(0);
|
61
|
+
// Ref to the container
|
62
|
+
const containerRef = useRef(null);
|
63
|
+
// State variable to control the visibility of the wait panel.
|
64
|
+
const [showWaitPanel, setShowWaitPanel] = useState(false);
|
65
|
+
// State variable to store the title of the wait panel.
|
66
|
+
const [waitPanelTitle, setWaitPanelTitle] = useState('');
|
67
|
+
// State variable to control the visibility of the primary section of the wait panel.
|
68
|
+
const [showPrimary, setShowPrimary] = useState(false);
|
69
|
+
// State variable to store the primary text of the wait panel.
|
70
|
+
const [waitPanelTextPrimary, setWaitPanelTextPrimary] = useState('');
|
71
|
+
// State variable to track the current value of the primary progress indicator in the wait panel.
|
72
|
+
const [waitPanelValuePrimary, setWaitPanelValuePrimary] = useState(0);
|
73
|
+
// State variable to define the maximum value for the primary progress indicator in the wait panel.
|
74
|
+
const [waitPanelMaxValuePrimary, setWaitPanelMaxValuePrimary] = useState(0);
|
75
|
+
// Data source for the number of posts to display in the UI
|
76
|
+
const postsToShowDataSource = [
|
77
|
+
{ value: 30, display: SDKUI_Localizator.Latest + ' 30' },
|
78
|
+
{ value: 50, display: SDKUI_Localizator.Latest + ' 50' },
|
79
|
+
{ value: 100, display: SDKUI_Localizator.Latest + ' 100' },
|
80
|
+
{ value: allData.length, display: SDKUI_Localizator.All },
|
81
|
+
];
|
82
|
+
const toggleHeaderClick = () => {
|
83
|
+
setCurrentHeader(prevState => {
|
84
|
+
if (prevState === undefined) {
|
85
|
+
return {
|
86
|
+
showViewMode: true,
|
87
|
+
showFilters: true,
|
88
|
+
showSearchBar: true,
|
89
|
+
showPostsDropDown: true,
|
90
|
+
};
|
91
|
+
}
|
92
|
+
else {
|
93
|
+
return {
|
94
|
+
showViewMode: !prevState.showViewMode,
|
95
|
+
showFilters: !prevState.showFilters,
|
96
|
+
showSearchBar: !prevState.showSearchBar,
|
97
|
+
showPostsDropDown: !prevState.showPostsDropDown,
|
98
|
+
};
|
99
|
+
}
|
100
|
+
});
|
101
|
+
};
|
102
|
+
const deleteOrUndeleteCommentCallback = async (del) => {
|
103
|
+
if (focusedBlog === undefined || focusedBlog.id === undefined)
|
104
|
+
return Promise.resolve();
|
105
|
+
const msg = del ? SDKUI_Localizator.DeleteComment : SDKUI_Localizator.RestoreComment;
|
106
|
+
TMMessageBoxManager.show({
|
107
|
+
title: del ? SDKUI_Localizator.Delete : SDKUI_Localizator.Restore, message: msg, buttons: [ButtonNames.YES, ButtonNames.NO],
|
108
|
+
onButtonClick: async (e) => {
|
109
|
+
if (e !== ButtonNames.YES)
|
110
|
+
return;
|
111
|
+
if (focusedBlog === undefined || focusedBlog.id === undefined || currentWorkingGroup === undefined || currentWorkingGroup.id === undefined)
|
112
|
+
return Promise.resolve();
|
113
|
+
setWaitPanelTitle(del ? SDKUI_Localizator.Delete : SDKUI_Localizator.Restore);
|
114
|
+
setShowWaitPanel(true);
|
115
|
+
setShowPrimary(true);
|
116
|
+
abortController = new AbortController();
|
117
|
+
let result = [];
|
118
|
+
let i = 0;
|
119
|
+
setWaitPanelMaxValuePrimary(1);
|
120
|
+
if (abortController.signal.aborted) {
|
121
|
+
result.push({ rowIndex: i, id1: focusedBlog.id, id2: focusedBlog.id, resultType: ResultTypes.WARNING, description: `Operazione interrotta. Elaborate ${i}` });
|
122
|
+
}
|
123
|
+
else {
|
124
|
+
setWaitPanelTextPrimary(del ? SDKUI_Localizator.Delete : SDKUI_Localizator.Restore);
|
125
|
+
const workingGroupEngine = new WorkingGroupEngine(SDK_Globals.tmSession);
|
126
|
+
await workingGroupEngine.BlogPostDeleteOrUndeleteAsync(currentWorkingGroup.id, focusedBlog.id, del)
|
127
|
+
.then(() => {
|
128
|
+
result.push({ rowIndex: 1, id1: currentWorkingGroup.id, id2: 0, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
129
|
+
TMResultManager.show(result, del ? SDKUI_Localizator.Delete : SDKUI_Localizator.Restore, "ID", undefined);
|
130
|
+
setFocusedBlog(undefined);
|
131
|
+
refresh();
|
132
|
+
})
|
133
|
+
.catch((err) => {
|
134
|
+
result.push({ rowIndex: 1, id1: currentWorkingGroup.id, id2: currentWorkingGroup.id, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
|
135
|
+
});
|
136
|
+
}
|
137
|
+
setWaitPanelTextPrimary('');
|
138
|
+
setWaitPanelMaxValuePrimary(0);
|
139
|
+
setWaitPanelValuePrimary(0);
|
140
|
+
setShowWaitPanel(false);
|
141
|
+
TMResultManager.show(result, del ? SDKUI_Localizator.Delete : SDKUI_Localizator.Restore, "ID", undefined);
|
142
|
+
}
|
143
|
+
});
|
144
|
+
};
|
145
|
+
const refresh = () => {
|
146
|
+
if (refreshCallback)
|
147
|
+
refreshCallback();
|
148
|
+
};
|
149
|
+
// ContexMenuItems array contains a list of context menu items for a blog
|
150
|
+
const contextMenuItems = useMemo(() => {
|
151
|
+
let menuItemsElements = [
|
152
|
+
{
|
153
|
+
icon: isHeaderHidden ? 'eyeopen' : 'eyeclose',
|
154
|
+
text: isHeaderHidden ? SDKUI_Localizator.ShowFilters : SDKUI_Localizator.HideFilters,
|
155
|
+
visible: contextMenuParams.isShowHideFilterEnabled,
|
156
|
+
onClick: toggleHeaderClick,
|
157
|
+
disabled: false,
|
158
|
+
},
|
159
|
+
{
|
160
|
+
icon: localShowId ? 'eyeclose' : 'eyeopen',
|
161
|
+
onClick: () => setLocalShowId(prevShowId => !prevShowId),
|
162
|
+
text: localShowId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show,
|
163
|
+
visible: contextMenuParams.isShowHideIDEnaled,
|
164
|
+
disabled: false,
|
165
|
+
},
|
166
|
+
{
|
167
|
+
icon: "chat",
|
168
|
+
text: SDKUI_Localizator.Comment,
|
169
|
+
visible: contextMenuParams.isCommentEnabled,
|
170
|
+
disabled: false,
|
171
|
+
onClick: () => { if (showCommentFormCallback)
|
172
|
+
showCommentFormCallback(); },
|
173
|
+
beginGroup: true
|
174
|
+
},
|
175
|
+
{
|
176
|
+
icon: "trash",
|
177
|
+
text: SDKUI_Localizator.Delete,
|
178
|
+
visible: contextMenuParams.isDeleteEnabled,
|
179
|
+
onClick: () => deleteOrUndeleteCommentCallback(true),
|
180
|
+
disabled: focusedBlog?.ownerID !== SDK_Globals.tmSession?.SessionDescr?.userID || focusedBlog === undefined || (focusedBlog && (focusedBlog.isDel !== undefined && focusedBlog.isDel !== 0)),
|
181
|
+
},
|
182
|
+
{
|
183
|
+
icon: "undo",
|
184
|
+
text: SDKUI_Localizator.Restore,
|
185
|
+
visible: contextMenuParams.isRestoreEnabled,
|
186
|
+
onClick: () => deleteOrUndeleteCommentCallback(false),
|
187
|
+
disabled: focusedBlog?.ownerID !== SDK_Globals.tmSession?.SessionDescr?.userID || focusedBlog === undefined || (focusedBlog && (focusedBlog.isDel === undefined || focusedBlog.isDel === 0)),
|
188
|
+
},
|
189
|
+
{
|
190
|
+
text: SDKUI_Localizator.CreateContextualTask,
|
191
|
+
icon: 'plus',
|
192
|
+
onClick: () => { if (showTaskFormCallback)
|
193
|
+
showTaskFormCallback(); },
|
194
|
+
visible: contextMenuParams.isCreateContextualTask,
|
195
|
+
disabled: false,
|
196
|
+
beginGroup: true
|
197
|
+
},
|
198
|
+
{
|
199
|
+
icon: "refresh",
|
200
|
+
text: SDKUI_Localizator.Refresh,
|
201
|
+
visible: contextMenuParams.isRefreshEnabled,
|
202
|
+
onClick: refresh,
|
203
|
+
disabled: false,
|
204
|
+
beginGroup: true
|
205
|
+
},
|
206
|
+
];
|
207
|
+
return menuItemsElements;
|
208
|
+
}, [isHeaderHidden, localShowId, setLocalShowId, focusedBlog]);
|
209
|
+
useEffect(() => {
|
210
|
+
if (currentWorkingGroup === undefined)
|
211
|
+
setNewPostCount(0);
|
212
|
+
else {
|
213
|
+
const postCount = newPosts?.find(d => d.id === currentWorkingGroup.id)?.count ?? 0;
|
214
|
+
setNewPostCount(postCount);
|
215
|
+
}
|
216
|
+
}, [currentWorkingGroup, newPosts]);
|
217
|
+
useEffect(() => {
|
218
|
+
if (showId !== undefined)
|
219
|
+
setLocalShowId(showId);
|
220
|
+
}, [showId]);
|
221
|
+
useEffect(() => {
|
222
|
+
if (setShowId)
|
223
|
+
setShowId(localShowId);
|
224
|
+
}, [localShowId]);
|
225
|
+
useEffect(() => {
|
226
|
+
setIsHeaderHidden(isHeaderFullyHidden(currentHeader));
|
227
|
+
}, [currentHeader]);
|
228
|
+
const getDcmtTypeDescriptor = async (blogPosts) => {
|
229
|
+
// Create a Map to store tid as key and DcmtTypeDescriptor as value
|
230
|
+
const dcmtTypeMap = new Map();
|
231
|
+
for (const blogPost of blogPosts) {
|
232
|
+
if (blogPost.attachments) {
|
233
|
+
for (const attachment of blogPost.attachments) {
|
234
|
+
try {
|
235
|
+
const dcmtTypeDescriptor = await DcmtTypeListCacheService.GetAsync(attachment.tid, true);
|
236
|
+
if (dcmtTypeDescriptor && attachment.tid) {
|
237
|
+
dcmtTypeMap.set(attachment.tid, dcmtTypeDescriptor);
|
238
|
+
}
|
239
|
+
}
|
240
|
+
catch (e) { }
|
241
|
+
}
|
242
|
+
}
|
243
|
+
}
|
244
|
+
return dcmtTypeMap;
|
245
|
+
};
|
246
|
+
useEffect(() => {
|
247
|
+
const fetchDcmtTypeDescriptor = async () => {
|
248
|
+
const descriptors = await getDcmtTypeDescriptor(blogPosts);
|
249
|
+
setDcmtTypeDescriptors(descriptors);
|
250
|
+
};
|
251
|
+
fetchDcmtTypeDescriptor();
|
252
|
+
if (updateVisualizedBlogCallback)
|
253
|
+
updateVisualizedBlogCallback(blogPosts);
|
254
|
+
}, [blogPosts]);
|
255
|
+
useEffect(() => {
|
256
|
+
const publishedBlogssLength = allData.filter(newsFeed => newsFeed.isSys !== 1 && newsFeed.isDel !== 1).length;
|
257
|
+
const systemBlogsLength = allData.filter(newsFeed => newsFeed.isSys === 1).length;
|
258
|
+
const deletedBlogsLength = allData.filter(newsFeed => newsFeed.isDel === 1).length;
|
259
|
+
setTreeDataSource([
|
260
|
+
{
|
261
|
+
id: TMBlogsFilterCategoryId.PublishedBlogs,
|
262
|
+
label: SDKUI_Localizator.Active + " (" + publishedBlogssLength + ")",
|
263
|
+
value: SDKUI_Localizator.Active,
|
264
|
+
},
|
265
|
+
{
|
266
|
+
id: TMBlogsFilterCategoryId.SystemBlogs,
|
267
|
+
label: SDKUI_Localizator.OfSystem + " (" + systemBlogsLength + ")",
|
268
|
+
value: SDKUI_Localizator.OfSystem,
|
269
|
+
},
|
270
|
+
{
|
271
|
+
id: TMBlogsFilterCategoryId.DeletedBlogs,
|
272
|
+
label: SDKUI_Localizator.Deleted + " (" + deletedBlogsLength + ")",
|
273
|
+
value: SDKUI_Localizator.Deleted,
|
274
|
+
},
|
275
|
+
]);
|
276
|
+
}, [allData]);
|
277
|
+
useEffect(() => {
|
278
|
+
// Helper function to check if a blog post is a system blog
|
279
|
+
const isActiveBlog = (blog) => blog.isSys !== 1 && blog.isDel !== 1;
|
280
|
+
// Helper function to check if a blog post is a system blog
|
281
|
+
const isSystemBlog = (blog) => blog.isSys === 1;
|
282
|
+
// Helper function to check if a blog post is marked as deleted
|
283
|
+
const isDeletedBlog = (blog) => blog.isDel === 1;
|
284
|
+
// Create a mapping of filter category IDs to their corresponding filter functions
|
285
|
+
const filters = {
|
286
|
+
[TMBlogsFilterCategoryId.PublishedBlogs]: isActiveBlog, // Map PublishedBlogs filter to the isActiveBlog function
|
287
|
+
[TMBlogsFilterCategoryId.SystemBlogs]: isSystemBlog, // Map SystemBlogs filter to the isSystemBlog function
|
288
|
+
[TMBlogsFilterCategoryId.DeletedBlogs]: isDeletedBlog, // Map DeletedBlogs filter to the isDeletedBlog function
|
289
|
+
};
|
290
|
+
// Function to apply filters to a single blog post
|
291
|
+
const applyFilters = (newsFeed) => {
|
292
|
+
// Check if the blog post matches the search text (case insensitive)
|
293
|
+
if (searchText && !(newsFeed.ownerName?.toLowerCase().includes(searchText.toLowerCase().trim())
|
294
|
+
|| newsFeed.description?.toLowerCase().includes(searchText.toLowerCase().trim())
|
295
|
+
|| newsFeed.id?.toString()?.toLowerCase().includes(searchText.toLowerCase().trim())
|
296
|
+
|| Globalization.getDateTimeDisplayValue(newsFeed.creationTime)?.toString()?.toLowerCase().includes(searchText.toLowerCase().trim())
|
297
|
+
|| newsFeed.header?.toString()?.toLowerCase().includes(searchText.toLowerCase().trim())
|
298
|
+
|| (newsFeed.attachments && newsFeed.attachments?.length > 0 && newsFeed.attachments.some((attachment) => findFileItemByDraftID(treeFs, attachment.draftID)?.name?.toLowerCase().includes(searchText.toLowerCase().trim())))
|
299
|
+
|| (newsFeed.attachments && newsFeed.attachments?.length > 0 && newsFeed.attachments.some((attachment) => attachment.tid && dcmtTypeDescriptors.get(attachment.tid)?.name?.toLowerCase().includes(searchText.toLowerCase().trim()))))) {
|
300
|
+
return false; // If the blog post doesn't match the search text, filter it out
|
301
|
+
}
|
302
|
+
// If no global filters are applied, exclude system and deleted blogs by default
|
303
|
+
if (appliedGlobalFilters.length === 0) {
|
304
|
+
return !isActiveBlog(newsFeed) && !isSystemBlog(newsFeed) && !isDeletedBlog(newsFeed);
|
305
|
+
}
|
306
|
+
// Check if the blog post matches any of the applied global filters
|
307
|
+
const matchesFilter = appliedGlobalFilters.some((filter) => filters[filter](newsFeed));
|
308
|
+
// Return true if it matches any applied filter or if it's neither a system nor a deleted blog
|
309
|
+
return matchesFilter || (!isActiveBlog(newsFeed) && !isSystemBlog(newsFeed) && !isDeletedBlog(newsFeed));
|
310
|
+
};
|
311
|
+
// Apply the filter logic to the complete list of blogs
|
312
|
+
let filteredBlogs = allData.filter(applyFilters);
|
313
|
+
if (currentHeader && currentHeader.showPostsDropDown) {
|
314
|
+
// Limit the results to the most recent postsToShow number of posts if the condition is true
|
315
|
+
filteredBlogs = filteredBlogs.slice(-postsToShow);
|
316
|
+
}
|
317
|
+
// Update the state with the filtered and limited list of blogs
|
318
|
+
setBlogPosts(filteredBlogs);
|
319
|
+
if (focusedBlog && focusedBlog.id && filteredBlogs.find(filteredBlog => focusedBlog.id === filteredBlog.id) === undefined)
|
320
|
+
setFocusedBlog(undefined);
|
321
|
+
}, [allData, appliedGlobalFilters, searchText, postsToShow, currentHeader]);
|
322
|
+
useEffect(() => {
|
323
|
+
if (viewMode)
|
324
|
+
setRenderMode(viewMode);
|
325
|
+
}, [viewMode]);
|
326
|
+
// Scroll the focused blog post into view
|
327
|
+
useEffect(() => {
|
328
|
+
if (focusedBlog && focusedBlog.id && containerRef.current) {
|
329
|
+
const focusedElement = document.getElementById(id + "-" + focusedBlog.id.toString());
|
330
|
+
if (focusedElement) {
|
331
|
+
focusedElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
332
|
+
}
|
333
|
+
}
|
334
|
+
}, [focusedBlog]);
|
335
|
+
const ThumbnailView = () => {
|
336
|
+
const scrollRef = useRef(null);
|
337
|
+
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
|
338
|
+
useEffect(() => {
|
339
|
+
if (focusedBlog && focusedBlog.id) { // containerRef.current
|
340
|
+
const focusedElement = document.getElementById(focusedBlog.id.toString());
|
341
|
+
if (focusedElement) {
|
342
|
+
focusedElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
343
|
+
}
|
344
|
+
}
|
345
|
+
else {
|
346
|
+
if (scrollToBottom && scrollRef.current) {
|
347
|
+
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
348
|
+
}
|
349
|
+
}
|
350
|
+
}, [blogPosts, viewMode, focusedBlog]);
|
351
|
+
const attachmentDetails = (attachments, isSelected) => {
|
352
|
+
return _jsx("div", { style: { marginTop: "10px", overflow: "hidden" }, children: attachments.map(attachment => {
|
353
|
+
return AttachmentElement(attachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText, color, handleClickAttachmentFolderFileCallback, downloadDcmtsAsync);
|
354
|
+
}) });
|
355
|
+
};
|
356
|
+
return _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsx("div", { ref: scrollRef, style: { backgroundColor: "rgba(191, 191, 191, 0.15)", height: "100%", padding: "5px", overflowY: "auto", width: "100%" }, children: blogPosts.length === 0 ?
|
357
|
+
_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), searchText.length > 0 ?
|
358
|
+
_jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoMessagesFound }) :
|
359
|
+
_jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoMessages })] })
|
360
|
+
: blogPosts.map((blogPost, index) => {
|
361
|
+
const isSelected = focusedBlog?.id === blogPost.id;
|
362
|
+
const isNew = index >= blogPosts.length - newPostCount;
|
363
|
+
const backgroundColors = {
|
364
|
+
default: colors.LIGHT_GRAY,
|
365
|
+
selectedItems: isSelected ? color ?? colors.PRIMARY_BLUE : colors.PRIMARY_BLUE,
|
366
|
+
};
|
367
|
+
let bgColor = isSelected ? backgroundColors.selectedItems : backgroundColors.default;
|
368
|
+
let textColor = blogPost.isSys ? colors.RED : isSelected ? colors.WHITE : colors.BLACK;
|
369
|
+
let iconColor = textColor;
|
370
|
+
const classID = blogPost.classID;
|
371
|
+
if (classID) {
|
372
|
+
if (classID === 'DS')
|
373
|
+
iconColor = isSelected ? colors.WHITE : colors.PRIMARY_ORANGE;
|
374
|
+
if (classID === 'WG')
|
375
|
+
iconColor = isSelected ? colors.WHITE : colors.PRIMARY_GREEN;
|
376
|
+
}
|
377
|
+
const canNavigate = () => {
|
378
|
+
return Boolean(handleNavigateToWGs && id && classID === 'WG');
|
379
|
+
};
|
380
|
+
const headerClickCallback = () => {
|
381
|
+
const id = blogPost.id;
|
382
|
+
if (handleNavigateToWGs && id && classID === 'WG')
|
383
|
+
handleNavigateToWGs(id);
|
384
|
+
};
|
385
|
+
const onClickCallback = () => {
|
386
|
+
setFocusedBlog(blogPost);
|
387
|
+
};
|
388
|
+
const handleKeyDown = (event) => {
|
389
|
+
event.preventDefault();
|
390
|
+
if (event.key === 'ArrowDown' && focusedBlog) {
|
391
|
+
const currentIndex = blogPosts.findIndex(post => post.id === focusedBlog.id);
|
392
|
+
if (blogPosts[currentIndex + 1]) {
|
393
|
+
setFocusedBlog(blogPosts[currentIndex + 1]);
|
394
|
+
}
|
395
|
+
;
|
396
|
+
}
|
397
|
+
};
|
398
|
+
const handleKeyUp = (event) => {
|
399
|
+
event.preventDefault();
|
400
|
+
if (event.key === 'ArrowUp' && focusedBlog) {
|
401
|
+
const currentIndex = blogPosts.findIndex(post => post.id === focusedBlog.id);
|
402
|
+
if (blogPosts[currentIndex - 1]) {
|
403
|
+
setFocusedBlog(blogPosts[currentIndex - 1]);
|
404
|
+
}
|
405
|
+
;
|
406
|
+
}
|
407
|
+
};
|
408
|
+
return (_jsxs(BlogPostContainer, { id: id + "-" + blogPost.id.toString(), ref: containerRef, "$color": textColor, "$textDecoration": blogPost.isDel ? 'line-through' : 'none', "$backgroundColor": bgColor, "$isNew": Boolean(blogPost.newPosts ?? 0) || isNew, "$canNavigate": canNavigate(), onClick: onClickCallback, onDoubleClick: headerClickCallback, tabIndex: 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, children: [_jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [OwnerInitialsBadge(blogPost), _jsx("div", { style: { flex: "1 1 auto", minWidth: "0" }, children: _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', flexWrap: "wrap", overflow: "hidden" }, children: [_jsxs("div", { children: [_jsxs("div", { style: { fontWeight: "bold", fontSize: "13px", display: "flex", alignItems: "center" }, children: [(showIconHeader && (blogPost.header && blogPost.classID))
|
409
|
+
? (IconAndHeaderElement(blogPost, iconColor, isSelected, headerClickCallback, searchText)) :
|
410
|
+
_jsx("span", { style: { marginLeft: showIconHeader ? "5px" : "0" }, children: highlightText(blogPost.ownerName ?? '', searchText, isSelected) }), (blogPost?.newPosts ?? 0) > 0 && (_jsx("div", { style: {
|
411
|
+
marginLeft: "5px",
|
412
|
+
width: "20px",
|
413
|
+
height: "20px",
|
414
|
+
display: "flex",
|
415
|
+
alignItems: "center",
|
416
|
+
justifyContent: "center",
|
417
|
+
backgroundColor: color,
|
418
|
+
color: "white",
|
419
|
+
boxShadow: "1px 1px 2px #00000020",
|
420
|
+
borderRadius: "30px",
|
421
|
+
fontWeight: "bold",
|
422
|
+
}, children: blogPost.newPosts }))] }), _jsxs("div", { style: { fontSize: "12px" }, children: [(showIconHeader && (blogPost.header && blogPost.classID)) && _jsxs("span", { style: { marginLeft: showIconHeader ? "5px" : "0" }, children: [blogPost.ownerName, _jsx("span", { style: { margin: "0 5px" }, children: "\u2501" })] }), blogPost.creationTime
|
423
|
+
? highlightText(`${Globalization.getDateTimeDisplayValue(blogPost.creationTime)} ${new Date(blogPost.creationTime).toDateString() === new Date().toDateString() ? "(" + SDKUI_Localizator.Today + ")" : ''}`, searchText, isSelected)
|
424
|
+
: '', localShowId && _jsxs("span", { children: [_jsx("span", { style: { margin: "0 5px" }, children: "\u2501" }), _jsxs("span", { children: ["(ID: ", blogPost.id, ")"] })] })] })] }), (blogPost.attachments && showExtendedAttachments === false) &&
|
425
|
+
_jsx("div", { style: { marginTop: "10px", fontSize: "13px", display: "flex", justifyContent: "flex-end" }, children: _jsx(TMTooltip, { content: SDKUI_Localizator.Attachments + ": " + blogPost.attachments.length, children: _jsx(IconAttachment, { fontSize: 20, color: isSelected ? '#fff' : color }) }) })] }) })] }), _jsx("div", { style: { marginTop: "10px", fontSize: "13px" }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), (showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0) && attachmentDetails(blogPost.attachments, isSelected)] }, id + "-" + blogPost.id));
|
426
|
+
}) }) });
|
427
|
+
};
|
428
|
+
const DataGridView = () => {
|
429
|
+
const gridRef = useRef(null);
|
430
|
+
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
|
431
|
+
useEffect(() => {
|
432
|
+
if (gridRef.current && renderMode === 'details') {
|
433
|
+
const dataGrid = gridRef.current.instance();
|
434
|
+
dataGrid.repaint(); // Repaint the grid first
|
435
|
+
}
|
436
|
+
if (scrollToBottom && gridRef.current) {
|
437
|
+
const dataGrid = gridRef.current.instance();
|
438
|
+
const scrollable = dataGrid.getScrollable();
|
439
|
+
if (scrollable && scrollable.scrollHeight()) {
|
440
|
+
// Wait for repaint to finish (if repaint causes a reflow/re-rendering of the grid)
|
441
|
+
setTimeout(() => {
|
442
|
+
scrollable.scrollTo({ y: scrollable.scrollHeight() });
|
443
|
+
}, 0); // Use setTimeout with 0 delay to defer scrolling until after repaint
|
444
|
+
}
|
445
|
+
}
|
446
|
+
}, [renderMode, scrollToBottom]); // Ensure to include scrollToBottom in the dependency array
|
447
|
+
const cellDefaultRender = useCallback((cellData) => {
|
448
|
+
const blogPost = cellData.data;
|
449
|
+
const { isDel, isSys } = blogPost;
|
450
|
+
return _jsx("div", { style: { color: isSys ? colors.RED : colors.BLACK, textDecoration: isDel ? 'line-through' : 'none' }, children: highlightText(cellData.value, searchText, false) });
|
451
|
+
}, [searchText]);
|
452
|
+
const cellOwnerRender = useCallback((cellData) => {
|
453
|
+
const blogPost = cellData.data;
|
454
|
+
const { isDel, isSys } = blogPost;
|
455
|
+
return _jsxs("span", { style: { display: 'inline-flex', alignItems: 'center', }, children: [OwnerInitialsBadge(blogPost), _jsx("span", { style: { color: isSys ? colors.RED : colors.BLACK, textDecoration: isDel ? 'line-through' : 'none', display: 'inline-block' }, children: highlightText(cellData.value, searchText, false) })] });
|
456
|
+
}, [searchText]);
|
457
|
+
const cellDescriptionRender = useCallback((cellData) => {
|
458
|
+
const blogPost = cellData.data;
|
459
|
+
const { isDel, isSys } = blogPost;
|
460
|
+
return _jsx("span", { style: { color: isSys ? colors.RED : colors.BLACK, textDecoration: isDel ? 'line-through' : 'none' }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: false }) });
|
461
|
+
}, [searchText]);
|
462
|
+
const cellClassIdRender = useCallback((cellData) => {
|
463
|
+
const blogPost = cellData.data;
|
464
|
+
let textColor = blogPost.isSys ? colors.RED : colors.BLACK;
|
465
|
+
let iconColor = textColor;
|
466
|
+
const classID = blogPost.classID;
|
467
|
+
if (classID) {
|
468
|
+
if (classID === 'DS')
|
469
|
+
iconColor = colors.PRIMARY_ORANGE;
|
470
|
+
if (classID === 'WG')
|
471
|
+
iconColor = colors.PRIMARY_GREEN;
|
472
|
+
}
|
473
|
+
const headerClickCallback = () => {
|
474
|
+
const id = blogPost.id;
|
475
|
+
if (handleNavigateToWGs && id && classID === 'WG')
|
476
|
+
handleNavigateToWGs(id);
|
477
|
+
};
|
478
|
+
return IconAndHeaderElement(blogPost, iconColor, false, headerClickCallback, searchText);
|
479
|
+
}, []);
|
480
|
+
const cellAttachmentsRender = useCallback((cellData) => {
|
481
|
+
const data = cellData.data;
|
482
|
+
const { attachments } = data;
|
483
|
+
return _jsx("div", { style: { marginTop: "10px", overflow: "hidden" }, children: (attachments && attachments.length > 0) ? attachments.map(attachment => {
|
484
|
+
return AttachmentElement(attachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, false, searchText, color, handleClickAttachmentFolderFileCallback, downloadDcmtsAsync);
|
485
|
+
}) : '' });
|
486
|
+
}, [treeFs, draftLatestInfoMap, dcmtTypeDescriptors, color, handleClickAttachmentFolderFileCallback, searchText]);
|
487
|
+
const cellDatetimeRender = useCallback((cellData) => {
|
488
|
+
const data = cellData.data;
|
489
|
+
const { value } = cellData;
|
490
|
+
const { isDel, isSys } = data;
|
491
|
+
const formattedDate = value ? new Date(value).toLocaleString('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' }) : '';
|
492
|
+
return _jsx("div", { style: { color: isSys ? colors.RED : colors.BLACK, textDecoration: isDel ? 'line-through' : 'none' }, children: formattedDate });
|
493
|
+
}, []);
|
494
|
+
// Handles focus change in the data grid
|
495
|
+
const onFocusedRowChanged = useCallback((e) => {
|
496
|
+
if (e.row)
|
497
|
+
setFocusedBlog(e.row.data);
|
498
|
+
}, []);
|
499
|
+
const onContextMenuPreparing = (e) => {
|
500
|
+
if (e === undefined)
|
501
|
+
return;
|
502
|
+
if (e.target === 'content') {
|
503
|
+
e.items = e.items || [];
|
504
|
+
e.items = contextMenuItems;
|
505
|
+
}
|
506
|
+
};
|
507
|
+
const dataColumns = useMemo(() => {
|
508
|
+
return [
|
509
|
+
{ dataField: "id", caption: "ID", dataType: 'string', visible: localShowId, cellRender: cellDefaultRender },
|
510
|
+
{ dataField: "ownerName", caption: SDKUI_Localizator.Author, dataType: 'string', visible: true, cellRender: cellOwnerRender },
|
511
|
+
{ dataField: "classID", caption: SDKUI_Localizator.Type, dataType: 'string', visible: showIconHeader, cellRender: cellClassIdRender },
|
512
|
+
{ dataField: "description", caption: SDKUI_Localizator.Description, dataType: 'string', visible: true, cellRender: cellDescriptionRender },
|
513
|
+
{ dataField: "creationTime", caption: SDKUI_Localizator.CreationTime, dataType: 'datetime', visible: true, format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
|
514
|
+
{ dataField: "attachments", caption: SDKUI_Localizator.RefersTo, dataType: 'string', visible: true, cellRender: cellAttachmentsRender },
|
515
|
+
];
|
516
|
+
}, [localShowId, showIconHeader, searchText]);
|
517
|
+
return _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsx(TMDataGrid, { ref: gridRef, showSearchPanel: false, dataSource: blogPosts ?? [], dataColumns: dataColumns, selection: { mode: 'none' }, focusedRowKey: focusedBlog?.id, onFocusedRowChanged: onFocusedRowChanged, showRowLines: SDKUI_Globals.dataGridShowRowLines, showColumnLines: SDKUI_Globals.dataGridShowColumnLines, onContextMenuPreparing: onContextMenuPreparing }) });
|
518
|
+
};
|
519
|
+
const toggleViewMode = () => {
|
520
|
+
setRenderMode((prevViewMode) => (prevViewMode === 'details' ? 'thumbnails' : 'details'));
|
521
|
+
};
|
522
|
+
// Function to handle changes in the search text
|
523
|
+
const handleSearchChange = (value) => {
|
524
|
+
setSearchText(value); // Update the search text state with the new value
|
525
|
+
};
|
526
|
+
// Function to handle changes in the filter (number of posts to show)
|
527
|
+
const handleFilterChange = (e) => {
|
528
|
+
if (!e?.target?.value)
|
529
|
+
return;
|
530
|
+
const value = e.target.value;
|
531
|
+
if (value !== undefined) {
|
532
|
+
setPostsToShow(Number(value));
|
533
|
+
}
|
534
|
+
};
|
535
|
+
const onContextMenu = (event) => {
|
536
|
+
if (event === undefined)
|
537
|
+
return;
|
538
|
+
event.preventDefault();
|
539
|
+
setAnchorEl(event.currentTarget);
|
540
|
+
setMenuItems(contextMenuItems);
|
541
|
+
};
|
542
|
+
// Handle closing the context menu
|
543
|
+
const closeContextMenu = useCallback(() => {
|
544
|
+
setAnchorEl(null);
|
545
|
+
}, []);
|
546
|
+
return _jsx("div", { style: { height: height ?? '100%', width: width ?? '100%' }, children: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: [(currentHeader && !isHeaderHidden) && (_jsx("div", { style: { display: 'block', width: '100%', overflowX: 'auto', overflowY: 'hidden', whiteSpace: 'nowrap' }, children: _jsx(ScrollView, { width: "100%", height: "auto", direction: "horizontal", useNative: true, children: _jsxs("div", { style: {
|
547
|
+
display: 'flex',
|
548
|
+
flexDirection: 'row',
|
549
|
+
gap: '8px',
|
550
|
+
alignItems: 'center',
|
551
|
+
minWidth: 'max-content',
|
552
|
+
padding: '10px 0',
|
553
|
+
}, children: [currentHeader.showSearchBar && (_jsx("div", { style: {
|
554
|
+
minWidth: isMobile ? '120px' : '160px',
|
555
|
+
maxWidth: isMobile ? '120px' : '200px',
|
556
|
+
marginLeft: "10px"
|
557
|
+
}, children: _jsx(TMSearchBar, { marginLeft: "0px", maxWidth: "100%", searchValue: searchText, onSearchValueChanged: (e) => handleSearchChange(e) }) })), currentHeader.showPostsDropDown && (_jsx("div", { style: {
|
558
|
+
minWidth: isMobile ? '90px' : '120px',
|
559
|
+
maxWidth: isMobile ? '90px' : '200px',
|
560
|
+
}, children: _jsx(TMDropDown, { value: postsToShow, dataSource: postsToShowDataSource, onValueChanged: handleFilterChange }) })), currentHeader.showFilters && (_jsx(TMTreeDropDown, { dataSource: treeDataSource, values: appliedGlobalFilters, setValues: setAppliedGlobalFilters, displayExpr: false, isValidKey: () => true, elementStyle: {
|
561
|
+
minWidth: isMobile ? '90px' : '120px',
|
562
|
+
width: isMobile ? '90px' : '150px',
|
563
|
+
height: '29px',
|
564
|
+
} }))] }) }) })), _jsxs("div", { style: { height: `calc(100% - ${currentHeader && !isHeaderHidden ? '50px' : '0px'})`, width: "100%", overflow: 'auto', display: 'block' }, children: [_jsx("div", { style: { display: renderMode === 'thumbnails' ? 'block' : 'none', width: "100%", height: "100%" }, onContextMenu: onContextMenu, children: ThumbnailView() }), _jsx("div", { style: { display: renderMode === 'details' ? 'block' : 'none', width: "100%", height: "100%" }, children: DataGridView() }), anchorEl && _jsx(ContextMenu, { dataSource: menuItems, target: anchorEl, onHiding: closeContextMenu })] })] }) });
|
565
|
+
};
|
566
|
+
export default TMBlogs;
|