@topconsultnpm/sdkui-react 6.21.0-t2 → 6.21.0-t4
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.
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +28 -2
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +4 -4
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +6 -6
- package/lib/components/base/Styled.d.ts +1 -1
- package/lib/components/base/TMAreaManager.js +11 -0
- package/lib/components/base/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +2 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMDataGrid.js +12 -2
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMDataGridExportForm.js +19 -8
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.js +4 -4
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +3 -3
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +7 -0
- package/lib/components/base/TMFileManagerUtils.js +14 -1
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +2 -1
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMModal.js +2 -2
- package/lib/components/base/TMPopUp.d.ts +1 -0
- package/lib/components/base/TMPopUp.js +59 -2
- package/lib/components/base/TMSpinner.d.ts +5 -2
- package/lib/components/base/TMSpinner.js +33 -6
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +16 -13
- package/lib/components/base/TMTreeView.js +242 -79
- package/lib/components/base/TMUserAvatar.d.ts +2 -1
- package/lib/components/base/TMVilViewer.d.ts +2 -1
- package/lib/components/base/TMWaitPanel.d.ts +5 -2
- package/lib/components/base/TMWaitPanel.js +8 -6
- package/lib/components/choosers/TMDistinctValues.js +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.js +6 -1
- package/lib/components/choosers/TMGroupChooser.js +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +6 -6
- package/lib/components/editors/TMFormulaEditor.d.ts +2 -1
- package/lib/components/editors/TMFormulaEditor.js +98 -49
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMMetadataEditor.js +6 -2
- package/lib/components/editors/TMMetadataValues.js +23 -6
- package/lib/components/editors/TMTextBox.d.ts +1 -0
- package/lib/components/editors/TMTextBox.js +2 -1
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/blog/TMBlogCommentForm.js +5 -2
- package/lib/components/features/documents/TMCopyToFolderForm.js +46 -24
- package/lib/components/features/documents/TMDcmtForm.d.ts +2 -0
- package/lib/components/features/documents/TMDcmtForm.js +21 -10
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +4 -1
- package/lib/components/features/documents/TMDcmtIcon.js +6 -33
- package/lib/components/features/documents/TMDcmtPreview.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +1 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -2
- package/lib/components/features/documents/TMMasterDetailDcmts.js +55 -16
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -3
- package/lib/components/features/documents/TMMergeToPdfForm.js +115 -56
- package/lib/components/features/documents/TMRelationViewer.d.ts +12 -10
- package/lib/components/features/documents/TMRelationViewer.js +405 -95
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +4 -16
- package/lib/components/features/documents/copyAndMergeDcmtsShared.js +47 -61
- package/lib/components/features/documents/mergePdfUtils.d.ts +52 -0
- package/lib/components/features/documents/mergePdfUtils.js +268 -0
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +18 -0
- package/lib/components/features/search/TMMetadataOutputForm.js +225 -0
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +18 -0
- package/lib/components/features/search/TMMetadataSorterForm.js +243 -0
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.d.ts +2 -2
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +14 -8
- package/lib/components/features/search/TMSearchQueryPanel.js +249 -58
- package/lib/components/features/search/TMSearchResult.d.ts +3 -2
- package/lib/components/features/search/TMSearchResult.js +94 -25
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
- package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
- package/lib/components/features/search/metadataFormHelper.d.ts +16 -0
- package/lib/components/features/search/metadataFormHelper.js +77 -0
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
- package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/Login/TMLoginForm.js +15 -3
- package/lib/components/forms/TMChooserForm.d.ts +2 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
- package/lib/components/grids/TMBlogAttachments.js +2 -2
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.js +5 -3
- package/lib/components/grids/TMBlogsPostUtils.d.ts +10 -9
- package/lib/components/grids/TMBlogsPostUtils.js +3 -1
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +1 -1
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- package/lib/components/sidebar/TMHeader.d.ts +3 -3
- package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.js +14 -2
- package/lib/components/wizard/TMWizard.d.ts +1 -0
- package/lib/components/wizard/TMWizard.js +5 -3
- package/lib/helper/Enum_Localizator.js +2 -0
- package/lib/helper/MergePdfManager.d.ts +45 -0
- package/lib/helper/MergePdfManager.js +148 -0
- package/lib/helper/SDKUI_Globals.d.ts +1 -0
- package/lib/helper/SDKUI_Globals.js +3 -1
- package/lib/helper/SDKUI_Localizator.d.ts +40 -0
- package/lib/helper/SDKUI_Localizator.js +412 -12
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +278 -278
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +57 -21
- package/lib/helper/TMUtils.js +159 -1
- package/lib/helper/certificateImportHelper.d.ts +43 -0
- package/lib/helper/certificateImportHelper.js +403 -0
- package/lib/helper/checkinCheckoutManager.d.ts +4 -3
- package/lib/helper/checkinCheckoutManager.js +29 -11
- package/lib/helper/helpers.d.ts +3 -2
- package/lib/helper/helpers.js +10 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +4 -3
- package/lib/hooks/useDataUserIdItem.js +1 -1
- package/lib/hooks/useDcmtOperations.d.ts +20 -2
- package/lib/hooks/useDcmtOperations.js +244 -25
- package/lib/hooks/useDocumentOperations.d.ts +2 -2
- package/lib/hooks/useDocumentOperations.js +52 -13
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/hooks/useRelatedDocuments.js +4 -4
- package/lib/services/platform_services.d.ts +7 -6
- package/lib/ts/types.d.ts +3 -1
- package/lib/ts/types.js +2 -0
- package/package.json +15 -7
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface ITMListItem {
|
|
2
3
|
icon: any;
|
|
3
4
|
text?: string;
|
|
@@ -5,5 +6,5 @@ interface ITMListItem {
|
|
|
5
6
|
}
|
|
6
7
|
declare const TMList: ({ items }: {
|
|
7
8
|
items: ITMListItem[];
|
|
8
|
-
}) =>
|
|
9
|
+
}) => React.JSX.Element;
|
|
9
10
|
export default TMList;
|
|
@@ -37,6 +37,6 @@ interface ListProps<T> {
|
|
|
37
37
|
onItemDblClick?: (item: T) => void;
|
|
38
38
|
itemTemplate?: (item: T) => JSX.Element;
|
|
39
39
|
}
|
|
40
|
-
declare const TMListView: <T>({ customGroupingHeaders, headerBackGroundColor, header, showId, setShowId, showSearch, setShowSearch, grouping, orderBy, id, onScrollChange, scroll, searchKeys, searchable, itemTemplate, customColor, dataSource, exprKey, onSelectionChanged, onItemClick, onItemDblClick, selectedItem, autoScrollToSelectedItem }: ListProps<T>) =>
|
|
40
|
+
declare const TMListView: <T>({ customGroupingHeaders, headerBackGroundColor, header, showId, setShowId, showSearch, setShowSearch, grouping, orderBy, id, onScrollChange, scroll, searchKeys, searchable, itemTemplate, customColor, dataSource, exprKey, onSelectionChanged, onItemClick, onItemDblClick, selectedItem, autoScrollToSelectedItem }: ListProps<T>) => React.JSX.Element;
|
|
41
41
|
export default TMListView;
|
|
42
42
|
export declare const CustomListViewHeader: React.FC<ITMListViewHeader>;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useState, useEffect, useRef } from 'react';
|
|
3
3
|
import { Popup } from 'devextreme-react';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import
|
|
5
|
+
import { TMCard } from './TMLayout';
|
|
6
6
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
7
7
|
import { IconWindowMaximize, IconWindowMinimize, svgToString } from '../../helper';
|
|
8
8
|
const StyledModal = styled.div `
|
|
@@ -110,6 +110,6 @@ const TMModal = ({ resizable = true, expandable = false, isModal = true, title =
|
|
|
110
110
|
onClick: () => setIsFullScreen(!isFullScreen)
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
] : undefined, children: _jsxs(
|
|
113
|
+
] : undefined, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', width: '100%' }, children: [toolbar && (_jsx(StyledModalToolbar, { children: toolbar })), _jsx("div", { style: { flex: 1, overflow: 'hidden', minHeight: 0 }, children: _jsx(TMCard, { showBorder: false, padding: false, scrollY: true, children: children }) })] }) })) : (_jsxs(StyledModal, { "$isModal": isModal, className: "temp-modal", "$fontSize": fontSize, "$width": initialWidth, "$height": initialHeight, children: [toolbar ? _jsx(StyledModalToolbar, { children: toolbar }) : _jsx(_Fragment, {}), _jsx(StyledModalContext, { children: children })] })) }));
|
|
114
114
|
};
|
|
115
115
|
export default TMModal;
|
|
@@ -24,6 +24,7 @@ interface ITMExceptionBox extends ITMPopup {
|
|
|
24
24
|
exception?: any;
|
|
25
25
|
onClose?: () => void;
|
|
26
26
|
}
|
|
27
|
+
export declare const sanitizeException: (exception: any) => any;
|
|
27
28
|
declare class TMExceptionBoxManager {
|
|
28
29
|
static show({ title, exception, onClose }: ITMExceptionBox): void;
|
|
29
30
|
}
|
|
@@ -23,6 +23,45 @@ export var ButtonNames;
|
|
|
23
23
|
// Dimensioni minime di default per i popup
|
|
24
24
|
const DEFAULT_MIN_WIDTH = 500;
|
|
25
25
|
const DEFAULT_MIN_HEIGHT = 400;
|
|
26
|
+
// filtr sensitive keys from all errors.
|
|
27
|
+
const SENSITIVE_KEYS = ['password', 'username'];
|
|
28
|
+
const redactSensitiveJsonString = (value) => {
|
|
29
|
+
const trimmed = value.trim();
|
|
30
|
+
const looksLikeJson = (trimmed.startsWith('{') && trimmed.endsWith('}')) || (trimmed.startsWith('[') && trimmed.endsWith(']'));
|
|
31
|
+
if (!looksLikeJson)
|
|
32
|
+
return value;
|
|
33
|
+
try {
|
|
34
|
+
return JSON.stringify(redactSensitiveValue(JSON.parse(value)));
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const redactSensitiveValue = (value) => {
|
|
41
|
+
if (Array.isArray(value))
|
|
42
|
+
return value.map(redactSensitiveValue);
|
|
43
|
+
if (typeof value === 'string')
|
|
44
|
+
return redactSensitiveJsonString(value);
|
|
45
|
+
if (!value || typeof value !== 'object')
|
|
46
|
+
return value;
|
|
47
|
+
const result = {};
|
|
48
|
+
for (const key of Object.keys(value)) {
|
|
49
|
+
result[key] = SENSITIVE_KEYS.includes(key.toLowerCase()) ? '***' : redactSensitiveValue(value[key]);
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
};
|
|
53
|
+
export const sanitizeException = (exception) => {
|
|
54
|
+
if (exception === null || exception === undefined)
|
|
55
|
+
return exception;
|
|
56
|
+
let plain;
|
|
57
|
+
try {
|
|
58
|
+
plain = JSON.parse(JSON.stringify(exception));
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return exception;
|
|
62
|
+
}
|
|
63
|
+
return redactSensitiveValue(plain);
|
|
64
|
+
};
|
|
26
65
|
const StyledExeptionToolbar = styled.div `
|
|
27
66
|
display: flex;
|
|
28
67
|
flex-direction: row;
|
|
@@ -273,6 +312,7 @@ const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.a
|
|
|
273
312
|
let dateString = d.getDate() + '/' + d.getMonth() + 1 + '/' + d.getFullYear();
|
|
274
313
|
let timeString = d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds() + ':' + d.getMilliseconds();
|
|
275
314
|
let message = getExceptionMessage(exception);
|
|
315
|
+
const safeException = useMemo(() => sanitizeException(exception), [exception]);
|
|
276
316
|
let deviceType = useDeviceType();
|
|
277
317
|
/**
|
|
278
318
|
* Gestore chiamato quando il popup viene mostrato.
|
|
@@ -304,17 +344,34 @@ const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.a
|
|
|
304
344
|
};
|
|
305
345
|
const getFullMessage = () => {
|
|
306
346
|
let fullMessage = '';
|
|
307
|
-
fullMessage += `${d}\n${'-' + JSON.stringify(
|
|
347
|
+
fullMessage += `${d}\n${'-' + JSON.stringify(safeException)}\n` + `-${SDK_Globals.appModule}: ${SDK_Globals.appVersion}\n` + `-SDKUI: ${SDK_Globals.sdkuiVersion}\n` + `-SDK: ${SDK_Globals.sdkVersion}\n`;
|
|
308
348
|
return fullMessage.replaceAll('{', '').replaceAll('}', '').replaceAll(`":`, '=').replaceAll(`,"`, '\n').replaceAll(`"`, '');
|
|
309
349
|
};
|
|
310
350
|
const copyToClipBoard = (e) => {
|
|
311
351
|
navigator.clipboard.writeText(e);
|
|
312
352
|
ShowAlert({ mode: 'success', duration: 3000, message: SDKUI_Localizator.CopiedSuccessfully, title: 'Success' });
|
|
313
353
|
};
|
|
354
|
+
const handleClose = useCallback(() => {
|
|
355
|
+
onClose?.();
|
|
356
|
+
setIsVisible(false);
|
|
357
|
+
}, [onClose]);
|
|
358
|
+
const handleKeyDown = useCallback((e) => {
|
|
359
|
+
if (e.key === 'Enter' || e.key === 'Escape') {
|
|
360
|
+
e.preventDefault();
|
|
361
|
+
e.stopPropagation();
|
|
362
|
+
handleClose();
|
|
363
|
+
}
|
|
364
|
+
}, [handleClose]);
|
|
365
|
+
useEffect(() => {
|
|
366
|
+
if (!isVisible)
|
|
367
|
+
return;
|
|
368
|
+
window.addEventListener('keydown', handleKeyDown, true);
|
|
369
|
+
return () => window.removeEventListener('keydown', handleKeyDown, true);
|
|
370
|
+
}, [isVisible, handleKeyDown]);
|
|
314
371
|
const ExceptionToolbar = () => {
|
|
315
372
|
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' })] }));
|
|
316
373
|
};
|
|
317
|
-
return (_jsx(Popup, { ref: popupRef, resizeEnabled: resizable, visible: isVisible, onHidden: () => { onClose?.(); setIsVisible(false); }, onShown: handleShown, showCloseButton: true, width: calcResponsiveSizes(deviceType, '600px', '400px', '350px'), height: '350px', minWidth: minWidth, minHeight: minHeight, maxHeight: '95%', maxWidth: '95%', 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(
|
|
374
|
+
return (_jsx(Popup, { ref: popupRef, resizeEnabled: resizable, visible: isVisible, onHidden: () => { onClose?.(); setIsVisible(false); }, onShown: handleShown, showCloseButton: true, width: calcResponsiveSizes(deviceType, '600px', '400px', '350px'), height: '350px', minWidth: minWidth, minHeight: minHeight, maxHeight: '95%', maxWidth: '95%', 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(safeException).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(safeException).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, {}) })] }) }));
|
|
318
375
|
};
|
|
319
376
|
class TMExceptionBoxManager {
|
|
320
377
|
static show({ title, exception, onClose }) {
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface ITMSpinner {
|
|
2
3
|
backgroundColor?: string;
|
|
3
4
|
fontSize?: string;
|
|
4
5
|
description?: string;
|
|
5
6
|
width?: string;
|
|
6
7
|
flat?: boolean;
|
|
8
|
+
onCancel?: () => void;
|
|
9
|
+
cancelText?: string;
|
|
7
10
|
}
|
|
8
|
-
declare const Spinner: ({ backgroundColor, description, fontSize, width, flat }: ITMSpinner) =>
|
|
11
|
+
declare const Spinner: ({ backgroundColor, description, fontSize, width, flat, onCancel, cancelText }: ITMSpinner) => React.JSX.Element;
|
|
9
12
|
declare class TMSpinner {
|
|
10
|
-
static show({ description, backgroundColor, fontSize, flat }?: ITMSpinner): void;
|
|
13
|
+
static show({ description, backgroundColor, fontSize, flat, onCancel, cancelText }?: ITMSpinner): void;
|
|
11
14
|
static hide(): void;
|
|
12
15
|
}
|
|
13
16
|
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
|
-
|
|
139
|
-
|
|
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
|
|
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');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
export interface ITMTabProps {
|
|
3
4
|
title: string;
|
|
@@ -7,14 +8,14 @@ export declare const TMTab: ({ label, propsToBeValidated, children }: {
|
|
|
7
8
|
label?: string;
|
|
8
9
|
propsToBeValidated?: string[] | undefined;
|
|
9
10
|
children?: any;
|
|
10
|
-
}) =>
|
|
11
|
+
}) => React.JSX.Element;
|
|
11
12
|
export declare const TMTabItemBadge: ({ vil }: {
|
|
12
13
|
vil: ValidationItem[];
|
|
13
|
-
}) =>
|
|
14
|
+
}) => React.JSX.Element;
|
|
14
15
|
declare const TMTabGroup: ({ children, fontSize, validationItems, onTabIndexChanged }: {
|
|
15
16
|
onTabIndexChanged?: (e: number) => void;
|
|
16
17
|
children: any;
|
|
17
18
|
fontSize?: string;
|
|
18
19
|
validationItems?: ValidationItem[];
|
|
19
|
-
}) =>
|
|
20
|
+
}) => React.JSX.Element;
|
|
20
21
|
export default TMTabGroup;
|
|
@@ -10,5 +10,5 @@ interface ITMTooltipProps extends ITooltipOptions {
|
|
|
10
10
|
parentStyle?: React.CSSProperties;
|
|
11
11
|
childStyle?: React.CSSProperties;
|
|
12
12
|
}
|
|
13
|
-
declare const TMTooltip: ({ children, position, content, hideAfterDelay, parentStyle, childStyle }: ITMTooltipProps) =>
|
|
13
|
+
declare const TMTooltip: ({ children, position, content, hideAfterDelay, parentStyle, childStyle }: ITMTooltipProps) => React.JSX.Element;
|
|
14
14
|
export default TMTooltip;
|
|
@@ -11,25 +11,28 @@ export interface ITMTreeItem {
|
|
|
11
11
|
currentPage?: number;
|
|
12
12
|
totalItemsCount?: number;
|
|
13
13
|
}
|
|
14
|
-
interface ITMTreeViewProps
|
|
15
|
-
dataSource?:
|
|
16
|
-
focusedItem?:
|
|
17
|
-
selectedItems?:
|
|
14
|
+
interface ITMTreeViewProps {
|
|
15
|
+
dataSource?: ITMTreeItem[];
|
|
16
|
+
focusedItem?: ITMTreeItem | null;
|
|
17
|
+
selectedItems?: ITMTreeItem[];
|
|
18
18
|
allowMultipleSelection?: boolean;
|
|
19
|
-
calculateItemsForNode?: (node:
|
|
20
|
-
itemRender: (item:
|
|
21
|
-
onFocusedItemChanged?: (item:
|
|
22
|
-
onSelectionChanged?: (selectedItems:
|
|
23
|
-
onNodeUpdate?: (updatedNode:
|
|
24
|
-
onDataChanged?: (items:
|
|
25
|
-
shouldDelayFocusOnEvent?: (node:
|
|
26
|
-
onItemContextMenu?: (item:
|
|
19
|
+
calculateItemsForNode?: (node: ITMTreeItem) => Promise<ITMTreeItem[] | undefined>;
|
|
20
|
+
itemRender: (item: ITMTreeItem | null) => JSX.Element;
|
|
21
|
+
onFocusedItemChanged?: (item: ITMTreeItem | null) => void;
|
|
22
|
+
onSelectionChanged?: (selectedItems: ITMTreeItem[]) => void;
|
|
23
|
+
onNodeUpdate?: (updatedNode: ITMTreeItem) => void;
|
|
24
|
+
onDataChanged?: (items: ITMTreeItem[]) => void;
|
|
25
|
+
shouldDelayFocusOnEvent?: (node: ITMTreeItem, event: React.MouseEvent) => boolean;
|
|
26
|
+
onItemContextMenu?: (item: ITMTreeItem, e: React.MouseEvent) => void;
|
|
27
27
|
autoSelectChildren?: boolean;
|
|
28
28
|
itemsPerPage?: number;
|
|
29
29
|
showLoadMoreButton?: boolean;
|
|
30
|
+
enableVirtualization?: boolean;
|
|
30
31
|
}
|
|
31
|
-
declare const TMTreeView:
|
|
32
|
+
declare const TMTreeView: ({ dataSource, focusedItem, selectedItems, allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, onItemContextMenu, autoSelectChildren, itemsPerPage, showLoadMoreButton, enableVirtualization }: ITMTreeViewProps) => React.JSX.Element;
|
|
32
33
|
export default TMTreeView;
|
|
34
|
+
export declare const StyledTreeContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
35
|
+
export declare const StyledItemContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
33
36
|
export declare const StyledTreeNode: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isSelected"> & {
|
|
34
37
|
$isSelected?: boolean;
|
|
35
38
|
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isSelected"> & {
|