@topconsultnpm/sdkui-react 6.20.0-dev1.77 → 6.20.0-dev1.78
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/features/search/TMSearchResult.js +9 -9
- package/lib/components/features/workflow/TMWorkflowPopup.js +5 -10
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +1 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +139 -7
- package/lib/helper/TMIcons.d.ts +1 -0
- package/lib/helper/TMIcons.js +4 -3
- package/package.json +1 -1
|
@@ -48,6 +48,7 @@ import { useCheckInOutOperations } from '../../../hooks/useCheckInOutOperations'
|
|
|
48
48
|
import TMDcmtCheckoutInfoForm from './TMDcmtCheckoutInfoForm';
|
|
49
49
|
import { useDataListItem } from '../../../hooks/useDataListItem';
|
|
50
50
|
import { useDataUserIdItem } from '../../../hooks/useDataUserIdItem';
|
|
51
|
+
import { LoadIndicator } from 'devextreme-react';
|
|
51
52
|
let abortControllerLocal = new AbortController();
|
|
52
53
|
//#region Helper Methods
|
|
53
54
|
export const getSearchResultCountersSingleCategory = (searchResults) => {
|
|
@@ -795,9 +796,6 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
795
796
|
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (showSignSettingsForm && fromDTD) && _jsx(TMSignSettingsForm, { fromDTD: fromDTD, inputDcmts: allFieldSelectedDocs, onCloseSignSettingsForm: closeSignSettingsForm, onSavedAsyncCallback: handleSavedAsyncCallback }), (showHistory && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: fromDTD, deviceType: deviceType, inputDcmt: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].TID, did: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: triggerBlogRefresh, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID)] })] }));
|
|
796
797
|
};
|
|
797
798
|
export default TMSearchResult;
|
|
798
|
-
const renderDcmtIcon = (cellData, onDownloadDcmtsAsync, openInOffice) => {
|
|
799
|
-
return _jsx(TMDcmtIcon, { tid: cellData.data.TID, did: cellData.data.DID, fileExtension: cellData.data.FILEEXT, fileCount: cellData.data.FILECOUNT, isLexProt: cellData.data.IsLexProt, isMail: cellData.data.ISMAIL, isShared: cellData.data.ISSHARED, isSigned: cellData.data.ISSIGNED, downloadMode: 'openInNewWindow', onDownloadDcmtsAsync: onDownloadDcmtsAsync, openInOffice: openInOffice });
|
|
800
|
-
};
|
|
801
799
|
const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, floatingMenuItems, onSelectionChanged, onDblClick }) => {
|
|
802
800
|
const [dataSource, setDataSource] = useState();
|
|
803
801
|
const [columns, setColumns] = useState([]);
|
|
@@ -806,6 +804,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
806
804
|
const [focusedItem, setFocusedItem] = useState();
|
|
807
805
|
const [visibleItems, setVisibleItems] = useState([]);
|
|
808
806
|
const [pageSize, setPageSize] = useState(SDKUI_Globals.userSettings.searchSettings?.pageSize ?? TMDataGridPageSize.Large);
|
|
807
|
+
const [isDataGridReady, setIsDataGridReady] = useState(false);
|
|
809
808
|
const { loadDataListsAsync, renderDataListCell, dataListsCache } = useDataListItem();
|
|
810
809
|
const { loadUsersAsync, renderUserIdViewer, usersCache } = useDataUserIdItem();
|
|
811
810
|
useEffect(() => {
|
|
@@ -882,6 +881,9 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
882
881
|
}
|
|
883
882
|
}
|
|
884
883
|
}, [inputSelectedItems, inputFocusedItem, dataSource]);
|
|
884
|
+
const cellRenderDcmtIcon = useCallback((cellData, onDownloadDcmtsAsync, openInOffice) => {
|
|
885
|
+
return _jsx(TMDcmtIcon, { tid: cellData.data.TID, did: cellData.data.DID, fileExtension: cellData.data.FILEEXT, fileCount: cellData.data.FILECOUNT, isLexProt: cellData.data.IsLexProt, isMail: cellData.data.ISMAIL, isShared: cellData.data.ISSHARED, isSigned: cellData.data.ISSIGNED, downloadMode: 'openInNewWindow', onDownloadDcmtsAsync: onDownloadDcmtsAsync, openInOffice: openInOffice });
|
|
886
|
+
}, []);
|
|
885
887
|
const cellRender = useCallback((cellData, dataDomain, dataListID, dataListViewMode) => {
|
|
886
888
|
if (!cellData || cellData.value === undefined)
|
|
887
889
|
return null;
|
|
@@ -1040,6 +1042,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1040
1042
|
const loadColumnsAndData = async () => {
|
|
1041
1043
|
// Resetta l'elemento focalizzato quando si caricano nuovi dati
|
|
1042
1044
|
setFocusedItem(undefined);
|
|
1045
|
+
setIsDataGridReady(false);
|
|
1043
1046
|
// Set per raccogliere gli ID univoci da precaricare
|
|
1044
1047
|
const dataListIDs = new Set();
|
|
1045
1048
|
const userIDs = new Set();
|
|
@@ -1076,6 +1079,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1076
1079
|
// Converte i risultati di ricerca in un array semplice per la griglia
|
|
1077
1080
|
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
1078
1081
|
setDataSource(newDataSource);
|
|
1082
|
+
setIsDataGridReady(true);
|
|
1079
1083
|
};
|
|
1080
1084
|
loadColumnsAndData();
|
|
1081
1085
|
}, [searchResult, fromDTD, allUsers, loadDataListsAsync, loadUsersAsync, generateColumns]);
|
|
@@ -1126,10 +1130,6 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1126
1130
|
onDblClick();
|
|
1127
1131
|
}, [onDblClick]);
|
|
1128
1132
|
const dataColumns = useMemo(() => {
|
|
1129
|
-
// Aspetta che le colonne siano completamente caricate
|
|
1130
|
-
if (!columns || columns.length === 0) {
|
|
1131
|
-
return [];
|
|
1132
|
-
}
|
|
1133
1133
|
return [
|
|
1134
1134
|
{
|
|
1135
1135
|
dataType: "object",
|
|
@@ -1137,7 +1137,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1137
1137
|
caption: '',
|
|
1138
1138
|
visible: true,
|
|
1139
1139
|
width: 50,
|
|
1140
|
-
cellRender: (cellData) =>
|
|
1140
|
+
cellRender: (cellData) => cellRenderDcmtIcon(cellData, onDownloadDcmtsAsync, openInOffice),
|
|
1141
1141
|
allowResizing: false,
|
|
1142
1142
|
filterOperations: ['=', "anyof"],
|
|
1143
1143
|
allowHiding: false,
|
|
@@ -1154,7 +1154,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1154
1154
|
setVisibleItems(visibleRows.map((row) => { return row.data; }));
|
|
1155
1155
|
}, []);
|
|
1156
1156
|
useEffect(() => { onVisibleItemChanged?.(visibleItems); }, [visibleItems]);
|
|
1157
|
-
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearch, showFilterPanel: true, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: pageSize, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, showHeaderColumnChooser: true, onKeyDown: onKeyDown, customContextMenuItems: floatingMenuItems, counterConfig: { show: true } }), (showExportForm && searchResult && onCloseExportForm) && _jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: onCloseExportForm, searchResult: searchResult })] });
|
|
1157
|
+
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [!isDataGridReady && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: '10px' }, children: [_jsx(LoadIndicator, { height: 60, width: 60 }), _jsx("div", { children: SDKUI_Localizator.Loading })] })), isDataGridReady && _jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearch, showFilterPanel: true, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: pageSize, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, showHeaderColumnChooser: true, onKeyDown: onKeyDown, customContextMenuItems: floatingMenuItems, counterConfig: { show: true } }), (showExportForm && searchResult && onCloseExportForm) && _jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: onCloseExportForm, searchResult: searchResult })] });
|
|
1158
1158
|
};
|
|
1159
1159
|
//#region TMSearchResultSelector
|
|
1160
1160
|
const StyledItemTemplate = styled.div `
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
2
|
+
import { useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { Priorities, ResultTypes, SDK_Globals, SDK_Localizator, TaskEngine, UserListCacheService, ValidationItem, WFEvents, WorkflowCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from "styled-components";
|
|
5
5
|
import { SDKUI_Localizator, IconApply, IconCloseOutline, IconUser, IconInfo, DateDisplayTypes, TASK_MORE_INFO_PREFIX_NAME, IconSignaturePencil, isSign4TopEnabled, IconCheck, IconCloseCircle, IconStop } from "../../../helper";
|
|
@@ -66,17 +66,12 @@ const StyledHorizontalContainer = styled.div `
|
|
|
66
66
|
export const WorkFlowOperationButtons = (props) => {
|
|
67
67
|
const { dtd = undefined, deviceType = DeviceType.DESKTOP, approveDisable = false, signApproveDisable = false, rejectDisable = false, reassignDisable = false, infoDisable = false, onApprove, onSignApprove, onReject, onReAssign, onMoreInfo } = props;
|
|
68
68
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
69
|
-
//
|
|
70
|
-
const
|
|
71
|
-
useEffect(() => {
|
|
72
|
-
// Controlla se il documento ha dei widget definiti, se il documento ha il widget SIGN4_TOP abilitato, allora è un workflow di firma
|
|
69
|
+
// Calcola direttamente se è un workflow di firma per evitare flickering durante il render
|
|
70
|
+
const isSignWorkflow = useMemo(() => {
|
|
73
71
|
if (dtd && dtd.widgets && dtd.widgets.length > 0) {
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
// Se non ci sono widget o non è SIGN4_TOP, imposta il workflow di default (approvazione senza firma)
|
|
78
|
-
setIsSignWorkflow(false);
|
|
72
|
+
return isSign4TopEnabled(dtd.widgets);
|
|
79
73
|
}
|
|
74
|
+
return false;
|
|
80
75
|
}, [dtd]);
|
|
81
76
|
return (_jsx(StyledWorkFlowOperationButtonsContainer, { "$isMobile": isMobile, children: isSignWorkflow ? (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconSignaturePencil, {}), caption: SDKUI_Localizator.SignatureAndApprove, width: "160px", disabled: signApproveDisable, onClick: () => !signApproveDisable && onSignApprove?.(), onMouseDown: e => e.stopPropagation(), advancedColor: "#1a9a49", color: "success" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), onMouseDown: e => e.stopPropagation(), advancedColor: TMColors.error, color: "error" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), onMouseDown: e => e.stopPropagation(), advancedColor: TMColors.info, color: "info" })] })) : (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconApply, {}), caption: SDKUI_Localizator.Approve, disabled: approveDisable, onClick: () => !approveDisable && onApprove?.(), advancedColor: "#1a9a49", color: "success" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), advancedColor: TMColors.error, color: "error" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconUser, { fontSize: 16 }), caption: SDKUI_Localizator.Reassign, disabled: reassignDisable, onClick: () => !reassignDisable && onReAssign?.(), advancedColor: TMColors.tertiary, color: "tertiary" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), advancedColor: TMColors.info, color: "info" })] })) }));
|
|
82
77
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useCallback, useRef, useMemo } from 'react';
|
|
2
|
+
import { useState, useEffect, useCallback, useRef, useMemo, useLayoutEffect } from 'react';
|
|
3
3
|
import { DiagramItemTypes, ArrowSymbol } from './interfaces';
|
|
4
4
|
import { parseWfDiagramXml, serializeWfDiagramToXml } from './xmlParser';
|
|
5
5
|
import styled, { css, keyframes } from 'styled-components';
|
|
@@ -8,7 +8,7 @@ import ConnectionComponent from './ConnectionComponent';
|
|
|
8
8
|
import DiagramItemComponent from './DiagramItemComponent';
|
|
9
9
|
import DiagramItemSvgContent from './DiagramItemSvgContent';
|
|
10
10
|
import { calculateArrowAngle, downloadFile, getConnectionPoint, getNewWfDiagram, isConnectionNonLinear, validateDiagram } from './workflowHelpers';
|
|
11
|
-
import { IconFlowChart, IconUndo, IconRestore, IconAdjust, IconCopy, IconCut, IconPaste, IconPin, IconUnpin, IconChevronRight, IconCloseOutline, IconNew, SDKUI_Localizator, generateUUID, IconExport, IconImport, IconWindowMaximize, IconZoomIn, IconZoomOut, IconPencil, IconLock, LocalizeDiagramItemType, IconWindowMinimize } from '../../../../helper';
|
|
11
|
+
import { IconFlowChart, IconUndo, IconRestore, IconAdjust, IconCopy, IconCut, IconPaste, IconPin, IconUnpin, IconChevronRight, IconCloseOutline, IconNew, SDKUI_Localizator, generateUUID, IconExport, IconImport, IconWindowMaximize, IconZoomIn, IconZoomOut, IconPencil, IconLock, LocalizeDiagramItemType, IconWindowMinimize, IconZoomAuto } from '../../../../helper';
|
|
12
12
|
import { ButtonNames, TMExceptionBoxManager, TMMessageBoxManager } from '../../../base/TMPopUp';
|
|
13
13
|
import { StyledLoadingContainer, StyledSpinner } from '../../../base/Styled';
|
|
14
14
|
import DiagramItemForm from './DiagramItemForm';
|
|
@@ -317,13 +317,15 @@ const DiagramMessage = styled.div `
|
|
|
317
317
|
color: #555;
|
|
318
318
|
text-align: center;
|
|
319
319
|
`;
|
|
320
|
-
const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagramChange, workitems }) => {
|
|
320
|
+
const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagramChange, workitems, defaultAutoZoom = false }) => {
|
|
321
321
|
const [isReadOnly, setIsReadOnly] = useState(true);
|
|
322
322
|
const [isFullScreen, setIsFullScreen] = useState(false);
|
|
323
323
|
const [zoomLevel, setZoomLevel] = useState(1);
|
|
324
324
|
const [translateX, setTranslateX] = useState(0);
|
|
325
325
|
const [translateY, setTranslateY] = useState(0);
|
|
326
|
+
const [isAutoZoomEnabled, setIsAutoZoomEnabled] = useState(defaultAutoZoom);
|
|
326
327
|
const [isLoading, setIsLoading] = useState(true);
|
|
328
|
+
const [isInitialZoomCalculated, setIsInitialZoomCalculated] = useState(!defaultAutoZoom);
|
|
327
329
|
const [wfDiagram, setWfDiagram] = useState(null);
|
|
328
330
|
const [selectedItems, setSelectedItems] = useState(new Set());
|
|
329
331
|
const [selectedConnections, setSelectedConnections] = useState(new Set());
|
|
@@ -333,6 +335,7 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
333
335
|
const initialDiagramRef = useRef(null);
|
|
334
336
|
const notifiedXmlRef = useRef(null);
|
|
335
337
|
const svgRef = useRef(null);
|
|
338
|
+
const containerRef = useRef(null);
|
|
336
339
|
const [isDrawingConnection, setIsDrawingConnection] = useState(false);
|
|
337
340
|
const [tempConnectionSource, setTempConnectionSource] = useState(null);
|
|
338
341
|
const [tempConnectionEnd, setTempConnectionEnd] = useState(null);
|
|
@@ -1624,6 +1627,67 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1624
1627
|
const handleZoomOut = useCallback(() => {
|
|
1625
1628
|
setZoomLevel(prev => Math.max(prev - 0.1, 0.5)); // Limite min a 0.5
|
|
1626
1629
|
}, []);
|
|
1630
|
+
const calculateOptimalZoom = useCallback(() => {
|
|
1631
|
+
if (!wfDiagram || !containerRef.current || wfDiagram.DiagramItems.length === 0) {
|
|
1632
|
+
return 1;
|
|
1633
|
+
}
|
|
1634
|
+
// Calcola il bounding box del diagramma
|
|
1635
|
+
let minX = Infinity;
|
|
1636
|
+
let minY = Infinity;
|
|
1637
|
+
let maxX = -Infinity;
|
|
1638
|
+
let maxY = -Infinity;
|
|
1639
|
+
wfDiagram.DiagramItems.forEach(item => {
|
|
1640
|
+
minX = Math.min(minX, item.Left);
|
|
1641
|
+
minY = Math.min(minY, item.Top);
|
|
1642
|
+
maxX = Math.max(maxX, item.Left + item.Width);
|
|
1643
|
+
maxY = Math.max(maxY, item.Top + item.Height + 50);
|
|
1644
|
+
});
|
|
1645
|
+
const padding = 100; // Padding intorno al diagramma
|
|
1646
|
+
const diagramWidth = maxX - minX + (padding * 2);
|
|
1647
|
+
const diagramHeight = maxY - minY + (padding * 2);
|
|
1648
|
+
// Ottieni le dimensioni del container
|
|
1649
|
+
const containerWidth = containerRef.current.clientWidth;
|
|
1650
|
+
const containerHeight = containerRef.current.clientHeight;
|
|
1651
|
+
// Calcola il fattore di zoom per far entrare tutto il contenuto
|
|
1652
|
+
const zoomX = containerWidth / diagramWidth;
|
|
1653
|
+
const zoomY = containerHeight / diagramHeight;
|
|
1654
|
+
// Usa il fattore più piccolo per garantire che tutto sia visibile
|
|
1655
|
+
let optimalZoom = Math.min(zoomX, zoomY, 2.0); // Max 2.0
|
|
1656
|
+
// Applica un minimo di 0.3 per evitare zoom troppo piccoli
|
|
1657
|
+
optimalZoom = Math.max(optimalZoom, 0.3);
|
|
1658
|
+
// Arrotonda per eccesso alla decina più vicina (in percentuale)
|
|
1659
|
+
const zoomPercentage = optimalZoom * 100;
|
|
1660
|
+
const roundedPercentage = Math.ceil(zoomPercentage / 10) * 10;
|
|
1661
|
+
// Limita al massimo 100%
|
|
1662
|
+
const finalPercentage = Math.min(roundedPercentage, 100);
|
|
1663
|
+
return finalPercentage / 100;
|
|
1664
|
+
}, [wfDiagram]);
|
|
1665
|
+
const handleZoomToFit = useCallback(() => {
|
|
1666
|
+
const optimalZoom = calculateOptimalZoom();
|
|
1667
|
+
setZoomLevel(optimalZoom);
|
|
1668
|
+
setTranslateX(0);
|
|
1669
|
+
setTranslateY(0);
|
|
1670
|
+
setIsAutoZoomEnabled(true);
|
|
1671
|
+
}, [calculateOptimalZoom]);
|
|
1672
|
+
const handleToggleAutoZoom = useCallback(() => {
|
|
1673
|
+
setIsAutoZoomEnabled(prev => {
|
|
1674
|
+
const newValue = !prev;
|
|
1675
|
+
if (!newValue) {
|
|
1676
|
+
// Se si disattiva AutoZoom, riporta lo zoom a 1
|
|
1677
|
+
setZoomLevel(1);
|
|
1678
|
+
setTranslateX(0);
|
|
1679
|
+
setTranslateY(0);
|
|
1680
|
+
}
|
|
1681
|
+
else {
|
|
1682
|
+
// Se si attiva AutoZoom, calcola lo zoom ottimale
|
|
1683
|
+
const optimalZoom = calculateOptimalZoom();
|
|
1684
|
+
setZoomLevel(optimalZoom);
|
|
1685
|
+
setTranslateX(0);
|
|
1686
|
+
setTranslateY(0);
|
|
1687
|
+
}
|
|
1688
|
+
return newValue;
|
|
1689
|
+
});
|
|
1690
|
+
}, [calculateOptimalZoom]);
|
|
1627
1691
|
const formattedZoomLevel = useMemo(() => {
|
|
1628
1692
|
return `${Math.round(zoomLevel * 100)}%`;
|
|
1629
1693
|
}, [zoomLevel]);
|
|
@@ -1662,8 +1726,6 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1662
1726
|
catch (error) {
|
|
1663
1727
|
console.error("Errore durante l'elaborazione del diagramma:", error);
|
|
1664
1728
|
setWfDiagram(null);
|
|
1665
|
-
}
|
|
1666
|
-
finally {
|
|
1667
1729
|
setIsLoading(false);
|
|
1668
1730
|
}
|
|
1669
1731
|
}, [xmlDiagramString, getAdjustedAndRecalculatedDiagram]);
|
|
@@ -1672,6 +1734,73 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1672
1734
|
isUndoingRedoing.current = false;
|
|
1673
1735
|
}
|
|
1674
1736
|
}, [wfDiagram]);
|
|
1737
|
+
// useLayoutEffect viene eseguito PRIMA del paint del browser, evitando il flash visivo
|
|
1738
|
+
useLayoutEffect(() => {
|
|
1739
|
+
if (defaultAutoZoom && !isInitialZoomCalculated && wfDiagram && wfDiagram.DiagramItems.length > 0 && containerRef.current) {
|
|
1740
|
+
const container = containerRef.current;
|
|
1741
|
+
// Calcola il bounding box del diagramma
|
|
1742
|
+
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
1743
|
+
wfDiagram.DiagramItems.forEach(item => {
|
|
1744
|
+
minX = Math.min(minX, item.Left);
|
|
1745
|
+
minY = Math.min(minY, item.Top);
|
|
1746
|
+
maxX = Math.max(maxX, item.Left + item.Width);
|
|
1747
|
+
maxY = Math.max(maxY, item.Top + item.Height + 50);
|
|
1748
|
+
});
|
|
1749
|
+
const padding = 100;
|
|
1750
|
+
const diagramWidth = maxX - minX + (padding * 2);
|
|
1751
|
+
const diagramHeight = maxY - minY + (padding * 2);
|
|
1752
|
+
const containerWidth = container.clientWidth;
|
|
1753
|
+
const containerHeight = container.clientHeight;
|
|
1754
|
+
if (containerWidth > 0 && containerHeight > 0) {
|
|
1755
|
+
const zoomX = containerWidth / diagramWidth;
|
|
1756
|
+
const zoomY = containerHeight / diagramHeight;
|
|
1757
|
+
let optimalZoom = Math.min(zoomX, zoomY, 2.0);
|
|
1758
|
+
optimalZoom = Math.max(optimalZoom, 0.3);
|
|
1759
|
+
const zoomPercentage = optimalZoom * 100;
|
|
1760
|
+
const roundedPercentage = Math.ceil(zoomPercentage / 10) * 10;
|
|
1761
|
+
const finalPercentage = Math.min(roundedPercentage, 100);
|
|
1762
|
+
setZoomLevel(finalPercentage / 100);
|
|
1763
|
+
setIsInitialZoomCalculated(true);
|
|
1764
|
+
setIsLoading(false);
|
|
1765
|
+
}
|
|
1766
|
+
else {
|
|
1767
|
+
// Se il container non ha dimensioni, riprova al prossimo render
|
|
1768
|
+
requestAnimationFrame(() => {
|
|
1769
|
+
setIsInitialZoomCalculated(false);
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
else if (!defaultAutoZoom && wfDiagram && isLoading) {
|
|
1774
|
+
// Se non c'è autozoom, rimuovi il loading appena il diagramma è pronto
|
|
1775
|
+
setIsLoading(false);
|
|
1776
|
+
}
|
|
1777
|
+
}, [wfDiagram, defaultAutoZoom, isInitialZoomCalculated, isLoading]);
|
|
1778
|
+
// Gestisce AutoZoom: ricalcola lo zoom quando il diagramma cambia o il container viene ridimensionato
|
|
1779
|
+
useEffect(() => {
|
|
1780
|
+
if (!containerRef.current || !isAutoZoomEnabled || !isInitialZoomCalculated) {
|
|
1781
|
+
return;
|
|
1782
|
+
}
|
|
1783
|
+
// Funzione per ricalcolare e applicare lo zoom se necessario
|
|
1784
|
+
const updateZoom = () => {
|
|
1785
|
+
if (wfDiagram && wfDiagram.DiagramItems.length > 0) {
|
|
1786
|
+
const newZoom = calculateOptimalZoom();
|
|
1787
|
+
if (newZoom !== undefined && Math.abs(zoomLevel - newZoom) > 0.001) {
|
|
1788
|
+
setZoomLevel(newZoom);
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
};
|
|
1792
|
+
// Ricalcola lo zoom quando il diagramma cambia
|
|
1793
|
+
updateZoom();
|
|
1794
|
+
// Installa ResizeObserver per reagire ai ridimensionamenti del container
|
|
1795
|
+
const container = containerRef.current;
|
|
1796
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
1797
|
+
updateZoom();
|
|
1798
|
+
});
|
|
1799
|
+
resizeObserver.observe(container);
|
|
1800
|
+
return () => {
|
|
1801
|
+
resizeObserver.disconnect();
|
|
1802
|
+
};
|
|
1803
|
+
}, [isAutoZoomEnabled, wfDiagram, calculateOptimalZoom, isInitialZoomCalculated, zoomLevel]);
|
|
1675
1804
|
const handleCanvasDoubleClick = useCallback((event) => {
|
|
1676
1805
|
if (isReadOnly && allowEdit) {
|
|
1677
1806
|
toggleReadOnlyMode();
|
|
@@ -1696,8 +1825,11 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1696
1825
|
}
|
|
1697
1826
|
}, [isFullScreen]);
|
|
1698
1827
|
const diagramContent = (_jsxs(CanvasContainer, { onDoubleClick: handleCanvasDoubleClick, children: [_jsx("input", { ref: fileInputRef, type: "file", accept: ".xml" // Filtra per file XML
|
|
1699
|
-
, onChange: handleFileChange, style: { display: 'none' } }), _jsxs(ToolbarContainer, { "$isCollapsed": isToolbarCollapsed, "$isFloating": isToolbarFloating, "$isToolboxVisible": isToolboxVisible, "$isReadOnly": isReadOnly, children: [allowEdit && _jsx(ButtonGroup, { "$isFloating": isToolbarFloating, children: _jsxs("button", { onClick: toggleReadOnlyMode, title: isReadOnly ? SDKUI_Localizator.Design : SDKUI_Localizator.ReadOnly, children: [isReadOnly ? _jsx(IconPencil, {}) : _jsx(IconLock, {}), !isToolbarCollapsed && _jsx("span", { children: isReadOnly ? SDKUI_Localizator.Design : SDKUI_Localizator.ReadOnly })] }) }), allowEdit && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [!isReadOnly && _jsxs("button", { onClick: handleToggleToolboxVisibility, title: SDKUI_Localizator.ShowToolbox, children: [_jsx(IconFlowChart, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ShowToolboxToggle })] }), _jsxs("button", { onClick: toggleFullScreenMode, title: SDKUI_Localizator.ShowFullScreen, children: [isFullScreen ? _jsx(IconWindowMinimize, {}) : _jsx(IconWindowMaximize, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ShowFullScreen })] })] }), _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleZoomIn, title: SDKUI_Localizator.ZoomIn, children: [_jsx(IconZoomIn, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ZoomIn })] }), _jsxs("button", { onClick: handleZoomOut, title: SDKUI_Localizator.ZoomOut, children: [_jsx(IconZoomOut, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ZoomOut })] }), _jsx(ZoomLevelText, { "$isFloating": isToolbarFloating, "$isCollapsed": isToolbarCollapsed, children: formattedZoomLevel })] }), !isReadOnly && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleUndo, disabled: historyIndex === 0, title: SDKUI_Localizator.Undo, children: [_jsx(IconUndo, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Undo })] }), _jsxs("button", { onClick: handleRedo, disabled: historyIndex === wfDiagramHistory.length - 1, title: SDKUI_Localizator.Redo, children: [_jsx(IconUndo, { style: { transform: 'scaleX(-1)' } }), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Redo })] }), _jsxs("button", { onClick: handleRestore, title: SDKUI_Localizator.Restore, children: [_jsx(IconRestore, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Restore })] }), _jsxs("button", { onClick: handleNew, title: SDKUI_Localizator.DiagramNew, disabled: isReadOnly, children: [_jsx(IconNew, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.DiagramNew })] }), _jsxs("button", { onClick: handleExportDiagram, disabled: isReadOnly || !wfDiagram, title: SDKUI_Localizator.Export, children: [_jsx(IconExport, {}), _jsx("span", { children: SDKUI_Localizator.Export })] }), _jsxs("button", { onClick: handleImportDiagramClick, disabled: isReadOnly, title: SDKUI_Localizator.Import, children: [_jsx(IconImport, {}), _jsx("span", { children: SDKUI_Localizator.Import })] })] }), !isReadOnly && _jsx(ButtonGroup, { "$isFloating": isToolbarFloating, children: _jsxs("button", { onClick: handleAutoAdjust, title: SDKUI_Localizator.AutoAdjust, children: [_jsx(IconAdjust, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.AutoAdjust })] }) }), !isReadOnly && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleCopy, disabled: selectedItems.size === 0, title: SDKUI_Localizator.Copy, children: [_jsx(IconCopy, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Copy })] }), _jsxs("button", { onClick: handleCut, disabled: selectedItems.size === 0, title: SDKUI_Localizator.Cut, children: [_jsx(IconCut, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Cut })] }), _jsxs("button", { onClick: handlePaste, disabled: copiedItems.length === 0 && copiedConnections.length === 0, title: SDKUI_Localizator.Paste, children: [_jsx(IconPaste, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Paste })] })] }), allowEdit && _jsxs("button", { onClick: handleToggleToolbarMode, title: isToolbarFloating ? SDKUI_Localizator.ToolbarDock : SDKUI_Localizator.ToolbarFloat, children: [isToolbarFloating ? _jsx(IconPin, {}) : _jsx(IconUnpin, {}), !isToolbarCollapsed && !isToolbarFloating && _jsx("span", { children: SDKUI_Localizator.ToggleMode })] }), !isToolbarFloating && _jsx(ToolbarToggle, { onClick: () => setIsToolbarCollapsed(!isToolbarCollapsed), title: isToolbarCollapsed ? SDKUI_Localizator.ToolbarExpand : SDKUI_Localizator.ToolbarCollapse, children: isToolbarCollapsed ? _jsx(IconChevronRight, {}) : _jsx(IconCloseOutline, {}) })] }), !isReadOnly && (_jsx(ToolboxContainer, { "$isVisible": isToolboxVisible, children: isToolboxVisible && availableItemTypes.map(type => (_jsxs(ToolboxItem, { draggable: true, onDragStart: (e) => handleToolboxDragStart(e, type), onDragEnd: handleToolboxDragEnd, children: [_jsx(ToolboxIconWrapper, { children: _jsx(DiagramItemSvgContent, { itemType: type, width: 38, height: 38, isToolboxPreview: true }) }), _jsx("span", { children: LocalizeDiagramItemType(type) })] }, type))) })), _jsx(SvgScrollContainer, { children: isLoading ?
|
|
1700
|
-
(_jsxs(StyledLoadingContainer, { children: [_jsx(StyledSpinner, {}), _jsx("span", { children: `${'Caricamento diagramma'}...` })] })) : wfDiagram ? (_jsx(StyledSvg, { ref: svgRef, tabIndex: 0, onKeyDownCapture: handleKeyDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseDown: handleMouseDown, onDrop: handleDropOnCanvas, onDragOver: handleDragOver, width: svgWidth, height: svgHeight,
|
|
1828
|
+
, onChange: handleFileChange, style: { display: 'none' } }), _jsxs(ToolbarContainer, { "$isCollapsed": isToolbarCollapsed, "$isFloating": isToolbarFloating, "$isToolboxVisible": isToolboxVisible, "$isReadOnly": isReadOnly, children: [allowEdit && _jsx(ButtonGroup, { "$isFloating": isToolbarFloating, children: _jsxs("button", { onClick: toggleReadOnlyMode, title: isReadOnly ? SDKUI_Localizator.Design : SDKUI_Localizator.ReadOnly, children: [isReadOnly ? _jsx(IconPencil, {}) : _jsx(IconLock, {}), !isToolbarCollapsed && _jsx("span", { children: isReadOnly ? SDKUI_Localizator.Design : SDKUI_Localizator.ReadOnly })] }) }), allowEdit && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [!isReadOnly && _jsxs("button", { onClick: handleToggleToolboxVisibility, title: SDKUI_Localizator.ShowToolbox, children: [_jsx(IconFlowChart, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ShowToolboxToggle })] }), _jsxs("button", { onClick: toggleFullScreenMode, title: SDKUI_Localizator.ShowFullScreen, children: [isFullScreen ? _jsx(IconWindowMinimize, {}) : _jsx(IconWindowMaximize, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ShowFullScreen })] })] }), _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleZoomIn, title: SDKUI_Localizator.ZoomIn, disabled: isAutoZoomEnabled, children: [_jsx(IconZoomIn, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ZoomIn })] }), _jsxs("button", { onClick: handleZoomOut, title: SDKUI_Localizator.ZoomOut, disabled: isAutoZoomEnabled, children: [_jsx(IconZoomOut, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ZoomOut })] }), _jsxs("button", { onClick: handleToggleAutoZoom, title: "AutoZoom", style: { backgroundColor: isAutoZoomEnabled ? '#66b3ff' : undefined }, children: [_jsx(IconZoomAuto, {}), !isToolbarCollapsed && _jsx("span", { children: "AutoZoom" })] }), _jsx(ZoomLevelText, { "$isFloating": isToolbarFloating, "$isCollapsed": isToolbarCollapsed, children: formattedZoomLevel })] }), !isReadOnly && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleUndo, disabled: historyIndex === 0, title: SDKUI_Localizator.Undo, children: [_jsx(IconUndo, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Undo })] }), _jsxs("button", { onClick: handleRedo, disabled: historyIndex === wfDiagramHistory.length - 1, title: SDKUI_Localizator.Redo, children: [_jsx(IconUndo, { style: { transform: 'scaleX(-1)' } }), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Redo })] }), _jsxs("button", { onClick: handleRestore, title: SDKUI_Localizator.Restore, children: [_jsx(IconRestore, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Restore })] }), _jsxs("button", { onClick: handleNew, title: SDKUI_Localizator.DiagramNew, disabled: isReadOnly, children: [_jsx(IconNew, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.DiagramNew })] }), _jsxs("button", { onClick: handleExportDiagram, disabled: isReadOnly || !wfDiagram, title: SDKUI_Localizator.Export, children: [_jsx(IconExport, {}), _jsx("span", { children: SDKUI_Localizator.Export })] }), _jsxs("button", { onClick: handleImportDiagramClick, disabled: isReadOnly, title: SDKUI_Localizator.Import, children: [_jsx(IconImport, {}), _jsx("span", { children: SDKUI_Localizator.Import })] })] }), !isReadOnly && _jsx(ButtonGroup, { "$isFloating": isToolbarFloating, children: _jsxs("button", { onClick: handleAutoAdjust, title: SDKUI_Localizator.AutoAdjust, children: [_jsx(IconAdjust, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.AutoAdjust })] }) }), !isReadOnly && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleCopy, disabled: selectedItems.size === 0, title: SDKUI_Localizator.Copy, children: [_jsx(IconCopy, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Copy })] }), _jsxs("button", { onClick: handleCut, disabled: selectedItems.size === 0, title: SDKUI_Localizator.Cut, children: [_jsx(IconCut, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Cut })] }), _jsxs("button", { onClick: handlePaste, disabled: copiedItems.length === 0 && copiedConnections.length === 0, title: SDKUI_Localizator.Paste, children: [_jsx(IconPaste, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Paste })] })] }), allowEdit && _jsxs("button", { onClick: handleToggleToolbarMode, title: isToolbarFloating ? SDKUI_Localizator.ToolbarDock : SDKUI_Localizator.ToolbarFloat, children: [isToolbarFloating ? _jsx(IconPin, {}) : _jsx(IconUnpin, {}), !isToolbarCollapsed && !isToolbarFloating && _jsx("span", { children: SDKUI_Localizator.ToggleMode })] }), !isToolbarFloating && _jsx(ToolbarToggle, { onClick: () => setIsToolbarCollapsed(!isToolbarCollapsed), title: isToolbarCollapsed ? SDKUI_Localizator.ToolbarExpand : SDKUI_Localizator.ToolbarCollapse, children: isToolbarCollapsed ? _jsx(IconChevronRight, {}) : _jsx(IconCloseOutline, {}) })] }), !isReadOnly && (_jsx(ToolboxContainer, { "$isVisible": isToolboxVisible, children: isToolboxVisible && availableItemTypes.map(type => (_jsxs(ToolboxItem, { draggable: true, onDragStart: (e) => handleToolboxDragStart(e, type), onDragEnd: handleToolboxDragEnd, children: [_jsx(ToolboxIconWrapper, { children: _jsx(DiagramItemSvgContent, { itemType: type, width: 38, height: 38, isToolboxPreview: true }) }), _jsx("span", { children: LocalizeDiagramItemType(type) })] }, type))) })), _jsx(SvgScrollContainer, { ref: containerRef, children: isLoading ?
|
|
1829
|
+
(_jsxs(StyledLoadingContainer, { children: [_jsx(StyledSpinner, {}), _jsx("span", { children: `${'Caricamento diagramma'}...` })] })) : wfDiagram ? (_jsx(StyledSvg, { ref: svgRef, tabIndex: 0, onKeyDownCapture: handleKeyDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseDown: handleMouseDown, onDrop: handleDropOnCanvas, onDragOver: handleDragOver, width: svgWidth, height: svgHeight, style: {
|
|
1830
|
+
opacity: (defaultAutoZoom && !isInitialZoomCalculated) ? 0 : 1,
|
|
1831
|
+
transition: 'opacity 0.15s ease-in'
|
|
1832
|
+
}, children: _jsxs(ScalableGroup, { "$scale": zoomLevel, "$translateX": translateX, "$translateY": translateY, children: [wfDiagram?.DiagramItems.map(item => (_jsx(DiagramItemComponent, { wf: wfDiagram?.Info, readOnly: isReadOnly, item: item, isSelected: selectedItems.has(item.ID), isCurrent: item.ID === currentSetID, onClick: handleDiagramItemClick, onDrag: handleDrag, onDragEnd: handleDragEnd, onConnectorMouseDown: handleConnectorMouseDown, onConnectorMouseUp: handleConnectorMouseUp, onDimensionsChange: handleItemDimensionsChange, onDoubleClick: handleDoubleClickItem, backgroundColor: getWorkItemBackgroundColor(item.ID) }, item.ID))), calculatedConnections.map(connection => {
|
|
1701
1833
|
const sourceItem = wfDiagram?.DiagramItems.find(item => item.ID === connection.Source.ParentDiagramItem.ID);
|
|
1702
1834
|
const sinkItem = wfDiagram?.DiagramItems.find(item => item.ID === connection.Sink.ParentDiagramItem.ID);
|
|
1703
1835
|
if (!sourceItem || !sinkItem)
|
package/lib/helper/TMIcons.d.ts
CHANGED
|
@@ -238,6 +238,7 @@ export declare function IconFunction(props: Readonly<React.SVGProps<SVGSVGElemen
|
|
|
238
238
|
export declare function IconNull(props?: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
239
239
|
declare function IconZoomOutLinear(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
240
240
|
declare function IconZoomInLinear(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
241
|
+
export declare function IconZoomAuto(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
241
242
|
declare function IconRoundFileUpload(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
242
243
|
declare function IconRotate(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
243
244
|
declare function IconPrintOutline(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
package/lib/helper/TMIcons.js
CHANGED
|
@@ -575,6 +575,9 @@ function IconZoomOutLinear(props) {
|
|
|
575
575
|
function IconZoomInLinear(props) {
|
|
576
576
|
return (_jsxs("svg", { fontSize: props?.fontSize ? props.fontSize : FONTSIZE, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "1em", height: "1em", ...props, children: [" ", _jsx("path", { fill: "currentColor", d: "M19 11h-6V5a1 1 0 0 0-2 0v6H5a1 1 0 0 0 0 2h6v6a1 1 0 0 0 2 0v-6h6a1 1 0 0 0 0-2" }), " "] }));
|
|
577
577
|
}
|
|
578
|
+
export function IconZoomAuto(props) {
|
|
579
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "1em", height: "1em", fontSize: props?.fontSize ? props.fontSize : FONTSIZE, ...props, children: _jsx("path", { fill: "currentColor", d: "m4.4 20.308l-.708-.708l3.6-3.6H4v-1h5v5H8v-3.292zm15.2 0l-3.6-3.6V20h-1v-5h5v1h-3.292l3.6 3.6zM4 9V8h3.292l-3.6-3.6l.708-.708l3.6 3.6V4h1v5zm11 0V4h1v3.292l3.6-3.6l.708.708l-3.6 3.6H20v1z" }) }));
|
|
580
|
+
}
|
|
578
581
|
function IconRoundFileUpload(props) {
|
|
579
582
|
return (_jsxs("svg", { fontSize: props?.fontSize ? props.fontSize : FONTSIZE, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "1em", height: "1em", ...props, children: [" ", _jsx("path", { fill: "currentColor", d: "M2 20V4h8l2 2h10v14zm9-3h2v-4.2l1.6 1.6L16 13l-4-4l-4 4l1.4 1.4l1.6-1.6z" }), " "] }));
|
|
580
583
|
}
|
|
@@ -677,9 +680,7 @@ export function IconUnpair(props) {
|
|
|
677
680
|
return (_jsxs("svg", { fontSize: props.fontSize ?? FONTSIZE, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "1em", height: "1em", ...props, children: [" ", _jsx("path", { fill: "currentColor", d: "M16.61 13.5c-.8.35-1.5.86-2.07 1.5H9.5a2.5 2.5 0 0 1 0-5H17v1.5H9.5c-.55 0-1 .45-1 1s.45 1 1 1zm-13.11-1c0-2.21 1.79-4 4-4H18a2.495 2.495 0 0 1 1.45 4.53c.6.04 1.18.17 1.72.38c.52-.67.83-1.5.83-2.41c0-2.21-1.79-4-4-4H7.5C4.46 7 2 9.46 2 12.5S4.46 18 7.5 18h5.59c.09-.53.25-1.03.46-1.5H7.5c-2.21 0-4-1.79-4-4M15 18v2h8v-2z" }), " "] }));
|
|
678
681
|
}
|
|
679
682
|
export function IconCtrlWorkflow(props) {
|
|
680
|
-
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg",
|
|
681
|
-
// stroke="currentColor" strokeWidth="0.3px"
|
|
682
|
-
d: "M14.085 2H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3v2H5.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H13v-2h3a2 2 0 0 0 2-2V7h-1v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10v-.5q.001-.264.085-.5M12 17H8v-2h4zm3-14.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5V5h-.78a.5.5 0 0 0-.474.342l-.544 1.632A1.5 1.5 0 0 1 11.78 8H11v1.5a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-3a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5V7h.78a.5.5 0 0 0 .474-.342l.544-1.632A1.5 1.5 0 0 1 14.22 4H15zM10 7H8v2h2zm6-2h2V3h-2z" }) }));
|
|
683
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "1em", height: "1em", ...props, children: _jsx("path", { fill: "currentColor", d: "M4 12.308V18V6zm10.577 7.923q.54 0 .924-.384q.384-.383.384-.924q0-.54-.384-.924q-.384-.383-.924-.383t-.924.383t-.384.924t.384.924t.924.384M20 12q.54 0 .924-.384q.384-.383.384-.924q0-.54-.384-.924q-.383-.383-.924-.383t-.924.383q-.384.384-.384.924t.384.924T20 12M6.5 10.5h5.27v-1H6.5zm0 4h5.27v-1H6.5zM4.616 19q-.691 0-1.153-.462T3 17.384V6.616q0-.691.463-1.153T4.615 5h14.77q.69 0 1.152.463T21 6.616h-1q0-.231-.192-.424T19.385 6H4.615q-.23 0-.423.192T4 6.616v10.769q0 .23.192.423t.423.192h5.654v1zm9.961 2.23q-.961 0-1.635-.672q-.673-.674-.673-1.635q0-.84.515-1.461q.514-.622 1.293-.787v-2.367H19.5V12.94q-.779-.165-1.293-.786q-.515-.621-.515-1.462q0-.961.674-1.634q.673-.674 1.634-.674t1.635.674t.673 1.634q0 .84-.515 1.462q-.514.621-1.293.787v2.367h-5.423v1.367q.779.166 1.293.787q.515.62.515 1.461q0 .962-.673 1.635t-1.635.673" }) }));
|
|
683
684
|
}
|
|
684
685
|
export function IconBackhandIndexPointingRight(props) {
|
|
685
686
|
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 128 128", width: "1em", height: "1em", ...props, children: [_jsx("path", { fill: "#E0BB95", d: "M58.7 41.1c10.8.1 53.3.4 54.9.4c12.8.3 12.7 16.7.7 16.9c-1.5 0-25 1.1-32.2 1.3c5.2 2 7.5 11.9-3.1 14.9c5 2.6 6.4 12.9-4.2 14.7c3.8 2.5 4.3 10.9-6 14.2c-8.4 2.7-28.2 2-40.3-2.3c-9.1-3.3-8.4-5.8-16.7-5.6c-1.4 0-2.1-1.1-2.4-2.4c-1.3-5.9-1.9-26.3-.3-33.8c.4-1.6 1.7-1.8 2.2-1.9c2.1-.4 4.2-2.5 5-4.3c3.2-6.4 12.8-12.8 23.4-18.2c5.5-2.8 9.2-8.8 10.4-18.3c.8-6.3 8.6-7.7 11.8-2.5c2.2 3.6 2.9 7 2.9 10.4c.2 6.2-1.6 10.1-6.1 16.5" }), _jsx("defs", { children: _jsx("path", { id: "notoBackhandIndexPointingRightMediumLightSkinTone0", d: "M58.7 41.1c10.8.1 53.3.4 54.9.4c12.8.3 12.7 16.7.7 16.9c-1.5 0-25 1.1-32.2 1.3c5.2 2 7.5 11.9-3.1 14.9c5 2.6 6.4 12.9-4.2 14.7c3.8 2.5 4.3 10.9-6 14.2c-8.4 2.7-28.2 2-40.3-2.3c-9.1-3.3-8.4-5.8-16.7-5.6c-1.4 0-2.1-1.1-2.4-2.4c-1.3-5.9-1.9-26.3-.3-33.8c.4-1.6 1.7-1.8 2.2-1.9c2.1-.4 4.2-2.5 5-4.3c3.2-6.4 12.8-12.8 23.4-18.2c5.5-2.8 9.2-8.8 10.4-18.3c.8-6.3 8.6-7.7 11.8-2.5c2.2 3.6 2.9 7 2.9 10.4c.2 6.2-1.6 10.1-6.1 16.5" }) }), _jsx("clipPath", { id: "notoBackhandIndexPointingRightMediumLightSkinTone1", children: _jsx("use", { href: "#notoBackhandIndexPointingRightMediumLightSkinTone0" }) }), _jsx("g", { fill: "#D19661", clipPath: "url(#notoBackhandIndexPointingRightMediumLightSkinTone1)", children: _jsx("path", { d: "M73.3 59.5c.1 1.6 2.8 2.9 2.8 6.4c0 3.7-3 4.7-3.1 7.5c-.1 2.7 2 3.8 1.5 7.7c-.6 4.5-4.1 4-4.2 7.1c0 2.7 1.8 3.2 1.8 6.6c0 3.1-3 5.8-5.5 7s-1.2 3.4 0 3.4s11.9-1.3 14.5-8.2c3-8 11-29.6 8.8-36.9c-7.1-1-11.5-1.6-13.7-1.8c-.7-.1-2.9-.6-2.9 1.2M60.1 40.7c0 .9.1 1.5 1 1.5c1 0 43.6 2.1 51.6 2.3c9.2.2 8.7 7.6 5.9 10.1c-1.9 1.7.6 4 2.2 2.6s4.4-3.4 4.3-8.4s-4.4-8.6-8.4-8.9c-3.8-.3-56.6.8-56.6.8m-51.9 21c15.9 0 14.1-11.7 25.2-18.9c15.4-10.1 16.3-11.1 19.7-25.2c1.2-4.9 5.7-4.4 7.7-2.1s4.9-1.3 3.6-2.7s-7.8-7.7-14.8-1.1s-42 46.2-42 46.2z" }) }), _jsx("defs", { children: _jsx("use", { href: "#notoBackhandIndexPointingRightMediumLightSkinTone0", id: "notoBackhandIndexPointingRightMediumLightSkinTone2" }) }), _jsx("clipPath", { id: "notoBackhandIndexPointingRightMediumLightSkinTone3", children: _jsx("use", { href: "#notoBackhandIndexPointingRightMediumLightSkinTone2" }) }), _jsx("g", { fill: "#8D542E", clipPath: "url(#notoBackhandIndexPointingRightMediumLightSkinTone3)", children: _jsx("path", { d: "M58.7 41.1h-1.9c-.4 0-.8-.4-.2-1.3s5.8-8 5.8-15c0-3.2-.5-7.7-3.4-12.4c-.6-.9.2-1.4.9-1c.7.5 6.4 3.2 6.5 13.4s-7.7 16.3-7.7 16.3m65.1 8.8c-.5 0-1.1-.2-1.7 1c-.7 1.5-3.1 4.4-8.4 4.7s-38.1 2.5-38.9 2.5c-1.1 0-1.2 1.9.1 1.8c1.7-.1 7.2-.2 7.2-.2s30.9 1.8 36.9-.6c6.1-2.4 4.8-9.2 4.8-9.2M86.6 68.5c-.3-.1-.7-.1-1 .3c-1.5 2-4.6 3.5-10.6 3.3c-1.4 0-1.6 2.7.1 2.7c.7 0 4-.1 4-.1l6.6-.2zm-3.6 15c-.3-.1-.7-.1-1.1.4c-1.5 2-3.5 2.8-9.7 3c-1.5.1-1.4 2.6.2 2.6c1.1 0 2.4-.1 2.4-.1l7-.6zm-5.4 12.7c-.3-.1-.8-.2-1.2.4c-.8 1.1-2.9 3-7.5 4.4c-3.7 1.1-21.3 1.9-32.5-.7c-2.3-.5-9.9-3-13.6-5.3s-7.3-1.6-8.3-1.4s-6.3.7-6.3.7l2.5 3.7l27 8.6l38.5-.6z" }) })] }));
|