@topconsultnpm/sdkui-react 6.17.0-test10 → 6.17.0-test11

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 (50) hide show
  1. package/lib/components/base/TMButton.d.ts +1 -0
  2. package/lib/components/base/TMButton.js +6 -6
  3. package/lib/components/base/TMCustomButton.d.ts +1 -1
  4. package/lib/components/base/TMCustomButton.js +28 -26
  5. package/lib/components/base/TMFileManagerDataGridView.js +1 -1
  6. package/lib/components/base/TMModal.d.ts +2 -0
  7. package/lib/components/base/TMModal.js +48 -3
  8. package/lib/components/base/TMPopUp.js +4 -1
  9. package/lib/components/base/TMWaitPanel.js +8 -2
  10. package/lib/components/choosers/TMDataListItemChooser.js +1 -1
  11. package/lib/components/choosers/TMMetadataChooser.js +3 -1
  12. package/lib/components/choosers/TMUserChooser.d.ts +4 -0
  13. package/lib/components/choosers/TMUserChooser.js +21 -5
  14. package/lib/components/editors/TMTextArea.d.ts +1 -0
  15. package/lib/components/editors/TMTextArea.js +43 -9
  16. package/lib/components/editors/TMTextBox.js +33 -3
  17. package/lib/components/editors/TMTextExpression.js +36 -28
  18. package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +30 -0
  19. package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +459 -0
  20. package/lib/components/features/assistant/ToppySpeechBubble.d.ts +9 -0
  21. package/lib/components/features/assistant/ToppySpeechBubble.js +117 -0
  22. package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -0
  23. package/lib/components/features/blog/TMBlogCommentForm.js +18 -6
  24. package/lib/components/features/documents/TMDcmtBlog.js +1 -1
  25. package/lib/components/features/documents/TMDcmtForm.js +5 -5
  26. package/lib/components/features/documents/TMDcmtPreview.js +45 -8
  27. package/lib/components/features/search/TMSearchQueryPanel.js +2 -3
  28. package/lib/components/features/search/TMSearchResult.js +12 -13
  29. package/lib/components/features/tasks/TMTaskForm.js +2 -2
  30. package/lib/components/features/workflow/TMWorkflowPopup.js +1 -1
  31. package/lib/components/forms/TMSaveForm.js +2 -2
  32. package/lib/components/grids/TMBlogsPost.d.ts +7 -5
  33. package/lib/components/grids/TMBlogsPost.js +56 -10
  34. package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
  35. package/lib/components/grids/TMBlogsPostUtils.js +10 -0
  36. package/lib/components/index.d.ts +1 -1
  37. package/lib/components/index.js +1 -1
  38. package/lib/helper/SDKUI_Localizator.d.ts +5 -0
  39. package/lib/helper/SDKUI_Localizator.js +50 -0
  40. package/lib/helper/TMIcons.d.ts +2 -0
  41. package/lib/helper/TMIcons.js +9 -0
  42. package/lib/helper/TMToppyMessage.js +2 -1
  43. package/lib/helper/dcmtsHelper.d.ts +2 -2
  44. package/lib/helper/dcmtsHelper.js +54 -25
  45. package/lib/helper/helpers.d.ts +1 -1
  46. package/lib/helper/helpers.js +10 -16
  47. package/lib/ts/types.d.ts +2 -0
  48. package/package.json +2 -2
  49. package/lib/components/features/assistant/ToppyHelpCenter.d.ts +0 -12
  50. package/lib/components/features/assistant/ToppyHelpCenter.js +0 -173
@@ -1,173 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import ReactDOM from 'react-dom';
4
- import styled, { keyframes, css } from 'styled-components';
5
- import Toppy from '../../../assets/Toppy-generico.png';
6
- import { DeviceType } from '../../base/TMDeviceProvider';
7
- const toppyEntrance = keyframes `
8
- 0% { right: -200px; opacity: 0; }
9
- 60% { opacity: 1; }
10
- 100% { right: 10px; opacity: 1; }
11
- `;
12
- const pulseAnimation = keyframes `
13
- 0% { transform: scale(1); }
14
- 50% { transform: scale(1.05); }
15
- 100% { transform: scale(1); }
16
- `;
17
- const bounceAnimation = keyframes `
18
- 0%, 20%, 50%, 80%, 100% {
19
- transform: translateY(0);
20
- }
21
- 40% {
22
- transform: translateY(-10px);
23
- }
24
- 60% {
25
- transform: translateY(-5px);
26
- }
27
- `;
28
- const wiggle = keyframes `
29
- 0% { transform: rotate(-5deg) scale(1.1); }
30
- 10% { transform: rotate(5deg) scale(0.95); }
31
- 20% { transform: rotate(-5deg) scale(1.1); }
32
- 30% { transform: rotate(5deg) scale(1.05); }
33
- 40% { transform: rotate(-5deg) scale(1); }
34
- 50% { transform: rotate(5deg) scale(0.96); }
35
- 60% { transform: rotate(-5deg) scale(1.15); }
36
- 70% { transform: rotate(5deg) scale(0.99); }
37
- 80% { transform: rotate(-5deg) scale(1.05); }
38
- 90% { transform: rotate(5deg) scale(1); }
39
- 100% { transform: rotate(-5deg) scale(1.08); }
40
- `;
41
- const ToppyContainer = styled.div `
42
- position: ${({ $fixed }) => ($fixed ? 'fixed' : 'absolute')};
43
- bottom: ${({ $isCollapsed, $isMobile }) => $isMobile ? '5px' : $isCollapsed ? '5px' : '-20px'};
44
- ${({ $align, $isCollapsed }) => $align === 'left'
45
- ? `left: ${$isCollapsed ? '5px' : '10px'}; right: auto;`
46
- : `right: ${$isCollapsed ? '5px' : '10px'}; left: auto;`}
47
- display: flex;
48
- flex-direction: column-reverse; /* Il contenuto è sopra l'immagine */
49
- align-items: ${({ $align }) => $align === 'left' ? 'flex-start' : 'flex-end'};
50
- animation: ${({ $fixed }) => $fixed && css `${toppyEntrance} 0.5s cubic-bezier(0.23, 1, 0.32, 1)`};
51
- z-index: ${({ $fixed }) => ($fixed ? 2147483647 : 10)};
52
- `;
53
- const ToppyImage = styled.img `
54
- width: ${({ $isMobile, $isCollapsed }) => $isCollapsed ? '60px' : $isMobile ? '90px' : '120px'};
55
- height: ${({ $isMobile, $isCollapsed }) => $isCollapsed ? '70px' : $isMobile ? '105px' : '140px'};
56
- cursor: pointer;
57
- object-fit: cover;
58
- object-position: top center;
59
- clip-path: inset(0 0 22% 0 round 10px);
60
- transform: ${({ $isCollapsed, $align }) => $isCollapsed
61
- ? 'none'
62
- : $align === 'left'
63
- ? 'rotate(20deg)'
64
- : 'rotate(-20deg)'};
65
-
66
- ${({ $isCollapsed }) => $isCollapsed &&
67
- css `
68
- /* animation: ${bounceAnimation} 2s infinite; */
69
- /* animation: ${pulseAnimation} 2s infinite; */
70
- animation: ${wiggle} 4s infinite;
71
- `}
72
- `;
73
- const ToppyContent = styled.div `
74
- margin-bottom: ${({ $isMobile, $align }) => $align === 'left'
75
- ? '30px' // Spazio tra ToppyContent e ToppyImage
76
- : $isMobile
77
- ? '30px'
78
- : '20px'};
79
-
80
-
81
- display: ${props => (props.$isCollapsed ? 'none' : 'block')};
82
- width: max-content;
83
- max-width: 250px;
84
- background: linear-gradient(
85
- 180deg,
86
- rgba(0, 113, 188, 0.45) 0%,
87
- rgba(27, 20, 100, 0.65) 100%
88
- );
89
- color: white;
90
- padding: 10px;
91
- border-radius: 10px;
92
- border: 1px solid #FFFFFF;
93
- opacity: ${props => (props.$isCollapsed ? 0 : 1)};
94
- transform: ${props => (props.$isCollapsed ? 'translateY(20px)' : 'translateY(0)')};
95
- transition: opacity 0.3s ease, transform 0.3s ease;
96
- pointer-events: ${props => (props.$isCollapsed ? 'none' : 'auto')};
97
- position: relative;
98
-
99
- ${({ $align, $isMobile }) => $align === 'left' &&
100
- css `
101
- position: absolute;
102
- left: 50px;
103
- right: auto;
104
- bottom: 100%;
105
- transform: translateY(-${$isMobile ? '10px' : '20px'});
106
- `}
107
-
108
- &::after {
109
- transform: ${({ $align }) => $align === 'left' ? 'skewX(15deg)' : 'skewX(-15deg)'};
110
- content: "";
111
- position: absolute;
112
- top: 100%;
113
-
114
- ${({ $align }) => $align === 'left' ? 'left: 20px; right: auto;' : 'right: 15px; left: auto;'}
115
- border-width: 32px 32px 0 0;
116
- border-style: solid;
117
- border-color: #FFFFFF transparent;
118
- display: block;
119
- width: 0;
120
- height: 0;
121
- z-index: 1;
122
- }
123
-
124
- &::before {
125
- transform: ${({ $align }) => $align === 'left' ? 'skewX(15deg)' : 'skewX(-15deg)'};
126
- content: "";
127
- position: absolute;
128
- top: 100%;
129
-
130
- ${({ $align }) => $align === 'left' ? 'left: 20px; right: auto;' : 'right: 15px; left: auto;'}
131
- border-width: 32px 32px 0 0;
132
- border-style: solid;
133
- border-color: rgba(27, 20, 100, 0.65) transparent;
134
- display: block;
135
- width: 0;
136
- height: 0;
137
- z-index: 2;
138
- }
139
- `;
140
- const ToppyHelpCenter = ({ content, deviceType, usePortal = true, align = 'right', initialIsCollapsed, onToppyImageClick }) => {
141
- const [isCollapsed, setIsCollapsed] = useState(initialIsCollapsed ?? false);
142
- const [portalContainer, setPortalContainer] = useState(null);
143
- useEffect(() => {
144
- if (initialIsCollapsed === undefined && deviceType === DeviceType.MOBILE) {
145
- setIsCollapsed(true);
146
- }
147
- }, [deviceType, initialIsCollapsed]);
148
- useEffect(() => {
149
- if (!usePortal)
150
- return;
151
- const portalRoot = document.createElement('div');
152
- portalRoot.setAttribute('id', 'toppy-portal-root');
153
- document.body.appendChild(portalRoot);
154
- setPortalContainer(portalRoot);
155
- return () => {
156
- document.body.removeChild(portalRoot);
157
- };
158
- }, [usePortal]);
159
- const toggleCollapse = (e) => {
160
- e.stopPropagation();
161
- setIsCollapsed(!isCollapsed);
162
- onToppyImageClick?.();
163
- };
164
- const isMobile = deviceType === DeviceType.MOBILE;
165
- const toppyComponent = (_jsxs(ToppyContainer, { "$isMobile": isMobile, "$isCollapsed": isCollapsed, "$fixed": usePortal, "$align": align, children: [_jsx(ToppyImage, { "$isMobile": isMobile, "$isCollapsed": isCollapsed, "$align": align, onClick: toggleCollapse, src: Toppy, alt: "Toppy" }), _jsx(ToppyContent, { "$isCollapsed": isCollapsed, "$isMobile": isMobile, "$align": align, children: content })] }));
166
- if (usePortal) {
167
- if (!portalContainer)
168
- return null;
169
- return ReactDOM.createPortal(toppyComponent, portalContainer);
170
- }
171
- return toppyComponent;
172
- };
173
- export default ToppyHelpCenter;