@topconsultnpm/sdkui-react-beta 6.12.141 → 6.12.143
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.
@@ -17,6 +17,7 @@ import { AttachmentElement, BlogPostContainer, colors, findFileItemByDraftID, hi
|
|
17
17
|
import { useDcmtOperations } from '../../hooks/useDcmtOperations';
|
18
18
|
import { DownloadTypes } from '../../ts';
|
19
19
|
import TMDcmtForm from '../features/documents/TMDcmtForm';
|
20
|
+
import { FontSize } from '../../utils/theme';
|
20
21
|
let localAbortController = new AbortController();
|
21
22
|
const TMBlogs = (props) => {
|
22
23
|
const { id, allData, showExtendedAttachments = true, treeFs, draftLatestInfoMap, archivedDocumentMap, updateVisualizedBlogCallback, height, width, scrollToBottom = true, viewMode = 'thumbnails', header, showIconHeader = true, color = colors.PRIMARY_BLUE, handleNavigateToWGs, showId, setShowId, currentWorkingGroup, contextMenuParams = {
|
@@ -445,7 +446,7 @@ const TMBlogs = (props) => {
|
|
445
446
|
setAnchorEl(e.currentTarget);
|
446
447
|
handleFocusedAttachment(undefined);
|
447
448
|
};
|
448
|
-
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, onContextMenu: onContextMenu, 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:
|
449
|
+
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, onContextMenu: onContextMenu, 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: FontSize.defaultFontSize, display: "flex", alignItems: "center" }, children: [(showIconHeader && (blogPost.header && blogPost.classID))
|
449
450
|
? (IconAndHeaderElement(blogPost, iconColor, isSelected, headerClickCallback, searchText)) :
|
450
451
|
_jsx("span", { style: { marginLeft: showIconHeader ? "5px" : "0" }, children: highlightText(blogPost.ownerName ?? '', searchText, isSelected) }), (blogPost?.newPosts ?? 0) > 0 && (_jsx("div", { style: {
|
451
452
|
marginLeft: "5px",
|
@@ -462,7 +463,7 @@ const TMBlogs = (props) => {
|
|
462
463
|
}, 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
|
463
464
|
? highlightText(SDKUI_Localizator.WrittenOn + " " + `${Globalization.getDateTimeDisplayValue(blogPost.creationTime)} ${new Date(blogPost.creationTime).toDateString() === new Date().toDateString() ? "(" + SDKUI_Localizator.Today + ")" : ''}`, searchText, isSelected)
|
464
465
|
: '', localShowId && _jsxs("span", { children: [_jsx("span", { style: { margin: "0 5px" }, children: "\u2501" }), _jsxs("span", { children: ["(ID: ", blogPost.id, ")"] })] })] })] }), (blogPost.attachments && showExtendedAttachments === false) &&
|
465
|
-
_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:
|
466
|
+
_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: FontSize.defaultFontSize }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), (showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0) && attachmentDetails(blogPost.attachments, isSelected)] }, id + "-" + blogPost.id));
|
466
467
|
}) }) });
|
467
468
|
};
|
468
469
|
const DataGridView = () => {
|
package/lib/helper/TMUtils.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const getFileIcon: (fileExtension: string | undefined, fileCount: number | undefined) => import("react/jsx-runtime").JSX.Element;
|
1
|
+
export declare const getFileIcon: (fileExtension: string | undefined, fileCount: number | undefined, tooltipContent?: JSX.Element | string) => import("react/jsx-runtime").JSX.Element;
|
2
2
|
export declare function formatBytes(bytes: number | undefined, decimalPlaces?: number): string;
|
package/lib/helper/TMUtils.js
CHANGED
@@ -23,7 +23,7 @@ const StyledIconFileExt = styled.div `
|
|
23
23
|
position: absolute;
|
24
24
|
height: 12px;
|
25
25
|
`;
|
26
|
-
export const getFileIcon = (fileExtension, fileCount) => {
|
26
|
+
export const getFileIcon = (fileExtension, fileCount, tooltipContent) => {
|
27
27
|
if (!fileExtension)
|
28
28
|
fileExtension = "";
|
29
29
|
if (fileExtension.startsWith("."))
|
@@ -82,7 +82,7 @@ export const getFileIcon = (fileExtension, fileCount) => {
|
|
82
82
|
}
|
83
83
|
return (_jsx(StyledIconFileContainer, { children: _jsx(StyledIconFileExt, { "$backgroundColor": fileCount == 0 ? "#424040" : fileBgColor, "$color": fileColor, children: fileCount == 0
|
84
84
|
? _jsxs(TMTooltip, { content: "Documento di soli metadati", children: [" ", _jsx(IconKey, { fontSize: 17, color: '#f8d775' }), " "] })
|
85
|
-
: _jsx(TMTooltip, { content: fileExtOri, children: fileExtension.toUpperCase() }) }) }));
|
85
|
+
: _jsx(TMTooltip, { content: tooltipContent ?? fileExtOri, children: fileExtension.toUpperCase() }) }) }));
|
86
86
|
};
|
87
87
|
export function formatBytes(bytes, decimalPlaces = 2) {
|
88
88
|
if (!bytes)
|