@topconsultnpm/sdkui-react 6.22.0-dev3.9 → 6.22.0-dev4.11

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 (97) hide show
  1. package/lib/components/base/TMAlert.js +6 -8
  2. package/lib/components/base/TMAreaManager.js +53 -55
  3. package/lib/components/base/TMButton.js +4 -2
  4. package/lib/components/base/TMCounterContainer.d.ts +3 -1
  5. package/lib/components/base/TMCounterContainer.js +16 -1
  6. package/lib/components/base/TMCustomButton.js +40 -48
  7. package/lib/components/base/TMDataGrid.js +24 -4
  8. package/lib/components/base/TMPanel.js +173 -170
  9. package/lib/components/base/TMSpinner.d.ts +2 -1
  10. package/lib/components/base/TMSpinner.js +9 -7
  11. package/lib/components/base/TMTabControl.d.ts +5 -0
  12. package/lib/components/base/TMTabControl.js +18 -7
  13. package/lib/components/base/TMTreeView.js +20 -0
  14. package/lib/components/base/TMWaitPanel.js +1 -1
  15. package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
  16. package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
  17. package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +179 -0
  18. package/lib/components/base/waitPanel/TMWaitPanelManager.js +373 -0
  19. package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +58 -0
  20. package/lib/components/base/waitPanel/TMWaitPanelView.js +346 -0
  21. package/lib/components/base/waitPanel/index.d.ts +1 -0
  22. package/lib/components/base/waitPanel/index.js +1 -0
  23. package/lib/components/choosers/TMDistinctValues.js +3 -3
  24. package/lib/components/choosers/TMPathChooser.js +17 -34
  25. package/lib/components/editors/TMTextBox.d.ts +4 -0
  26. package/lib/components/editors/TMTextBox.js +99 -11
  27. package/lib/components/features/archive/TMArchive.js +7 -2
  28. package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +28 -0
  29. package/lib/components/features/assistant/TMHelpOnLineChat.js +1231 -0
  30. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
  31. package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
  32. package/lib/components/features/documents/TMCopyToFolderForm.js +53 -84
  33. package/lib/components/features/documents/TMDcmtForm.js +50 -61
  34. package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -3
  35. package/lib/components/features/documents/TMDcmtIcon.js +3 -5
  36. package/lib/components/features/documents/TMDcmtPreview.js +5 -3
  37. package/lib/components/features/documents/TMDcmtTasks.js +2 -9
  38. package/lib/components/features/documents/TMFileUploader.js +26 -26
  39. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
  40. package/lib/components/features/documents/TMMasterDetailDcmts.js +53 -148
  41. package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
  42. package/lib/components/features/documents/TMMergeToPdfForm.js +52 -56
  43. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
  44. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +1 -1
  45. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +3 -3
  46. package/lib/components/features/documents/TMRelationViewer.d.ts +13 -14
  47. package/lib/components/features/documents/TMRelationViewer.js +206 -143
  48. package/lib/components/features/documents/relationTreeState.d.ts +32 -0
  49. package/lib/components/features/documents/relationTreeState.js +89 -0
  50. package/lib/components/features/search/TMSearch.js +3 -4
  51. package/lib/components/features/search/TMSearchQueryPanel.js +0 -4
  52. package/lib/components/features/search/TMSearchResult.d.ts +5 -0
  53. package/lib/components/features/search/TMSearchResult.js +51 -24
  54. package/lib/components/features/search/TMTreeSelector.js +23 -27
  55. package/lib/components/features/search/TMViewHistoryDcmt.js +15 -26
  56. package/lib/components/features/tasks/TMTasksView.js +97 -90
  57. package/lib/components/features/wg/TMWGsCopyMoveForm.js +104 -100
  58. package/lib/components/forms/TMResultDialog.js +1 -1
  59. package/lib/components/grids/TMBlogsPost.js +93 -97
  60. package/lib/components/index.d.ts +5 -1
  61. package/lib/components/index.js +4 -1
  62. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +16 -15
  63. package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +1 -0
  64. package/lib/components/layout/panelManager/TMPanelManagerContext.js +5 -1
  65. package/lib/components/layout/panelManager/TMPanelManagerLoader.d.ts +6 -0
  66. package/lib/components/layout/panelManager/TMPanelManagerLoader.js +18 -0
  67. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +4 -8
  68. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +1 -1
  69. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +2 -1
  70. package/lib/components/pages/TMPage.js +32 -31
  71. package/lib/components/query/TMQueryEditor.d.ts +3 -0
  72. package/lib/components/query/TMQueryEditor.js +2 -1
  73. package/lib/components/sidebar/TMHeader.d.ts +1 -0
  74. package/lib/components/sidebar/TMHeader.js +2 -2
  75. package/lib/helper/Enum_Localizator.js +1 -0
  76. package/lib/helper/SDKUI_Globals.d.ts +7 -2
  77. package/lib/helper/SDKUI_Globals.js +7 -2
  78. package/lib/helper/SDKUI_Localizator.d.ts +31 -6
  79. package/lib/helper/SDKUI_Localizator.js +301 -51
  80. package/lib/helper/ZipManager.d.ts +1 -1
  81. package/lib/helper/ZipManager.js +2 -1
  82. package/lib/helper/checkinCheckoutManager.js +2 -3
  83. package/lib/helper/dcmtsHelper.d.ts +2 -0
  84. package/lib/helper/dcmtsHelper.js +3 -1
  85. package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
  86. package/lib/hooks/useCheckInOutOperations.js +16 -37
  87. package/lib/hooks/useDcmtOperations.d.ts +3 -19
  88. package/lib/hooks/useDcmtOperations.js +175 -229
  89. package/lib/hooks/useDocumentOperations.d.ts +1 -0
  90. package/lib/hooks/useDocumentOperations.js +16 -29
  91. package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
  92. package/lib/hooks/useMultiMasterDetailDcmts.js +70 -68
  93. package/lib/hooks/usePreventFileDrop.js +9 -0
  94. package/lib/hooks/useWorkflowApprove.js +33 -17
  95. package/lib/services/caseflow/CaseFlowService.d.ts +69 -9
  96. package/lib/services/caseflow/CaseFlowService.js +126 -58
  97. package/package.json +2 -2
@@ -0,0 +1,346 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useLayoutEffect, useRef } from 'react';
3
+ import styled, { keyframes } from 'styled-components';
4
+ import toppy from '../../../assets/Toppy-generico.png';
5
+ import { AppModules, SDK_Globals } from '@topconsultnpm/sdk-ts';
6
+ import { getAppModuleButtonColors, SDKUI_Localizator } from '../../../helper';
7
+ import TMWaitPanelConfirm from './TMWaitPanelConfirm';
8
+ /** Colore della barra per applicazione, da getAppModuleButtonColors. SDK_Globals.tmSession lancia senza sessione. */
9
+ const getProgressColor = () => {
10
+ let appModuleID = AppModules.SURFER;
11
+ try {
12
+ appModuleID = SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER;
13
+ }
14
+ catch { /* nessuna sessione: resta il default */ }
15
+ return getAppModuleButtonColors(appModuleID).base;
16
+ };
17
+ const fadeIn = keyframes `
18
+ from { opacity: 0; }
19
+ to { opacity: 1; }
20
+ `;
21
+ // Sfondo su uno pseudo-elemento: il layer composito dell'animazione sgranerebbe Toppy.
22
+ const StyledOverlay = styled.div `
23
+ position: fixed;
24
+ inset: 0;
25
+ z-index: ${props => props.$zIndex};
26
+
27
+ &::before {
28
+ content: '';
29
+ position: absolute;
30
+ inset: 0;
31
+ background-color: rgba(17, 24, 39, 0.16);
32
+ animation: ${fadeIn} 140ms ease-out;
33
+ }
34
+ `;
35
+ const StyledCard = styled.div `
36
+ position: absolute;
37
+ top: 50%;
38
+ left: 50%;
39
+ transform: translate(-50%, -50%);
40
+ width: 420px;
41
+ max-width: calc(100% - 24px);
42
+ max-height: calc(100% - 24px);
43
+ overflow-y: auto;
44
+ box-sizing: border-box;
45
+ padding: 22px 24px 18px 24px;
46
+ background: #ffffff;
47
+ border-radius: 16px;
48
+ box-shadow: 0 18px 48px rgba(16, 24, 40, 0.22);
49
+ font-family: inherit;
50
+ `;
51
+ const StyledHeader = styled.div `
52
+ display: flex;
53
+ flex-direction: row;
54
+ align-items: center;
55
+ gap: 16px;
56
+ `;
57
+ // Ritaglio dal contenitore, non object-fit: cover darebbe un'altezza frazionaria e sgranerebbe l'immagine.
58
+ const StyledToppyClip = styled.div `
59
+ height: 61px;
60
+ width: 68px;
61
+ overflow: hidden;
62
+ flex: 0 0 auto;
63
+ `;
64
+ const StyledToppy = styled.img `
65
+ display: block;
66
+ width: 68px;
67
+ height: 79px;
68
+ user-select: none;
69
+ -webkit-user-drag: none;
70
+ `;
71
+ const StyledHeaderText = styled.div `
72
+ flex: 1;
73
+ min-width: 0;
74
+ `;
75
+ const StyledTitle = styled.div `
76
+ font-size: 17px;
77
+ font-weight: 600;
78
+ color: #1f2937;
79
+ line-height: 1.3;
80
+ overflow-wrap: anywhere;
81
+ `;
82
+ const StyledSubtitle = styled.div `
83
+ margin-top: 3px;
84
+ font-size: 13px;
85
+ color: #6b7280;
86
+ line-height: 1.3;
87
+ font-variant-numeric: tabular-nums;
88
+ overflow-wrap: anywhere;
89
+ `;
90
+ // Didascalia di una barra: con due avanzamenti e' l'unica cosa che dice quale sia quale.
91
+ const StyledBarLabel = styled.div `
92
+ margin-top: 18px;
93
+ font-size: 11px;
94
+ font-weight: 700;
95
+ letter-spacing: 0.04em;
96
+ text-transform: uppercase;
97
+ color: #9aa3b2;
98
+ overflow: hidden;
99
+ text-overflow: ellipsis;
100
+ white-space: nowrap;
101
+ `;
102
+ const StyledPercentRow = styled.div `
103
+ display: flex;
104
+ flex-direction: row;
105
+ align-items: flex-end;
106
+ justify-content: space-between;
107
+ flex-wrap: wrap;
108
+ gap: 8px 12px;
109
+ margin-top: ${props => (props.$hasLabel ? '4px' : '18px')};
110
+ `;
111
+ const StyledPercent = styled.div `
112
+ font-size: 34px;
113
+ font-weight: 700;
114
+ color: #111827;
115
+ line-height: 1;
116
+ font-variant-numeric: tabular-nums;
117
+ `;
118
+ const StyledCounters = styled.div `
119
+ display: flex;
120
+ flex-direction: row;
121
+ align-items: center;
122
+ gap: 6px;
123
+ padding-bottom: 3px;
124
+ `;
125
+ const StyledPill = styled.span `
126
+ display: inline-flex;
127
+ flex-direction: row;
128
+ align-items: center;
129
+ gap: 4px;
130
+ padding: 2px 8px 2px 6px;
131
+ border-radius: 999px;
132
+ font-size: 12px;
133
+ font-weight: 600;
134
+ line-height: 18px;
135
+ color: ${props => props.$color};
136
+ background: ${props => props.$background};
137
+ font-variant-numeric: tabular-nums;
138
+
139
+ svg { flex: 0 0 auto; }
140
+ `;
141
+ // Fratello della card, non figlio: l'overflow della card lo taglierebbe. Coordinate dell'overlay, calcolate all'apertura.
142
+ const StyledPopover = styled.div `
143
+ display: none;
144
+ position: absolute;
145
+ width: 320px;
146
+ max-width: calc(100% - 24px);
147
+ overflow-y: auto;
148
+ box-sizing: border-box;
149
+ padding: 10px 12px;
150
+ background: #ffffff;
151
+ border-left: 3px solid ${props => props.$accent};
152
+ border-radius: 10px;
153
+ box-shadow: 0 10px 30px rgba(16, 24, 40, 0.22);
154
+ font-size: 12px;
155
+ color: #374151;
156
+
157
+ ul { margin: 6px 0 0 0; padding: 0; list-style: none; }
158
+ li { padding: 4px 0; border-top: 1px solid #eef1f6; overflow-wrap: anywhere; line-height: 1.35; }
159
+ li:first-child { border-top: none; }
160
+ li.tm-wait-panel-more { color: #8a94a6; font-style: italic; }
161
+ `;
162
+ const StyledPopoverTitle = styled.div `
163
+ font-size: 11px;
164
+ font-weight: 700;
165
+ letter-spacing: 0.04em;
166
+ text-transform: uppercase;
167
+ color: ${props => props.$color};
168
+ `;
169
+ /** Tempo per spostare il mouse dalla pill al popover. */
170
+ const POPOVER_HIDE_DELAY_MS = 250;
171
+ const StyledTrack = styled.div `
172
+ margin-top: 12px;
173
+ width: 100%;
174
+ height: 8px;
175
+ border-radius: 999px;
176
+ background: #e8edf4;
177
+ overflow: hidden;
178
+ `;
179
+ const StyledFill = styled.div `
180
+ width: 100%;
181
+ height: 100%;
182
+ background: ${props => props.$color};
183
+ transform: scaleX(0);
184
+ transform-origin: left center;
185
+ transition: transform 120ms linear;
186
+ will-change: transform;
187
+ `;
188
+ const StyledTimeRow = styled.div `
189
+ display: flex;
190
+ flex-direction: row;
191
+ align-items: center;
192
+ justify-content: space-between;
193
+ gap: 12px;
194
+ margin-top: 8px;
195
+ font-size: 12px;
196
+ color: #8a94a6;
197
+ font-variant-numeric: tabular-nums;
198
+ `;
199
+ // Seconda barra: come la principale ma piu' piccola e in tono minore.
200
+ const StyledSecondary = styled.div `
201
+ margin-top: ${props => (props.$hasLabel ? '4px' : '14px')};
202
+ `;
203
+ const StyledSecondaryRow = styled.div `
204
+ display: flex;
205
+ flex-direction: row;
206
+ align-items: baseline;
207
+ justify-content: space-between;
208
+ gap: 12px;
209
+ font-size: 12px;
210
+ color: #6b7280;
211
+ font-variant-numeric: tabular-nums;
212
+ `;
213
+ const StyledSecondaryText = styled.span `
214
+ overflow: hidden;
215
+ text-overflow: ellipsis;
216
+ white-space: nowrap;
217
+ `;
218
+ const StyledSecondaryTrack = styled.div `
219
+ margin-top: 5px;
220
+ width: 100%;
221
+ height: 5px;
222
+ border-radius: 999px;
223
+ background: #eef1f6;
224
+ overflow: hidden;
225
+ `;
226
+ const StyledSecondaryFill = styled.div `
227
+ width: 100%;
228
+ height: 100%;
229
+ background: ${props => props.$color};
230
+ opacity: 0.55;
231
+ transform: scaleX(0);
232
+ transform-origin: left center;
233
+ transition: transform 120ms linear;
234
+ will-change: transform;
235
+ `;
236
+ const StyledFooter = styled.div `
237
+ display: flex;
238
+ flex-direction: row;
239
+ justify-content: flex-end;
240
+ margin-top: 18px;
241
+ `;
242
+ const StyledAbortButton = styled.button `
243
+ padding: 9px 18px;
244
+ border: 1px solid #d5dbe5;
245
+ border-radius: 10px;
246
+ background: #ffffff;
247
+ color: #374151;
248
+ font-size: 13px;
249
+ font-family: inherit;
250
+ cursor: pointer;
251
+ transition: background-color 120ms ease, border-color 120ms ease;
252
+
253
+ &:hover:not(:disabled) { background: #f3f5f9; border-color: #c3cbd8; }
254
+ &:active:not(:disabled) { background: #e9edf4; }
255
+ &:disabled { cursor: default; opacity: 0.55; }
256
+ `;
257
+ const IconOk = () => (_jsx("svg", { width: '13', height: '13', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: '3', strokeLinecap: 'round', strokeLinejoin: 'round', children: _jsx("polyline", { points: '20 6 9 17 4 12' }) }));
258
+ const IconWarning = () => (_jsxs("svg", { width: '13', height: '13', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: '2.4', strokeLinecap: 'round', strokeLinejoin: 'round', children: [_jsx("path", { d: 'M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z' }), _jsx("line", { x1: '12', y1: '9', x2: '12', y2: '13' }), _jsx("line", { x1: '12', y1: '17', x2: '12.01', y2: '17' })] }));
259
+ const IconError = () => (_jsxs("svg", { width: '13', height: '13', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: '3', strokeLinecap: 'round', strokeLinejoin: 'round', children: [_jsx("line", { x1: '18', y1: '6', x2: '6', y2: '18' }), _jsx("line", { x1: '6', y1: '6', x2: '18', y2: '18' })] }));
260
+ const TMWaitPanelView = ({ title = '', subtitle = '', cancelable = false, showEta = true, showCounters = true, showSecondary = false, secondaryText = '', primaryLabel = '', secondaryLabel = '', zIndex = 2147483601, onAbort, onConfirmYes, onConfirmNo, onMount }) => {
261
+ const confirmRef = useRef(null);
262
+ const titleRef = useRef(null);
263
+ const subtitleRef = useRef(null);
264
+ const percentRef = useRef(null);
265
+ const fillRef = useRef(null);
266
+ const elapsedRef = useRef(null);
267
+ const remainingRef = useRef(null);
268
+ const okValueRef = useRef(null);
269
+ const warningValueRef = useRef(null);
270
+ const errorValueRef = useRef(null);
271
+ const overlayRef = useRef(null);
272
+ const warningPillRef = useRef(null);
273
+ const errorPillRef = useRef(null);
274
+ const warningPopoverRef = useRef(null);
275
+ const warningListRef = useRef(null);
276
+ const errorPopoverRef = useRef(null);
277
+ const errorListRef = useRef(null);
278
+ const hideTimerRef = useRef();
279
+ const abortRef = useRef(null);
280
+ const secondaryTextRef = useRef(null);
281
+ const secondaryPercentRef = useRef(null);
282
+ const secondaryFillRef = useRef(null);
283
+ useLayoutEffect(() => {
284
+ if (!confirmRef.current || !titleRef.current || !subtitleRef.current || !percentRef.current || !fillRef.current)
285
+ return;
286
+ if (!elapsedRef.current || !remainingRef.current)
287
+ return;
288
+ if (!okValueRef.current || !warningValueRef.current || !errorValueRef.current)
289
+ return;
290
+ if (!warningPopoverRef.current || !warningListRef.current || !errorPopoverRef.current || !errorListRef.current)
291
+ return;
292
+ onMount?.({
293
+ confirm: confirmRef.current,
294
+ title: titleRef.current,
295
+ subtitle: subtitleRef.current,
296
+ percent: percentRef.current,
297
+ fill: fillRef.current,
298
+ elapsed: elapsedRef.current,
299
+ remaining: remainingRef.current,
300
+ okValue: okValueRef.current,
301
+ warningValue: warningValueRef.current,
302
+ errorValue: errorValueRef.current,
303
+ warningPopover: warningPopoverRef.current,
304
+ warningList: warningListRef.current,
305
+ errorPopover: errorPopoverRef.current,
306
+ errorList: errorListRef.current,
307
+ abortButton: abortRef.current,
308
+ secondaryText: secondaryTextRef.current,
309
+ secondaryPercent: secondaryPercentRef.current,
310
+ secondaryFill: secondaryFillRef.current,
311
+ });
312
+ // Montaggio una tantum: da qui in avanti il manager aggiorna il pannello via DOM, non via render.
313
+ return () => clearTimeout(hideTimerRef.current);
314
+ }, []);
315
+ // Popover gestiti via DOM come il resto del pannello: nessuno stato React, nessun render durante il progresso.
316
+ const hidePopovers = () => {
317
+ clearTimeout(hideTimerRef.current);
318
+ if (warningPopoverRef.current)
319
+ warningPopoverRef.current.style.display = 'none';
320
+ if (errorPopoverRef.current)
321
+ errorPopoverRef.current.style.display = 'none';
322
+ };
323
+ const scheduleHide = () => {
324
+ clearTimeout(hideTimerRef.current);
325
+ hideTimerRef.current = setTimeout(hidePopovers, POPOVER_HIDE_DELAY_MS);
326
+ };
327
+ const cancelHide = () => clearTimeout(hideTimerRef.current);
328
+ /** Apre il popover sotto la pill, allineato a destra. Finche' non arriva un messaggio resta chiuso. */
329
+ const openPopover = (pill, popover) => {
330
+ const overlay = overlayRef.current;
331
+ if (!pill || !popover || !overlay || popover.dataset.empty !== 'false')
332
+ return;
333
+ hidePopovers();
334
+ const overlayRect = overlay.getBoundingClientRect();
335
+ const pillRect = pill.getBoundingClientRect();
336
+ const top = pillRect.bottom - overlayRect.top + 6;
337
+ popover.style.top = `${top}px`;
338
+ popover.style.right = `${Math.max(12, overlayRect.right - pillRect.right)}px`;
339
+ popover.style.maxHeight = `${Math.max(80, overlayRect.height - top - 12)}px`;
340
+ popover.style.display = 'block';
341
+ };
342
+ return (_jsxs(_Fragment, { children: [_jsxs(StyledOverlay, { ref: overlayRef, $zIndex: zIndex, children: [_jsxs(StyledCard, { role: 'dialog', "aria-live": 'polite', children: [_jsxs(StyledHeader, { children: [_jsx(StyledToppyClip, { children: _jsx(StyledToppy, { src: toppy, alt: '', draggable: false }) }), _jsxs(StyledHeaderText, { children: [_jsx(StyledTitle, { ref: titleRef, children: title }), _jsx(StyledSubtitle, { ref: subtitleRef, children: subtitle })] })] }), primaryLabel && _jsx(StyledBarLabel, { children: primaryLabel }), _jsxs(StyledPercentRow, { $hasLabel: !!primaryLabel, children: [_jsx(StyledPercent, { ref: percentRef, children: "0.00%" }), _jsxs(StyledCounters, { style: { display: showCounters ? 'flex' : 'none' }, children: [_jsxs(StyledPill, { $color: '#3E7B1C', $background: '#E8F5E0', children: [_jsx(IconOk, {}), _jsx("span", { ref: okValueRef, children: "0" })] }), _jsxs(StyledPill, { ref: warningPillRef, $color: '#8A6D00', $background: '#FBF3CF', onMouseEnter: () => openPopover(warningPillRef.current, warningPopoverRef.current), onMouseLeave: scheduleHide, onClick: () => openPopover(warningPillRef.current, warningPopoverRef.current), children: [_jsx(IconWarning, {}), _jsx("span", { ref: warningValueRef, children: "0" })] }), _jsxs(StyledPill, { ref: errorPillRef, $color: '#B00F2B', $background: '#FBE1E6', onMouseEnter: () => openPopover(errorPillRef.current, errorPopoverRef.current), onMouseLeave: scheduleHide, onClick: () => openPopover(errorPillRef.current, errorPopoverRef.current), children: [_jsx(IconError, {}), _jsx("span", { ref: errorValueRef, children: "0" })] })] })] }), _jsx(StyledTrack, { children: _jsx(StyledFill, { ref: fillRef, $color: getProgressColor() }) }), _jsxs(StyledTimeRow, { style: { visibility: showEta ? 'visible' : 'hidden' }, children: [_jsx("span", { ref: elapsedRef }), _jsx("span", { ref: remainingRef })] }), showSecondary && secondaryLabel && _jsx(StyledBarLabel, { children: secondaryLabel }), showSecondary &&
343
+ _jsxs(StyledSecondary, { $hasLabel: !!secondaryLabel, children: [_jsxs(StyledSecondaryRow, { children: [_jsx(StyledSecondaryText, { ref: secondaryTextRef, children: secondaryText }), _jsx("span", { ref: secondaryPercentRef, children: "0.00%" })] }), _jsx(StyledSecondaryTrack, { children: _jsx(StyledSecondaryFill, { ref: secondaryFillRef, $color: getProgressColor() }) })] }), cancelable &&
344
+ _jsx(StyledFooter, { children: _jsx(StyledAbortButton, { ref: abortRef, type: 'button', onClick: onAbort, children: SDKUI_Localizator.Abort }) })] }), _jsxs(StyledPopover, { ref: warningPopoverRef, $accent: '#E0B400', "data-empty": 'true', onMouseEnter: cancelHide, onMouseLeave: scheduleHide, children: [_jsx(StyledPopoverTitle, { $color: '#8A6D00', children: SDKUI_Localizator.LatestWarnings }), _jsx("ul", { ref: warningListRef })] }), _jsxs(StyledPopover, { ref: errorPopoverRef, $accent: '#B00F2B', "data-empty": 'true', onMouseEnter: cancelHide, onMouseLeave: scheduleHide, children: [_jsx(StyledPopoverTitle, { $color: '#B00F2B', children: SDKUI_Localizator.LatestErrors }), _jsx("ul", { ref: errorListRef })] })] }), _jsx(TMWaitPanelConfirm, { ref: confirmRef, zIndex: zIndex + 1, onYes: onConfirmYes, onNo: onConfirmNo })] }));
345
+ };
346
+ export default TMWaitPanelView;
@@ -0,0 +1 @@
1
+ export * from './TMWaitPanelManager';
@@ -0,0 +1 @@
1
+ export * from './TMWaitPanelManager';
@@ -5,7 +5,7 @@ import styled from 'styled-components';
5
5
  import { calcResponsiveSizes, IconAll, IconDelete, IconPencil, IconRefresh, IconSelected, SDKUI_Localizator } from '../../helper';
6
6
  import TMButton from '../base/TMButton';
7
7
  import TMDataGrid from '../base/TMDataGrid';
8
- import { CounterItemKey } from '../base/TMCounterContainer';
8
+ import { CounterItemKey, formatCount } from '../base/TMCounterContainer';
9
9
  import { useDeviceType } from '../base/TMDeviceProvider';
10
10
  import TMCheckBox from '../editors/TMCheckBox';
11
11
  import TMDropDown from '../editors/TMDropDown';
@@ -126,8 +126,8 @@ const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppend
126
126
  items.set(CounterItemKey.allItems, {
127
127
  key: CounterItemKey.allItems,
128
128
  show: true,
129
- caption: `${counts.returned} restituiti su ${counts.found} trovati`,
130
- value: `${counts.returned}/${counts.found}`,
129
+ caption: `${formatCount(counts.returned)} restituiti su ${formatCount(counts.found)} trovati`,
130
+ value: `${formatCount(counts.returned)}/${formatCount(counts.found)}`,
131
131
  icon: _jsx(IconAll, {}),
132
132
  order: -1
133
133
  });
@@ -6,12 +6,11 @@ import { TMColors } from '../../utils/theme';
6
6
  import ShowAlert from '../base/TMAlert';
7
7
  import TMAreaManager from '../base/TMAreaManager';
8
8
  import TMButton from '../base/TMButton';
9
- import { TMLayoutItem } from '../base/TMLayout';
9
+ import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
10
10
  import TMModal from '../base/TMModal';
11
11
  import { TMExceptionBoxManager } from '../base/TMPopUp';
12
- import { TMLayoutWaitingContainer } from '../base/TMWaitPanel';
12
+ import TMWaitPanelManager from '../base/waitPanel/TMWaitPanelManager';
13
13
  import TMTextBox from '../editors/TMTextBox';
14
- let abortController = new AbortController();
15
14
  const TMPathChooser = (props) => {
16
15
  //const [path, setPath] = useState<string>(props.value)
17
16
  const [elementStyle, setElementStyle] = useState(props.elementStyle);
@@ -22,12 +21,6 @@ const TMPathChooser = (props) => {
22
21
  const [showAreaManager, setShowAreaManager] = useState(false);
23
22
  const [downloadLink, setDownloadLink] = useState(null);
24
23
  const [file, setFile] = useState(null);
25
- const [showWaitPanel, setShowWaitPanel] = useState(false);
26
- const [waitPanelTitle, setWaitPanelTitle] = useState('');
27
- const [showSecondary, setShowSecondary] = useState(false);
28
- const [waitPanelTextSecondary, setWaitPanelTextSecondary] = useState('');
29
- const [waitPanelValueSecondary, setWaitPanelValueSecondary] = useState(0);
30
- const [waitPanelMaxValueSecondary, setWaitPanelMaxValueSecondary] = useState(0);
31
24
  const formulaItems = ['{@JobName}', '{@JobStartDate}', '{@JobStartDate_DDMMYYYY}', '{@JobStartDateTime}', '{@ProcessRunID}', '{@ProcessName}', '{@ProcessStartDate}', '{@ProcessStartDateTime}'];
32
25
  //useEffect(() => { setPath(props.value) }, [props.value])
33
26
  useEffect(() => {
@@ -98,30 +91,23 @@ const TMPathChooser = (props) => {
98
91
  return buttons;
99
92
  };
100
93
  const onFileDownloadHandler = async () => {
94
+ // Un solo file: la barra del pannello segue i byte scaricati
95
+ const waitPanel = TMWaitPanelManager.show({
96
+ title: "Download",
97
+ cancelable: true,
98
+ showCounters: false,
99
+ });
101
100
  try {
102
101
  let av = AreaHelper.ExtractAreaInfo_2(props.value, true);
103
102
  let doc;
104
103
  let tms = props.tmSession ?? SDK_Globals.tmSession;
105
- setShowWaitPanel(true);
106
- setShowSecondary(true);
107
- setWaitPanelTitle("Download");
108
- abortController = new AbortController();
109
- let firstBlock = true;
110
- let maxFileSize = 0;
111
- doc = await tms?.NewAreaEngine().RetrieveFileAsync(av.aid, av.subFolder, av.fileName, FileFormats.None, abortController.signal, (pd) => {
112
- if (firstBlock) {
113
- maxFileSize = pd.ProgressBarMaximum ?? 0;
114
- setWaitPanelMaxValueSecondary(maxFileSize);
115
- firstBlock = false;
116
- }
117
- setWaitPanelValueSecondary(pd.ProgressBarValue);
118
- setWaitPanelTextSecondary(`Downloading... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
119
- if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
120
- setWaitPanelMaxValueSecondary(0);
121
- setWaitPanelValueSecondary(0);
122
- setWaitPanelTextSecondary('');
123
- firstBlock = true;
124
- }
104
+ doc = await tms?.NewAreaEngine().RetrieveFileAsync(av.aid, av.subFolder, av.fileName, FileFormats.None, waitPanel.signal, (pd) => {
105
+ const total = pd.ProgressBarMaximum ?? 0;
106
+ waitPanel.update({
107
+ value: pd.ProgressBarValue,
108
+ max: total,
109
+ subtitle: `Downloading... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(total, true)}`
110
+ });
125
111
  });
126
112
  setFile(doc);
127
113
  }
@@ -135,13 +121,10 @@ const TMPathChooser = (props) => {
135
121
  setFile(null);
136
122
  }
137
123
  finally {
138
- setWaitPanelTextSecondary('');
139
- setWaitPanelMaxValueSecondary(0);
140
- setWaitPanelValueSecondary(0);
141
- setShowWaitPanel(false);
124
+ waitPanel.close();
142
125
  }
143
126
  };
144
- return (_jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: [_jsx(TMLayoutItem, { children: _jsx(TMTextBox, { buttons: renderButtons(), elementStyle: elementStyle, formulaItems: props.allowParametricPath ? formulaItems : [], isModifiedWhen: props.isModifiedWhen, label: props.label, value: props.value || '', onValueChanged: (e) => { /*setPath(e.target.value);*/ props.onValueChanged?.(e.target.value); }, validationItems: props.validationItems }) }), showAreaManager &&
127
+ return (_jsxs(TMLayoutContainer, { direction: 'vertical', children: [_jsx(TMLayoutItem, { children: _jsx(TMTextBox, { buttons: renderButtons(), elementStyle: elementStyle, formulaItems: props.allowParametricPath ? formulaItems : [], isModifiedWhen: props.isModifiedWhen, label: props.label, value: props.value || '', onValueChanged: (e) => { /*setPath(e.target.value);*/ props.onValueChanged?.(e.target.value); }, validationItems: props.validationItems }) }), showAreaManager &&
145
128
  _jsxs(TMModal, { resizable: true, width: '80%', onClose: () => setShowAreaManager(false), children: [_jsx(TMAreaManager, { showOnlyFolders: props.allowBrowseFolder_Area && !props.allowBrowseFile_Area, initialPath: props.value, onFolderChanged: (folder) => setAreaFolderPath(folder), onFileChanged: (file) => setAreaFilePath(file), isPathChooser: true, areaChoose: areaChoose, width: '98%', height: props.allowBrowseFile_Area ? '70vh' : '90%', tmSession: props.tmSession, selectionMode: 'single' }), _jsx("div", { style: { position: 'absolute', right: '22px', bottom: '8px' }, children: _jsx(TMButton, { caption: 'OK', onClick: () => areaChoose() }) })] })] }));
146
129
  };
147
130
  export default TMPathChooser;
@@ -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;