@topconsultnpm/sdkui-react-beta 6.16.106 → 6.16.107
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.
|
@@ -22,9 +22,10 @@ interface ITMMessageBox extends ITMPopup {
|
|
|
22
22
|
}
|
|
23
23
|
interface ITMExceptionBox extends ITMPopup {
|
|
24
24
|
exception?: any;
|
|
25
|
+
onClose?: () => void;
|
|
25
26
|
}
|
|
26
27
|
declare class TMExceptionBoxManager {
|
|
27
|
-
static show({ title, exception }: ITMExceptionBox): void;
|
|
28
|
+
static show({ title, exception, onClose }: ITMExceptionBox): void;
|
|
28
29
|
}
|
|
29
30
|
declare class TMMessageBoxManager {
|
|
30
31
|
static show({ title, buttons, onButtonClick, message, parentId, resizable, onClose, confirmOnEnter, showToppy, initialHeight, initialWidth }: ITMMessageBox): void;
|
|
@@ -229,7 +229,7 @@ const TMMessageBox = ({ resizable = false, onButtonClick, title = 'TopMedia', me
|
|
|
229
229
|
el.style.zIndex = '20000';
|
|
230
230
|
}, children: _jsx(ResponsiveMessageBody, { message: message, isMobile: isMobile, MessageToolbar: MessageToolbar, showToppy: showToppy }) }));
|
|
231
231
|
};
|
|
232
|
-
const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.appModule} v. ${SDK_Globals.appVersion}
|
|
232
|
+
const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.appModule} v. ${SDK_Globals.appVersion}`, onClose }) => {
|
|
233
233
|
const [isVisible, setIsVisible] = useState(true);
|
|
234
234
|
let d = new Date();
|
|
235
235
|
let dateString = d.getDate() + '/' + d.getMonth() + 1 + '/' + d.getFullYear();
|
|
@@ -246,16 +246,16 @@ const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.a
|
|
|
246
246
|
ShowAlert({ mode: 'success', duration: 3000, message: SDKUI_Localizator.CopiedSuccessfully, title: 'Success' });
|
|
247
247
|
};
|
|
248
248
|
const ExceptionToolbar = () => {
|
|
249
|
-
return (_jsxs(StyledExeptionToolbar, { children: [_jsx(TMButton, { color: 'primaryOutline', btnStyle: 'text', onClick: () => copyToClipBoard(getFullMessage()), caption: SDKUI_Localizator.CopyToClipboard, showTooltip: false }), _jsx(TMButton, { btnStyle: 'text', onClick: () => setIsVisible(false), caption: SDKUI_Localizator.Close, showTooltip: false, color: 'error' })] }));
|
|
249
|
+
return (_jsxs(StyledExeptionToolbar, { children: [_jsx(TMButton, { color: 'primaryOutline', btnStyle: 'text', onClick: () => copyToClipBoard(getFullMessage()), caption: SDKUI_Localizator.CopyToClipboard, showTooltip: false }), _jsx(TMButton, { btnStyle: 'text', onClick: () => { onClose?.(); setIsVisible(false); }, caption: SDKUI_Localizator.Close, showTooltip: false, color: 'error' })] }));
|
|
250
250
|
};
|
|
251
251
|
return (_jsx(Popup, { resizeEnabled: resizable, visible: isVisible, onHidden: () => setIsVisible(false), showCloseButton: true, width: calcResponsiveSizes(deviceType, '600px', '400px', '350px'), height: '350px', title: title, children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { height: 'calc(100% - 50px)', children: _jsxs(TMTabGroup, { validationItems: [], children: [_jsxs(TMTab, { label: SDKUI_Localizator.Error, children: [_jsxs(TabContextContainer, { style: { height: 'calc(100% - 68px )', paddingRight: '40px' }, children: [_jsxs("p", { children: [" ", _jsx("span", { style: { color: TMColors.primary }, children: "Messaggio: " }), " ", message] }), _jsx("div", { style: { display: 'flex', flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'flex-start', gap: '5px', marginTop: '5px' }, children: _jsxs("div", { children: [_jsxs("span", { style: { color: TMColors.primary }, children: [SDKUI_Localizator.Date, " ", SDKUI_Localizator.Time.toLowerCase(), ": "] }), d.toString()] }) })] }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(`Date: ${dateString}\nTime: ${timeString}\nMessage: ${message}`), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] }), _jsxs(TMTab, { label: SDKUI_Localizator.CompleteError, children: [_jsx(TabContextContainer, { style: { paddingRight: '40px' }, children: JSON.stringify(exception).replaceAll('{', '').replaceAll('}', '').split(`,"`).map((t, index) => (_jsxs("div", { style: { padding: '5px', borderBottom: '1px solid rgb(180,180,180)' }, children: ["\u261B", ' ' + (t.toLowerCase().includes('detail') ? (t.replaceAll(`"`, '').replaceAll(`:`, ': ').replaceAll(String.fromCharCode(92), '')) : (t.replaceAll(`"`, '').replaceAll(`:`, ': ')))] }, index))) }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(JSON.stringify(exception).replaceAll('{', '').replaceAll('}', '').replaceAll(',', '\n')), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] }), _jsxs(TMTab, { label: SDKUI_Localizator.Details, children: [_jsxs(TabContextContainer, { children: [_jsxs(StyledAppVersionText, { "$color": TMColors.primary, children: [SDK_Globals.appModule, " ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.appVersion })] }), _jsxs(StyledAppVersionText, { "$color": TMColors.tertiary, children: ["SDKUI: ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.sdkuiVersion })] }), _jsxs(StyledAppVersionText, { "$color": TMColors.success, children: ["SDK : ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.sdkVersion })] })] }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(`-${SDK_Globals.appModule}: ${SDK_Globals.appVersion}\n` + `-SDKUI: ${SDK_Globals.sdkuiVersion}\n` + `-SDK: ${SDK_Globals.sdkVersion}\n`), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] })] }) }), _jsx(TMLayoutItem, { height: '40px', children: _jsx(ExceptionToolbar, {}) })] }) }));
|
|
252
252
|
};
|
|
253
253
|
class TMExceptionBoxManager {
|
|
254
|
-
static show({ title, exception }) {
|
|
254
|
+
static show({ title, exception, onClose }) {
|
|
255
255
|
let container = document.createElement('div');
|
|
256
256
|
document.body.appendChild(container);
|
|
257
257
|
const root = ReactDOM.createRoot(container);
|
|
258
|
-
root.render(_jsx(TMDeviceProvider, { children: React.createElement(TMExceptionBox, { title: title, exception: exception }) }));
|
|
258
|
+
root.render(_jsx(TMDeviceProvider, { children: React.createElement(TMExceptionBox, { title: title, exception: exception, onClose: onClose }) }));
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
class TMMessageBoxManager {
|