@topconsultnpm/sdkui-react-beta 6.15.35 → 6.15.36

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.
@@ -18,7 +18,7 @@ const TMDataGrid = React.forwardRef((props, ref) => {
18
18
  // custom options
19
19
  dataColumns = [], pageSize = TMDataGridPageSize.Large, showHeaderFilter = true, showFilterPanel = false, showLoadPanel = true, showSearchPanel = true, searchPanelToolbarPosition = 'before', counterConfig = { show: false, items: new Map() },
20
20
  // events and callbacks
21
- onSelectionChanged, onFocusedRowChanged, onRowDblClick, onRowClick, onCellClick, onOptionChanged, onContentReady, onContextMenuPreparing, onInitialized, onEditorPreparing, onCellPrepared, onRowPrepared, onRowUpdating, onRowExpanded, onRowCollapsed, onRowUpdated, onSaved, onEditCanceled, onEditingStart, onEditingChange, customizeColumns, onKeyDown, scrolling = { mode: 'standard', useNative: SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar === 1 }, paging = { enabled: true, pageSize: pageSize }, pager = { visible: true, showInfo: true, showNavigationButtons: true }, selection = { mode: 'multiple', showCheckBoxesMode: "always", selectAllMode: "allPages" }, sorting, summary, stateStoring, columnChooser, grouping, groupPanel, filterRow, headerFilter, editing, rowDragging, masterDetail,
21
+ onSelectionChanged, onFocusedRowChanged, onRowDblClick, onRowClick, onCellClick, onCellDblClick, onOptionChanged, onContentReady, onContextMenuPreparing, onInitialized, onEditorPreparing, onCellPrepared, onRowPrepared, onRowUpdating, onRowExpanded, onRowCollapsed, onRowUpdated, onSaved, onEditCanceled, onEditingStart, onEditingChange, customizeColumns, onKeyDown, scrolling = { mode: 'standard', useNative: SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar === 1 }, paging = { enabled: true, pageSize: pageSize }, pager = { visible: true, showInfo: true, showNavigationButtons: true }, selection = { mode: 'multiple', showCheckBoxesMode: "always", selectAllMode: "allPages" }, sorting, summary, stateStoring, columnChooser, grouping, groupPanel, filterRow, headerFilter, editing, rowDragging, masterDetail,
22
22
  // other properties
23
23
  disabled = false, autoNavigateToFocusedRow = true, columnResizingMode = 'widget', columnHidingEnabled = true, columnAutoWidth = true, allowColumnResizing = true, allowColumnReordering = true, showBorders = true, showRowLines = SDKUI_Globals.userSettings?.themeSettings.gridSettings.showRowLines === 1, showColumnLines = SDKUI_Globals.userSettings?.themeSettings.gridSettings.showColumnLines === 1, showColumnHeaders = true, rowAlternationEnabled = false, wordWrapEnabled = false, noDataText,
24
24
  // styles
@@ -155,7 +155,7 @@ const TMDataGrid = React.forwardRef((props, ref) => {
155
155
  // main properties
156
156
  keyExpr: keyExpr, dataSource: dataSource, selectedRowKeys: selectedRowKeys, focusedRowEnabled: focusedRowEnabled, hoverStateEnabled: hoverStateEnabled,
157
157
  // events and callbacks
158
- onSelectionChanged: onSelectionChangedCallback, onRowDblClick: onRowDblClickCallback, onRowPrepared: onRowPrepared, onContextMenuPreparing: onContextMenuPreparingCallback, onToolbarPreparing: onToolbarPreparingCallback, onFocusedRowChanged: onFocusedRowChanged, onRowClick: onRowClick, onCellClick: onCellClick, onOptionChanged: onOptionChanged, onContentReady: onContentReady, onInitialized: onInitialized, customizeColumns: customizeColumns, onEditorPreparing: onEditorPreparing, onCellPrepared: onCellPrepared, onRowUpdating: onRowUpdating, onRowExpanded: onRowExpanded, onRowCollapsed: onRowCollapsed, onRowUpdated: onRowUpdated, onSaved: onSaved, onEditCanceled: onEditCanceled, onEditingStart: onEditingStart, onEditingChange: onEditingChange, onKeyDown: onKeyDown,
158
+ onSelectionChanged: onSelectionChangedCallback, onRowDblClick: onRowDblClickCallback, onRowPrepared: onRowPrepared, onContextMenuPreparing: onContextMenuPreparingCallback, onToolbarPreparing: onToolbarPreparingCallback, onFocusedRowChanged: onFocusedRowChanged, onRowClick: onRowClick, onCellClick: onCellClick, onCellDblClick: onCellDblClick, onOptionChanged: onOptionChanged, onContentReady: onContentReady, onInitialized: onInitialized, customizeColumns: customizeColumns, onEditorPreparing: onEditorPreparing, onCellPrepared: onCellPrepared, onRowUpdating: onRowUpdating, onRowExpanded: onRowExpanded, onRowCollapsed: onRowCollapsed, onRowUpdated: onRowUpdated, onSaved: onSaved, onEditCanceled: onEditCanceled, onEditingStart: onEditingStart, onEditingChange: onEditingChange, onKeyDown: onKeyDown,
159
159
  // other properties
160
160
  disabled: disabled, autoNavigateToFocusedRow: autoNavigateToFocusedRow, focusedRowKey: focusedRowKey, columnHidingEnabled: columnHidingEnabled, columnResizingMode: columnResizingMode, columnAutoWidth: columnAutoWidth, allowColumnResizing: allowColumnResizing, allowColumnReordering: allowColumnReordering, showBorders: showBorders, showRowLines: showRowLines, showColumnLines: showColumnLines, showColumnHeaders: showColumnHeaders, rowAlternationEnabled: rowAlternationEnabled, wordWrapEnabled: wordWrapEnabled, noDataText: noDataText,
161
161
  // styles
@@ -1,16 +1,17 @@
1
1
  import { DcmtInfo, DownloadModes, DownloadTypes } from '../../../ts';
2
2
  import { FileDescriptor } from '@topconsultnpm/sdk-ts-beta';
3
3
  interface ITMDcmtIconProps {
4
- fileExtension: string | undefined;
5
- fileCount: number | undefined;
6
- isLexProt: number | undefined;
7
- isSigned: number | undefined;
8
- isMail: number | undefined;
9
- isShared: number | undefined;
4
+ fileExtension?: string | undefined;
5
+ fileCount?: number | undefined;
6
+ isLexProt?: number | undefined;
7
+ isSigned?: number | undefined;
8
+ isMail?: number | undefined;
9
+ isShared?: number | undefined;
10
10
  tid?: number;
11
11
  did?: number;
12
12
  downloadMode?: DownloadModes;
13
+ tooltipContent?: JSX.Element | string;
13
14
  onDownloadDcmtsAsync?: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => Promise<void>;
14
15
  }
15
- declare const TMDcmtIcon: ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode, onDownloadDcmtsAsync }: ITMDcmtIconProps) => import("react/jsx-runtime").JSX.Element;
16
+ declare const TMDcmtIcon: ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode, tooltipContent, onDownloadDcmtsAsync }: ITMDcmtIconProps) => import("react/jsx-runtime").JSX.Element;
16
17
  export default TMDcmtIcon;
@@ -15,13 +15,13 @@ const StyledCellRenderDcmtIcon = styled.div `
15
15
  overflow: visible;
16
16
  position: relative;
17
17
  `;
18
- const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode = "none", onDownloadDcmtsAsync }) => {
18
+ const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode = "none", tooltipContent, onDownloadDcmtsAsync }) => {
19
19
  const { downloadDcmtsAsync, showWaitPanel, waitPanelTitle, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, abortController } = useDcmtOperations();
20
20
  const deviceType = useDeviceType();
21
21
  let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
22
22
  const icon = useMemo(() => {
23
- return getFileIcon(isMail == 2 ? "PEC" : fileExtension, fileCount);
24
- }, [fileExtension, fileCount, isMail]);
23
+ return getFileIcon(isMail == 2 ? "PEC" : fileExtension, fileCount, tooltipContent);
24
+ }, [fileExtension, fileCount, isMail, tooltipContent]);
25
25
  // Gestore unificato per l'azione di download (click singolo su mobile, doppio click su desktop)
26
26
  const handleDownloadAction = useCallback(async (e) => {
27
27
  e.stopPropagation();
@@ -436,7 +436,7 @@ const TMBlogs = (props) => {
436
436
  }, [blogPosts, focusedBlog, rightClickedOnBackground]);
437
437
  const attachmentDetails = (attachments, isSelected) => {
438
438
  return _jsx("div", { style: { marginTop: "10px", overflow: "hidden" }, children: attachments.map(attachment => {
439
- return AttachmentElement(attachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText, color, downloadDcmtsAsync, handleFocusedAttachment, setAnchorEl, contextMenuRef);
439
+ return AttachmentElement(attachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText, color, setShowDcmtForm, handleFocusedAttachment, setAnchorEl, contextMenuRef);
440
440
  }) });
441
441
  };
442
442
  const renderBlogPostContent = (blogPost, index, isOwnComment) => {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { BlogPost, BlogPostAttachment, DcmtTypeDescriptor, HomeBlogPost, TID_DID, WorkingGroupDescriptor } from "@topconsultnpm/sdk-ts-beta";
3
3
  import { FileItem } from '../base/TMFileManager';
4
- import { DcmtInfo, DownloadModes, DownloadTypes } from '../../ts';
4
+ import { DcmtInfo } from '../../ts';
5
5
  import { ContextMenuRef } from 'devextreme-react/cjs/context-menu';
6
6
  export declare const DRAFT_TYPE_TID = 6;
7
7
  export type TMBlogContextDescriptor = {
@@ -84,7 +84,7 @@ export declare const AttachmentElement: (attachment: BlogPostAttachment, treeFs:
84
84
  did: number;
85
85
  fileExt: string;
86
86
  fileSize: string;
87
- }> | undefined, dcmtTypeDescriptors: Map<number, DcmtTypeDescriptor>, isSelected: boolean, searchText: string, color: string, downloadDcmtsAsync: (inputDcmts: Array<DcmtInfo> | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes) => Promise<void>, handleFocusedAttachment: (attachment: DcmtInfo | undefined) => void, setAnchorEl: (value: React.SetStateAction<HTMLElement | null>) => void, contextMenuRef: React.MutableRefObject<ContextMenuRef<any> | null>) => import("react/jsx-runtime").JSX.Element;
87
+ }> | 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;
88
88
  export declare const OwnerInitialsBadge: (blogPost: BlogPost | HomeBlogPost) => import("react/jsx-runtime").JSX.Element;
89
89
  export declare const IconAndHeaderElement: (blogPost: BlogPost | HomeBlogPost, iconColor: string, isSelected: boolean, headerClickCallback: () => void, searchText: string) => import("react/jsx-runtime").JSX.Element;
90
90
  export declare const findFileItemByDraftID: (tree: FileItem | undefined, draftID: number | undefined) => FileItem | null;
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import styled from "styled-components";
3
3
  import { SDK_Globals } from "@topconsultnpm/sdk-ts-beta";
4
- import { extractInitialsFromName, formatBytes, getAvatarColor, getFileIcon, IconAttachment, IconCADossier, IconMenuCAWorkingGroups, SDKUI_Localizator } from "../../helper";
4
+ import { extractInitialsFromName, formatBytes, getAvatarColor, IconAttachment, IconCADossier, IconMenuCAWorkingGroups, SDKUI_Localizator } from "../../helper";
5
5
  import TMTooltip from "../base/TMTooltip";
6
- import { DownloadTypes } from '../../ts';
7
6
  import { TMColors } from '../../utils/theme';
7
+ import TMDcmtIcon from '../features/documents/TMDcmtIcon';
8
8
  export const DRAFT_TYPE_TID = 6;
9
9
  export const colors = {
10
10
  DARK_BLUE: "#1a0dab",
@@ -138,15 +138,15 @@ export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archiv
138
138
  }
139
139
  return { name, nameElement, tooltipContent, folderId, fileExt, draftExist, archivedDocumentsExist };
140
140
  };
141
- export const AttachmentElement = (attachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText, color, downloadDcmtsAsync, handleFocusedAttachment, setAnchorEl, contextMenuRef) => {
141
+ export const AttachmentElement = (attachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText, color, setShowDcmtForm, handleFocusedAttachment, setAnchorEl, contextMenuRef) => {
142
142
  const { name, nameElement, tooltipContent, folderId, fileExt, draftExist } = getAttachmentInfo(attachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText, color);
143
143
  const onDoubleClick = (e) => {
144
144
  e.preventDefault();
145
145
  e.stopPropagation();
146
146
  const archiveID = SDK_Globals.tmSession?.SessionDescr?.archiveID;
147
147
  const fileName = `${removeFileExtension(name)}_${archiveID}_${attachment.tid}_${attachment.did}.${fileExt}`;
148
- if (downloadDcmtsAsync)
149
- downloadDcmtsAsync([{ TID: attachment.tid, DID: attachment.did, fileName }], DownloadTypes.Dcmt, "download");
148
+ handleFocusedAttachment({ TID: attachment.tid, DID: attachment.did, fileName });
149
+ setShowDcmtForm(true);
150
150
  };
151
151
  const onContextMenu = (e) => {
152
152
  const archiveID = SDK_Globals.tmSession?.SessionDescr?.archiveID;
@@ -175,7 +175,7 @@ export const AttachmentElement = (attachment, treeFs, draftLatestInfoMap, archiv
175
175
  }, onMouseLeave: (e) => {
176
176
  e.currentTarget.style.boxShadow = '0 2px 4px rgba(0, 0, 0, 0.1)';
177
177
  e.currentTarget.style.backgroundColor = isSelected ? color : colors.WHITE;
178
- }, children: _jsxs("div", { style: { alignItems: 'center', display: 'flex' }, children: [fileExt ? _jsx("span", { style: { marginRight: "10px" }, children: getFileIcon(fileExt, undefined, tooltipContent) }) : _jsx(IconAttachment, { style: { marginRight: "5px" } }), _jsx("span", { children: nameElement })] }) }, attachment.did);
178
+ }, 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);
179
179
  };
180
180
  export const OwnerInitialsBadge = (blogPost) => {
181
181
  return _jsx(TMTooltip, { content: blogPost.ownerName ?? '-', children: _jsx("div", { style: {
@@ -153,7 +153,7 @@ export const TMPanelManagerProvider = (props) => {
153
153
  }, defaultPanelDimensionsRef.current);
154
154
  // Apply the recalculated dimensions to the panel state
155
155
  setPanelDimensions(nextDimensions);
156
- }, [initialVisibility, panelVisibility, hierarchyMap]);
156
+ }, [panelVisibility, hierarchyMap]);
157
157
  // Toggle the maximized state of a panel by its ID
158
158
  const toggleMaximize = useCallback((id) => {
159
159
  if (maximizedPanels.includes(id)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.15.35",
3
+ "version": "6.15.36",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",