@topconsultnpm/sdkui-react-beta 6.12.140 → 6.12.142
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/helper/TMUtils.d.ts +1 -1
- package/lib/helper/TMUtils.js +2 -2
- package/package.json +1 -1
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)
|