@topconsultnpm/sdkui-react 6.19.0-dev2.43 → 6.19.0-dev2.45
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/TMButton.d.ts +1 -0
- package/lib/components/base/TMButton.js +6 -6
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -2
- package/lib/components/features/documents/TMDcmtForm.js +2 -2
- package/lib/components/features/search/TMSearchResult.js +2 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +1 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +2 -1
- package/package.json +1 -1
|
@@ -16,6 +16,7 @@ export interface ITMButton extends ITMEditorBase {
|
|
|
16
16
|
padding?: string;
|
|
17
17
|
showTooltip?: boolean;
|
|
18
18
|
onClick?: VoidFunction;
|
|
19
|
+
onMouseDown?: (e: any) => any;
|
|
19
20
|
}
|
|
20
21
|
declare const TMButton: React.ForwardRefExoticComponent<ITMButton & React.RefAttributes<HTMLButtonElement>>;
|
|
21
22
|
export default TMButton;
|
|
@@ -145,23 +145,23 @@ const StyledAdvancedButtonText = styled.div `
|
|
|
145
145
|
padding: 5px;
|
|
146
146
|
`;
|
|
147
147
|
const TMButton = forwardRef((props, ref) => {
|
|
148
|
-
const { width, height, keyGesture, btnStyle = 'normal', advancedColor, advancedType = 'primary', color = 'primary', fontSize = FontSize.defaultFontSize, disabled = false, showTooltip = true, caption, icon, description, padding, elementStyle, onClick = () => { } } = props;
|
|
148
|
+
const { width, height, keyGesture, btnStyle = 'normal', advancedColor, advancedType = 'primary', color = 'primary', fontSize = FontSize.defaultFontSize, disabled = false, showTooltip = true, caption, icon, description, padding, elementStyle, onClick = () => { }, onMouseDown = () => { } } = props;
|
|
149
149
|
const [isHovered, setIsHovered] = useState(false);
|
|
150
150
|
const renderedButton = () => {
|
|
151
151
|
if (btnStyle === 'normal') {
|
|
152
|
-
return (_jsx(StyledNormalButton, { ref: ref, width: width, height: height, color: color, caption: caption, disabled: disabled, fontSize: fontSize, onClick: onClick, children: caption }));
|
|
152
|
+
return (_jsx(StyledNormalButton, { ref: ref, width: width, height: height, color: color, caption: caption, disabled: disabled, fontSize: fontSize, onClick: onClick, onMouseDown: (e) => !disabled && onMouseDown?.(e), children: caption }));
|
|
153
153
|
}
|
|
154
154
|
else if (btnStyle === 'toolbar') {
|
|
155
|
-
return (_jsx(StyledToolbarButton, { ref: ref, color: color, caption: caption, disabled: disabled, fontSize: fontSize, onClick: onClick, children: icon }));
|
|
155
|
+
return (_jsx(StyledToolbarButton, { ref: ref, color: color, caption: caption, disabled: disabled, fontSize: fontSize, onClick: onClick, onMouseDown: (e) => !disabled && onMouseDown?.(e), children: icon }));
|
|
156
156
|
}
|
|
157
157
|
else if (btnStyle === 'icon') {
|
|
158
|
-
return (_jsx(StyledIconButton, { ref: ref, color: color, caption: caption, disabled: disabled, fontSize: fontSize, padding: padding, onClick: onClick, children: icon }));
|
|
158
|
+
return (_jsx(StyledIconButton, { ref: ref, color: color, caption: caption, disabled: disabled, fontSize: fontSize, padding: padding, onClick: onClick, onMouseDown: (e) => !disabled && onMouseDown?.(e), children: icon }));
|
|
159
159
|
}
|
|
160
160
|
else if (btnStyle === 'advanced') {
|
|
161
|
-
return (_jsxs(StyledAdvancedButton, { ref: ref, "$width": width ?? '90px', "$height": height ?? '30px', onMouseOver: () => !disabled && setIsHovered(true), onMouseOut: () => setIsHovered(false), "$isDisabled": disabled, "$isPrimaryOutline": advancedType === 'primary' && (advancedColor === 'primaryOutline' || color === 'primaryOutline'), onClick: () => !disabled && onClick?.(), children: [_jsx(StyledAdvancedButtonIcon, { "$color": advancedColor, "$isVisible": isHovered, "$isDisabled": disabled, "$type": advancedType, children: icon }), _jsx(StyledAdvancedButtonText, { "$color": advancedColor, "$isDisabled": disabled, "$type": advancedType, children: caption })] }));
|
|
161
|
+
return (_jsxs(StyledAdvancedButton, { ref: ref, "$width": width ?? '90px', "$height": height ?? '30px', onMouseOver: () => !disabled && setIsHovered(true), onMouseOut: () => setIsHovered(false), "$isDisabled": disabled, "$isPrimaryOutline": advancedType === 'primary' && (advancedColor === 'primaryOutline' || color === 'primaryOutline'), onClick: () => !disabled && onClick?.(), onMouseDown: (e) => !disabled && onMouseDown?.(e), children: [_jsx(StyledAdvancedButtonIcon, { "$color": advancedColor, "$isVisible": isHovered, "$isDisabled": disabled, "$type": advancedType, children: icon }), _jsx(StyledAdvancedButtonText, { "$color": advancedColor, "$isDisabled": disabled, "$type": advancedType, children: caption })] }));
|
|
162
162
|
}
|
|
163
163
|
else {
|
|
164
|
-
return (_jsx(StyledTextButton, { ref: ref, color: color, caption: caption, disabled: disabled, fontSize: fontSize, onClick: onClick, children: caption }));
|
|
164
|
+
return (_jsx(StyledTextButton, { ref: ref, color: color, caption: caption, disabled: disabled, fontSize: fontSize, onClick: onClick, onMouseDown: (e) => !disabled && onMouseDown?.(e), children: caption }));
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
167
|
const renderTooltip = () => {
|
|
@@ -8,8 +8,6 @@ interface ToppyDraggableHelpCenterProps {
|
|
|
8
8
|
content?: React.ReactNode;
|
|
9
9
|
/** Tipo di dispositivo per adattare il comportamento */
|
|
10
10
|
deviceType?: DeviceType;
|
|
11
|
-
/** Se utilizzare un portal per il rendering (non utilizzato attualmente) */
|
|
12
|
-
usePortal?: boolean;
|
|
13
11
|
/** Allineamento iniziale del componente (destra o sinistra) */
|
|
14
12
|
align?: 'right' | 'left';
|
|
15
13
|
/** Stato iniziale collassato/espanso */
|
|
@@ -34,7 +34,6 @@ import { useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManag
|
|
|
34
34
|
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
35
35
|
import { TMPanelManagerWithPersistenceProvider } from '../../layout/panelManager/TMPanelManagerWithPersistenceProvider';
|
|
36
36
|
import { useWorkflowApprove } from '../../../hooks/useWorkflowApprove';
|
|
37
|
-
import ToppyHelpCenter from '../assistant/ToppyHelpCenter';
|
|
38
37
|
import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
39
38
|
import WFDiagram from '../workflow/diagram/WFDiagram';
|
|
40
39
|
import TMTooltip from '../../base/TMTooltip';
|
|
@@ -42,6 +41,7 @@ import TMDcmtTasks from './TMDcmtTasks';
|
|
|
42
41
|
import TMToppyMessage from '../../../helper/TMToppyMessage';
|
|
43
42
|
import { getTaskAssignedToMe } from '../tasks/TMTasksUtils';
|
|
44
43
|
import TMCustomButton from '../../base/TMCustomButton';
|
|
44
|
+
import ToppyDraggableHelpCenter from '../assistant/ToppyDraggableHelpCenter';
|
|
45
45
|
let abortControllerLocal = new AbortController();
|
|
46
46
|
//#endregion
|
|
47
47
|
const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, showBackButton = true, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtFormSidebar = true, invokedByTodo = false, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", groupId, onWFOperationCompleted, onTaskCompleted, onTaskCreateRequest, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined, inputMids = [], onOpenS4TViewerRequest, s4TViewerDialogComponent, enableDragDropOverlay = false, passToSearch, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowButtonsRefs = false, onReferenceClick, }) => {
|
|
@@ -1353,7 +1353,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1353
1353
|
isEditable: true,
|
|
1354
1354
|
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
|
1355
1355
|
}));
|
|
1356
|
-
} }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowMoreInfoPopup(false) }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }), (showToppyForApprove || showToppyForCompleteMoreInfo || showToppyForReferences) && (_jsx(
|
|
1356
|
+
} }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowMoreInfoPopup(false) }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }), (showToppyForApprove || showToppyForCompleteMoreInfo || showToppyForReferences) && (_jsx(ToppyDraggableHelpCenter, { deviceType: deviceType, content: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [showToppyForApprove && (workItems.length === 1 ?
|
|
1357
1357
|
_jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), dtd: fromDTD })
|
|
1358
1358
|
:
|
|
1359
1359
|
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Devi approvare ${workItems.length} workitem(s) per questo documento.`, `Vai alla sezione di approvazione.`] })), showToppyForCompleteMoreInfo && (_jsxs(_Fragment, { children: [_jsx("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: `${SDKUI_Localizator.MoreInfoCompleteRequestSentBy} ${taskMoreInfo?.fromName}!` }), _jsx(TMButton, { caption: SDKUI_Localizator.CommentAndComplete, color: 'success', showTooltip: false, onClick: () => {
|
|
@@ -31,7 +31,6 @@ import TMDcmtBlog from '../documents/TMDcmtBlog';
|
|
|
31
31
|
import TMDcmtIcon from '../documents/TMDcmtIcon';
|
|
32
32
|
import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
33
33
|
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
34
|
-
import ToppyHelpCenter from '../assistant/ToppyHelpCenter';
|
|
35
34
|
import TMAccordion from '../../base/TMAccordion';
|
|
36
35
|
import TMDataGridExportForm from '../../base/TMDataGridExportForm';
|
|
37
36
|
import TMSearchResultFloatingActionButton from './TMSearchResultFloatingActionButton';
|
|
@@ -43,6 +42,7 @@ import TMSearch from './TMSearch';
|
|
|
43
42
|
import TMArchive from '../archive/TMArchive';
|
|
44
43
|
import { TMResultManager } from '../../forms/TMResultDialog';
|
|
45
44
|
import TMCustomButton from '../../base/TMCustomButton';
|
|
45
|
+
import ToppyDraggableHelpCenter from '../assistant/ToppyDraggableHelpCenter';
|
|
46
46
|
//#region Helper Methods
|
|
47
47
|
export const getSearchResultCountersSingleCategory = (searchResults) => {
|
|
48
48
|
// let totDcmtTypes = searchResults.length;
|
|
@@ -585,7 +585,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
585
585
|
setIsModifiedBatchUpdate(false);
|
|
586
586
|
await refreshSelectionDataRowsAsync();
|
|
587
587
|
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), (showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup && !openS4TViewer && !showTodoDcmtForm) &&
|
|
588
|
-
_jsx(
|
|
588
|
+
_jsx(ToppyDraggableHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => {
|
|
589
589
|
setShowApprovePopup(true);
|
|
590
590
|
}, onSignApprove: () => {
|
|
591
591
|
handleSignApprove();
|
|
@@ -80,7 +80,7 @@ export const WorkFlowOperationButtons = (props) => {
|
|
|
80
80
|
setIsSignWorkflow(false);
|
|
81
81
|
}
|
|
82
82
|
}, [dtd]);
|
|
83
|
-
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?.(), 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(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), 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" })] })) }));
|
|
83
|
+
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" })] })) }));
|
|
84
84
|
};
|
|
85
85
|
export const WorkFlowApproveRejectPopUp = ({ TID = 0, DID = 0, deviceType = DeviceType.DESKTOP, isReject, selectedItems = [], onClose, onCompleted }) => {
|
|
86
86
|
const [commentValue, setCommentValue] = useState('');
|
|
@@ -59,7 +59,8 @@ export { default as TMBlogAttachments } from './grids/TMBlogAttachments';
|
|
|
59
59
|
export { default as TMBlogCommentForm } from './features/blog/TMBlogCommentForm';
|
|
60
60
|
export * from './query/TMQueryEditor';
|
|
61
61
|
export * from './query/TMQuerySummary';
|
|
62
|
-
export
|
|
62
|
+
export { default as ToppyHelpCenter } from './features/assistant/ToppyHelpCenter';
|
|
63
|
+
export { default as ToppyDraggableHelpCenter } from './features/assistant/ToppyDraggableHelpCenter';
|
|
63
64
|
export * from './features/documents/TMDcmtForm';
|
|
64
65
|
export * from './features/documents/TMDcmtIcon';
|
|
65
66
|
export * from './features/documents/TMDcmtPreview';
|
package/lib/components/index.js
CHANGED
|
@@ -66,7 +66,8 @@ export { default as TMBlogCommentForm } from './features/blog/TMBlogCommentForm'
|
|
|
66
66
|
export * from './query/TMQueryEditor';
|
|
67
67
|
export * from './query/TMQuerySummary';
|
|
68
68
|
//assistant
|
|
69
|
-
export
|
|
69
|
+
export { default as ToppyHelpCenter } from './features/assistant/ToppyHelpCenter';
|
|
70
|
+
export { default as ToppyDraggableHelpCenter } from './features/assistant/ToppyDraggableHelpCenter';
|
|
70
71
|
//documents
|
|
71
72
|
export * from './features/documents/TMDcmtForm';
|
|
72
73
|
export * from './features/documents/TMDcmtIcon';
|