@topconsultnpm/sdkui-react 6.22.0-dev3.8 → 6.22.0-dev4.10

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 (186) hide show
  1. package/lib/components/NewComponents/ContextMenu/styles.d.ts +43 -45
  2. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +60 -67
  3. package/lib/components/base/Styled.d.ts +77 -93
  4. package/lib/components/base/TMAlert.js +6 -8
  5. package/lib/components/base/TMAreaManager.js +53 -55
  6. package/lib/components/base/TMButton.js +4 -2
  7. package/lib/components/base/TMCounterBar.d.ts +2 -2
  8. package/lib/components/base/TMCounterContainer.d.ts +4 -3
  9. package/lib/components/base/TMCounterContainer.js +16 -1
  10. package/lib/components/base/TMCustomButton.d.ts +1 -1
  11. package/lib/components/base/TMCustomButton.js +40 -48
  12. package/lib/components/base/TMDataGrid.js +243 -223
  13. package/lib/components/base/TMDataGridExportForm.d.ts +1 -2
  14. package/lib/components/base/TMFileManager.d.ts +1 -2
  15. package/lib/components/base/TMFileManagerDataGridView.d.ts +1 -2
  16. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
  17. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
  18. package/lib/components/base/TMFileManagerUtils.d.ts +6 -4
  19. package/lib/components/base/TMLayout.d.ts +4 -4
  20. package/lib/components/base/TMList.d.ts +1 -2
  21. package/lib/components/base/TMListView.d.ts +1 -1
  22. package/lib/components/base/TMPanel.js +173 -170
  23. package/lib/components/base/TMSpinner.d.ts +3 -3
  24. package/lib/components/base/TMSpinner.js +9 -7
  25. package/lib/components/base/TMTab.d.ts +3 -4
  26. package/lib/components/base/TMTabControl.d.ts +7 -0
  27. package/lib/components/base/TMTabControl.js +225 -213
  28. package/lib/components/base/TMTooltip.d.ts +1 -1
  29. package/lib/components/base/TMTreeView.d.ts +8 -14
  30. package/lib/components/base/TMTreeView.js +20 -0
  31. package/lib/components/base/TMUserAvatar.d.ts +1 -2
  32. package/lib/components/base/TMVilViewer.d.ts +1 -2
  33. package/lib/components/base/TMWaitPanel.d.ts +2 -3
  34. package/lib/components/base/TMWaitPanel.js +1 -1
  35. package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
  36. package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
  37. package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +179 -0
  38. package/lib/components/base/waitPanel/TMWaitPanelManager.js +373 -0
  39. package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +57 -0
  40. package/lib/components/base/waitPanel/TMWaitPanelView.js +346 -0
  41. package/lib/components/base/waitPanel/index.d.ts +1 -0
  42. package/lib/components/base/waitPanel/index.js +1 -0
  43. package/lib/components/choosers/TMDistinctValues.js +3 -3
  44. package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
  45. package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +1 -2
  46. package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +1 -2
  47. package/lib/components/choosers/TMPathChooser.js +17 -34
  48. package/lib/components/choosers/TMQuickSearchInfo.d.ts +1 -2
  49. package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
  50. package/lib/components/choosers/TMUserChooser.d.ts +2 -2
  51. package/lib/components/editors/TMEditorStyled.d.ts +42 -20
  52. package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
  53. package/lib/components/editors/TMHtmlContentDisplay.d.ts +1 -2
  54. package/lib/components/editors/TMHtmlEditor.d.ts +1 -2
  55. package/lib/components/editors/TMTextBox.d.ts +4 -0
  56. package/lib/components/editors/TMTextBox.js +99 -11
  57. package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
  58. package/lib/components/features/archive/TMArchive.js +7 -2
  59. package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +28 -0
  60. package/lib/components/features/assistant/TMHelpOnLineChat.js +1231 -0
  61. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
  62. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
  63. package/lib/components/features/blog/TMBlogCommentForm.d.ts +1 -2
  64. package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
  65. package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
  66. package/lib/components/features/documents/TMDcmtForm.js +50 -61
  67. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
  68. package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -4
  69. package/lib/components/features/documents/TMDcmtIcon.js +3 -5
  70. package/lib/components/features/documents/TMDcmtPreview.d.ts +6 -8
  71. package/lib/components/features/documents/TMDcmtPreview.js +5 -3
  72. package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -2
  73. package/lib/components/features/documents/TMDcmtTasks.js +2 -9
  74. package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
  75. package/lib/components/features/documents/TMFileUploader.js +5 -5
  76. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
  77. package/lib/components/features/documents/TMMasterDetailDcmts.js +53 -141
  78. package/lib/components/features/documents/TMMasterInfoFields.d.ts +1 -2
  79. package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
  80. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
  81. package/lib/components/features/documents/TMMergeToPdfForm.js +59 -56
  82. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +1 -2
  83. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
  84. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +5 -5
  85. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +3 -3
  86. package/lib/components/features/documents/TMRelationViewer.d.ts +13 -14
  87. package/lib/components/features/documents/TMRelationViewer.js +206 -143
  88. package/lib/components/features/documents/relationTreeState.d.ts +32 -0
  89. package/lib/components/features/documents/relationTreeState.js +89 -0
  90. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +1 -2
  91. package/lib/components/features/search/TMMetadataOutputForm.d.ts +1 -2
  92. package/lib/components/features/search/TMMetadataSorterForm.d.ts +1 -2
  93. package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
  94. package/lib/components/features/search/TMSearch.d.ts +1 -2
  95. package/lib/components/features/search/TMSearch.js +3 -4
  96. package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -9
  97. package/lib/components/features/search/TMSearchQueryPanel.js +0 -4
  98. package/lib/components/features/search/TMSearchResult.d.ts +5 -0
  99. package/lib/components/features/search/TMSearchResult.js +129 -102
  100. package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
  101. package/lib/components/features/search/TMSignatureInfoContent.d.ts +1 -2
  102. package/lib/components/features/search/TMTreeSelector.js +23 -27
  103. package/lib/components/features/search/TMViewHistoryDcmt.d.ts +1 -2
  104. package/lib/components/features/search/TMViewHistoryDcmt.js +15 -26
  105. package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
  106. package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
  107. package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
  108. package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
  109. package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
  110. package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
  111. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
  112. package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
  113. package/lib/components/features/tasks/TMTasksView.js +97 -90
  114. package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +2 -3
  115. package/lib/components/features/wg/TMWGsCopyMoveForm.js +95 -91
  116. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +7 -8
  117. package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -3
  118. package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -3
  119. package/lib/components/forms/Login/Chooser.d.ts +2 -2
  120. package/lib/components/forms/TMChooserForm.d.ts +1 -2
  121. package/lib/components/forms/TMResultDialog.js +1 -1
  122. package/lib/components/forms/TMSaveForm.d.ts +4 -4
  123. package/lib/components/grids/TMBlogAttachments.d.ts +1 -2
  124. package/lib/components/grids/TMBlogHeader.d.ts +1 -1
  125. package/lib/components/grids/TMBlogsPost.d.ts +1 -1
  126. package/lib/components/grids/TMBlogsPost.js +93 -97
  127. package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
  128. package/lib/components/grids/TMValidationItemsList.d.ts +1 -2
  129. package/lib/components/index.d.ts +5 -1
  130. package/lib/components/index.js +4 -1
  131. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -2
  132. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +4 -3
  133. package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +3 -2
  134. package/lib/components/layout/panelManager/TMPanelManagerContext.js +5 -1
  135. package/lib/components/layout/panelManager/TMPanelManagerLoader.d.ts +5 -0
  136. package/lib/components/layout/panelManager/TMPanelManagerLoader.js +18 -0
  137. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +6 -5
  138. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +4 -8
  139. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
  140. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +2 -1
  141. package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
  142. package/lib/components/pages/TMPage.d.ts +1 -1
  143. package/lib/components/pages/TMPage.js +32 -31
  144. package/lib/components/query/TMQueryEditor.d.ts +13 -14
  145. package/lib/components/query/TMQueryEditor.js +2 -1
  146. package/lib/components/settings/SettingsAppearance.d.ts +1 -2
  147. package/lib/components/sidebar/TMAboutApp.d.ts +1 -2
  148. package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
  149. package/lib/components/sidebar/TMHeader.d.ts +4 -3
  150. package/lib/components/sidebar/TMHeader.js +2 -2
  151. package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -3
  152. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +2 -3
  153. package/lib/components/viewers/TMMidViewer.d.ts +2 -2
  154. package/lib/components/viewers/TMTidViewer.d.ts +2 -2
  155. package/lib/helper/Enum_Localizator.js +1 -0
  156. package/lib/helper/SDKUI_Globals.d.ts +7 -2
  157. package/lib/helper/SDKUI_Globals.js +7 -2
  158. package/lib/helper/SDKUI_Localizator.d.ts +31 -6
  159. package/lib/helper/SDKUI_Localizator.js +301 -51
  160. package/lib/helper/TMAppUpdatedModal.d.ts +1 -2
  161. package/lib/helper/TMAppUpdatedModal.js +93 -93
  162. package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
  163. package/lib/helper/TMIcons.d.ts +280 -280
  164. package/lib/helper/TMPdfViewer.d.ts +1 -2
  165. package/lib/helper/TMToppyMessage.d.ts +2 -2
  166. package/lib/helper/TMUtils.d.ts +4 -10
  167. package/lib/helper/ZipManager.d.ts +1 -1
  168. package/lib/helper/ZipManager.js +2 -1
  169. package/lib/helper/dcmtsHelper.d.ts +2 -0
  170. package/lib/helper/dcmtsHelper.js +3 -1
  171. package/lib/helper/helpers.d.ts +1 -1
  172. package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
  173. package/lib/hooks/useCheckInOutOperations.js +14 -34
  174. package/lib/hooks/useDcmtOperations.d.ts +3 -12
  175. package/lib/hooks/useDcmtOperations.js +201 -184
  176. package/lib/hooks/useDocumentOperations.d.ts +1 -0
  177. package/lib/hooks/useDocumentOperations.js +14 -25
  178. package/lib/hooks/useInputDialog.d.ts +1 -2
  179. package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
  180. package/lib/hooks/useMultiMasterDetailDcmts.js +70 -68
  181. package/lib/hooks/usePreventFileDrop.js +9 -0
  182. package/lib/hooks/useWorkflowApprove.js +33 -17
  183. package/lib/services/caseflow/CaseFlowService.d.ts +69 -9
  184. package/lib/services/caseflow/CaseFlowService.js +126 -58
  185. package/lib/services/platform_services.d.ts +2 -3
  186. package/package.json +2 -2
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { ValidationItem } from '@topconsultnpm/sdk-ts';
3
2
  export declare const sanitizeAndFormatComment: (raw?: string) => string;
4
3
  export interface ITMHtmlEditor {
@@ -35,5 +34,5 @@ export interface ITMHtmlEditor {
35
34
  /** If true, displays a character count below the editor */
36
35
  showCount?: boolean;
37
36
  }
38
- declare const TMHtmlEditor: (props: ITMHtmlEditor) => React.JSX.Element;
37
+ declare const TMHtmlEditor: (props: ITMHtmlEditor) => import("react/jsx-runtime").JSX.Element;
39
38
  export default TMHtmlEditor;
@@ -16,6 +16,10 @@ export interface ITMTextBox extends ITMEditorBase {
16
16
  allowedPattern?: RegExp;
17
17
  textTransform?: 'lowercase' | 'uppercase';
18
18
  currencySymbol?: string;
19
+ /** Solo per type='number'. 'alert' (default): popup e valore rifiutato. 'inline': il valore resta digitabile, errore in rosso sotto il campo e clamp al blur */
20
+ rangeValidationMode?: 'alert' | 'inline';
21
+ /** Descrizione mostrata nel tooltip dell'icona "i" accanto alla label (insieme al range in modalità inline) */
22
+ infoText?: string;
19
23
  onClick?: () => void;
20
24
  onValueChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
21
25
  onBlur?: (value: string | undefined) => void;
@@ -1,9 +1,10 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useRef } from 'react';
3
3
  import styled from 'styled-components';
4
+ import { ResultTypes, ValidationItem } from '@topconsultnpm/sdk-ts';
4
5
  import { StyledEditor, StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, editorColorManager } from './TMEditorStyled';
5
6
  import { FontSize, TMColors } from '../../utils/theme';
6
- import { genUniqueId, IconClearButton, IconDataList, IconHide, IconShow, SDKUI_Localizator } from '../../helper';
7
+ import { genUniqueId, IconClearButton, IconDataList, IconHide, IconInfo, IconShow, SDKUI_Localizator } from '../../helper';
7
8
  import ShowAlert from '../base/TMAlert';
8
9
  import { TMExceptionBoxManager } from '../base/TMPopUp';
9
10
  import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
@@ -34,7 +35,7 @@ const StyledTextBoxEditorButton = styled.div `
34
35
  border-bottom-color: ${TMColors.primary};
35
36
  }
36
37
  `;
37
- const TMTextBox = ({ autoComplete = 'off', 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', onClick, onValueChanged, onBlur, onKeyDown, borderRadius, allowedPattern, textTransform, currencySymbol }) => {
38
+ const TMTextBox = ({ autoComplete = 'off', 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', onClick, onValueChanged, onBlur, onKeyDown, borderRadius, allowedPattern, textTransform, currencySymbol, rangeValidationMode = 'alert', infoText }) => {
38
39
  const [initialType, setInitialType] = useState(type);
39
40
  const [currentType, setCurrentType] = useState(type);
40
41
  const [currentValue, setCurrentValue] = useState(value);
@@ -52,8 +53,28 @@ const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, pre
52
53
  setCurrentType('password');
53
54
  }
54
55
  }, [value]);
56
+ const isInlineRange = currentType === 'number' && rangeValidationMode === 'inline';
57
+ // Modalità inline: i valori validi vengono propagati con un debounce durante la digitazione
58
+ const inlineTimerRef = useRef();
59
+ const inlinePendingRef = useRef();
60
+ const valueRef = useRef(value);
61
+ valueRef.current = value;
62
+ const onValueChangedRef = useRef(onValueChanged);
63
+ onValueChangedRef.current = onValueChanged;
64
+ const commitInlineValue = (newValue) => {
65
+ clearTimeout(inlineTimerRef.current);
66
+ inlinePendingRef.current = undefined;
67
+ if (newValue != valueRef.current)
68
+ onValueChangedRef.current?.({ target: { value: newValue } });
69
+ };
70
+ // Alla chiusura (es. Esc) non si perde il valore in attesa
71
+ useEffect(() => () => {
72
+ clearTimeout(inlineTimerRef.current);
73
+ if (inlinePendingRef.current !== undefined)
74
+ commitInlineValue(inlinePendingRef.current);
75
+ }, []);
55
76
  useEffect(() => {
56
- if (currentType === 'number') {
77
+ if (currentType === 'number' && !isInlineRange) {
57
78
  if (currentValue) {
58
79
  const numericValue = parseFloat(currentValue);
59
80
  // Check maxValue
@@ -78,7 +99,7 @@ const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, pre
78
99
  }
79
100
  }
80
101
  }
81
- }, [maxValue, minValue, currentValue, currentType]);
102
+ }, [maxValue, minValue, currentValue, currentType, isInlineRange]);
82
103
  // Handle autofocus behavior on mount
83
104
  useEffect(() => {
84
105
  if (!autoFocus || !inputRef.current)
@@ -149,6 +170,45 @@ const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, pre
149
170
  return Number("9".repeat((precision ?? 0) - (scale ?? 0)) + '.' + "9".repeat(scale ?? 0));
150
171
  return Number(curValue);
151
172
  };
173
+ const formatNumber = (n) => n.toLocaleString(navigator.language);
174
+ // Modalità inline: messaggio di range fuori limite (undefined se valido)
175
+ const getRangeError = (curValue) => {
176
+ if (curValue === undefined || curValue === null || curValue === '')
177
+ return undefined;
178
+ const number = Number(curValue);
179
+ if (isNaN(number))
180
+ return undefined;
181
+ if (maxValue !== undefined && number > maxValue)
182
+ return SDKUI_Localizator.Max_Value.replaceParams(formatNumber(maxValue));
183
+ if (minValue !== undefined && number < minValue)
184
+ return SDKUI_Localizator.Min_Value.replaceParams(formatNumber(minValue));
185
+ return undefined;
186
+ };
187
+ // Modalità inline: testo del tooltip accanto alla label
188
+ const getRangeInfo = () => {
189
+ if (minValue !== undefined && maxValue !== undefined)
190
+ return SDKUI_Localizator.AllowedValuesRange.replaceParams(formatNumber(minValue), formatNumber(maxValue));
191
+ if (maxValue !== undefined)
192
+ return SDKUI_Localizator.Max_Value.replaceParams(formatNumber(maxValue));
193
+ if (minValue !== undefined)
194
+ return SDKUI_Localizator.Min_Value.replaceParams(formatNumber(minValue));
195
+ return undefined;
196
+ };
197
+ // Modalità inline: riporta il valore nel range (vuoto -> ultimo valore valido)
198
+ const clampToRange = (curValue) => {
199
+ if (curValue === undefined || curValue === null || curValue === '')
200
+ return minValue !== undefined ? (value?.toString() ?? minValue.toString()) : curValue;
201
+ let number = Number(curValue);
202
+ if (isNaN(number))
203
+ return value?.toString();
204
+ if (maxValue !== undefined)
205
+ number = Math.min(maxValue, number);
206
+ if (minValue !== undefined)
207
+ number = Math.max(minValue, number);
208
+ return number.toString();
209
+ };
210
+ const rangeError = isInlineRange ? getRangeError(currentValue) : undefined;
211
+ const effectiveVil = rangeError ? [...validationItems, new ValidationItem(ResultTypes.ERROR, label, rangeError)] : validationItems;
152
212
  const handleInputChange = (e) => {
153
213
  let inputValue = e.target.value;
154
214
  // Applica textTransform direttamente durante la digitazione (non per i numeri)
@@ -187,7 +247,7 @@ const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, pre
187
247
  let number = Number(inputValue);
188
248
  let max = getMaxValue(inputValue);
189
249
  // Check maxValue
190
- if (number > max) {
250
+ if (!isInlineRange && number > max) {
191
251
  ShowAlert({
192
252
  mode: 'warning',
193
253
  message: `Max value is ${max}`,
@@ -198,7 +258,7 @@ const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, pre
198
258
  return;
199
259
  }
200
260
  // Check minValue
201
- if (minValue && number < minValue) {
261
+ if (!isInlineRange && minValue && number < minValue) {
202
262
  ShowAlert({
203
263
  mode: 'warning',
204
264
  message: `Min value is ${minValue}`,
@@ -229,6 +289,14 @@ const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, pre
229
289
  }
230
290
  }
231
291
  setCurrentValue(inputValue);
292
+ if (isInlineRange) {
293
+ clearTimeout(inlineTimerRef.current);
294
+ const isValid = !getRangeError(inputValue) && !(inputValue === '' && minValue !== undefined);
295
+ inlinePendingRef.current = isValid ? inputValue : undefined;
296
+ if (isValid)
297
+ inlineTimerRef.current = setTimeout(() => commitInlineValue(inputValue), 800);
298
+ return;
299
+ }
232
300
  onValueChanged?.({ target: { value: inputValue } }); // Passa il valore filtrato
233
301
  };
234
302
  function getFormulaDataSorce() {
@@ -296,24 +364,44 @@ const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, pre
296
364
  // Stima la larghezza del simbolo (circa 10px per carattere + margine)
297
365
  return 6 + (currencySymbol.length * 10) + 4;
298
366
  };
299
- return (_jsx("div", { style: { width: '100%', height: 'fit-content', cursor: onClick ? 'pointer' : undefined, display: 'flex', alignItems: 'center' }, id: `text-${id}`, onClick: onClick, children: _jsxs("div", { style: { flex: 1 }, children: [_jsxs("div", { style: { position: 'relative' }, children: [currencySymbol && initialType !== 'password' && initialType !== 'secureText' && _jsx("span", { style: { position: 'absolute', left: '6px', top: '50%', transform: 'translateY(-50%)', color: disabled ? TMColors.disabled : TMColors.text_normal, fontSize: fontSize, pointerEvents: 'none', zIndex: 1 }, children: currencySymbol }), _jsx(StyledEditor, { ref: inputRef, onContextMenu: (e) => e.stopPropagation(), id: `text-${label}-${id}`, name: label, autoFocus: autoFocus, readOnly: readOnly, type: currentType, disabled: disabled, value: displayedValue, width: width || '100%', placeholder: placeHolder, maxLength: maxLength, autoComplete: autoComplete, spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => { setIsFocused(false); if (currentValue != value)
300
- onBlur?.(currentValue); }, onChange: handleInputChange, onKeyDown: (e) => {
367
+ return (_jsx("div", { style: { width: '100%', height: 'fit-content', cursor: onClick ? 'pointer' : undefined, display: 'flex', alignItems: 'center' }, id: `text-${id}`, onClick: onClick, children: _jsxs("div", { style: { flex: 1 }, children: [_jsxs("div", { style: { position: 'relative' }, children: [currencySymbol && initialType !== 'password' && initialType !== 'secureText' && _jsx("span", { style: { position: 'absolute', left: '6px', top: '50%', transform: 'translateY(-50%)', color: disabled ? TMColors.disabled : TMColors.text_normal, fontSize: fontSize, pointerEvents: 'none', zIndex: 1 }, children: currencySymbol }), _jsx(StyledEditor, { ref: inputRef, onContextMenu: (e) => e.stopPropagation(), id: `text-${label}-${id}`, name: label, autoFocus: autoFocus, readOnly: readOnly, type: currentType, disabled: disabled, value: displayedValue, width: width || '100%', placeholder: placeHolder, maxLength: maxLength, autoComplete: autoComplete, spellCheck: false, onFocus: () => setIsFocused(true), onBlur: (e) => {
368
+ setIsFocused(false);
369
+ let blurValue = currentValue;
370
+ if (isInlineRange) {
371
+ const clamped = clampToRange(currentValue);
372
+ if (clamped !== currentValue) {
373
+ blurValue = clamped;
374
+ setCurrentValue(blurValue);
375
+ }
376
+ commitInlineValue(blurValue);
377
+ }
378
+ if (blurValue != value)
379
+ onBlur?.(blurValue);
380
+ }, onChange: handleInputChange, onKeyDown: (e) => {
301
381
  if (currentType === 'number') {
302
382
  if (!scale && (e.key == "." || e.key == ","))
303
383
  e.preventDefault();
384
+ if (isInlineRange && e.key === 'Enter')
385
+ inputRef.current?.blur();
304
386
  }
305
387
  onKeyDown?.(e);
306
- }, $isMobile: deviceType === DeviceType.MOBILE, $disabled: disabled, $vil: validationItems, $isModified: isModifiedWhen, $fontSize: fontSize, $maxValue: maxValue, $width: width, $type: currentType, $borderRadius: borderRadius, style: { paddingLeft: `${calculateLeftPadding()}px`, paddingRight: `${calculateRightPadding()}px`, cursor: onClick ? 'pointer' : undefined } }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, $disabled: disabled, $vil: validationItems, $isModified: isModifiedWhen, children: showPasswordIcon() }), (formulaItems.length > 0 || (showClearButton && currentValue) || buttons.length > 0) &&
388
+ }, $isMobile: deviceType === DeviceType.MOBILE, $disabled: disabled, $vil: effectiveVil, $isModified: isModifiedWhen, $fontSize: fontSize, $maxValue: maxValue, $width: width, $type: currentType, $borderRadius: borderRadius, style: { paddingLeft: `${calculateLeftPadding()}px`, paddingRight: `${calculateRightPadding()}px`, cursor: onClick ? 'pointer' : undefined } }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, $disabled: disabled, $vil: validationItems, $isModified: isModifiedWhen, children: showPasswordIcon() }), (formulaItems.length > 0 || (showClearButton && currentValue) || buttons.length > 0) &&
307
389
  _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : (initialType === 'password' ? '34px' : '6px'), top: '50%', transform: 'translateY(-50%)', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
308
390
  _jsx(StyledTextBoxEditorButton, { onClick: () => {
309
391
  setShowFormulaItemsChooser(true);
310
392
  }, children: _jsx(IconDataList, {}) }), (showClearButton && currentValue) &&
311
393
  _jsx(StyledTextBoxEditorButton, { onClick: () => { onValueChanged?.({ target: { value: undefined } }); onBlur?.(undefined); }, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
312
394
  return (_jsx(StyledTextBoxEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
313
- })] }), openFormulaItemsChooser(), formulaItems.length > 0 && (_jsx(TMContextMenu, { items: formulaMenuItems, target: `#text-${id}` }))] }), _jsx(TMVilViewer, { vil: validationItems })] }) }));
395
+ })] }), openFormulaItemsChooser(), formulaItems.length > 0 && (_jsx(TMContextMenu, { items: formulaMenuItems, target: `#text-${id}` }))] }), _jsx(TMVilViewer, { vil: effectiveVil })] }) }));
314
396
  };
315
397
  const renderedLeftLabelTextBox = () => {
316
- 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()] }) })] }));
398
+ const rangeInfo = isInlineRange ? getRangeInfo() : undefined;
399
+ const tooltipContent = (infoText || rangeInfo)
400
+ ? _jsxs("div", { style: { maxWidth: '280px', whiteSpace: 'normal', textAlign: 'left', lineHeight: 1.4 }, children: [infoText && _jsx("div", { children: infoText }), rangeInfo && _jsx("div", { style: { marginTop: infoText ? '6px' : 0, fontWeight: infoText ? 600 : undefined }, children: rangeInfo })] })
401
+ : undefined;
402
+ 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: tooltipContent
403
+ ? _jsxs("span", { style: { display: 'inline-flex', alignItems: 'center', gap: '4px' }, children: [label, _jsx(TMTooltip, { content: tooltipContent, parentStyle: { display: 'inline-flex' }, children: _jsx(IconInfo, { fontSize: 11, style: { color: disabled ? TMColors.disabled : TMColors.label_normal, opacity: 0.5 } }) })] })
404
+ : label }), renderInputField()] }) })] }));
317
405
  };
318
406
  return (_jsx("div", { style: elementStyle, children: renderedLeftLabelTextBox() }));
319
407
  };
@@ -14,5 +14,5 @@ interface TMTreeDropDownProps {
14
14
  isValidKey?: (key: number) => boolean;
15
15
  elementStyle?: React.CSSProperties;
16
16
  }
17
- declare const TMTreeDropDown: (props: TMTreeDropDownProps) => React.JSX.Element;
17
+ declare const TMTreeDropDown: (props: TMTreeDropDownProps) => import("react/jsx-runtime").JSX.Element;
18
18
  export default TMTreeDropDown;
@@ -22,12 +22,17 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
22
22
  const pendingMidsRef = React.useRef(null);
23
23
  const deviceType = useDeviceType();
24
24
  useEffect(() => { setMruTIDs(SDKUI_Globals.userSettings.archivingSettings.mruTIDs); }, []);
25
+ // Applica inputTID solo quando cambia davvero: non deve sovrascrivere il tipo documento
26
+ // selezionato dall'utente.
25
27
  useEffect(() => {
26
28
  if (!inputTID)
27
29
  return;
28
30
  setCurrentTID(inputTID);
29
- setCurrentMruTID(mruTIDs.includes(inputTID) ? inputTID : 0);
30
- }, [inputTID, mruTIDs]);
31
+ }, [inputTID]);
32
+ // Evidenzia la scorciatoia del tipo documento corrente, anche quando mruTIDs cambia.
33
+ useEffect(() => {
34
+ setCurrentMruTID(currentTID && mruTIDs.includes(currentTID) ? currentTID : 0);
35
+ }, [currentTID, mruTIDs]);
31
36
  useEffect(() => {
32
37
  pendingMidsRef.current = inputMids;
33
38
  if (currentTID && currentTID > 0 && inputMids && inputMids.length > 0) {
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ export interface HolChatMessage {
3
+ id: string;
4
+ text: string;
5
+ isUser: boolean;
6
+ }
7
+ export interface ITMHelpOnLineChatProps {
8
+ isOpen: boolean;
9
+ showChatButton: boolean;
10
+ isLogged: boolean;
11
+ messages: HolChatMessage[];
12
+ conversationId?: string;
13
+ isThinking: boolean;
14
+ endpointUrl?: string;
15
+ onClose: () => void;
16
+ onToggle: () => void;
17
+ onNewConversation: () => void;
18
+ onAddMessage: (message: HolChatMessage) => void;
19
+ onSetThinking: (isThinking: boolean) => void;
20
+ onSetConversationId: (id: string) => void;
21
+ }
22
+ export interface ITMToppyHeaderButtonProps {
23
+ showChatButton: boolean;
24
+ onToggle: () => void;
25
+ }
26
+ declare const TMHelpOnLineChat: React.FC<ITMHelpOnLineChatProps>;
27
+ export default TMHelpOnLineChat;
28
+ export declare const TMToppyHeaderButton: React.FC<ITMToppyHeaderButtonProps>;