@topconsultnpm/sdkui-react 6.19.0-test.1 → 6.19.0-test2

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.
Files changed (208) hide show
  1. package/lib/assets/IconsS4t/add.svg +12 -12
  2. package/lib/assets/IconsS4t/aggiorna.svg +18 -18
  3. package/lib/assets/IconsS4t/bookmark.svg +42 -42
  4. package/lib/assets/IconsS4t/cancella.svg +15 -15
  5. package/lib/assets/IconsS4t/check-box.svg +19 -19
  6. package/lib/assets/IconsS4t/down-arrow-signBook.svg +40 -40
  7. package/lib/assets/IconsS4t/down.svg +28 -28
  8. package/lib/assets/IconsS4t/edit-file.svg +19 -19
  9. package/lib/assets/IconsS4t/edita.svg +32 -32
  10. package/lib/assets/IconsS4t/firma.svg +19 -19
  11. package/lib/assets/IconsS4t/icona_download.svg +16 -16
  12. package/lib/assets/IconsS4t/info.svg +51 -51
  13. package/lib/assets/IconsS4t/left.svg +20 -20
  14. package/lib/assets/IconsS4t/line.svg +40 -40
  15. package/lib/assets/IconsS4t/more.svg +19 -19
  16. package/lib/assets/IconsS4t/plus.svg +23 -23
  17. package/lib/assets/IconsS4t/printer.svg +49 -49
  18. package/lib/assets/IconsS4t/radio-on-button.svg +25 -25
  19. package/lib/assets/IconsS4t/rectangle.svg +41 -41
  20. package/lib/assets/IconsS4t/redo.svg +19 -19
  21. package/lib/assets/IconsS4t/right-arrow-signBook-finish.svg +40 -40
  22. package/lib/assets/IconsS4t/right-arrow-signBook.svg +40 -40
  23. package/lib/assets/IconsS4t/right.svg +22 -22
  24. package/lib/assets/IconsS4t/searchbar.svg +21 -21
  25. package/lib/assets/IconsS4t/text-box.svg +36 -36
  26. package/lib/assets/IconsS4t/tick.svg +8 -8
  27. package/lib/assets/IconsS4t/trash-white.svg +10 -10
  28. package/lib/assets/IconsS4t/undo.svg +19 -19
  29. package/lib/assets/IconsS4t/up.svg +32 -32
  30. package/lib/assets/IconsS4t/video-streaming.svg +2 -2
  31. package/lib/assets/IconsS4t/zoom-in.svg +58 -58
  32. package/lib/assets/IconsS4t/zoom-out.svg +56 -56
  33. package/lib/assets/icomoon.svg +96 -96
  34. package/lib/assets/italy.svg +16 -16
  35. package/lib/assets/six.svg +3 -3
  36. package/lib/assets/thumbnails/index.ts +39 -39
  37. package/lib/assets/topmedia-six.svg +65 -65
  38. package/lib/assets/topmeida-six-bianco.svg +65 -65
  39. package/lib/components/base/Styled.js +302 -302
  40. package/lib/components/base/TMAccordion.js +43 -43
  41. package/lib/components/base/TMAccordionNew.d.ts +28 -0
  42. package/lib/components/base/TMAccordionNew.js +326 -0
  43. package/lib/components/base/TMAreaManager.js +23 -23
  44. package/lib/components/base/TMButton.d.ts +1 -0
  45. package/lib/components/base/TMButton.js +136 -136
  46. package/lib/components/base/TMClosableList.js +46 -46
  47. package/lib/components/base/TMConfirm.js +20 -20
  48. package/lib/components/base/TMContextMenu.js +4 -4
  49. package/lib/components/base/TMContextMenuOLD.js +25 -25
  50. package/lib/components/base/TMCounterBar.js +32 -32
  51. package/lib/components/base/TMCounterContainer.js +30 -30
  52. package/lib/components/base/TMCustomButton.d.ts +1 -1
  53. package/lib/components/base/TMCustomButton.js +90 -35
  54. package/lib/components/base/TMDataGridExportForm.d.ts +1 -1
  55. package/lib/components/base/TMDataGridExportForm.js +9 -3
  56. package/lib/components/base/TMDropDownMenu.js +24 -24
  57. package/lib/components/base/TMFileManager.js +12 -3
  58. package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
  59. package/lib/components/base/TMFileManagerDataGridView.js +12 -3
  60. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
  61. package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
  62. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
  63. package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
  64. package/lib/components/base/TMFileManagerUtils.js +19 -19
  65. package/lib/components/base/TMFloatingToolbar.js +34 -34
  66. package/lib/components/base/TMLayout.js +44 -44
  67. package/lib/components/base/TMList.js +34 -34
  68. package/lib/components/base/TMModal.d.ts +2 -0
  69. package/lib/components/base/TMModal.js +79 -34
  70. package/lib/components/base/TMPanel.js +57 -57
  71. package/lib/components/base/TMPopUp.js +186 -117
  72. package/lib/components/base/TMProgressBar.js +20 -20
  73. package/lib/components/base/TMResizableMenu.js +28 -28
  74. package/lib/components/base/TMRightSidebar.js +40 -40
  75. package/lib/components/base/TMSpinner.js +121 -121
  76. package/lib/components/base/TMTab.js +11 -11
  77. package/lib/components/base/TMToggleButton.js +36 -36
  78. package/lib/components/base/TMToolbarCard.js +35 -35
  79. package/lib/components/base/TMTooltip.d.ts +1 -1
  80. package/lib/components/base/TMTooltip.js +1 -1
  81. package/lib/components/base/TMTreeView.js +16 -16
  82. package/lib/components/base/TMUserAvatar.js +7 -7
  83. package/lib/components/base/TMWaitPanel.js +30 -24
  84. package/lib/components/choosers/TMCultureIDPicker.js +35 -35
  85. package/lib/components/choosers/TMDataListItemChooser.js +1 -1
  86. package/lib/components/choosers/TMDataListItemPicker.js +54 -54
  87. package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
  88. package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
  89. package/lib/components/choosers/TMMetadataChooser.js +31 -8
  90. package/lib/components/choosers/TMUserChooser.d.ts +4 -0
  91. package/lib/components/choosers/TMUserChooser.js +21 -5
  92. package/lib/components/editors/TMCheckBox.js +24 -24
  93. package/lib/components/editors/TMDateBox.d.ts +1 -1
  94. package/lib/components/editors/TMDropDown.js +43 -43
  95. package/lib/components/editors/TMEditorStyled.js +71 -71
  96. package/lib/components/editors/TMHtmlContentDisplay.js +16 -16
  97. package/lib/components/editors/TMLocalizedTextBox.js +31 -31
  98. package/lib/components/editors/TMMetadataValues.js +62 -21
  99. package/lib/components/editors/TMRadioButton.js +39 -39
  100. package/lib/components/editors/TMSummary.js +39 -39
  101. package/lib/components/editors/TMTextArea.d.ts +1 -0
  102. package/lib/components/editors/TMTextArea.js +56 -22
  103. package/lib/components/editors/TMTextBox.js +53 -23
  104. package/lib/components/editors/TMTextExpression.js +36 -28
  105. package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +30 -0
  106. package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +471 -0
  107. package/lib/components/features/assistant/ToppySpeechBubble.d.ts +9 -0
  108. package/lib/components/features/assistant/ToppySpeechBubble.js +117 -0
  109. package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -0
  110. package/lib/components/features/blog/TMBlogCommentForm.js +21 -9
  111. package/lib/components/features/documents/TMDcmtBlog.js +1 -1
  112. package/lib/components/features/documents/TMDcmtForm.js +321 -62
  113. package/lib/components/features/documents/TMDcmtIcon.js +17 -12
  114. package/lib/components/features/documents/TMDcmtPreview.js +75 -38
  115. package/lib/components/features/documents/TMFileUploader.js +21 -21
  116. package/lib/components/features/documents/TMRelationViewer.js +56 -23
  117. package/lib/components/features/search/TMSavedQuerySelector.js +52 -52
  118. package/lib/components/features/search/TMSearch.js +2 -2
  119. package/lib/components/features/search/TMSearchQueryEditor.js +14 -14
  120. package/lib/components/features/search/TMSearchQueryPanel.js +40 -58
  121. package/lib/components/features/search/TMSearchResult.js +160 -35
  122. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
  123. package/lib/components/features/search/TMSearchResultsMenuItems.js +117 -60
  124. package/lib/components/features/search/TMSignSettingsForm.d.ts +9 -0
  125. package/lib/components/features/search/TMSignSettingsForm.js +621 -0
  126. package/lib/components/features/search/TMTreeSelector.js +66 -66
  127. package/lib/components/features/tasks/TMTaskForm.js +42 -36
  128. package/lib/components/features/tasks/TMTasksAgenda.js +4 -4
  129. package/lib/components/features/tasks/TMTasksCalendar.js +2 -2
  130. package/lib/components/features/tasks/TMTasksHeader.js +1 -1
  131. package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -1
  132. package/lib/components/features/tasks/TMTasksUtils.js +18 -3
  133. package/lib/components/features/tasks/TMTasksUtilsView.js +26 -4
  134. package/lib/components/features/tasks/TMTasksView.js +12 -6
  135. package/lib/components/features/wg/TMWGsCopyMoveForm.js +9 -9
  136. package/lib/components/features/workflow/TMWorkflowPopup.js +44 -44
  137. package/lib/components/features/workflow/diagram/ConnectionComponent.js +29 -29
  138. package/lib/components/features/workflow/diagram/ConnectionForm.js +10 -10
  139. package/lib/components/features/workflow/diagram/DiagramItemComponent.js +57 -57
  140. package/lib/components/features/workflow/diagram/DiagramItemForm.js +40 -35
  141. package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +12 -12
  142. package/lib/components/features/workflow/diagram/RecipientList.js +39 -39
  143. package/lib/components/features/workflow/diagram/WFDiagram.js +317 -285
  144. package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.js +4 -4
  145. package/lib/components/forms/Login/Chooser.js +35 -35
  146. package/lib/components/forms/Login/Menu.js +22 -22
  147. package/lib/components/forms/Login/SelectBox.js +46 -46
  148. package/lib/components/forms/Login/TMLoginForm.js +14 -14
  149. package/lib/components/forms/Login/TextBox.js +57 -57
  150. package/lib/components/forms/TMResultDialog.js +8 -2
  151. package/lib/components/forms/TMSaveForm.js +3 -11
  152. package/lib/components/grids/TMBlogAttachments.d.ts +0 -14
  153. package/lib/components/grids/TMBlogAttachments.js +10 -5
  154. package/lib/components/grids/TMBlogsPost.d.ts +8 -3
  155. package/lib/components/grids/TMBlogsPost.js +100 -39
  156. package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
  157. package/lib/components/grids/TMBlogsPostUtils.js +32 -11
  158. package/lib/components/grids/TMRecentsManager.js +51 -51
  159. package/lib/components/grids/TMValidationItemsList.js +48 -48
  160. package/lib/components/index.d.ts +2 -1
  161. package/lib/components/index.js +2 -1
  162. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
  163. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +14 -14
  164. package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
  165. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +36 -35
  166. package/lib/components/layout/panelManager/types.d.ts +1 -0
  167. package/lib/components/pages/TMPage.js +1 -1
  168. package/lib/components/query/TMQueryEditor.js +17 -17
  169. package/lib/components/query/TMQuerySummary.d.ts +1 -0
  170. package/lib/components/query/TMQuerySummary.js +15 -15
  171. package/lib/components/settings/SettingsAppearance.js +9 -1
  172. package/lib/components/sidebar/TMCommandsPanel.js +10 -10
  173. package/lib/components/sidebar/TMHeader.js +307 -307
  174. package/lib/components/sidebar/TMSidebar.js +24 -24
  175. package/lib/components/sidebar/TMSidebarItem.js +21 -21
  176. package/lib/components/viewers/TMDataListItemViewer.d.ts +1 -1
  177. package/lib/components/viewers/TMMidViewer.d.ts +1 -1
  178. package/lib/components/viewers/TMTidViewer.d.ts +1 -1
  179. package/lib/components/wizard/TMStepIndicator.js +102 -102
  180. package/lib/components/wizard/TMWizard.js +29 -29
  181. package/lib/helper/GlobalStyles.d.ts +2 -0
  182. package/lib/helper/GlobalStyles.js +10 -0
  183. package/lib/helper/Globalization.d.ts +1 -0
  184. package/lib/helper/Globalization.js +30 -0
  185. package/lib/helper/SDKUI_Globals.d.ts +2 -0
  186. package/lib/helper/SDKUI_Globals.js +9 -1
  187. package/lib/helper/SDKUI_Localizator.d.ts +50 -2
  188. package/lib/helper/SDKUI_Localizator.js +502 -22
  189. package/lib/helper/TMCustomSearchBar.js +1 -1
  190. package/lib/helper/TMIcons.d.ts +4 -1
  191. package/lib/helper/TMIcons.js +14 -2
  192. package/lib/helper/TMToppyMessage.d.ts +1 -0
  193. package/lib/helper/TMToppyMessage.js +33 -32
  194. package/lib/helper/TMUtils.d.ts +42 -4
  195. package/lib/helper/TMUtils.js +227 -60
  196. package/lib/helper/dcmtsHelper.d.ts +2 -1
  197. package/lib/helper/dcmtsHelper.js +56 -17
  198. package/lib/helper/helpers.d.ts +1 -1
  199. package/lib/helper/helpers.js +12 -17
  200. package/lib/helper/index.d.ts +1 -0
  201. package/lib/helper/index.js +1 -0
  202. package/lib/hooks/useDcmtOperations.d.ts +1 -1
  203. package/lib/hooks/useDcmtOperations.js +10 -6
  204. package/lib/hooks/useRelatedDocuments.js +35 -26
  205. package/lib/ts/types.d.ts +3 -1
  206. package/package.json +54 -54
  207. package/lib/components/features/assistant/ToppyHelpCenter.d.ts +0 -12
  208. package/lib/components/features/assistant/ToppyHelpCenter.js +0 -173
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
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
- const StyledTextAreaEditorButton = styled.div `
14
- color: ${TMColors.button_icon};
15
- display: flex;
16
- align-items: center;
17
- position: relative;
18
- cursor: pointer;
19
- &:focus{
20
- outline: none;
21
- background-image: linear-gradient(white, #E4E9F7);
22
- border-bottom: 2px solid;
23
- border-bottom-color: ${TMColors.primary};
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: [showClearButton && currentValue &&
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
- setCalculatedRows(1);
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
- const StyledShowPasswordIcon = styled.div `
15
- color: ${props => !props.$disabled ? (props.$vil.length === 0) ? !props.$isModified ? TMColors.text_normal : TMColors.isModified : editorColorManager(props.$vil) : TMColors.disabled};
16
- position: absolute;
17
- right: 10px;
18
- font-size: 18px;
19
- transform: translateY(-25px);
20
- cursor: pointer;
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'; // &#8226;
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' : '7px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [showClearButton && currentValue &&
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, IconDataList, SDKUI_Localizator, stringIsNullOrEmpty } from '../../helper';
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
- let fiarray = [];
125
- if (!props.formulaItems)
126
- return [];
127
- let i = 0;
128
- for (const f of props.formulaItems) {
129
- let fi = new FormulaItemHelper();
130
- fi.id = i;
131
- fi.paramName = f;
132
- fiarray.push(fi);
133
- i++;
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
- return (showFormulaChooser ?
151
- _jsx(TMChooserForm, { title: props.titleChooser ?? SDKUI_Localizator.Parameters, height: props.higthChooser ?? '350', width: props.widthChooser ?? '300', hasShowId: false, showDefaultColumns: false, allowMultipleSelection: props.disableMultipleSelection !== true, columns: dataColumns, dataSource: getFormulaDataSorce(), onClose: () => { setShowFormulaChooser(false); }, onChoose: (IDs) => {
152
- let expr = props.value ?? '';
153
- IDs.map(i => expr += props.formulaItems[i]);
154
- props.onValueChanged?.(expr);
155
- } }) : _jsx(_Fragment, {}));
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(), " ", openFormulaChooseForm()] }));
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;