@topconsultnpm/sdkui-react 6.20.0-dev1.11 → 6.20.0-dev1.110
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/assets/Toppy-help-center.png +0 -0
- package/lib/assets/headergradient.svg +87 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +285 -28
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +8 -1
- package/lib/components/NewComponents/ContextMenu/hooks.js +80 -8
- 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 +9 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +157 -37
- package/lib/components/NewComponents/ContextMenu/types.d.ts +14 -1
- 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 +563 -112
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +21 -5
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +210 -58
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +8 -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 +153 -11
- package/lib/components/base/TMDropDownMenu.js +19 -18
- package/lib/components/base/TMFileManager.d.ts +4 -3
- package/lib/components/base/TMFileManager.js +32 -24
- package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
- package/lib/components/base/TMFileManagerDataGridView.js +1 -11
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
- package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
- package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
- package/lib/components/base/TMListView.js +33 -15
- package/lib/components/base/TMPanel.d.ts +1 -1
- package/lib/components/base/TMPanel.js +1 -1
- package/lib/components/choosers/TMDistinctValues.js +2 -2
- 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/TMDateBox.js +18 -9
- package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
- package/lib/components/editors/TMLocalizedTextBox.js +16 -14
- package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
- package/lib/components/editors/TMMetadataTextBox.js +92 -0
- package/lib/components/editors/TMMetadataValues.js +23 -5
- package/lib/components/editors/TMTextArea.js +18 -30
- package/lib/components/editors/TMTextBox.d.ts +1 -1
- package/lib/components/editors/TMTextBox.js +6 -3
- package/lib/components/editors/TMTextExpression.js +6 -91
- package/lib/components/features/archive/TMArchive.js +2 -2
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +460 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
- package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
- package/lib/components/features/documents/TMDcmtForm.js +457 -206
- package/lib/components/features/documents/TMDcmtPreview.js +44 -110
- package/lib/components/features/documents/TMDcmtTasks.js +9 -9
- package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
- 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} +2 -2
- package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
- package/lib/components/features/search/TMSearch.d.ts +3 -0
- package/lib/components/features/search/TMSearch.js +50 -11
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +29 -21
- package/lib/components/features/search/TMSearchResult.d.ts +3 -0
- package/lib/components/features/search/TMSearchResult.js +208 -250
- 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 +2 -2
- package/lib/components/features/tasks/TMTaskForm.js +20 -1
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
- package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
- package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
- package/lib/components/features/tasks/TMTasksUtils.js +43 -36
- package/lib/components/features/tasks/TMTasksView.js +28 -19
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +139 -34
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +12 -7
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
- 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 +56 -31
- package/lib/components/grids/TMRecentsManager.js +20 -10
- package/lib/components/index.d.ts +6 -3
- package/lib/components/index.js +6 -3
- package/lib/components/query/TMQueryEditor.d.ts +2 -1
- package/lib/components/query/TMQueryEditor.js +92 -92
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/settings/SettingsAppearance.js +99 -30
- package/lib/components/sidebar/TMHeader.js +7 -7
- package/lib/components/sidebar/TMSidebar.d.ts +0 -1
- package/lib/components/sidebar/TMSidebar.js +16 -44
- package/lib/components/sidebar/TMSidebarItem.js +34 -17
- 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 +22 -0
- package/lib/helper/SDKUI_Globals.js +10 -1
- package/lib/helper/SDKUI_Localizator.d.ts +17 -1
- package/lib/helper/SDKUI_Localizator.js +167 -1
- package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
- package/lib/helper/TMCommandsContextMenu.js +15 -4
- package/lib/helper/TMIcons.d.ts +4 -0
- package/lib/helper/TMIcons.js +13 -3
- package/lib/helper/TMPdfViewer.d.ts +8 -0
- package/lib/helper/TMPdfViewer.js +373 -0
- package/lib/helper/checkinCheckoutManager.d.ts +31 -1
- package/lib/helper/checkinCheckoutManager.js +112 -30
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +28 -1
- package/lib/helper/helpers.js +130 -3
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +1 -1
- package/lib/helper/queryHelper.js +33 -3
- package/lib/helper/workItemsHelper.d.ts +6 -0
- package/lib/helper/workItemsHelper.js +230 -0
- 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 +132 -0
- package/lib/hooks/useDataUserIdItem.d.ts +10 -0
- package/lib/hooks/useDataUserIdItem.js +96 -0
- package/lib/hooks/useMetadataExpression.d.ts +19 -0
- package/lib/hooks/useMetadataExpression.js +99 -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 +3 -2
- package/lib/services/platform_services.d.ts +3 -3
- package/lib/ts/types.d.ts +61 -1
- package/lib/utils/theme.d.ts +1 -1
- package/lib/utils/theme.js +1 -1
- package/package.json +7 -4
- 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/base/TMContextMenu.d.ts +0 -25
- package/lib/components/base/TMContextMenu.js +0 -109
- package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
- package/lib/components/base/TMContextMenuOLD.js +0 -56
- package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
- package/lib/components/base/TMFloatingToolbar.js +0 -101
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
- package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import TMTextBox from './TMTextBox';
|
|
5
|
+
import TMMetadataTextBox from './TMMetadataTextBox';
|
|
5
6
|
import { IconLanguage, SDKUI_Localizator } from '../../helper';
|
|
6
7
|
import { CultureIDs } from '@topconsultnpm/sdk-ts';
|
|
7
8
|
import it from '../../assets/italy.svg';
|
|
@@ -13,11 +14,9 @@ import pt from '../../assets/portugal.svg';
|
|
|
13
14
|
import { createPortal } from 'react-dom';
|
|
14
15
|
const Portal = ({ children, popoverRef }) => {
|
|
15
16
|
const mount = document.body;
|
|
16
|
-
// Usa un ref per l'elemento del portale per evitare di ricrearlo ad ogni render
|
|
17
17
|
const elRef = useRef(document.createElement('div'));
|
|
18
18
|
useEffect(() => {
|
|
19
19
|
const el = elRef.current;
|
|
20
|
-
// Assegna il ref al div del portale
|
|
21
20
|
el.ref = popoverRef;
|
|
22
21
|
mount.appendChild(el);
|
|
23
22
|
return () => {
|
|
@@ -33,7 +32,7 @@ const LocalizedContainer = styled.div `
|
|
|
33
32
|
const Popover = styled.div `
|
|
34
33
|
display: ${props => props.$isVisible ? 'flex' : 'none'};
|
|
35
34
|
flex-direction: column;
|
|
36
|
-
position: fixed;
|
|
35
|
+
position: fixed;
|
|
37
36
|
top: ${props => props.$top}px;
|
|
38
37
|
left: ${props => props.$left}px;
|
|
39
38
|
width: ${props => props.$width}px;
|
|
@@ -41,7 +40,7 @@ const Popover = styled.div `
|
|
|
41
40
|
border-radius: 4px;
|
|
42
41
|
background-color: #fff;
|
|
43
42
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
44
|
-
z-index:
|
|
43
|
+
z-index: 1502;
|
|
45
44
|
padding: 8px;
|
|
46
45
|
`;
|
|
47
46
|
const Badge = styled.span `
|
|
@@ -72,10 +71,10 @@ export const getCultureIDImg = (cultureID) => {
|
|
|
72
71
|
default: return it;
|
|
73
72
|
}
|
|
74
73
|
};
|
|
75
|
-
const TMLocalizedTextBox = ({ label, value, value_IT, value_EN, value_FR, value_PT, value_ES, value_DE, isModifiedWhen, validationItems, onValueChanged, }) => {
|
|
74
|
+
const TMLocalizedTextBox = ({ label, value, value_IT, value_EN, value_FR, value_PT, value_ES, value_DE, isModifiedWhen, validationItems, qd, tid, onValueChanged, }) => {
|
|
76
75
|
const [isPopoverVisible, setIsPopoverVisible] = useState(false);
|
|
77
|
-
const containerRef = useRef(null);
|
|
78
|
-
const popoverRef = useRef(null);
|
|
76
|
+
const containerRef = useRef(null);
|
|
77
|
+
const popoverRef = useRef(null);
|
|
79
78
|
const [popoverPosition, setPopoverPosition] = useState({ top: 0, left: 0, width: 0 });
|
|
80
79
|
const languages = [
|
|
81
80
|
{ code: CultureIDs.It_IT, label: 'Italiano', value: value_IT },
|
|
@@ -85,13 +84,12 @@ const TMLocalizedTextBox = ({ label, value, value_IT, value_EN, value_FR, value_
|
|
|
85
84
|
{ code: CultureIDs.Es_ES, label: 'Español', value: value_ES },
|
|
86
85
|
{ code: CultureIDs.De_DE, label: 'Deutsch', value: value_DE },
|
|
87
86
|
];
|
|
88
|
-
// Calcola il numero di lingue con valori non nulli o vuoti
|
|
89
87
|
const localizedCount = languages.filter(lang => lang.value && lang.value.trim() !== '').length;
|
|
90
88
|
const handleTogglePopover = () => {
|
|
91
89
|
if (containerRef.current) {
|
|
92
90
|
const rect = containerRef.current.getBoundingClientRect();
|
|
93
91
|
setPopoverPosition({
|
|
94
|
-
top: rect.bottom,
|
|
92
|
+
top: rect.bottom,
|
|
95
93
|
left: rect.left,
|
|
96
94
|
width: rect.width
|
|
97
95
|
});
|
|
@@ -99,19 +97,23 @@ const TMLocalizedTextBox = ({ label, value, value_IT, value_EN, value_FR, value_
|
|
|
99
97
|
setIsPopoverVisible(prev => !prev);
|
|
100
98
|
};
|
|
101
99
|
const handleClosePopover = () => setIsPopoverVisible(false);
|
|
102
|
-
// Close popover when clicking outside
|
|
103
100
|
useEffect(() => {
|
|
101
|
+
if (!isPopoverVisible)
|
|
102
|
+
return;
|
|
104
103
|
const handleClickOutside = (event) => {
|
|
105
|
-
if (
|
|
106
|
-
containerRef.current &&
|
|
104
|
+
if (containerRef.current &&
|
|
107
105
|
!containerRef.current.contains(event.target) &&
|
|
108
106
|
popoverRef.current &&
|
|
109
107
|
!popoverRef.current.contains(event.target)) {
|
|
110
108
|
handleClosePopover();
|
|
111
109
|
}
|
|
112
110
|
};
|
|
113
|
-
|
|
111
|
+
// Ritarda l'aggiunta del listener per evitare che catturi il click di apertura
|
|
112
|
+
const timeoutId = setTimeout(() => {
|
|
113
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
114
|
+
}, 0);
|
|
114
115
|
return () => {
|
|
116
|
+
clearTimeout(timeoutId);
|
|
115
117
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
116
118
|
};
|
|
117
119
|
}, [isPopoverVisible]);
|
|
@@ -120,6 +122,6 @@ const TMLocalizedTextBox = ({ label, value, value_IT, value_EN, value_FR, value_
|
|
|
120
122
|
icon: (_jsxs(IconContainer, { children: [_jsx(IconLanguage, {}), localizedCount > 0 && _jsx(Badge, { children: localizedCount })] })),
|
|
121
123
|
onClick: handleTogglePopover,
|
|
122
124
|
};
|
|
123
|
-
return (_jsxs(LocalizedContainer, { ref: containerRef, children: [_jsx(TMTextBox, { type: "text", label: label, value: value, isModifiedWhen: isModifiedWhen, buttons: [localizationButton], validationItems: validationItems, onValueChanged: (e) => onValueChanged(CultureIDs.None, e.target.value) }), isPopoverVisible && (_jsx(Portal, { popoverRef: popoverRef, children: _jsx(Popover, { ref: popoverRef, "$isVisible": isPopoverVisible, "$top": popoverPosition.top, "$left": popoverPosition.left, "$width": popoverPosition.width, onMouseDown: (e) => e.stopPropagation(), children: languages.map((lang) => (_jsx(TMTextBox, { label: `${lang.label}`, showClearButton: true, icon: _jsx("img", { src: getCultureIDImg(lang.code), alt: "Lang", width: 18, height: 18 }), value: lang.value || '', onValueChanged: (e) => onValueChanged(lang.code, e.target.value) }, lang.code))) }) }))] }));
|
|
125
|
+
return (_jsxs(LocalizedContainer, { ref: containerRef, children: [(qd || tid) ? (_jsx(TMMetadataTextBox, { type: "text", label: label, value: value, isModifiedWhen: isModifiedWhen, buttons: [localizationButton], validationItems: validationItems, qd: qd, tid: tid, onValueChanged: (e) => onValueChanged(CultureIDs.None, e.target.value) })) : (_jsx(TMTextBox, { type: "text", label: label, value: value, isModifiedWhen: isModifiedWhen, buttons: [localizationButton], validationItems: validationItems, onValueChanged: (e) => onValueChanged(CultureIDs.None, e.target.value) })), isPopoverVisible && (_jsx(Portal, { popoverRef: popoverRef, children: _jsx(Popover, { ref: popoverRef, "$isVisible": isPopoverVisible, "$top": popoverPosition.top, "$left": popoverPosition.left, "$width": popoverPosition.width, onMouseDown: (e) => e.stopPropagation(), children: languages.map((lang) => ((qd || tid) ? (_jsx(TMMetadataTextBox, { label: `${lang.label}`, showClearButton: true, icon: _jsx("img", { src: getCultureIDImg(lang.code), alt: "Lang", width: 18, height: 18 }), value: lang.value || '', qd: qd, tid: tid, onValueChanged: (e) => onValueChanged(lang.code, e.target.value) }, lang.code)) : (_jsx(TMTextBox, { label: `${lang.label}`, showClearButton: true, icon: _jsx("img", { src: getCultureIDImg(lang.code), alt: "Lang", width: 18, height: 18 }), value: lang.value || '', onValueChanged: (e) => onValueChanged(lang.code, e.target.value) }, lang.code)))) }) }))] }));
|
|
124
126
|
};
|
|
125
127
|
export default TMLocalizedTextBox;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import type { ITMTextBox } from './TMTextBox';
|
|
4
|
+
interface ITMMetadataTextBox extends ITMTextBox {
|
|
5
|
+
qd?: QueryDescriptor;
|
|
6
|
+
tid?: number;
|
|
7
|
+
}
|
|
8
|
+
declare const TMMetadataTextBox: React.FC<ITMMetadataTextBox>;
|
|
9
|
+
export default TMMetadataTextBox;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import TMTextBox from './TMTextBox';
|
|
4
|
+
import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
|
|
5
|
+
import { useMetadataExpression } from '../../hooks/useMetadataExpression';
|
|
6
|
+
const TMMetadataTextBox = (props) => {
|
|
7
|
+
const { metadatas_Info_Source, Expression_IDs2Names, Expression_Names2IDs } = useMetadataExpression({
|
|
8
|
+
qd: props.qd,
|
|
9
|
+
tid: props.tid
|
|
10
|
+
});
|
|
11
|
+
const insertAtCursor = (textToInsert) => {
|
|
12
|
+
const currentValue = Expression_IDs2Names(props.value) || '';
|
|
13
|
+
let newValue = currentValue;
|
|
14
|
+
let cursorPosition = currentValue.length;
|
|
15
|
+
const activeElement = document.activeElement;
|
|
16
|
+
if (activeElement && activeElement.tagName === 'INPUT' && activeElement.selectionStart !== null) {
|
|
17
|
+
const start = activeElement.selectionStart || 0;
|
|
18
|
+
const end = activeElement.selectionEnd || 0;
|
|
19
|
+
newValue =
|
|
20
|
+
currentValue.substring(0, start) +
|
|
21
|
+
textToInsert +
|
|
22
|
+
currentValue.substring(end);
|
|
23
|
+
cursorPosition = start + textToInsert.length;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
newValue = currentValue + textToInsert;
|
|
27
|
+
cursorPosition = newValue.length;
|
|
28
|
+
}
|
|
29
|
+
const syntheticEvent = {
|
|
30
|
+
target: { value: Expression_Names2IDs(newValue) }
|
|
31
|
+
};
|
|
32
|
+
props.onValueChanged?.(syntheticEvent);
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
const activeElement = document.activeElement;
|
|
35
|
+
if (activeElement && activeElement.tagName === 'INPUT') {
|
|
36
|
+
activeElement.setSelectionRange(cursorPosition, cursorPosition);
|
|
37
|
+
activeElement.focus();
|
|
38
|
+
}
|
|
39
|
+
}, 0);
|
|
40
|
+
};
|
|
41
|
+
// Crea i menu items per il context menu
|
|
42
|
+
const contextMenuItems = useMemo(() => {
|
|
43
|
+
// Separa metadati di sistema (Mid < 100) da quelli normali
|
|
44
|
+
const systemMetadata = metadatas_Info_Source.filter(mh => mh.Mid < 100);
|
|
45
|
+
const normalMetadata = metadatas_Info_Source.filter(mh => mh.Mid >= 100);
|
|
46
|
+
const items = [];
|
|
47
|
+
// Aggiungi metadati normali
|
|
48
|
+
normalMetadata.forEach(mh => {
|
|
49
|
+
items.push({
|
|
50
|
+
name: mh.MetadataName,
|
|
51
|
+
onClick: () => insertAtCursor(`{@${mh.MetadataName}}`)
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
// Aggiungi sottomenu per metadati di sistema se presenti
|
|
55
|
+
if (systemMetadata.length > 0) {
|
|
56
|
+
items.push({
|
|
57
|
+
name: 'Metadati di sistema',
|
|
58
|
+
beginGroup: normalMetadata.length > 0, // Separatore se ci sono anche metadati normali
|
|
59
|
+
submenu: systemMetadata.map(mh => ({
|
|
60
|
+
name: mh.MetadataName,
|
|
61
|
+
onClick: () => insertAtCursor(`{@${mh.MetadataName}}`)
|
|
62
|
+
}))
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return items;
|
|
66
|
+
}, [metadatas_Info_Source, props.value]);
|
|
67
|
+
const renderButtons = () => {
|
|
68
|
+
const customButtons = [];
|
|
69
|
+
// Aggiungi eventuali bottoni custom passati via props
|
|
70
|
+
if (props.buttons) {
|
|
71
|
+
customButtons.push(...props.buttons);
|
|
72
|
+
}
|
|
73
|
+
return customButtons;
|
|
74
|
+
};
|
|
75
|
+
const handleValueChanged = (e) => {
|
|
76
|
+
const syntheticEvent = {
|
|
77
|
+
...e,
|
|
78
|
+
target: {
|
|
79
|
+
...e.target,
|
|
80
|
+
value: Expression_Names2IDs(e.target.value) || ''
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
props.onValueChanged?.(syntheticEvent);
|
|
84
|
+
};
|
|
85
|
+
// Se non ci sono metadati (qd o tid non specificati), usa TMTextBox normale
|
|
86
|
+
if (!props.qd && !props.tid) {
|
|
87
|
+
return (_jsx(TMTextBox, { ...props, buttons: renderButtons(), value: Expression_IDs2Names(props.value) ?? '', onValueChanged: handleValueChanged }));
|
|
88
|
+
}
|
|
89
|
+
// Altrimenti, wrappa TMTextBox con TMContextMenu
|
|
90
|
+
return (_jsx(TMContextMenu, { items: contextMenuItems, trigger: "right", children: _jsx(TMTextBox, { ...props, buttons: renderButtons(), value: Expression_IDs2Names(props.value) ?? '', onValueChanged: handleValueChanged }) }));
|
|
91
|
+
};
|
|
92
|
+
export default TMMetadataTextBox;
|
|
@@ -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) {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useState, useEffect, useRef } from 'react';
|
|
3
3
|
import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, StyledTextareaEditor } from './TMEditorStyled';
|
|
4
4
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
5
|
-
import TMContextMenu
|
|
5
|
+
import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
|
|
6
6
|
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
7
7
|
import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
|
|
8
8
|
import TMVilViewer from '../base/TMVilViewer';
|
|
@@ -35,14 +35,10 @@ const TMTextArea = (props) => {
|
|
|
35
35
|
const [isFocused, setIsFocused] = useState(false);
|
|
36
36
|
// Stores the current value of the textarea
|
|
37
37
|
const [currentValue, setCurrentValue] = useState(value);
|
|
38
|
-
// Stores the items for the context menu
|
|
39
|
-
const [formulaMenuItems, setFormulaMenuItems] = useState([]);
|
|
40
38
|
// Stores the calculated number of rows for the textarea
|
|
41
39
|
const [calculatedRows, setCalculatedRows] = useState(rows ?? 1);
|
|
42
40
|
//Show chooserForm formulaItems
|
|
43
41
|
const [showFormulaItemsChooser, setShowFormulaItemsChooser] = useState(false);
|
|
44
|
-
// Manages the state for the custom context menu
|
|
45
|
-
const { clicked, setClicked, points, setPoints } = useContextMenu();
|
|
46
42
|
const deviceType = useDeviceType();
|
|
47
43
|
// Attach a `ResizeObserver` to the textarea to monitor changes in width: dynamically updates rows based on textarea content and width
|
|
48
44
|
useEffect(() => {
|
|
@@ -69,16 +65,15 @@ const TMTextArea = (props) => {
|
|
|
69
65
|
setCalculatedRows(newRowCount);
|
|
70
66
|
}
|
|
71
67
|
}, [currentValue, autoCalculateRows]);
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
if (formulaItems
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, [formulaItems]);
|
|
68
|
+
// Build context menu items for formulas
|
|
69
|
+
const getFormulaMenuItems = () => {
|
|
70
|
+
if (!formulaItems || formulaItems.length === 0)
|
|
71
|
+
return [];
|
|
72
|
+
return formulaItems.map(formula => ({
|
|
73
|
+
name: formula,
|
|
74
|
+
onClick: () => insertText(formula)
|
|
75
|
+
}));
|
|
76
|
+
};
|
|
82
77
|
function getFormulaDataSorce() {
|
|
83
78
|
let fiarray = [];
|
|
84
79
|
if (!formulaItems)
|
|
@@ -153,20 +148,8 @@ const TMTextArea = (props) => {
|
|
|
153
148
|
};
|
|
154
149
|
// Renders the textarea
|
|
155
150
|
const renderTextArea = () => {
|
|
156
|
-
|
|
157
|
-
onBlur?.(currentValue); }, onChange: (e) => { setCurrentValue(e.target.value); onValueChanged?.(e); },
|
|
158
|
-
if (formulaItems.length <= 0)
|
|
159
|
-
return;
|
|
160
|
-
// prevent default right click behavior
|
|
161
|
-
e.preventDefault();
|
|
162
|
-
// set our click state to true when a user right clicks
|
|
163
|
-
setClicked(true);
|
|
164
|
-
const bounds = e.currentTarget.getBoundingClientRect();
|
|
165
|
-
const x = e.clientX - bounds.left;
|
|
166
|
-
const y = e.clientY - bounds.top;
|
|
167
|
-
// set the x and y coordinates of our users right click
|
|
168
|
-
setPoints({ x, y });
|
|
169
|
-
}, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: calculatedRows === 1 ? (label.length > 0 ? '20px' : '7px') : (label.length > 0 ? '22px' : '7px'), pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
|
|
151
|
+
const textareaElement = _jsxs(_Fragment, { children: [_jsx(StyledTextareaEditor, { ref: inputRef, autoFocus: autoFocus, readOnly: readOnly, disabled: disabled, value: currentValue, placeholder: placeHolder, rows: calculatedRows, maxLength: maxLength, spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
|
|
152
|
+
onBlur?.(currentValue); }, onChange: (e) => { setCurrentValue(e.target.value); onValueChanged?.(e); }, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: calculatedRows === 1 ? (label.length > 0 ? '20px' : '7px') : (label.length > 0 ? '22px' : '7px'), pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
|
|
170
153
|
_jsx(StyledTextAreaEditorButton, { onClick: () => {
|
|
171
154
|
setShowFormulaItemsChooser(true);
|
|
172
155
|
}, children: _jsx(IconDataList, {}) }), showClearButton && currentValue &&
|
|
@@ -178,7 +161,12 @@ const TMTextArea = (props) => {
|
|
|
178
161
|
onBlur?.(undefined);
|
|
179
162
|
}, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
|
|
180
163
|
return (_jsx(StyledTextAreaEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
|
|
181
|
-
})] }), openFormulaItemsChooser(),
|
|
164
|
+
})] }), openFormulaItemsChooser(), _jsx(TMVilViewer, { vil: validationItems })] });
|
|
165
|
+
// Wrap with context menu if formula items exist
|
|
166
|
+
if (formulaItems.length > 0) {
|
|
167
|
+
return (_jsx(TMContextMenu, { items: getFormulaMenuItems(), trigger: "right", children: textareaElement }));
|
|
168
|
+
}
|
|
169
|
+
return textareaElement;
|
|
182
170
|
};
|
|
183
171
|
// Layout for the textarea with a left-aligned label
|
|
184
172
|
const renderedLeftLabelTextArea = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ITMEditorBase } from '../base/TMEditorBase';
|
|
3
3
|
export type TextBoxType = 'text' | 'email' | 'password' | 'number' | 'secureText';
|
|
4
|
-
interface ITMTextBox extends ITMEditorBase {
|
|
4
|
+
export interface ITMTextBox extends ITMEditorBase {
|
|
5
5
|
autoFocus?: boolean;
|
|
6
6
|
formulaItems?: string[];
|
|
7
7
|
maxValue?: number;
|
|
@@ -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,96 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { DcmtTypeListCacheService } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
4
3
|
import { IconClear, IconColumns, SDKUI_Localizator, stringIsNullOrEmpty } from '../../helper';
|
|
5
|
-
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
6
4
|
import { TMMetadataChooserForm } from '../choosers/TMMetadataChooser';
|
|
7
5
|
import TMTextBox from './TMTextBox';
|
|
8
6
|
import TMTextArea from './TMTextArea';
|
|
7
|
+
import { useMetadataExpression } from '../../hooks/useMetadataExpression';
|
|
9
8
|
const TMTextExpression = (props) => {
|
|
10
|
-
const
|
|
9
|
+
const { metadatas_Info_Source, Expression_IDs2Names, Expression_Names2IDs } = useMetadataExpression({
|
|
10
|
+
qd: props.qd,
|
|
11
|
+
tid: props.tid
|
|
12
|
+
});
|
|
11
13
|
const [showMetadataChooser, setShowMetadataChooser] = useState(false);
|
|
12
14
|
const [showFormulaChooser, setShowFormulaChooser] = useState(false);
|
|
13
|
-
useEffect(() => { MetadataInfos_Source_Get_Async(); }, [props.qd]);
|
|
14
|
-
useEffect(() => { MetadataInfos_Source_GetByTID_Async(); }, [props.tid]);
|
|
15
|
-
async function MetadataInfos_Source_Get_Async() {
|
|
16
|
-
if (!props.qd?.select)
|
|
17
|
-
return;
|
|
18
|
-
let mhs_source = [];
|
|
19
|
-
try {
|
|
20
|
-
let dtd_source;
|
|
21
|
-
let md_source;
|
|
22
|
-
let tid_source = -1;
|
|
23
|
-
let si;
|
|
24
|
-
let sis = props.qd?.select?.slice();
|
|
25
|
-
sis = sis.slice().sort((a, b) => a.tid - b.tid);
|
|
26
|
-
for (si of sis) {
|
|
27
|
-
if (si.tid == undefined || si.mid == undefined)
|
|
28
|
-
continue;
|
|
29
|
-
if (tid_source != si.tid) {
|
|
30
|
-
dtd_source = await DcmtTypeListCacheService.GetAsync(si.tid, true);
|
|
31
|
-
if (dtd_source == undefined)
|
|
32
|
-
continue;
|
|
33
|
-
tid_source = si.tid;
|
|
34
|
-
}
|
|
35
|
-
if (dtd_source?.metadata == undefined)
|
|
36
|
-
continue;
|
|
37
|
-
md_source = dtd_source.metadata.find(o => o.id == si.mid);
|
|
38
|
-
if (md_source?.name == undefined)
|
|
39
|
-
continue;
|
|
40
|
-
if (tid_source == undefined)
|
|
41
|
-
continue;
|
|
42
|
-
mhs_source.push(new MetatadaHelper(si.mid, md_source.name));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
TMExceptionBoxManager.show({ exception: e, title: 'MetadataInfos_Source_Get_Async' });
|
|
47
|
-
}
|
|
48
|
-
setMetadatas_Info_Source(mhs_source);
|
|
49
|
-
}
|
|
50
|
-
async function MetadataInfos_Source_GetByTID_Async() {
|
|
51
|
-
if (!props.tid)
|
|
52
|
-
return;
|
|
53
|
-
let mhs_source = [];
|
|
54
|
-
try {
|
|
55
|
-
let dtd_source = await DcmtTypeListCacheService.GetAsync(props.tid, true);
|
|
56
|
-
if (dtd_source == undefined)
|
|
57
|
-
return;
|
|
58
|
-
if (dtd_source?.metadata == undefined)
|
|
59
|
-
return;
|
|
60
|
-
for (let md_source of dtd_source?.metadata) {
|
|
61
|
-
if (md_source?.name == undefined)
|
|
62
|
-
continue;
|
|
63
|
-
if (md_source?.id == undefined)
|
|
64
|
-
continue;
|
|
65
|
-
mhs_source.push(new MetatadaHelper(md_source.id, md_source.name));
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
catch (e) {
|
|
69
|
-
TMExceptionBoxManager.show({ exception: e, title: 'MetadataInfos_Source_GetByTID_Async' });
|
|
70
|
-
}
|
|
71
|
-
setMetadatas_Info_Source(mhs_source);
|
|
72
|
-
}
|
|
73
|
-
function Expression_IDs2Names(expression) {
|
|
74
|
-
if (expression == undefined)
|
|
75
|
-
return expression;
|
|
76
|
-
let temp = expression.slice();
|
|
77
|
-
let mh;
|
|
78
|
-
for (mh of metadatas_Info_Source) {
|
|
79
|
-
temp = temp.replaceAll(`{@${mh.Mid}}`, `{@${mh.MetadataName}}`);
|
|
80
|
-
}
|
|
81
|
-
temp = temp.replaceAll("{@1}", "{@DID}");
|
|
82
|
-
return temp;
|
|
83
|
-
}
|
|
84
|
-
function Expression_Names2IDs(expression) {
|
|
85
|
-
if (expression == undefined)
|
|
86
|
-
return expression;
|
|
87
|
-
let temp = expression.slice();
|
|
88
|
-
let mh;
|
|
89
|
-
for (mh of metadatas_Info_Source)
|
|
90
|
-
temp = temp.replaceAll(`{@${mh.MetadataName}}`, `{@${mh.Mid}}`);
|
|
91
|
-
temp = temp.replaceAll("{@DID}", "{@1}");
|
|
92
|
-
return temp;
|
|
93
|
-
}
|
|
94
15
|
const renderButtons = () => {
|
|
95
16
|
let buttons = [];
|
|
96
17
|
if (props.qd || props.tid)
|
|
@@ -167,12 +88,6 @@ const TMTextExpression = (props) => {
|
|
|
167
88
|
:
|
|
168
89
|
_jsx(TMTextArea, { buttons: renderButtons(), formulaItems: props.formulaItems, isModifiedWhen: props.value != props.valueOrig, label: props.label, rows: props.rows, resize: false, placeHolder: props.placeHolder, value: Expression_IDs2Names(props.value) ?? '', validationItems: props.validationItems, onValueChanged: (e) => { props.onValueChanged?.(Expression_Names2IDs(e.target.value)); } }), openMetadataChooseForm(), " "] }));
|
|
169
90
|
};
|
|
170
|
-
class MetatadaHelper {
|
|
171
|
-
constructor(mid, metadataName) {
|
|
172
|
-
this.Mid = mid;
|
|
173
|
-
this.MetadataName = metadataName;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
91
|
export class FormulaItemHelper {
|
|
177
92
|
constructor() {
|
|
178
93
|
this.id = 0;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import Logo from '../../../assets/Toppy-generico.png';
|
|
4
4
|
import { DcmtTypeListCacheService, LayoutModes, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
5
|
-
import { IconTree, SDKUI_Globals, SDKUI_Localizator, IconRecentlyViewed, IconPreview, IconShow, IconBoard, IconDcmtTypeSys, removeMruTid } from '../../../helper';
|
|
5
|
+
import { IconTree, SDKUI_Globals, SDKUI_Localizator, IconRecentlyViewed, IconPreview, IconShow, IconBoard, IconDcmtTypeSys, removeMruTid, getMoreInfoTasksForDocument } from '../../../helper';
|
|
6
6
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
7
7
|
import TMLayoutContainer from '../../base/TMLayout';
|
|
8
8
|
import TMRecentsManager from '../../grids/TMRecentsManager';
|
|
@@ -77,7 +77,7 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
77
77
|
if (onDcmtTypeSelect)
|
|
78
78
|
onDcmtTypeSelect(tidToUse);
|
|
79
79
|
passToSearch(tidToUse, outputMids);
|
|
80
|
-
} : undefined, isSharedDcmt: isSharedArchive, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }, currentTID)
|
|
80
|
+
} : undefined, isSharedDcmt: isSharedArchive, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, currentTID, currentTID === inputTID ? inputDID : undefined) }, currentTID)
|
|
81
81
|
:
|
|
82
82
|
_jsx(TMPanel, { title: 'Archiviazione', allowMaximize: false, children: _jsxs(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: [_jsx(StyledToppyTextContainer, { children: _jsx(StyledToppyText, { children: SDKUI_Localizator.DcmtTypeSelect }) }), _jsx(StyledToppyImage, { src: Logo, alt: 'Toppy' })] }) }), [currentTID, deviceType, mruTIDs, inputFile, currentInputMids, enableDragDropOverlay, isSharedArchive, allTasks]);
|
|
83
83
|
const allInitialPanelVisibility = {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface TMToppyDraggableHelpCenterProps {
|
|
3
|
+
/** Contenuto da visualizzare nella speech bubble */
|
|
4
|
+
content?: React.ReactNode;
|
|
5
|
+
/** Se true, renderizza Toppy nel document.body tramite Portal invece che nel parent */
|
|
6
|
+
usePortal?: boolean;
|
|
7
|
+
/** Allineamento iniziale del componente (destra o sinistra) */
|
|
8
|
+
align?: 'right' | 'left';
|
|
9
|
+
/** Visibilità del componente */
|
|
10
|
+
isVisible?: boolean;
|
|
11
|
+
/** Callback chiamato quando si clicca sull'immagine di Toppy */
|
|
12
|
+
onToppyImageClick?: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const TMToppyDraggableHelpCenter: (props: TMToppyDraggableHelpCenterProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default TMToppyDraggableHelpCenter;
|