@topconsultnpm/sdkui-react 6.21.0-dev3.31 → 6.21.0-dev3.33

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.
@@ -4,10 +4,12 @@ interface ITMSpinner {
4
4
  description?: string;
5
5
  width?: string;
6
6
  flat?: boolean;
7
+ onCancel?: () => void;
8
+ cancelText?: string;
7
9
  }
8
- declare const Spinner: ({ backgroundColor, description, fontSize, width, flat }: ITMSpinner) => import("react/jsx-runtime").JSX.Element;
10
+ declare const Spinner: ({ backgroundColor, description, fontSize, width, flat, onCancel, cancelText }: ITMSpinner) => import("react/jsx-runtime").JSX.Element;
9
11
  declare class TMSpinner {
10
- static show({ description, backgroundColor, fontSize, flat }?: ITMSpinner): void;
12
+ static show({ description, backgroundColor, fontSize, flat, onCancel, cancelText }?: ITMSpinner): void;
11
13
  static hide(): void;
12
14
  }
13
15
  export { Spinner };
@@ -32,7 +32,7 @@ const StyledSpinnerWrapper = styled.div `
32
32
  width: ${props => props.$width || 'fit-content'};
33
33
  height: fit-content;
34
34
  max-width: 250px;
35
- max-height: 200px;
35
+ max-height: ${props => props.$hasCancel ? '280px' : '200px'};
36
36
  padding: 10px;
37
37
  border-radius: 5px;
38
38
  background-color: ${props => props.$flat ? 'transparent' : '#fcfcfc'};
@@ -134,22 +134,49 @@ const StyledSpinnerAnimation = styled.div `
134
134
  const StyledSpinnerDescription = styled.div `
135
135
  font-size: ${props => props.$fontSize || FontSize.defaultFontSize};
136
136
  text-align: center;
137
+ white-space: pre-line;
137
138
  `;
138
- const Spinner = ({ backgroundColor = 'transparent', description = '', fontSize = FontSize.defaultFontSize, width = 'fit-content', flat = false }) => {
139
- return (_jsx(StyledSpinnerContainer, { "$backgroundColor": backgroundColor, children: _jsxs(StyledSpinnerWrapper, { "$width": width, "$flat": flat, children: [_jsxs("div", { style: { position: 'relative', width: '80px', height: '80px' }, children: [_jsx("img", { style: {
139
+ // Pulsante Annulla sotto lo spinner
140
+ const StyledCancelButton = styled.button `
141
+ margin-top: 15px;
142
+ padding: 8px 20px;
143
+ font-size: 14px;
144
+ font-weight: 500;
145
+ color: #fff;
146
+ background-color: #d12a1c;
147
+ border: none;
148
+ border-radius: 5px;
149
+ cursor: pointer;
150
+ transition: background-color 0.2s ease, transform 0.1s ease;
151
+
152
+ &:hover {
153
+ background-color: #b8241a;
154
+ }
155
+
156
+ &:active {
157
+ transform: scale(0.98);
158
+ }
159
+ `;
160
+ const Spinner = ({ backgroundColor = 'transparent', description = '', fontSize = FontSize.defaultFontSize, width = 'fit-content', flat = false, onCancel, cancelText = 'Annulla' }) => {
161
+ return (_jsx(StyledSpinnerContainer, { "$backgroundColor": backgroundColor, children: _jsxs(StyledSpinnerWrapper, { "$width": width, "$flat": flat, "$hasCancel": !!onCancel, children: [_jsxs("div", { style: { position: 'relative', width: '80px', height: '80px' }, children: [_jsx("img", { style: {
140
162
  position: 'absolute',
141
163
  top: '50%',
142
164
  left: '50%',
143
165
  transform: 'translate(-54%, -54%)'
144
- }, src: six, width: 35, alt: "" }), _jsxs(StyledSpinnerAnimation, { children: [_jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {})] })] }), _jsx(StyledSpinnerDescription, { "$fontSize": fontSize, children: description })] }) }));
166
+ }, src: six, width: 35, alt: "" }), _jsxs(StyledSpinnerAnimation, { children: [_jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {})] })] }), _jsx(StyledSpinnerDescription, { "$fontSize": fontSize, children: description }), onCancel && (_jsx(StyledCancelButton, { onClick: onCancel, children: cancelText }))] }) }));
145
167
  };
146
168
  class TMSpinner {
147
- static show({ description, backgroundColor, fontSize, flat } = { backgroundColor: 'transparent', description: '', fontSize: FontSize.defaultFontSize, flat: false }) {
169
+ static show({ description, backgroundColor, fontSize, flat, onCancel, cancelText } = {
170
+ backgroundColor: 'transparent',
171
+ description: '',
172
+ fontSize: FontSize.defaultFontSize,
173
+ flat: false
174
+ }) {
148
175
  let container = document.createElement('div');
149
176
  container.setAttribute("id", 'tm-spinner-temporary-container');
150
177
  document.body.appendChild(container);
151
178
  const root = ReactDOM.createRoot(container);
152
- root.render(_jsx(React.StrictMode, { children: _jsx(Spinner, { backgroundColor: backgroundColor, fontSize: fontSize, description: description, flat: flat }) }));
179
+ root.render(_jsx(React.StrictMode, { children: _jsx(Spinner, { backgroundColor: backgroundColor, fontSize: fontSize, description: description, flat: flat, onCancel: onCancel, cancelText: cancelText }) }));
153
180
  }
154
181
  static hide() {
155
182
  let container = document.getElementById('tm-spinner-temporary-container');
@@ -15,6 +15,8 @@ import { TMNothingToShow } from "../features/documents/TMDcmtPreview";
15
15
  import TMAccordion from "../base/TMAccordion";
16
16
  import TabPanel, { Item } from 'devextreme-react/tab-panel';
17
17
  import { TMExceptionBoxManager } from "../base/TMPopUp";
18
+ // Costante per la minWidth degli elementi - garantisce coerenza tra layout orizzontale e verticale
19
+ const ITEM_MIN_WIDTH = 200;
18
20
  export var ShowCheckBoxesMode;
19
21
  (function (ShowCheckBoxesMode) {
20
22
  ShowCheckBoxesMode[ShowCheckBoxesMode["Never"] = 0] = "Never";
@@ -616,7 +618,7 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
616
618
  }
617
619
  // Orizzontale con bordo, children e titolo
618
620
  if (!groupIsNoBorder && isHorizontal && children.length > 0 && groupTitle.length > 0) {
619
- return (_jsxs("div", { style: borderedGroupStyle('row'), children: [groupTitleElement, renderChildren(layoutItem, nextDepth)] }, `group-horizontal-${layoutItem.layoutItemID}`));
621
+ return (_jsxs("div", { style: { position: 'relative', border: '2px solid #CAD9EB', borderRadius: '3px', padding: '12px 6px 6px', margin: '10px' }, children: [groupTitleElement, _jsx("div", { style: { display: 'flex', flexDirection: 'row', flexWrap: 'nowrap', gap: '8px', overflowX: 'auto', overflowY: 'hidden', paddingBottom: '8px' }, children: children.map(child => (_jsx("div", { style: { flex: `1 1 ${ITEM_MIN_WIDTH}px`, minWidth: `${ITEM_MIN_WIDTH}px` }, children: renderLayoutItem(child, nextDepth, visited) }, child.layoutItemID))) })] }, `group-horizontal-${layoutItem.layoutItemID}`));
620
622
  }
621
623
  // Verticale senza bordo
622
624
  if (groupIsNoBorder && isVertical) {
@@ -633,8 +635,14 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
633
635
  }
634
636
  // Orizzontale
635
637
  if (isHorizontal) {
636
- const renderHorizontalChildren = () => children.map(child => (_jsx("div", { style: { flex: '1 1 0', minWidth: 0 }, children: renderLayoutItem(child, nextDepth, visited) }, child.layoutItemID)));
637
- return (_jsx("div", { style: { display: 'flex', flexDirection: 'row', flexWrap: 'wrap', gap: '3px' }, children: groupDescriptor.borderStyle === LayoutGroupBorderStyles.GroupBox || groupDescriptor.borderStyle === LayoutGroupBorderStyles.Tabbed ? (_jsx(TMAccordion, { title: groupTitle, titleSize: "Small", children: renderChildren(layoutItem, nextDepth) })) : groupDescriptor.borderStyle === LayoutGroupBorderStyles.Group ? (_jsxs("div", { style: borderedGroupStyle('column'), children: [groupTitleElement, renderHorizontalChildren()] })) : (renderHorizontalChildren()) }, `group-horizontal-${layoutItem.layoutItemID}`));
638
+ const renderHorizontalChildren = () => (_jsx("div", { style: { display: 'flex', flexDirection: 'row', flexWrap: 'nowrap', gap: '8px', overflowX: 'auto', overflowY: 'hidden', paddingBottom: '8px' }, children: children.map(child => (_jsx("div", { style: { flex: `1 1 ${ITEM_MIN_WIDTH}px`, minWidth: `${ITEM_MIN_WIDTH}px` }, children: renderLayoutItem(child, nextDepth, visited) }, child.layoutItemID))) }));
639
+ if (groupDescriptor.borderStyle === LayoutGroupBorderStyles.GroupBox || groupDescriptor.borderStyle === LayoutGroupBorderStyles.Tabbed) {
640
+ return (_jsx(TMAccordion, { title: groupTitle, titleSize: "Small", children: renderHorizontalChildren() }, `group-horizontal-${layoutItem.layoutItemID}`));
641
+ }
642
+ if (groupDescriptor.borderStyle === LayoutGroupBorderStyles.Group) {
643
+ return (_jsxs("div", { style: { position: 'relative', border: '2px solid #CAD9EB', borderRadius: '3px', padding: '12px 6px 6px', margin: '10px' }, children: [groupTitleElement, renderHorizontalChildren()] }, `group-horizontal-${layoutItem.layoutItemID}`));
644
+ }
645
+ return (_jsx("div", { children: renderHorizontalChildren() }, `group-horizontal-${layoutItem.layoutItemID}`));
638
646
  }
639
647
  // Fallback: gruppo con accordion e indentazione
640
648
  const indentationPx = depth > 0 ? depth * 10 : 0;
@@ -717,6 +725,7 @@ const StyledRow = styled.div `
717
725
  display: flex;
718
726
  flex-direction: row;
719
727
  width: 100%;
728
+ min-width: ${ITEM_MIN_WIDTH}px;
720
729
  gap: 5px;
721
730
  `;
722
731
  const StyledSeparator = styled.hr `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.21.0-dev3.31",
3
+ "version": "6.21.0-dev3.33",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",