@topconsultnpm/sdkui-react 6.19.0-test.1 → 6.19.0
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/IconsS4t/add.svg +12 -12
- package/lib/assets/IconsS4t/aggiorna.svg +18 -18
- package/lib/assets/IconsS4t/bookmark.svg +42 -42
- package/lib/assets/IconsS4t/cancella.svg +15 -15
- package/lib/assets/IconsS4t/check-box.svg +19 -19
- package/lib/assets/IconsS4t/down-arrow-signBook.svg +40 -40
- package/lib/assets/IconsS4t/down.svg +28 -28
- package/lib/assets/IconsS4t/edit-file.svg +19 -19
- package/lib/assets/IconsS4t/edita.svg +32 -32
- package/lib/assets/IconsS4t/firma.svg +19 -19
- package/lib/assets/IconsS4t/icona_download.svg +16 -16
- package/lib/assets/IconsS4t/info.svg +51 -51
- package/lib/assets/IconsS4t/left.svg +20 -20
- package/lib/assets/IconsS4t/line.svg +40 -40
- package/lib/assets/IconsS4t/more.svg +19 -19
- package/lib/assets/IconsS4t/plus.svg +23 -23
- package/lib/assets/IconsS4t/printer.svg +49 -49
- package/lib/assets/IconsS4t/radio-on-button.svg +25 -25
- package/lib/assets/IconsS4t/rectangle.svg +41 -41
- package/lib/assets/IconsS4t/redo.svg +19 -19
- package/lib/assets/IconsS4t/right-arrow-signBook-finish.svg +40 -40
- package/lib/assets/IconsS4t/right-arrow-signBook.svg +40 -40
- package/lib/assets/IconsS4t/right.svg +22 -22
- package/lib/assets/IconsS4t/searchbar.svg +21 -21
- package/lib/assets/IconsS4t/text-box.svg +36 -36
- package/lib/assets/IconsS4t/tick.svg +8 -8
- package/lib/assets/IconsS4t/trash-white.svg +10 -10
- package/lib/assets/IconsS4t/undo.svg +19 -19
- package/lib/assets/IconsS4t/up.svg +32 -32
- package/lib/assets/IconsS4t/video-streaming.svg +2 -2
- package/lib/assets/IconsS4t/zoom-in.svg +58 -58
- package/lib/assets/IconsS4t/zoom-out.svg +56 -56
- package/lib/assets/icomoon.svg +96 -96
- package/lib/assets/italy.svg +16 -16
- package/lib/assets/six.svg +3 -3
- package/lib/assets/thumbnails/index.ts +39 -39
- package/lib/assets/topmedia-six.svg +65 -65
- package/lib/assets/topmeida-six-bianco.svg +65 -65
- package/lib/components/base/Styled.js +302 -302
- package/lib/components/base/TMAccordion.js +43 -43
- package/lib/components/base/TMAccordionNew.d.ts +28 -0
- package/lib/components/base/TMAccordionNew.js +326 -0
- package/lib/components/base/TMAreaManager.js +23 -23
- package/lib/components/base/TMButton.d.ts +1 -0
- package/lib/components/base/TMButton.js +136 -136
- package/lib/components/base/TMClosableList.js +46 -46
- package/lib/components/base/TMConfirm.js +20 -20
- package/lib/components/base/TMContextMenu.js +4 -4
- package/lib/components/base/TMContextMenuOLD.js +25 -25
- package/lib/components/base/TMCounterBar.js +32 -32
- package/lib/components/base/TMCounterContainer.js +30 -30
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +90 -35
- package/lib/components/base/TMDataGridExportForm.d.ts +1 -1
- package/lib/components/base/TMDataGridExportForm.js +9 -3
- package/lib/components/base/TMDropDownMenu.js +24 -24
- package/lib/components/base/TMFileManager.js +12 -3
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
- package/lib/components/base/TMFileManagerDataGridView.js +12 -3
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
- package/lib/components/base/TMFileManagerUtils.js +19 -19
- package/lib/components/base/TMFloatingToolbar.js +34 -34
- package/lib/components/base/TMLayout.js +44 -44
- package/lib/components/base/TMList.js +34 -34
- package/lib/components/base/TMModal.d.ts +2 -0
- package/lib/components/base/TMModal.js +79 -34
- package/lib/components/base/TMPanel.js +57 -57
- package/lib/components/base/TMPopUp.js +186 -117
- package/lib/components/base/TMProgressBar.js +20 -20
- package/lib/components/base/TMResizableMenu.js +28 -28
- package/lib/components/base/TMRightSidebar.js +40 -40
- package/lib/components/base/TMSpinner.js +121 -121
- package/lib/components/base/TMTab.js +11 -11
- package/lib/components/base/TMToggleButton.js +36 -36
- package/lib/components/base/TMToolbarCard.js +35 -35
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTooltip.js +1 -1
- package/lib/components/base/TMTreeView.js +16 -16
- package/lib/components/base/TMUserAvatar.js +7 -7
- package/lib/components/base/TMWaitPanel.js +30 -24
- package/lib/components/choosers/TMCultureIDPicker.js +35 -35
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.js +54 -54
- package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
- package/lib/components/choosers/TMDynDataListItemChooser.js +5 -4
- package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
- package/lib/components/choosers/TMMetadataChooser.js +31 -8
- package/lib/components/choosers/TMUserChooser.d.ts +4 -0
- package/lib/components/choosers/TMUserChooser.js +21 -5
- package/lib/components/editors/TMCheckBox.js +24 -24
- package/lib/components/editors/TMDateBox.d.ts +1 -1
- package/lib/components/editors/TMDropDown.js +43 -43
- package/lib/components/editors/TMEditorStyled.js +71 -71
- package/lib/components/editors/TMHtmlContentDisplay.js +16 -16
- package/lib/components/editors/TMLocalizedTextBox.js +31 -31
- package/lib/components/editors/TMMetadataValues.js +71 -22
- package/lib/components/editors/TMRadioButton.js +39 -39
- package/lib/components/editors/TMSummary.js +39 -39
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +56 -22
- package/lib/components/editors/TMTextBox.js +53 -23
- package/lib/components/editors/TMTextExpression.js +36 -28
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +30 -0
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +482 -0
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +9 -0
- package/lib/components/features/assistant/ToppySpeechBubble.js +117 -0
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -0
- package/lib/components/features/blog/TMBlogCommentForm.js +21 -9
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtForm.js +331 -65
- package/lib/components/features/documents/TMDcmtIcon.js +17 -12
- package/lib/components/features/documents/TMDcmtPreview.js +75 -38
- package/lib/components/features/documents/TMFileUploader.js +21 -21
- package/lib/components/features/documents/TMRelationViewer.js +56 -23
- package/lib/components/features/search/TMSavedQuerySelector.js +53 -53
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +14 -14
- package/lib/components/features/search/TMSearchQueryPanel.js +41 -59
- package/lib/components/features/search/TMSearchResult.js +256 -51
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.js +134 -0
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -2
- package/lib/components/features/search/TMSearchResultsMenuItems.js +94 -59
- package/lib/components/features/search/TMSignSettingsForm.d.ts +9 -0
- package/lib/components/features/search/TMSignSettingsForm.js +621 -0
- package/lib/components/features/search/TMTreeSelector.js +67 -67
- package/lib/components/features/search/TMViewHistoryDcmtForm.d.ts +18 -0
- package/lib/components/features/search/TMViewHistoryDcmtForm.js +215 -0
- package/lib/components/features/tasks/TMTaskForm.js +42 -36
- package/lib/components/features/tasks/TMTasksAgenda.js +4 -4
- package/lib/components/features/tasks/TMTasksCalendar.js +2 -2
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -1
- package/lib/components/features/tasks/TMTasksUtils.js +18 -3
- package/lib/components/features/tasks/TMTasksUtilsView.js +26 -4
- package/lib/components/features/tasks/TMTasksView.js +12 -6
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +9 -9
- package/lib/components/features/workflow/TMWorkflowPopup.js +44 -44
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +29 -29
- package/lib/components/features/workflow/diagram/ConnectionForm.js +10 -10
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +57 -57
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +40 -35
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +12 -12
- package/lib/components/features/workflow/diagram/RecipientList.js +39 -39
- package/lib/components/features/workflow/diagram/WFDiagram.js +317 -285
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.js +4 -4
- package/lib/components/forms/Login/Chooser.js +35 -35
- package/lib/components/forms/Login/Menu.js +22 -22
- package/lib/components/forms/Login/SelectBox.js +46 -46
- package/lib/components/forms/Login/TMLoginForm.js +14 -14
- package/lib/components/forms/Login/TextBox.js +57 -57
- package/lib/components/forms/TMResultDialog.js +8 -2
- package/lib/components/forms/TMSaveForm.js +3 -11
- package/lib/components/grids/TMBlogAttachments.d.ts +0 -14
- package/lib/components/grids/TMBlogAttachments.js +10 -5
- package/lib/components/grids/TMBlogsPost.d.ts +8 -3
- package/lib/components/grids/TMBlogsPost.js +100 -39
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +32 -11
- package/lib/components/grids/TMRecentsManager.js +52 -52
- package/lib/components/grids/TMValidationItemsList.js +48 -48
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +14 -14
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +36 -35
- package/lib/components/layout/panelManager/types.d.ts +1 -0
- package/lib/components/pages/TMPage.js +1 -1
- package/lib/components/query/TMQueryEditor.js +17 -17
- package/lib/components/query/TMQuerySummary.d.ts +1 -0
- package/lib/components/query/TMQuerySummary.js +15 -15
- package/lib/components/settings/SettingsAppearance.js +9 -1
- package/lib/components/sidebar/TMCommandsPanel.js +10 -10
- package/lib/components/sidebar/TMHeader.js +307 -307
- package/lib/components/sidebar/TMSidebar.js +24 -24
- package/lib/components/sidebar/TMSidebarItem.js +21 -21
- package/lib/components/viewers/TMDataListItemViewer.d.ts +1 -1
- package/lib/components/viewers/TMMidViewer.d.ts +1 -1
- package/lib/components/viewers/TMTidViewer.d.ts +1 -1
- package/lib/components/wizard/TMStepIndicator.js +102 -102
- package/lib/components/wizard/TMWizard.js +29 -29
- package/lib/helper/GlobalStyles.d.ts +2 -0
- package/lib/helper/GlobalStyles.js +10 -0
- package/lib/helper/Globalization.d.ts +1 -0
- package/lib/helper/Globalization.js +30 -0
- package/lib/helper/SDKUI_Globals.d.ts +9 -0
- package/lib/helper/SDKUI_Globals.js +10 -1
- package/lib/helper/SDKUI_Localizator.d.ts +59 -2
- package/lib/helper/SDKUI_Localizator.js +617 -22
- package/lib/helper/TMCustomSearchBar.js +1 -1
- package/lib/helper/TMIcons.d.ts +6 -1
- package/lib/helper/TMIcons.js +22 -2
- package/lib/helper/TMToppyMessage.d.ts +1 -0
- package/lib/helper/TMToppyMessage.js +33 -32
- package/lib/helper/TMUtils.d.ts +42 -4
- package/lib/helper/TMUtils.js +227 -60
- package/lib/helper/cicoHelper.d.ts +31 -0
- package/lib/helper/cicoHelper.js +155 -0
- package/lib/helper/dcmtsHelper.d.ts +2 -1
- package/lib/helper/dcmtsHelper.js +56 -17
- package/lib/helper/helpers.d.ts +8 -1
- package/lib/helper/helpers.js +43 -21
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useDcmtOperations.d.ts +1 -1
- package/lib/hooks/useDcmtOperations.js +10 -6
- package/lib/hooks/useRelatedDocuments.js +35 -26
- package/lib/ts/types.d.ts +3 -1
- package/package.json +54 -54
- package/lib/components/features/assistant/ToppyHelpCenter.d.ts +0 -12
- package/lib/components/features/assistant/ToppyHelpCenter.js +0 -173
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
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';
|
|
@@ -8,25 +8,27 @@ import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
|
|
|
8
8
|
import TMVilViewer from '../base/TMVilViewer';
|
|
9
9
|
import TMTooltip from '../base/TMTooltip';
|
|
10
10
|
import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
|
|
11
|
-
import { IconClearButton } from '../../helper';
|
|
11
|
+
import { IconClearButton, IconDataList, SDKUI_Localizator } from '../../helper';
|
|
12
12
|
import styled from 'styled-components';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
import { FormulaItemHelper } from './TMTextExpression';
|
|
14
|
+
import TMChooserForm from '../forms/TMChooserForm';
|
|
15
|
+
const StyledTextAreaEditorButton = styled.div `
|
|
16
|
+
color: ${TMColors.button_icon};
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
position: relative;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
&:focus{
|
|
22
|
+
outline: none;
|
|
23
|
+
background-image: linear-gradient(white, #E4E9F7);
|
|
24
|
+
border-bottom: 2px solid;
|
|
25
|
+
border-bottom-color: ${TMColors.primary};
|
|
26
|
+
}
|
|
25
27
|
`;
|
|
26
28
|
// Define the TMTextArea component
|
|
27
29
|
const TMTextArea = (props) => {
|
|
28
30
|
// Extract properties from the props object
|
|
29
|
-
const { label = '', value = '', width = '100%', height = 'auto', autoFocus = false, showClearButton, validationItems = [], disabled = false, isModifiedWhen = false, fontSize = FontSize.defaultFontSize, elementStyle = {}, icon = null, labelPosition = 'left', readOnly = false, onValueChanged, onBlur, placeHolder, formulaItems = [], buttons = [], maxHeight = 'auto', rows, maxLength, resize = true } = props;
|
|
31
|
+
const { label = '', value = '', width = '100%', height = 'auto', autoFocus = false, showClearButton, validationItems = [], disabled = false, isModifiedWhen = false, fontSize = FontSize.defaultFontSize, elementStyle = {}, icon = null, labelPosition = 'left', readOnly = false, onValueChanged, onBlur, placeHolder, formulaItems = [], buttons = [], maxHeight = 'auto', rows, maxLength, resize = true, autoCalculateRows = true } = props;
|
|
30
32
|
// Reference to the textarea DOM element
|
|
31
33
|
const inputRef = useRef(null);
|
|
32
34
|
// Stores the textarea is focused
|
|
@@ -37,11 +39,15 @@ const TMTextArea = (props) => {
|
|
|
37
39
|
const [formulaMenuItems, setFormulaMenuItems] = useState([]);
|
|
38
40
|
// Stores the calculated number of rows for the textarea
|
|
39
41
|
const [calculatedRows, setCalculatedRows] = useState(rows ?? 1);
|
|
42
|
+
//Show chooserForm formulaItems
|
|
43
|
+
const [showFormulaItemsChooser, setShowFormulaItemsChooser] = useState(false);
|
|
40
44
|
// Manages the state for the custom context menu
|
|
41
45
|
const { clicked, setClicked, points, setPoints } = useContextMenu();
|
|
42
46
|
const deviceType = useDeviceType();
|
|
43
47
|
// Attach a `ResizeObserver` to the textarea to monitor changes in width: dynamically updates rows based on textarea content and width
|
|
44
48
|
useEffect(() => {
|
|
49
|
+
if (!autoCalculateRows)
|
|
50
|
+
return;
|
|
45
51
|
const observer = new ResizeObserver(() => { if (currentValue) {
|
|
46
52
|
updateRows();
|
|
47
53
|
} });
|
|
@@ -51,18 +57,18 @@ const TMTextArea = (props) => {
|
|
|
51
57
|
return () => { if (inputRef.current) {
|
|
52
58
|
observer.unobserve(inputRef.current);
|
|
53
59
|
} };
|
|
54
|
-
}, [currentValue]);
|
|
60
|
+
}, [currentValue, autoCalculateRows]);
|
|
55
61
|
// Update current value whenever the `value` prop changes, synchronize the internal state with the `value` prop
|
|
56
62
|
useEffect(() => {
|
|
57
63
|
setCurrentValue(value);
|
|
58
64
|
}, [value]);
|
|
59
65
|
// Recalculate the number of rows whenever the `currentValue` changes
|
|
60
66
|
useEffect(() => {
|
|
61
|
-
if (currentValue) {
|
|
67
|
+
if (autoCalculateRows && currentValue) {
|
|
62
68
|
const newRowCount = calculateRows(currentValue);
|
|
63
69
|
setCalculatedRows(newRowCount);
|
|
64
70
|
}
|
|
65
|
-
}, [currentValue]);
|
|
71
|
+
}, [currentValue, autoCalculateRows]);
|
|
66
72
|
// Populate the formula menu items whenever the `formulaItems` prop changes
|
|
67
73
|
useEffect(() => {
|
|
68
74
|
if (formulaItems && formulaItems.length > 0) {
|
|
@@ -73,6 +79,30 @@ const TMTextArea = (props) => {
|
|
|
73
79
|
setFormulaMenuItems(menuItems);
|
|
74
80
|
}
|
|
75
81
|
}, [formulaItems]);
|
|
82
|
+
function getFormulaDataSorce() {
|
|
83
|
+
let fiarray = [];
|
|
84
|
+
if (!formulaItems)
|
|
85
|
+
return [];
|
|
86
|
+
let i = 0;
|
|
87
|
+
for (const f of formulaItems) {
|
|
88
|
+
let fi = new FormulaItemHelper();
|
|
89
|
+
fi.id = i;
|
|
90
|
+
fi.paramName = f;
|
|
91
|
+
fiarray.push(fi);
|
|
92
|
+
i++;
|
|
93
|
+
}
|
|
94
|
+
return fiarray;
|
|
95
|
+
}
|
|
96
|
+
const openFormulaItemsChooser = () => {
|
|
97
|
+
return (showFormulaItemsChooser ?
|
|
98
|
+
_jsx(TMChooserForm, { title: SDKUI_Localizator.Parameters, height: '350', width: '300', hasShowId: false, showDefaultColumns: false, allowMultipleSelection: true, columns: [
|
|
99
|
+
{ dataField: 'paramName', caption: SDKUI_Localizator.Name, dataType: 'string', sortOrder: 'asc', alignment: 'left' }
|
|
100
|
+
], dataSource: getFormulaDataSorce(), onClose: () => { setShowFormulaItemsChooser(false); }, onChoose: (IDs) => {
|
|
101
|
+
let expr = value?.toString() ?? '';
|
|
102
|
+
IDs.map(i => expr += formulaItems[i]);
|
|
103
|
+
onValueChanged?.({ target: { value: expr } });
|
|
104
|
+
} }) : _jsx(_Fragment, {}));
|
|
105
|
+
};
|
|
76
106
|
// Adjust the rows dynamically
|
|
77
107
|
const updateRows = () => {
|
|
78
108
|
const newRowCount = calculateRows(currentValue);
|
|
@@ -123,7 +153,7 @@ const TMTextArea = (props) => {
|
|
|
123
153
|
};
|
|
124
154
|
// Renders the textarea
|
|
125
155
|
const renderTextArea = () => {
|
|
126
|
-
return _jsxs(_Fragment, { children: [_jsx(StyledTextareaEditor, { ref: inputRef, autoFocus: autoFocus, readOnly: readOnly, disabled: disabled, value: currentValue, placeholder: placeHolder, rows: calculatedRows, maxLength: maxLength, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
|
|
156
|
+
return _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)
|
|
127
157
|
onBlur?.(currentValue); }, onChange: (e) => { setCurrentValue(e.target.value); onValueChanged?.(e); }, onContextMenu: (e) => {
|
|
128
158
|
if (formulaItems.length <= 0)
|
|
129
159
|
return;
|
|
@@ -136,15 +166,19 @@ const TMTextArea = (props) => {
|
|
|
136
166
|
const y = e.clientY - bounds.top;
|
|
137
167
|
// set the x and y coordinates of our users right click
|
|
138
168
|
setPoints({ x, y });
|
|
139
|
-
}, "$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: label.length > 0 ? '22px' : '7px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [
|
|
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 &&
|
|
170
|
+
_jsx(StyledTextAreaEditorButton, { onClick: () => {
|
|
171
|
+
setShowFormulaItemsChooser(true);
|
|
172
|
+
}, children: _jsx(IconDataList, {}) }), showClearButton && currentValue &&
|
|
140
173
|
_jsx(StyledTextAreaEditorButton, { onClick: () => {
|
|
141
174
|
onValueChanged?.({ target: { value: undefined } });
|
|
142
175
|
setCurrentValue('');
|
|
143
|
-
|
|
176
|
+
if (autoCalculateRows)
|
|
177
|
+
setCalculatedRows(1);
|
|
144
178
|
onBlur?.(undefined);
|
|
145
179
|
}, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
|
|
146
180
|
return (_jsx(StyledTextAreaEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
|
|
147
|
-
})] }), formulaItems.length > 0 && clicked && (_jsx(TMContextMenu, { menuData: formulaMenuItems, top: points.y, left: points.x, onMenuItemClick: (formula) => insertText(formula) })), _jsx(TMVilViewer, { vil: validationItems })] });
|
|
181
|
+
})] }), openFormulaItemsChooser(), formulaItems.length > 0 && clicked && (_jsx(TMContextMenu, { menuData: formulaMenuItems, top: points.y, left: points.x, onMenuItemClick: (formula) => insertText(formula) })), _jsx(TMVilViewer, { vil: validationItems })] });
|
|
148
182
|
};
|
|
149
183
|
// Layout for the textarea with a left-aligned label
|
|
150
184
|
const renderedLeftLabelTextArea = () => {
|
|
@@ -3,7 +3,7 @@ import { useState, useEffect, useRef } from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { StyledEditor, StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, editorColorManager } from './TMEditorStyled';
|
|
5
5
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
6
|
-
import { genUniqueId, IconClearButton, IconHide, IconShow, SDKUI_Localizator } from '../../helper';
|
|
6
|
+
import { genUniqueId, IconClearButton, IconDataList, IconHide, IconShow, SDKUI_Localizator } from '../../helper';
|
|
7
7
|
import ShowAlert from '../base/TMAlert';
|
|
8
8
|
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
9
9
|
import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
|
|
@@ -11,32 +11,35 @@ import TMVilViewer from '../base/TMVilViewer';
|
|
|
11
11
|
import TMTooltip from '../base/TMTooltip';
|
|
12
12
|
import { ContextMenu } from 'devextreme-react';
|
|
13
13
|
import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
import TMChooserForm from '../forms/TMChooserForm';
|
|
15
|
+
import { FormulaItemHelper } from './TMTextExpression';
|
|
16
|
+
const StyledShowPasswordIcon = styled.div `
|
|
17
|
+
color: ${props => !props.$disabled ? (props.$vil.length === 0) ? !props.$isModified ? TMColors.text_normal : TMColors.isModified : editorColorManager(props.$vil) : TMColors.disabled};
|
|
18
|
+
position: absolute;
|
|
19
|
+
right: 10px;
|
|
20
|
+
font-size: 18px;
|
|
21
|
+
transform: translateY(-25px);
|
|
22
|
+
cursor: pointer;
|
|
21
23
|
`;
|
|
22
|
-
const StyledTextBoxEditorButton = styled.div `
|
|
23
|
-
color: ${TMColors.button_icon};
|
|
24
|
-
display: flex;
|
|
25
|
-
align-items: center;
|
|
26
|
-
position: relative;
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
&:focus{
|
|
29
|
-
outline: none;
|
|
30
|
-
background-image: linear-gradient(white, #E4E9F7);
|
|
31
|
-
border-bottom: 2px solid;
|
|
32
|
-
border-bottom-color: ${TMColors.primary};
|
|
33
|
-
}
|
|
24
|
+
const StyledTextBoxEditorButton = styled.div `
|
|
25
|
+
color: ${TMColors.button_icon};
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
position: relative;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
&:focus{
|
|
31
|
+
outline: none;
|
|
32
|
+
background-image: linear-gradient(white, #E4E9F7);
|
|
33
|
+
border-bottom: 2px solid;
|
|
34
|
+
border-bottom-color: ${TMColors.primary};
|
|
35
|
+
}
|
|
34
36
|
`;
|
|
35
37
|
const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = false, scale, showClearButton, validationItems = [], label = '', readOnly = false, formulaItems = [], buttons = [], isModifiedWhen, placeHolder, elementStyle, width = '100%', maxValue, minValue, fontSize = FontSize.defaultFontSize, icon, labelPosition = 'left', value, disabled = false, type = 'text', onValueChanged, onBlur, borderRadius, allowedPattern }) => {
|
|
36
38
|
const [initialType, setInitialType] = useState(type);
|
|
37
39
|
const [currentType, setCurrentType] = useState(type);
|
|
38
40
|
const [currentValue, setCurrentValue] = useState(value);
|
|
39
41
|
const [formulaMenuItems, setFormulaMenuItems] = useState([]);
|
|
42
|
+
const [showFormulaItemsChooser, setShowFormulaItemsChooser] = useState(false);
|
|
40
43
|
const [isFocused, setIsFocused] = useState(false);
|
|
41
44
|
const inputRef = useRef(null);
|
|
42
45
|
const deviceType = useDeviceType();
|
|
@@ -219,6 +222,30 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
|
|
|
219
222
|
setCurrentValue(inputValue);
|
|
220
223
|
onValueChanged?.({ target: { value: inputValue } }); // Passa il valore filtrato
|
|
221
224
|
};
|
|
225
|
+
function getFormulaDataSorce() {
|
|
226
|
+
let fiarray = [];
|
|
227
|
+
if (!formulaItems)
|
|
228
|
+
return [];
|
|
229
|
+
let i = 0;
|
|
230
|
+
for (const f of formulaItems) {
|
|
231
|
+
let fi = new FormulaItemHelper();
|
|
232
|
+
fi.id = i;
|
|
233
|
+
fi.paramName = f;
|
|
234
|
+
fiarray.push(fi);
|
|
235
|
+
i++;
|
|
236
|
+
}
|
|
237
|
+
return fiarray;
|
|
238
|
+
}
|
|
239
|
+
const openFormulaItemsChooser = () => {
|
|
240
|
+
return (showFormulaItemsChooser ?
|
|
241
|
+
_jsx(TMChooserForm, { title: SDKUI_Localizator.Parameters, height: '350', width: '300', hasShowId: false, showDefaultColumns: false, allowMultipleSelection: true, columns: [
|
|
242
|
+
{ dataField: 'paramName', caption: SDKUI_Localizator.Name, dataType: 'string', sortOrder: 'asc', alignment: 'left' }
|
|
243
|
+
], dataSource: getFormulaDataSorce(), onClose: () => { setShowFormulaItemsChooser(false); }, onChoose: (IDs) => {
|
|
244
|
+
let expr = value?.toString() ?? '';
|
|
245
|
+
IDs.map(i => expr += formulaItems[i]);
|
|
246
|
+
onValueChanged?.({ target: { value: expr } });
|
|
247
|
+
} }) : _jsx(_Fragment, {}));
|
|
248
|
+
};
|
|
222
249
|
const renderInputField = () => {
|
|
223
250
|
const bulletEntity = '\u2022'; // •
|
|
224
251
|
const displayedValue = initialType === 'secureText'
|
|
@@ -226,20 +253,23 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
|
|
|
226
253
|
? bulletEntity.repeat(currentValue?.length ?? 0)
|
|
227
254
|
: currentValue ?? '')
|
|
228
255
|
: currentValue ?? '';
|
|
229
|
-
return (_jsxs("div", { style: { width: '100%', height: 'fit-content' }, id: `text-${id}`, children: [_jsx(StyledEditor, { ref: inputRef, id: `text-${label}-${id}`, name: label, autoFocus: autoFocus, readOnly: readOnly, type: currentType, disabled: disabled, value: displayedValue, width: width || '100%', placeholder: placeHolder, maxLength: maxLength, autoComplete: 'off', onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
|
|
256
|
+
return (_jsxs("div", { style: { width: '100%', height: 'fit-content' }, id: `text-${id}`, children: [_jsx(StyledEditor, { ref: inputRef, id: `text-${label}-${id}`, name: label, autoFocus: autoFocus, readOnly: readOnly, type: currentType, disabled: disabled, value: displayedValue, width: width || '100%', placeholder: placeHolder, maxLength: maxLength, autoComplete: 'off', spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
|
|
230
257
|
onBlur?.(currentValue); }, onChange: handleInputChange, onKeyDown: (e) => {
|
|
231
258
|
if (currentType === 'number') {
|
|
232
259
|
if (!scale && (e.key == "." || e.key == ","))
|
|
233
260
|
e.preventDefault();
|
|
234
261
|
}
|
|
235
262
|
}, "$isMobile": deviceType === DeviceType.MOBILE, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType, "$borderRadius": borderRadius }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' &&
|
|
236
|
-
_jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : '6px', top: label.length > 0 ? '20px' : '
|
|
263
|
+
_jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : '6px', top: label.length > 0 ? '20px' : '3px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
|
|
264
|
+
_jsx(StyledTextBoxEditorButton, { onClick: () => {
|
|
265
|
+
setShowFormulaItemsChooser(true);
|
|
266
|
+
}, children: _jsx(IconDataList, {}) }), showClearButton && currentValue &&
|
|
237
267
|
_jsx(StyledTextBoxEditorButton, { onClick: () => {
|
|
238
268
|
onValueChanged?.({ target: { value: undefined } });
|
|
239
269
|
onBlur?.(undefined);
|
|
240
270
|
}, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
|
|
241
271
|
return (_jsx(StyledTextBoxEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
|
|
242
|
-
})] }), formulaItems.length > 0 && (_jsx(ContextMenu, { dataSource: formulaMenuItems, target: `#text-${id}`, onItemClick: (e) => { insertText(e.itemData?.text ?? ''); } })), _jsx(TMVilViewer, { vil: validationItems })] }));
|
|
272
|
+
})] }), openFormulaItemsChooser(), formulaItems.length > 0 && (_jsx(ContextMenu, { dataSource: formulaMenuItems, target: `#text-${id}`, onItemClick: (e) => { insertText(e.itemData?.text ?? ''); } })), _jsx(TMVilViewer, { vil: validationItems })] }));
|
|
243
273
|
};
|
|
244
274
|
const renderedLeftLabelTextBox = () => {
|
|
245
275
|
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,10 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { DcmtTypeListCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
|
-
import { IconClear, IconColumns,
|
|
4
|
+
import { IconClear, IconColumns, SDKUI_Localizator, stringIsNullOrEmpty } from '../../helper';
|
|
5
5
|
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
6
6
|
import { TMMetadataChooserForm } from '../choosers/TMMetadataChooser';
|
|
7
|
-
import TMChooserForm from '../forms/TMChooserForm';
|
|
8
7
|
import TMTextBox from './TMTextBox';
|
|
9
8
|
import TMTextArea from './TMTextArea';
|
|
10
9
|
const TMTextExpression = (props) => {
|
|
@@ -96,8 +95,7 @@ const TMTextExpression = (props) => {
|
|
|
96
95
|
let buttons = [];
|
|
97
96
|
if (props.qd || props.tid)
|
|
98
97
|
buttons.push({ icon: _jsx(IconColumns, {}), text: SDKUI_Localizator.MetadataReferenceInsert, onClick: () => { setShowMetadataChooser(true); } });
|
|
99
|
-
if (props.formulaItems && props.formulaItems.length > 0)
|
|
100
|
-
buttons.push({ icon: _jsx(IconDataList, {}), text: SDKUI_Localizator.Parameters, onClick: () => setShowFormulaChooser(true) });
|
|
98
|
+
// if (props.formulaItems && props.formulaItems.length > 0) buttons.push({ icon: <IconDataList />, text: SDKUI_Localizator.Parameters, onClick: () => setShowFormulaChooser(true) })
|
|
101
99
|
buttons.push({ icon: _jsx(IconClear, {}), text: SDKUI_Localizator.Clear, onClick: () => props.onValueChanged?.('') });
|
|
102
100
|
return buttons;
|
|
103
101
|
};
|
|
@@ -120,20 +118,18 @@ const TMTextExpression = (props) => {
|
|
|
120
118
|
}
|
|
121
119
|
return output;
|
|
122
120
|
}
|
|
123
|
-
function getFormulaDataSorce() {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return fiarray;
|
|
136
|
-
}
|
|
121
|
+
// function getFormulaDataSorce() {
|
|
122
|
+
// let fiarray: FormulaItemHelper[] = []
|
|
123
|
+
// if (!props.formulaItems) return []
|
|
124
|
+
// let i: number = 0;
|
|
125
|
+
// for (const f of props.formulaItems!) {
|
|
126
|
+
// let fi = new FormulaItemHelper();
|
|
127
|
+
// fi.id = i; fi.paramName = f;
|
|
128
|
+
// fiarray.push(fi);
|
|
129
|
+
// i++;
|
|
130
|
+
// }
|
|
131
|
+
// return fiarray;
|
|
132
|
+
// }
|
|
137
133
|
const openMetadataChooseForm = () => {
|
|
138
134
|
return (showMetadataChooser ?
|
|
139
135
|
_jsx(TMMetadataChooserForm, { allowMultipleSelection: true, qd: props.qd, tids: props.tid ? [props.tid] : undefined, qdShowOnlySelectItems: true, allowSysMetadata: true, onClose: () => setShowMetadataChooser(false), onChoose: (tid_mid) => {
|
|
@@ -146,18 +142,30 @@ const TMTextExpression = (props) => {
|
|
|
146
142
|
{ dataField: 'paramName', caption: props.captionColumnChooser ?? SDKUI_Localizator.Name, dataType: 'string', sortOrder: 'asc', alignment: 'left' }
|
|
147
143
|
];
|
|
148
144
|
}, []);
|
|
149
|
-
const openFormulaChooseForm = () => {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
145
|
+
// const openFormulaChooseForm = () => {
|
|
146
|
+
// return (showFormulaChooser ?
|
|
147
|
+
// <TMChooserForm
|
|
148
|
+
// title={props.titleChooser ?? SDKUI_Localizator.Parameters}
|
|
149
|
+
// height={props.higthChooser ?? '350'}
|
|
150
|
+
// width={props.widthChooser ?? '300'}
|
|
151
|
+
// hasShowId={false}
|
|
152
|
+
// showDefaultColumns={false}
|
|
153
|
+
// allowMultipleSelection={props.disableMultipleSelection !== true}
|
|
154
|
+
// columns={dataColumns}
|
|
155
|
+
// dataSource={getFormulaDataSorce()}
|
|
156
|
+
// onClose={() => { setShowFormulaChooser(false); }}
|
|
157
|
+
// onChoose={(IDs: number[]) => {
|
|
158
|
+
// let expr: string = props.value ?? '';
|
|
159
|
+
// IDs.map(i => expr += props.formulaItems![i]);
|
|
160
|
+
// props.onValueChanged?.(expr)
|
|
161
|
+
// }}
|
|
162
|
+
// /> : <></>
|
|
163
|
+
// )
|
|
164
|
+
// }
|
|
157
165
|
return (_jsxs(_Fragment, { children: [props.rows === undefined ?
|
|
158
|
-
_jsx(TMTextBox, { buttons: renderButtons(), isModifiedWhen: props.value != props.valueOrig, label: props.label, value: Expression_IDs2Names(props.value) ?? '', validationItems: props.validationItems, onValueChanged: (e) => { props.onValueChanged?.(Expression_Names2IDs(e.target.value)); } })
|
|
166
|
+
_jsx(TMTextBox, { buttons: renderButtons(), formulaItems: props.formulaItems, isModifiedWhen: props.value != props.valueOrig, label: props.label, value: Expression_IDs2Names(props.value) ?? '', validationItems: props.validationItems, onValueChanged: (e) => { props.onValueChanged?.(Expression_Names2IDs(e.target.value)); } })
|
|
159
167
|
:
|
|
160
|
-
_jsx(TMTextArea, { buttons: renderButtons(), 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(), " "
|
|
168
|
+
_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(), " "] }));
|
|
161
169
|
};
|
|
162
170
|
class MetatadaHelper {
|
|
163
171
|
constructor(mid, metadataName) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DeviceType } from '../../base/TMDeviceProvider';
|
|
3
|
+
/**
|
|
4
|
+
* Proprietà del componente ToppyDraggableHelpCenter
|
|
5
|
+
*/
|
|
6
|
+
interface ToppyDraggableHelpCenterProps {
|
|
7
|
+
/** Contenuto da visualizzare nella speech bubble */
|
|
8
|
+
content?: React.ReactNode;
|
|
9
|
+
/** Tipo di dispositivo per adattare il comportamento */
|
|
10
|
+
deviceType?: DeviceType;
|
|
11
|
+
/** Allineamento iniziale del componente (destra o sinistra) */
|
|
12
|
+
align?: 'right' | 'left';
|
|
13
|
+
/** Stato iniziale collassato/espanso */
|
|
14
|
+
initialIsCollapsed?: boolean;
|
|
15
|
+
/** Callback chiamato quando si clicca sull'immagine di Toppy */
|
|
16
|
+
onToppyImageClick?: () => void;
|
|
17
|
+
/** Visibilità del componente */
|
|
18
|
+
isVisible?: boolean;
|
|
19
|
+
/** Se true, renderizza Toppy nel document.body tramite Portal invece che nel parent */
|
|
20
|
+
usePortal?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Componente ToppyDraggableHelpCenter
|
|
24
|
+
*
|
|
25
|
+
* Renderizza un assistente virtuale (Toppy) draggable che può mostrare contenuti
|
|
26
|
+
* in una speech bubble. Il componente può essere trascinato all'interno del suo
|
|
27
|
+
* contenitore e può essere collassato/espanso con un doppio click.
|
|
28
|
+
*/
|
|
29
|
+
declare const ToppyDraggableHelpCenter: React.FC<ToppyDraggableHelpCenterProps>;
|
|
30
|
+
export default ToppyDraggableHelpCenter;
|