@topconsultnpm/sdkui-react 6.20.0-dev1.7 → 6.20.0-dev1.70
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/NewComponents/ContextMenu/TMContextMenu.js +258 -17
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +2 -0
- package/lib/components/NewComponents/ContextMenu/hooks.js +17 -4
- package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
- package/lib/components/NewComponents/ContextMenu/index.js +2 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +5 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +59 -31
- package/lib/components/NewComponents/ContextMenu/types.d.ts +13 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +517 -100
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +19 -5
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +206 -54
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +1 -2
- package/lib/components/base/TMAccordionNew.js +35 -14
- package/lib/components/base/TMCustomButton.js +61 -17
- package/lib/components/base/TMDataGrid.d.ts +7 -4
- package/lib/components/base/TMDataGrid.js +142 -11
- package/lib/components/base/TMDropDownMenu.js +19 -18
- package/lib/components/base/TMPanel.js +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +8 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMUserChooser.d.ts +0 -5
- package/lib/components/choosers/TMUserChooser.js +25 -45
- package/lib/components/editors/TMMetadataValues.js +23 -5
- package/lib/components/editors/TMTextBox.js +6 -3
- package/lib/components/features/documents/TMDcmtForm.d.ts +13 -1
- package/lib/components/features/documents/TMDcmtForm.js +386 -194
- package/lib/components/features/documents/TMDcmtPreview.js +41 -105
- package/lib/components/features/documents/TMMasterDetailDcmts.js +37 -52
- package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
- package/lib/components/features/documents/TMRelationViewer.js +2 -2
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +5 -10
- package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
- package/lib/components/features/search/TMSearch.js +41 -9
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +19 -18
- package/lib/components/features/search/TMSearchResult.js +118 -242
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.js +205 -169
- package/lib/components/features/search/TMSignSettingsForm.js +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
- package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
- package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
- package/lib/components/features/tasks/TMTaskForm.js +20 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
- package/lib/components/features/tasks/TMTasksUtils.js +62 -52
- package/lib/components/features/tasks/TMTasksView.js +6 -6
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +134 -24
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +1 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +2 -3
- package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +2 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +21 -4
- package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
- package/lib/components/forms/Login/LoginValidatorService.js +7 -2
- package/lib/components/forms/Login/TMLoginForm.js +34 -6
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +55 -30
- package/lib/components/grids/TMRecentsManager.js +20 -10
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.js +4 -0
- package/lib/components/settings/SettingsAppearance.js +92 -29
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +35 -71
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
- package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +19 -0
- package/lib/helper/SDKUI_Globals.js +11 -0
- package/lib/helper/SDKUI_Localizator.d.ts +15 -1
- package/lib/helper/SDKUI_Localizator.js +147 -1
- package/lib/helper/TMIcons.d.ts +2 -0
- package/lib/helper/TMIcons.js +6 -0
- package/lib/helper/TMPdfViewer.d.ts +8 -0
- package/lib/helper/TMPdfViewer.js +373 -0
- package/lib/helper/checkinCheckoutManager.d.ts +32 -2
- package/lib/helper/checkinCheckoutManager.js +115 -38
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +2 -1
- package/lib/helper/helpers.js +14 -3
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/helper/queryHelper.d.ts +1 -1
- package/lib/helper/queryHelper.js +33 -3
- package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
- package/lib/hooks/useCheckInOutOperations.js +223 -0
- package/lib/hooks/useDataListItem.d.ts +12 -0
- package/lib/hooks/useDataListItem.js +131 -0
- package/lib/hooks/useDataUserIdItem.d.ts +10 -0
- package/lib/hooks/useDataUserIdItem.js +96 -0
- package/lib/hooks/useSettingsFeedback.d.ts +11 -0
- package/lib/hooks/useSettingsFeedback.js +38 -0
- package/lib/hooks/useWorkflowApprove.d.ts +4 -0
- package/lib/hooks/useWorkflowApprove.js +14 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/ts/types.d.ts +58 -1
- package/lib/utils/theme.d.ts +1 -1
- package/lib/utils/theme.js +1 -1
- package/package.json +5 -2
- package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
- package/lib/components/NewComponents/Notification/Notification.js +0 -60
- package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
- package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
- package/lib/components/NewComponents/Notification/index.d.ts +0 -2
- package/lib/components/NewComponents/Notification/index.js +0 -2
- package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
- package/lib/components/NewComponents/Notification/styles.js +0 -180
- package/lib/components/NewComponents/Notification/types.d.ts +0 -18
- package/lib/components/NewComponents/Notification/types.js +0 -1
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { OwnershipLevels, SDK_Localizator, UserLevels, UserListCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
|
-
import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator,
|
|
5
|
-
import { StyledDivHorizontal
|
|
4
|
+
import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator, LocalizeOwnershipLevels, LocalizeUserLevels, IconShowAllUsersOff, IconShowAllUsers } from '../../helper';
|
|
5
|
+
import { StyledDivHorizontal } from '../base/Styled';
|
|
6
6
|
import TMSpinner from '../base/TMSpinner';
|
|
7
|
-
import TMTooltip from '../base/TMTooltip';
|
|
8
7
|
import TMSummary from '../editors/TMSummary';
|
|
9
8
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
10
|
-
import { TMColors } from '../../utils/theme';
|
|
11
|
-
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
12
9
|
import TMButton from '../base/TMButton';
|
|
10
|
+
import TMDataUserIdItemViewer from '../viewers/TMDataUserIdItemViewer';
|
|
13
11
|
const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon, width, dataSource, backgroundColor, openChooserBySingleClick, buttons = [], disabled = false, showBorder = true, hideRefresh = false, hideShowId = false, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], onValueChanged, showClearButton, initialShowChooser = false, allowShowAllUsers = false }) => {
|
|
14
12
|
const [showChooser, setShowChooser] = useState(initialShowChooser);
|
|
15
13
|
useEffect(() => {
|
|
@@ -18,7 +16,7 @@ const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon,
|
|
|
18
16
|
const summaryInputRef = useRef(null);
|
|
19
17
|
const renderTemplate = () => {
|
|
20
18
|
const isPlaceholder = values?.[0] === placeHolder;
|
|
21
|
-
return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [values && values.length > 0 && _jsx(
|
|
19
|
+
return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [values && values.length > 0 && _jsx(TMDataUserIdItemViewer, { userId: values?.[0], showIcon: true }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
|
22
20
|
};
|
|
23
21
|
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { ref: summaryInputRef, width: width, disabled: disabled, placeHolder: placeHolder, readOnly: readOnly, labelColor: labelColor, icon: icon, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, openEditorOnSummaryClick: openChooserBySingleClick, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
|
24
22
|
_jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, allowShowAllUsers: allowShowAllUsers, onClose: () => {
|
|
@@ -67,40 +65,6 @@ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh
|
|
|
67
65
|
const customButton = (allowShowAllUsers && dataSource) ? (_jsx(TMButton, { btnStyle: 'toolbar', caption: showingAllUsers ? SDKUI_Localizator.HideAll : SDKUI_Localizator.ShowAll, onClick: handleToggleAllUsers, icon: showingAllUsers ? _jsx(IconShowAllUsersOff, {}) : _jsx(IconShowAllUsers, {}) })) : undefined;
|
|
68
66
|
return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: allowMultipleSelection, startWithShowOnlySelectedItems: startWithShowOnlySelectedItems, hasShowOnlySelectedItems: hasShowOnlySelectedItems, width: width, height: height, manageUseLocalizedName: false, columns: columns ?? dataColumns, showDefaultColumns: false, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, dataSource: currentDataSource, getItems: getItems, hasShowId: !hideShowId, hideRefresh: hideRefresh, customButtons: customButton, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
|
|
69
67
|
};
|
|
70
|
-
export const TMUserIdViewer = ({ userId, showIcon = false, noneSelectionText = `<${SDKUI_Localizator.NoneSelection}>` }) => {
|
|
71
|
-
const [ud, setUd] = useState();
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
if (!userId || userId <= 0) {
|
|
74
|
-
setUd(undefined);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.Users} ...` });
|
|
78
|
-
UserListCacheService.GetAsync(userId).then((ud) => { setUd(ud); TMSpinner.hide(); }).catch((err) => { TMExceptionBoxManager.show({ exception: err }); });
|
|
79
|
-
}, [userId]);
|
|
80
|
-
const getIcon = () => {
|
|
81
|
-
if (!showIcon)
|
|
82
|
-
return null;
|
|
83
|
-
if (!userId)
|
|
84
|
-
return null;
|
|
85
|
-
return ud ?
|
|
86
|
-
_jsx(TMUserIcon, { ud: ud })
|
|
87
|
-
:
|
|
88
|
-
_jsx(TMTooltip, { content: SDKUI_Localizator.ValueNotPresent, children: _jsx(IconWarning, { color: TMColors.warning }) });
|
|
89
|
-
};
|
|
90
|
-
const getDescription = () => {
|
|
91
|
-
if (!userId)
|
|
92
|
-
return undefined;
|
|
93
|
-
return ud ? getCompleteUserName(ud.domain, ud.name) : userId.toString() ?? noneSelectionText;
|
|
94
|
-
};
|
|
95
|
-
return (_jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '4px' }, children: [getIcon(), _jsx("span", { children: getDescription() })] })
|
|
96
|
-
// <StyledDivHorizontal>
|
|
97
|
-
// {getIcon()}
|
|
98
|
-
// <p style={{ textAlign: 'left', marginLeft: showIcon ? '5px' : '', opacity: ud ? 1 : 0.5 }}>
|
|
99
|
-
// {getDescription()}
|
|
100
|
-
// </p>
|
|
101
|
-
// </StyledDivHorizontal>
|
|
102
|
-
);
|
|
103
|
-
};
|
|
104
68
|
export const TMUserIcon = ({ ud }) => {
|
|
105
69
|
if (!ud)
|
|
106
70
|
return null;
|
|
@@ -109,12 +73,28 @@ export const TMUserIcon = ({ ud }) => {
|
|
|
109
73
|
return (_jsx(TMUserTooltip, { ud: ud, children: icon }));
|
|
110
74
|
};
|
|
111
75
|
export const TMUserTooltip = ({ ud, children }) => {
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
76
|
+
const buildTitle = (ud) => {
|
|
77
|
+
if (!ud)
|
|
78
|
+
return '';
|
|
79
|
+
const isExpired = User_IsExpired(ud);
|
|
80
|
+
return [
|
|
81
|
+
`ID: ${ud.id ?? ''}`,
|
|
82
|
+
`${SDKUI_Localizator.Name}: ${getCompleteUserName(ud.domain, ud.name) ?? ''}`,
|
|
83
|
+
ud.description && `${SDKUI_Localizator.Description}: ${ud.description}`,
|
|
84
|
+
ud.type && `${SDKUI_Localizator.Type}: ${ud.type}`,
|
|
85
|
+
ud.level && `${SDKUI_Localizator.UserLevel}: ${LocalizeUserLevels(ud.level) ?? ''}`,
|
|
86
|
+
`${SDKUI_Localizator.Valid}: ${isExpired ? SDKUI_Localizator.No : SDKUI_Localizator.Yes}`,
|
|
87
|
+
`${SDKUI_Localizator.Disabled}: ${ud.disabled ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}`,
|
|
88
|
+
`---`,
|
|
89
|
+
`${SDKUI_Localizator.OwnerName}: ${ud.ownerName ?? ''} (${ud.ownerID ?? ''})`,
|
|
90
|
+
`${SDKUI_Localizator.OwnershipLevel}: ${LocalizeOwnershipLevels(ud.ownershipLevel) ?? ''}`,
|
|
91
|
+
`${SDKUI_Localizator.CreationTime}: ${ud.creationTime?.toDateString() ?? ''}`,
|
|
92
|
+
`${SDKUI_Localizator.LastUpdateTime}: ${ud.lastUpdateTime?.toDateString() ?? ''}`
|
|
93
|
+
]
|
|
94
|
+
.filter(Boolean)
|
|
95
|
+
.join('\n');
|
|
116
96
|
};
|
|
117
|
-
return (_jsx(
|
|
97
|
+
return (_jsx("div", { title: buildTitle(ud), children: children }));
|
|
118
98
|
};
|
|
119
99
|
const getCompleteUserName = (domain, name) => {
|
|
120
100
|
if (!name)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import styled from "styled-components";
|
|
4
|
-
import { AccessLevels, DcmtTypeListCacheService, LayoutGroupBorderStyles, LayoutGroupOrientations, LayoutItemTypes, LayoutModes, MetadataDataDomains, MetadataDataTypes, SDK_Globals, SystemMIDsAsNumber, SystemTIDs,
|
|
5
|
-
import { IconUndo, IconPencil, IconFunction, IconMenuVertical, IconDataList, SDKUI_Localizator, IconNull, stringIsNullOrEmpty, deepCompare, SDKUI_Globals, IconDcmtTypeSys } from "../../helper";
|
|
4
|
+
import { AccessLevels, DcmtTypeListCacheService, LayoutGroupBorderStyles, LayoutGroupOrientations, LayoutItemTypes, LayoutModes, MetadataDataDomains, MetadataDataTypes, SDK_Globals, SystemMIDsAsNumber, SystemTIDs, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
|
|
5
|
+
import { IconUndo, IconPencil, IconFunction, IconMenuVertical, IconDataList, SDKUI_Localizator, IconNull, stringIsNullOrEmpty, deepCompare, SDKUI_Globals, IconDcmtTypeSys, isApprovalWorkflowView } from "../../helper";
|
|
6
6
|
import { TMColors } from "../../utils/theme";
|
|
7
7
|
import TMButton from "../base/TMButton";
|
|
8
8
|
import TMDropDownMenu from "../base/TMDropDownMenu";
|
|
@@ -389,17 +389,35 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
|
|
|
389
389
|
return (_jsxs("div", { style: { width: '100%' }, children: [draftData.length > 0 && _jsx(TMAccordion, { title: SDKUI_Localizator.Draft, children: draftData.map(item => renderMetadataItem(item, isReadOnly)) }), checkOutData.length > 0 && _jsx(TMAccordion, { title: `${SDKUI_Localizator.CheckIn}/${SDKUI_Localizator.CheckOut}`, children: checkOutData.map(item => renderMetadataItem(item, true)) })] }));
|
|
390
390
|
}, [metadataValues, showCheckBoxes, showNullValueCheckBoxes, isReadOnly, dynDataListsToBeRefreshed, validationItems, selectedMID, isOpenDistinctValues, openChooserBySingleClick, metadataValuesOrig]);
|
|
391
391
|
const layoutChronology = useMemo(() => {
|
|
392
|
-
|
|
392
|
+
// Definiamo l'ordine desiderato: Version, Tipo, Dimensione, Autore, Data Ultima modifica
|
|
393
|
+
const desiredChronologyOrder = [
|
|
394
|
+
ChronologyMIDs.Ver,
|
|
395
|
+
SystemMIDsAsNumber.FileExt,
|
|
396
|
+
SystemMIDsAsNumber.FileSize,
|
|
397
|
+
ChronologyMIDs.AuthorID,
|
|
398
|
+
ChronologyMIDs.CheckInTime,
|
|
399
|
+
];
|
|
400
|
+
const tempChronologyDataMap = {};
|
|
393
401
|
metadataValues.forEach(item => {
|
|
394
402
|
switch (item.md?.id) {
|
|
395
403
|
case ChronologyMIDs.Ver:
|
|
396
404
|
case ChronologyMIDs.AuthorID:
|
|
397
|
-
|
|
405
|
+
case ChronologyMIDs.CheckInTime:
|
|
406
|
+
case SystemMIDsAsNumber.FileExt:
|
|
407
|
+
case SystemMIDsAsNumber.FileSize:
|
|
408
|
+
tempChronologyDataMap[item.md.id] = item;
|
|
398
409
|
break;
|
|
399
410
|
default:
|
|
400
411
|
break;
|
|
401
412
|
}
|
|
402
413
|
});
|
|
414
|
+
// Visualizziamo nell'ordine desiderato
|
|
415
|
+
const chronologyData = [];
|
|
416
|
+
desiredChronologyOrder.forEach(id => {
|
|
417
|
+
if (tempChronologyDataMap[id]) {
|
|
418
|
+
chronologyData.push(tempChronologyDataMap[id]);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
403
421
|
return (_jsx("div", { style: { width: '100%' }, children: chronologyData.length > 0 && chronologyData.map(item => renderMetadataItem(item, isReadOnly)) }));
|
|
404
422
|
}, [metadataValues, showCheckBoxes, showNullValueCheckBoxes, isReadOnly, dynDataListsToBeRefreshed, validationItems, selectedMID, isOpenDistinctValues, openChooserBySingleClick, metadataValuesOrig]);
|
|
405
423
|
const layoutDsAttachs = useMemo(() => {
|
|
@@ -550,7 +568,7 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
|
|
|
550
568
|
if (allSystem) {
|
|
551
569
|
return metadataValues.map((item) => renderMetadataItem(item, true));
|
|
552
570
|
}
|
|
553
|
-
if (currentDTD
|
|
571
|
+
if (isApprovalWorkflowView(currentDTD) && !isReadOnly) {
|
|
554
572
|
return layoutWorkItem;
|
|
555
573
|
}
|
|
556
574
|
switch (currentDTD?.id) {
|
|
@@ -9,7 +9,7 @@ import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
|
9
9
|
import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
|
|
10
10
|
import TMVilViewer from '../base/TMVilViewer';
|
|
11
11
|
import TMTooltip from '../base/TMTooltip';
|
|
12
|
-
import
|
|
12
|
+
import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
|
|
13
13
|
import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
|
|
14
14
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
15
15
|
import { FormulaItemHelper } from './TMTextExpression';
|
|
@@ -94,7 +94,10 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
|
|
|
94
94
|
if (formulaItems && formulaItems.length > 0) {
|
|
95
95
|
let menuItems = [];
|
|
96
96
|
for (const formula of formulaItems) {
|
|
97
|
-
menuItems.push({
|
|
97
|
+
menuItems.push({
|
|
98
|
+
name: formula,
|
|
99
|
+
onClick: () => insertText(formula)
|
|
100
|
+
});
|
|
98
101
|
}
|
|
99
102
|
setFormulaMenuItems(menuItems);
|
|
100
103
|
}
|
|
@@ -269,7 +272,7 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
|
|
|
269
272
|
onBlur?.(undefined);
|
|
270
273
|
}, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
|
|
271
274
|
return (_jsx(StyledTextBoxEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
|
|
272
|
-
})] }), openFormulaItemsChooser(), formulaItems.length > 0 && (_jsx(
|
|
275
|
+
})] }), openFormulaItemsChooser(), formulaItems.length > 0 && (_jsx(TMContextMenu, { items: formulaMenuItems, target: `#text-${id}` })), _jsx(TMVilViewer, { vil: validationItems })] }));
|
|
273
276
|
};
|
|
274
277
|
const renderedLeftLabelTextBox = () => {
|
|
275
278
|
return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$color": labelColor, "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, children: label }), renderInputField()] }) })] }));
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { HomeBlogPost, LayoutModes, ObjectRef, SearchResultDescriptor, TaskDescriptor, ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { DcmtInfo, FormModes, MetadataValueDescriptorEx, TaskContext } from '../../../ts';
|
|
4
|
+
/**
|
|
5
|
+
* Definisce il contesto da cui è stato invocato il TMDcmtForm.
|
|
6
|
+
* Permette di gestire logiche diverse in base alla provenienza.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum InvocationContext {
|
|
9
|
+
/** Invocazione standard */
|
|
10
|
+
Default = "default",
|
|
11
|
+
/** Invocato dalla pagina Todo/Task */
|
|
12
|
+
Todo = "todo",
|
|
13
|
+
/** Invocato dalla pagina WorkflowCtrl */
|
|
14
|
+
WorkflowCtrl = "workflowCtrl"
|
|
15
|
+
}
|
|
4
16
|
interface ITMDcmtFormProps {
|
|
5
17
|
allTasks?: Array<TaskDescriptor>;
|
|
6
18
|
getAllTasks?: () => Promise<void>;
|
|
@@ -24,7 +36,7 @@ interface ITMDcmtFormProps {
|
|
|
24
36
|
canPrev?: boolean;
|
|
25
37
|
isClosable?: boolean;
|
|
26
38
|
groupId?: string;
|
|
27
|
-
|
|
39
|
+
invocationContext?: InvocationContext;
|
|
28
40
|
taskFormDialogComponent?: React.ReactNode;
|
|
29
41
|
taskMoreInfo?: TaskDescriptor;
|
|
30
42
|
showBackButton?: boolean;
|