@topconsultnpm/sdkui-react 6.22.0-dev2.9 → 6.22.0-dev3.3
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 +3 -3
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +1 -1
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +14 -14
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +31 -31
- package/lib/components/base/Styled.d.ts +4 -4
- package/lib/components/base/TMAccordionNew.js +7 -7
- package/lib/components/base/TMAlert.d.ts +32 -32
- package/lib/components/base/TMAreaManager.js +1 -1
- package/lib/components/base/TMButton.js +4 -4
- package/lib/components/base/TMClosableList.js +3 -3
- package/lib/components/base/TMCustomButton.js +1 -1
- package/lib/components/base/TMDataGrid.d.ts +4 -0
- package/lib/components/base/TMDataGrid.js +290 -10
- package/lib/components/base/TMDropDownMenu.js +1 -1
- package/lib/components/base/TMEditorBase.d.ts +2 -0
- package/lib/components/base/TMFileManager.js +5 -3
- package/lib/components/base/TMFileManagerDataGridView.js +12 -3
- package/lib/components/base/TMFileManagerThumbnailItems.js +20 -10
- package/lib/components/base/TMFileManagerUtils.d.ts +4 -2
- package/lib/components/base/TMFileManagerUtils.js +37 -1
- package/lib/components/base/TMLayout.d.ts +2 -2
- package/lib/components/base/TMLayout.js +3 -3
- package/lib/components/base/TMList.js +1 -1
- package/lib/components/base/TMListView.js +3 -3
- package/lib/components/base/TMModal.d.ts +11 -0
- package/lib/components/base/TMModal.js +47 -13
- package/lib/components/base/TMPanel.d.ts +6 -0
- package/lib/components/base/TMPanel.js +141 -28
- package/lib/components/base/TMPopUp.js +5 -2
- package/lib/components/base/TMResizableMenu.js +2 -2
- package/lib/components/base/TMRightSidebar.js +1 -1
- package/lib/components/base/TMShowAllOrMaxItemsButton.js +1 -1
- package/lib/components/base/TMSpinner.js +2 -2
- package/lib/components/base/TMTab.js +2 -2
- package/lib/components/base/TMToggleButton.js +2 -2
- package/lib/components/base/TMToolbarCard.js +3 -3
- package/lib/components/base/TMTooltip.d.ts +2 -1
- package/lib/components/base/TMTooltip.js +24 -8
- package/lib/components/base/TMTreeView.js +110 -69
- package/lib/components/base/TMWaitPanel.js +2 -2
- package/lib/components/choosers/TMCultureIDPicker.js +2 -2
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.js +2 -2
- package/lib/components/choosers/TMDcmtTypeChooser.js +5 -4
- package/lib/components/choosers/TMDiskChooser.js +1 -1
- package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
- package/lib/components/choosers/TMDistinctValues.js +157 -141
- package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMImageIDChooser.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +3 -3
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +12 -0
- package/lib/components/choosers/TMQuickSearchInfo.js +279 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.d.ts +16 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.js +94 -0
- package/lib/components/choosers/TMRelationChooser.js +1 -1
- package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
- package/lib/components/choosers/TMSelectedValuesSummary.js +89 -0
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMCheckBox.js +1 -1
- package/lib/components/editors/TMDropDown.d.ts +3 -0
- package/lib/components/editors/TMDropDown.js +197 -5
- package/lib/components/editors/TMEditorStyled.d.ts +10 -10
- package/lib/components/editors/TMFormulaEditor.js +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.js +1 -1
- package/lib/components/editors/TMLocalizedTextBox.js +1 -1
- package/lib/components/editors/TMMetadataValues.js +2 -2
- package/lib/components/editors/TMRadioButton.js +2 -2
- package/lib/components/editors/TMSummary.js +3 -3
- package/lib/components/editors/TMTextArea.js +3 -3
- package/lib/components/editors/TMTextBox.js +3 -3
- package/lib/components/editors/TMTextExpression.js +1 -1
- package/lib/components/features/archive/TMArchive.js +17 -3
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
- package/lib/components/features/assistant/TMToppySpeechBubble.js +1 -1
- package/lib/components/features/documents/TMBatchUpdateForm.js +20 -6
- package/lib/components/features/documents/TMDcmtBlog.d.ts +3 -0
- package/lib/components/features/documents/TMDcmtBlog.js +4 -4
- package/lib/components/features/documents/TMDcmtForm.d.ts +7 -0
- package/lib/components/features/documents/TMDcmtForm.js +180 -53
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +11 -0
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +79 -9
- package/lib/components/features/documents/TMDcmtIcon.js +5 -3
- package/lib/components/features/documents/TMDcmtPreview.js +12 -8
- package/lib/components/features/documents/TMDownloadRelationViewerSection.js +1 -1
- package/lib/components/features/documents/TMFileUploader.js +3 -3
- package/lib/components/features/documents/TMMasterDetailDcmts.js +96 -34
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +19 -0
- package/lib/components/features/documents/TMMasterInfoFields.js +184 -0
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +30 -5
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +45 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +323 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +370 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +283 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +14 -1
- package/lib/components/features/documents/TMRelationViewer.js +71 -22
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +1 -1
- package/lib/components/features/search/TMMetadataOutputForm.js +1 -1
- package/lib/components/features/search/TMMetadataSorterForm.js +1 -1
- package/lib/components/features/search/TMSavedQuerySelector.js +2 -2
- package/lib/components/features/search/TMSearch.js +78 -12
- package/lib/components/features/search/TMSearchQueryEditor.js +7 -5
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +4 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +142 -68
- package/lib/components/features/search/TMSearchResult.d.ts +16 -0
- package/lib/components/features/search/TMSearchResult.js +431 -110
- package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
- package/lib/components/features/search/TMTreeSelector.js +109 -64
- package/lib/components/features/tasks/TMTaskForm.js +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.js +3 -3
- package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.js +1 -1
- package/lib/components/features/tasks/TMTasksView.js +4 -4
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +1 -1
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +10 -0
- package/lib/components/features/workflow/TMWorkflowPopup.js +9 -5
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +4 -4
- package/lib/components/forms/Login/Menu.js +1 -1
- package/lib/components/forms/Login/OTPReader.js +1 -1
- package/lib/components/forms/Login/PasswordStrengthChecker.js +1 -1
- package/lib/components/forms/Login/RapidAccessLogin.js +2 -2
- package/lib/components/forms/Login/RecoverPasswordFlow.js +2 -2
- package/lib/components/forms/Login/SelectBox.js +1 -1
- package/lib/components/forms/Login/StepIndicator.js +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +7 -7
- package/lib/components/forms/Login/TextBox.js +1 -1
- package/lib/components/forms/TMApplyForm.js +3 -3
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/forms/TMSaveForm.js +3 -3
- package/lib/components/grids/TMBlogAttachments.js +14 -3
- package/lib/components/grids/TMBlogHeader.js +5 -1
- package/lib/components/grids/TMBlogsPost.d.ts +2 -0
- package/lib/components/grids/TMBlogsPost.js +31 -4
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +15 -4
- package/lib/components/grids/TMRecentsManager.js +4 -4
- package/lib/components/grids/TMValidationItemsList.js +1 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +25 -15
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
- package/lib/components/layout/panelManager/TMPanelWrapper.js +3 -3
- package/lib/components/layout/panelManager/types.d.ts +3 -0
- package/lib/components/layout/panelManager/utils.js +13 -11
- package/lib/components/pages/TMPage.js +1 -1
- package/lib/components/query/TMQueryCountButton.js +1 -1
- package/lib/components/query/TMQueryEditor.js +7 -7
- package/lib/components/sidebar/TMCommandsPanel.js +1 -1
- package/lib/components/sidebar/TMHeader.js +36 -26
- package/lib/components/sidebar/TMSidebar.js +1 -1
- package/lib/components/sidebar/TMSidebarItem.js +1 -1
- package/lib/components/viewers/TMMidViewer.js +6 -3
- package/lib/components/viewers/TMTidViewer.js +89 -28
- package/lib/components/wizard/TMStepIndicator.js +3 -3
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/devextreme-license.d.ts +1 -0
- package/lib/devextreme-license.js +3 -0
- package/lib/helper/Enum_Localizator.d.ts +4 -4
- package/lib/helper/Globalization.d.ts +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +110 -0
- package/lib/helper/SDKUI_Globals.js +151 -0
- package/lib/helper/SDKUI_Localizator.d.ts +731 -687
- package/lib/helper/SDKUI_Localizator.js +440 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +1 -0
- package/lib/helper/TMAppUpdatedModal.js +134 -0
- package/lib/helper/TMIcons.d.ts +1 -0
- package/lib/helper/TMIcons.js +4 -3
- package/lib/helper/TMPdfViewer.js +1 -1
- package/lib/helper/TMToppyMessage.js +1 -1
- package/lib/helper/TMUtils.d.ts +13 -0
- package/lib/helper/TMUtils.js +25 -3
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +1 -1
- package/lib/helper/dataGridSearchHelper.d.ts +28 -0
- package/lib/helper/dataGridSearchHelper.js +51 -0
- package/lib/helper/dcmtsHelper.d.ts +20 -0
- package/lib/helper/dcmtsHelper.js +58 -1
- package/lib/helper/helpers.d.ts +12 -1
- package/lib/helper/helpers.js +27 -3
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +6 -1
- package/lib/helper/queryHelper.js +8 -3
- package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
- package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
- package/lib/hooks/useArchiveListForm.d.ts +39 -0
- package/lib/hooks/useArchiveListForm.js +46 -0
- package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
- package/lib/hooks/useCaseFlowApprove.js +157 -0
- package/lib/hooks/useDataUserIdItem.d.ts +1 -0
- package/lib/hooks/useDataUserIdItem.js +1 -0
- package/lib/hooks/useDocumentOperations.d.ts +4 -0
- package/lib/hooks/useDocumentOperations.js +53 -11
- package/lib/hooks/useInputDialog.js +1 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +113 -0
- package/lib/hooks/useMultiMasterDetailDcmts.js +760 -0
- package/lib/hooks/useQueryParametersDialog.js +1 -1
- package/lib/hooks/useRelatedDocuments.d.ts +1 -0
- package/lib/hooks/useRelatedDocuments.js +22 -27
- package/lib/hooks/useShowDossiersV5.d.ts +12 -0
- package/lib/hooks/useShowDossiersV5.js +37 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
- package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
- package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
- package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
- package/lib/hooks/useTMDistinctValuesSource.js +105 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -2
- package/lib/services/caseflow/CaseFlowService.d.ts +247 -0
- package/lib/services/caseflow/CaseFlowService.js +720 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.d.ts +28 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.js +121 -0
- package/lib/services/caseflow/caseFlowNameCache.d.ts +32 -0
- package/lib/services/caseflow/caseFlowNameCache.js +116 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.d.ts +61 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.js +113 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/index.js +4 -0
- package/lib/services/platform_services.d.ts +4 -4
- package/package.json +71 -68
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { getFileItemLinkUrl } from "./TMFileManagerUtils";
|
|
3
4
|
import { formatBytes, Globalization, renderHighlightedText, SDKUI_Localizator } from "../../helper";
|
|
4
5
|
import TMDataGrid from "./TMDataGrid";
|
|
5
6
|
import TMDcmtIcon from "../features/documents/TMDcmtIcon";
|
|
@@ -43,6 +44,12 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
43
44
|
}, [handleSelectedFiles]);
|
|
44
45
|
// Handler for double-click cell event
|
|
45
46
|
const onCellDblClick = useCallback((e) => {
|
|
47
|
+
// i link non hanno un documento da aprire: il doppio click (anche sull'icona dell'estensione) apre l'url in un nuovo tab
|
|
48
|
+
const linkUrl = getFileItemLinkUrl(e.data);
|
|
49
|
+
if (linkUrl) {
|
|
50
|
+
window.open(linkUrl, '_blank', 'noopener,noreferrer');
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
46
53
|
if (e.column.dataField === "ext")
|
|
47
54
|
return;
|
|
48
55
|
if (onDoubleClickHandler)
|
|
@@ -62,8 +69,10 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
62
69
|
}, [searchText, findCheckOutUserName]);
|
|
63
70
|
const cellExtRender = useCallback((cellData) => {
|
|
64
71
|
const item = cellData.data;
|
|
65
|
-
const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", item.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", item.did ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", item.tid ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", item.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Extension, ":"] }), " ", item.ext ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", item.updaterName ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", item.version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(item.size ?? 0)] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.creationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime)] })] }));
|
|
66
|
-
|
|
72
|
+
const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", item.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", item.did ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", item.tid ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", item.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Extension, ":"] }), " ", item.ext ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", item.updaterName ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", item.version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(item.size ?? 0)] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.creationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime)] }), item.description && _jsxs(_Fragment, { children: [_jsx("hr", {}), _jsxs("div", { style: { maxWidth: '400px', overflowWrap: 'anywhere' }, children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Description, ":"] }), " ", item.description] })] })] }));
|
|
73
|
+
// i link non hanno un file associato: l'icona non deve avviare il download
|
|
74
|
+
const isLink = getFileItemLinkUrl(item) !== undefined;
|
|
75
|
+
return _jsx(TMDcmtIcon, { tid: item.tid, did: item.did, fileExtension: item.ext, downloadMode: isLink ? 'none' : 'openInNewWindow', tooltipContent: tooltipContent, isSigned: item.isSigned });
|
|
67
76
|
}, []);
|
|
68
77
|
const cellDatetimeRender = useCallback((cellData) => {
|
|
69
78
|
if (!cellData.value)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useRef } from 'react';
|
|
3
|
-
import { colors, TMFileItemContainer } from './TMFileManagerUtils';
|
|
3
|
+
import { colors, getFileItemLinkUrl, TMFileItemContainer } from './TMFileManagerUtils';
|
|
4
4
|
import { formatBytes, Globalization, renderHighlightedText, SDKUI_Localizator } from '../../helper';
|
|
5
5
|
import TMTooltip from './TMTooltip';
|
|
6
6
|
import TMDcmtIcon from '../features/documents/TMDcmtIcon';
|
|
@@ -35,6 +35,16 @@ const TMFileManagerThumbnailItems = (props) => {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}, [items, lastSelectedIndexRef.current]);
|
|
38
|
+
// Apre l'item: i link non hanno un documento da aprire, si apre direttamente l'url in un nuovo tab
|
|
39
|
+
const openFileItem = useCallback((item) => {
|
|
40
|
+
const linkUrl = getFileItemLinkUrl(item);
|
|
41
|
+
if (linkUrl) {
|
|
42
|
+
window.open(linkUrl, '_blank', 'noopener,noreferrer');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (onDoubleClick)
|
|
46
|
+
onDoubleClick(item);
|
|
47
|
+
}, [onDoubleClick]);
|
|
38
48
|
const handleKeyDown = useCallback((event) => {
|
|
39
49
|
event.preventDefault();
|
|
40
50
|
if (event.key === 'ArrowDown' && lastSelectedIndexRef.current !== null) {
|
|
@@ -44,21 +54,21 @@ const TMFileManagerThumbnailItems = (props) => {
|
|
|
44
54
|
lastSelectedIndexRef.current = currentIndex;
|
|
45
55
|
}
|
|
46
56
|
}
|
|
47
|
-
if (event.key === 'Enter' && selectedFiles.length === 1
|
|
57
|
+
if (event.key === 'Enter' && selectedFiles.length === 1) {
|
|
48
58
|
const currentItem = items.find(item => item.id === selectedFiles[0].id);
|
|
49
59
|
if (currentItem)
|
|
50
|
-
|
|
60
|
+
openFileItem(currentItem);
|
|
51
61
|
}
|
|
52
|
-
}, [items, lastSelectedIndexRef.current, selectedFiles]);
|
|
62
|
+
}, [items, lastSelectedIndexRef.current, selectedFiles, openFileItem]);
|
|
53
63
|
// Double click handler with timeout cleanup
|
|
54
64
|
const onDoubleClickHandler = useCallback((item) => {
|
|
55
65
|
if (clickTimeoutRef.current) {
|
|
56
66
|
clearTimeout(clickTimeoutRef.current);
|
|
57
67
|
clickTimeoutRef.current = null;
|
|
58
68
|
}
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
}, [
|
|
69
|
+
if (item)
|
|
70
|
+
openFileItem(item);
|
|
71
|
+
}, [openFileItem]);
|
|
62
72
|
const onClickHandler = useCallback((e, item) => {
|
|
63
73
|
// If a click timeout is already running, clear it (distinguish between single and double clicks)
|
|
64
74
|
if (clickTimeoutRef.current) {
|
|
@@ -144,8 +154,8 @@ const TMFileManagerThumbnailItems = (props) => {
|
|
|
144
154
|
bgHoverColor = isSelected ? colors.PRIMARY_BLUE : "#fff59d";
|
|
145
155
|
}
|
|
146
156
|
const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", findCheckOutUserName(item) ?? '-', " (ID: ", item.checkOutUserID, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(item.checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", item.version ?? 1] }) }), _jsx("hr", {}), _jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Extension }), ": ", item.ext] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.CreationTime }), ": ", Globalization.getDateTimeDisplayValue(item.creationTime?.toString())] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.LastUpdateTime }), ": ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime?.toString())] })] })] })] });
|
|
147
|
-
const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", item.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", item.did ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", item.tid ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", item.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Extension, ":"] }), " ", item.ext ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", item.updaterName ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", item.version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(item.size ?? 0)] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.creationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime)] })] }));
|
|
148
|
-
return _jsx(TMFileItemContainer, { className: "tm-file-manager-thumbnail-items", ref: containerRef, id: "tm-file-manager-thumbnail-item-" + item.id.toString(),
|
|
157
|
+
const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", item.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", item.did ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", item.tid ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", item.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Extension, ":"] }), " ", item.ext ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", item.updaterName ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", item.version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(item.size ?? 0)] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.creationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime)] }), item.description && _jsxs(_Fragment, { children: [_jsx("hr", {}), _jsxs("div", { style: { maxWidth: '400px', overflowWrap: 'anywhere' }, children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Description, ":"] }), " ", item.description] })] })] }));
|
|
158
|
+
return _jsx(TMFileItemContainer, { className: "tm-file-manager-thumbnail-items", ref: containerRef, id: "tm-file-manager-thumbnail-item-" + item.id.toString(), $backgroundColor: bgColor, $bgHoverColor: bgHoverColor, $textColor: textColor, onDoubleClick: () => onDoubleClickHandler(item), onContextMenu: (e) => onContextMenu(e, item), onClick: (e) => onClickHandler(e, item), tabIndex: 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', width: '100%' }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', flex: 1, minWidth: 0 }, children: [_jsxs("div", { style: { marginRight: '16px', flexShrink: 0, display: 'flex', flexDirection: 'column', alignItems: 'center' }, children: [_jsx("div", { style: { width: '40px' }, children: _jsx(TMDcmtIcon, { tid: item.tid, did: item.did, fileExtension: item.ext, downloadMode: getFileItemLinkUrl(item) !== undefined ? 'none' : 'openInNewWindow', tooltipContent: tooltipContent, isSigned: item.isSigned }) }), _jsxs("div", { style: { display: 'flex', justifyContent: 'center', width: '40px' }, children: [editMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: !isSelected ? colors.MEDIUM_GREEN : '#fff', fontWeight: "bold" }, className: "dx-icon-edit" }) }), lockMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: !isSelected ? colors.MEDIUM_GREEN : '#fff', fontWeight: "bold" }, className: "dx-icon-lock" }) })] })] }), _jsxs("div", { style: { overflow: 'hidden', minWidth: 0 }, children: [_jsx("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block', fontSize: '1rem', fontWeight: "bold" }, children: _jsx(TMTooltip, { parentStyle: { overflow: 'hidden' }, childStyle: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block' }, children: renderHighlightedText(item.name, searchText, isSelected) }) }), _jsx("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block', fontSize: 'calc(1rem - 1px)' }, children: formatBytes(item.size ?? 0) })] })] }), item.version && (_jsx("div", { style: { flexShrink: 0, marginLeft: '12px', whiteSpace: 'nowrap' }, children: _jsx(TMTooltip, { content: SDKUI_Localizator.Version, children: _jsx("div", { style: { border: "2px solid #28a745", backgroundColor: "#28a745", color: "#ffffff", borderRadius: '50%', width: '30px', height: '30px', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '12px', fontWeight: 'bold' }, children: item.version }) }) }))] }) }, "tm-file-manager-thumbnail-item-" + item.id);
|
|
149
159
|
}) });
|
|
150
160
|
};
|
|
151
161
|
export default TMFileManagerThumbnailItems;
|
|
@@ -26,6 +26,7 @@ export interface FileItem {
|
|
|
26
26
|
version?: number;
|
|
27
27
|
isSigned?: number;
|
|
28
28
|
}
|
|
29
|
+
export declare const resolveFileItemUserNames: (item: FileItem, users: Array<UserDescriptor>) => FileItem;
|
|
29
30
|
export interface TMFileManagerTreeViewDirectory {
|
|
30
31
|
id: number;
|
|
31
32
|
text: string;
|
|
@@ -47,15 +48,16 @@ export declare const colors: {
|
|
|
47
48
|
LIGHT_YELLOW: string;
|
|
48
49
|
MEDIUM_GREEN: string;
|
|
49
50
|
};
|
|
50
|
-
export declare const TMFileItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$backgroundColor" | "$
|
|
51
|
+
export declare const TMFileItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$backgroundColor" | "$bgHoverColor" | "$textColor"> & {
|
|
51
52
|
$backgroundColor?: string;
|
|
52
53
|
$textColor?: string;
|
|
53
54
|
$bgHoverColor?: string;
|
|
54
|
-
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$backgroundColor" | "$
|
|
55
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$backgroundColor" | "$bgHoverColor" | "$textColor"> & {
|
|
55
56
|
$backgroundColor?: string;
|
|
56
57
|
$textColor?: string;
|
|
57
58
|
$bgHoverColor?: string;
|
|
58
59
|
}, never>>> & string;
|
|
60
|
+
export declare const getFileItemLinkUrl: (fileItem: FileItem | undefined) => string | undefined;
|
|
59
61
|
export declare const findFileItems: (items: Array<FileItem>, id: number) => FileItem | undefined;
|
|
60
62
|
export declare const setFolderTreeViewItems: (items: Array<FileItem>) => Array<TMFileManagerTreeViewDirectory>;
|
|
61
63
|
export declare const buildFolderHierarchy: (fileSystemTree: WGTreeDescriptor | undefined, draftsFile: SearchResultDescriptor | undefined, archivedDocuments: Array<SearchResultDescriptor> | undefined, participants: Array<UserDescriptor> | undefined) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
-
import { associateColumnsToRows, SIGNATURE_EXTENSIONS } from "../../helper";
|
|
2
|
+
import { associateColumnsToRows, SIGNATURE_EXTENSIONS, WHATS_NEWS_FILE_NAME, WHATS_NEWS_LINK_URL } from "../../helper";
|
|
3
3
|
/**
|
|
4
4
|
* Verifica se un'estensione indica che il file è firmato digitalmente.
|
|
5
5
|
* Controlla se l'estensione (es. "pdf.p7m", ".p7m", "p7m") contiene
|
|
@@ -12,6 +12,22 @@ export const isSigned = (ext) => {
|
|
|
12
12
|
const parts = normalized.split('.');
|
|
13
13
|
return parts.some(part => SIGNATURE_EXTENSIONS.has(part));
|
|
14
14
|
};
|
|
15
|
+
// Completa i nomi utente (autore e utente di check-out) di un FileItem quando mancano, risolvendoli dagli ID.
|
|
16
|
+
export const resolveFileItemUserNames = (item, users) => {
|
|
17
|
+
if (!users || users.length === 0)
|
|
18
|
+
return item;
|
|
19
|
+
const isValidUserID = (id) => id !== undefined && Number.isFinite(id) && id > 0;
|
|
20
|
+
const needsUpdaterName = !item.updaterName && isValidUserID(item.updaterID);
|
|
21
|
+
const needsCheckOutUserName = !item.checkOutUserName && isValidUserID(item.checkOutUserID);
|
|
22
|
+
if (!needsUpdaterName && !needsCheckOutUserName)
|
|
23
|
+
return item;
|
|
24
|
+
const resolved = { ...item };
|
|
25
|
+
if (needsUpdaterName)
|
|
26
|
+
resolved.updaterName = users.find(user => user.id === item.updaterID)?.name ?? item.updaterName;
|
|
27
|
+
if (needsCheckOutUserName)
|
|
28
|
+
resolved.checkOutUserName = users.find(user => user.id === item.checkOutUserID)?.name ?? item.checkOutUserName;
|
|
29
|
+
return resolved;
|
|
30
|
+
};
|
|
15
31
|
export var TMFileManagerPageSize;
|
|
16
32
|
(function (TMFileManagerPageSize) {
|
|
17
33
|
TMFileManagerPageSize[TMFileManagerPageSize["Small"] = 30] = "Small";
|
|
@@ -47,6 +63,26 @@ export const TMFileItemContainer = styled.div `
|
|
|
47
63
|
outline: none;
|
|
48
64
|
}
|
|
49
65
|
`;
|
|
66
|
+
// Confronto case-insensitive con il nome del file
|
|
67
|
+
const isWhatsNewsFileName = (name) => (name ?? '').toLowerCase() === WHATS_NEWS_FILE_NAME;
|
|
68
|
+
// Ritorna l'url del link associato al file: un file il cui metadato "description" contiene un url http/https
|
|
69
|
+
// e' un link, quindi non ha un file/documento da scaricare o da aprire nella form: si apre direttamente l'url
|
|
70
|
+
export const getFileItemLinkUrl = (fileItem) => {
|
|
71
|
+
if (!fileItem || fileItem.isDirectory)
|
|
72
|
+
return undefined;
|
|
73
|
+
if (isWhatsNewsFileName(fileItem.name))
|
|
74
|
+
return WHATS_NEWS_LINK_URL;
|
|
75
|
+
const value = fileItem.description?.trim();
|
|
76
|
+
if (!value)
|
|
77
|
+
return undefined;
|
|
78
|
+
try {
|
|
79
|
+
const url = new URL(value);
|
|
80
|
+
return (url.protocol === 'http:' || url.protocol === 'https:') ? url.href : undefined;
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
50
86
|
// Function to find a specific file or folder based on its ID (used for finding nested items)
|
|
51
87
|
export const findFileItems = (items, id) => {
|
|
52
88
|
for (let item of items) {
|
|
@@ -22,10 +22,10 @@ declare const TMSplitterLayout: ({ animation, showSeparator, separatorColor, ove
|
|
|
22
22
|
animation?: boolean;
|
|
23
23
|
separatorColor?: string;
|
|
24
24
|
separatorActiveColor?: string;
|
|
25
|
-
overflow?:
|
|
25
|
+
overflow?: 'hidden' | 'visible';
|
|
26
26
|
showSeparator?: boolean;
|
|
27
27
|
separatorSize?: number;
|
|
28
|
-
direction?:
|
|
28
|
+
direction?: 'horizontal' | 'vertical';
|
|
29
29
|
children?: React.ReactNode;
|
|
30
30
|
start?: string[];
|
|
31
31
|
min?: string[];
|
|
@@ -51,7 +51,7 @@ const StyledCardContext = styled.div `
|
|
|
51
51
|
padding: ${props => props.$padding ? '5px' : '0'};
|
|
52
52
|
`;
|
|
53
53
|
const TMCard = ({ borderRadius = true, onClick, scrollX = false, scrollY = false, width = '100%', height = '100%', children, title = '', fontSize = FontSize.defaultFontSize, fontWeight, showBorder = true, padding = true, scroll = false, backgroundColor, color }) => {
|
|
54
|
-
return (_jsxs("div", { onClick: onClick, style: { width: width, height: height, fontSize: fontSize, overflow: 'hidden' }, children: [title.length > 0 && _jsx(StyledCardHeader, {
|
|
54
|
+
return (_jsxs("div", { onClick: onClick, style: { width: width, height: height, fontSize: fontSize, overflow: 'hidden' }, children: [title.length > 0 && _jsx(StyledCardHeader, { $borderRadius: borderRadius, $fontWeight: fontWeight, $backgroundColor: backgroundColor, $color: color, children: title }), _jsxs(StyledCardContext, { $scrollX: scrollX, $scrollY: scrollY, $scroll: scroll, $padding: padding, $showHeader: title.length > 0, style: { border: showBorder ? '2px solid #CAD9EB' : 'none', borderBottomLeftRadius: showBorder ? '3px' : '0', borderBottomRightRadius: showBorder ? '3px' : '0' }, children: [" ", children, " "] })] }));
|
|
55
55
|
};
|
|
56
56
|
const TMSplitterLayout = ({ animation = false, showSeparator = true, separatorColor = '#e4e4e4', overflow = 'hidden', separatorActiveColor = 'orange', separatorSize = 4, direction = 'horizontal', children, start = ['50%', '50%'], min = ['150px', '150px'], }) => {
|
|
57
57
|
function isReactFragment(variableToInspect) {
|
|
@@ -191,11 +191,11 @@ const TMSplitterLayout = ({ animation = false, showSeparator = true, separatorCo
|
|
|
191
191
|
return (_jsxs("div", { ref: containerRef, style: { display: 'flex', width: '100%', height: '100%', flexDirection: direction === 'vertical' ? 'column' : 'row', position: 'relative', }, children: [_jsxs("div", { style: { position: 'relative', transition: animation ? 'ease 300ms' : 'none', overflow: overflow, height: direction === 'vertical' ? start[0] : '100%', width: direction === 'horizontal' ? start[0] : '100%', minHeight: direction === 'vertical' ? min[0] : '100%', minWidth: direction === 'horizontal' ? min[0] : '100%', }, ref: firstDivRef, children: [" ", React.Children.toArray(children)[0], " ", isResizing && _jsx("div", { style: { position: 'absolute', top: '0px', left: '0px', zIndex: 1000, backgroundColor: 'transparent', width: '100%', height: '100%', pointerEvents: 'none' } }), " "] }), !isFrag && (_jsx("div", { ref: sepRef, style: { display: showSeparator ? 'block' : 'none', backgroundColor: separatorBgColor, cursor: direction === 'vertical' ? 's-resize' : 'e-resize', minWidth: direction === 'horizontal' ? `${separatorSize}px` : '100%', minHeight: direction === 'vertical' ? `${separatorSize}px` : '100%', } })), _jsxs("div", { style: { position: 'relative', transition: animation ? 'ease 300ms' : 'none', overflow: overflow, height: direction === 'vertical' ? start[1] : '100%', width: direction === 'horizontal' ? start[1] : '100%', minHeight: direction === 'vertical' ? min[1] : '100%', minWidth: direction === 'horizontal' ? min[1] : '100%', }, ref: secondDivRef, children: [" ", React.Children.toArray(children)[1], " ", isResizing && _jsx("div", { style: { position: 'absolute', top: '0px', left: '0px', zIndex: 1000, backgroundColor: 'transparent', width: '100%', height: '100%', pointerEvents: 'none' } }), " "] })] }));
|
|
192
192
|
};
|
|
193
193
|
const TMLayoutItem = ({ onClick, children, width = '100%', minWidth, maxWidth, maxHeight, height = '100%', minHeight }) => {
|
|
194
|
-
return (_jsx(StyledLayoutItem, { onClick: onClick,
|
|
194
|
+
return (_jsx(StyledLayoutItem, { onClick: onClick, $height: height, $maxHeight: maxHeight, $minHeight: minHeight, $width: width, $minWidth: minWidth, $maxWidth: maxWidth, children: children }));
|
|
195
195
|
};
|
|
196
196
|
const TMLayoutContainer = ({ gap = 3, onClick, justifyContent = 'flex-start', alignItems = 'flex-start', children, direction = 'vertical', onContextMenu }) => {
|
|
197
197
|
const renderedEls = () => { return (React.Children.map(children, child => (child))); };
|
|
198
|
-
return (_jsxs(StyledLayoutContainer, {
|
|
198
|
+
return (_jsxs(StyledLayoutContainer, { $alignItems: alignItems, $justifyContent: justifyContent, onClick: onClick, onContextMenu: onContextMenu, $direction: direction, style: { gap: gap }, children: [" ", renderedEls(), " "] }));
|
|
199
199
|
};
|
|
200
200
|
export { TMCard, TMLayoutItem, TMSplitterLayout };
|
|
201
201
|
export default TMLayoutContainer;
|
|
@@ -48,7 +48,7 @@ const TMList = ({ items }) => {
|
|
|
48
48
|
onClick(); // Call the item's onClick handler if provided
|
|
49
49
|
};
|
|
50
50
|
return (_jsx(StyledListContainer, { children: items?.map((item, index) => {
|
|
51
|
-
return (_jsxs(StyledListItem, {
|
|
51
|
+
return (_jsxs(StyledListItem, { $isSelected: selectedIndex === index, onClick: () => handleItemClick(index, item.onClick), children: [_jsx(StyledIconWrapper, { children: item.icon }), _jsx("span", { children: item.text })] }, index));
|
|
52
52
|
}) }));
|
|
53
53
|
};
|
|
54
54
|
export default TMList;
|
|
@@ -265,7 +265,7 @@ const TMListView = ({ customGroupingHeaders, headerBackGroundColor, header, show
|
|
|
265
265
|
}
|
|
266
266
|
// map memo
|
|
267
267
|
const memoList = useMemo(() => currentDataSource.map((data, index) => {
|
|
268
|
-
return (_jsx(StyledListItem, {
|
|
268
|
+
return (_jsx(StyledListItem, { $isSelected: isSelected(data), $color: getContrastColor(customColor).bgColor, $textColor: getContrastColor(customColor).textColor, onClick: () => { onSelectionChanged && onSelectionChanged(data); onItemClick && onItemClick(data); }, onDoubleClick: () => onItemDblClick && onItemDblClick(data), children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'flex-start', justifyContent: 'flex-start', gap: 5, padding: '5px 5px' }, children: [localShowId && _jsxs("p", { style: { color: isSelected(data) ? 'red' : 'black', backgroundColor: `${customColor}20`, width: '100%', padding: '2px 5px', borderRadius: '5px', height: 'max-content', textAlign: 'left' }, children: [" ", exprKey + ' : ' + data[exprKey], " "] }), _jsxs("div", { style: { width: '100%', height: '100%' }, children: [" ", itemTemplate ? itemTemplate(data) : _jsx("div", {})] })] }) }, index));
|
|
269
269
|
}), [currentDataSource, selectedItem, localShowId, customColor]);
|
|
270
270
|
const groupedMemoList = useMemo(() => groupKeys.map((key, index) => {
|
|
271
271
|
const groupingText = () => {
|
|
@@ -292,7 +292,7 @@ const TMListView = ({ customGroupingHeaders, headerBackGroundColor, header, show
|
|
|
292
292
|
:
|
|
293
293
|
_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 10 }, children: [_jsx("p", { children: groupingText() }), _jsx("div", { style: { width: '16px', height: '16px', display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: getContrastColor(customColor).textColor, color: getContrastColor(customColor).bgColor, boxShadow: '1px 1px 2px #00000020', borderRadius: '30px', fontWeight: 'bold' }, children: groupByKey(currentDataSource, grouping)[key].length })] })
|
|
294
294
|
:
|
|
295
|
-
_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 10 }, children: [_jsx("p", { children: groupingText() }), _jsx("div", { style: { width: '16px', height: '16px', display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: getContrastColor(customColor).textColor, color: getContrastColor(customColor).bgColor, boxShadow: '1px 1px 2px #00000020', borderRadius: '30px', fontWeight: 'bold' }, children: groupByKey(currentDataSource, grouping)[key].length })] }), _jsxs("div", { style: { cursor: 'pointer' }, onClick: () => { let arr = [...openList]; arr[index] = !arr[index]; setOpenList(arr); }, children: [" ", openList[index] ? _jsx(IconUp, { fontSize: 12 }) : _jsx(IconDown, { fontSize: 12 }), " "] })] }) }), openList[index] && _jsx("div", { style: { width: '100%', height: '100%' }, children: groupByKey(currentDataSource, grouping)[key].map((data, index2) => (_jsx(StyledListItem, {
|
|
295
|
+
_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 10 }, children: [_jsx("p", { children: groupingText() }), _jsx("div", { style: { width: '16px', height: '16px', display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: getContrastColor(customColor).textColor, color: getContrastColor(customColor).bgColor, boxShadow: '1px 1px 2px #00000020', borderRadius: '30px', fontWeight: 'bold' }, children: groupByKey(currentDataSource, grouping)[key].length })] }), _jsxs("div", { style: { cursor: 'pointer' }, onClick: () => { let arr = [...openList]; arr[index] = !arr[index]; setOpenList(arr); }, children: [" ", openList[index] ? _jsx(IconUp, { fontSize: 12 }) : _jsx(IconDown, { fontSize: 12 }), " "] })] }) }), openList[index] && _jsx("div", { style: { width: '100%', height: '100%' }, children: groupByKey(currentDataSource, grouping)[key].map((data, index2) => (_jsx(StyledListItem, { $isSelected: data === selectedItem, $color: getContrastColor(customColor).bgColor, $textColor: getContrastColor(customColor).textColor, onClick: () => { onSelectionChanged && onSelectionChanged(data); onItemClick && onItemClick(data); }, onDoubleClick: () => { onItemDblClick && onItemDblClick(data); }, children: _jsxs("div", { style: { width: '100%', height: 'max-content', display: 'flex', flexDirection: 'column', padding: '5px 5px' }, children: [localShowId && _jsxs("p", { style: { color: data === selectedItem ? 'red' : 'black', backgroundColor: `${customColor}20`, width: '100%', padding: '2px 5px', borderRadius: '5px', height: 'max-content', textAlign: 'left' }, children: [" ", 'ID: ' + data.id, " "] }), _jsxs("div", { style: { width: '100%', height: '100%' }, children: [" ", itemTemplate ? itemTemplate(data) : _jsx("div", {})] })] }) }, index2))) })] }, index));
|
|
296
296
|
}), [currentDataSource, selectedItem, localShowId, customColor, openList, grouping, customGroupingHeaders]);
|
|
297
297
|
// List height
|
|
298
298
|
const listHeight = () => {
|
|
@@ -376,7 +376,7 @@ const TMListView = ({ customGroupingHeaders, headerBackGroundColor, header, show
|
|
|
376
376
|
grouping.length === 0 ? memoList : groupedMemoList :
|
|
377
377
|
searchValue.length > 0 ? _jsx("div", { style: { width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "No data found" }) :
|
|
378
378
|
_jsx("div", { style: { width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "No data" }) }), (searchValue.length > 0 || showOrderMenu) &&
|
|
379
|
-
_jsxs(StyledListViewFooter, {
|
|
379
|
+
_jsxs(StyledListViewFooter, { $bgColor: `${customColor}20`, children: [showOrderMenu &&
|
|
380
380
|
_jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: 5 }, children: [_jsx("div", { style: { width: 'max-content' }, children: "Ordinato per" }), _jsx("div", { ref: orderRef, onClick: () => { setShowOrderOptions(!showOrderOptions); setOrderMenuVisible(!orderMenuVisible); }, style: { cursor: 'pointer', fontWeight: 'bold' }, children: orderedBy.length > 0 ? orderedBy : 'Nulla' }), orderedBy.length > 0 && _jsxs(TMTooltip, { content: orderDir ? 'ASC' : 'DESC', children: [" ", orderDir ? _jsx(IconUp, { style: { cursor: 'pointer' }, onClick: () => setOrderDir(false), fontSize: 14 }) : _jsx(IconDown, { style: { cursor: 'pointer' }, onClick: () => setOrderDir(true), fontSize: 14 }), " "] }), _jsx(TMTooltip, { content: 'Annulla ordinamento', children: _jsx(IconCloseCircle, { style: { cursor: 'pointer' }, color: 'red', fontSize: 14, onClick: () => { setOrderedBy(''); setShowOrderMenu(false); setShowOrderOptions(false); } }) })] }), searchValue.length > 0 && _jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', justifyContent: 'flex-end', gap: 5 }, children: [_jsx(TMTooltip, { content: 'Visibili', children: _jsx(IconVisible, { fontSize: 14 }) }), currentDataSource.length] })] })] }));
|
|
381
381
|
};
|
|
382
382
|
export default TMListView;
|
|
@@ -14,6 +14,17 @@ interface ITMModal {
|
|
|
14
14
|
askClosingConfirm?: boolean;
|
|
15
15
|
showCloseButton?: boolean;
|
|
16
16
|
showHeader?: boolean;
|
|
17
|
+
/** Se true, ricentra il popup ogni volta che cambiano width/height, annullando lo spostamento manuale */
|
|
18
|
+
recenterOnResize?: boolean;
|
|
19
|
+
/** Contenuto aggiuntivo nella barra del titolo, prima del pulsante di chiusura (es. un menu di opzioni) */
|
|
20
|
+
titleActions?: React.ReactNode;
|
|
21
|
+
/** Dimensioni in px al termine di un ridimensionamento manuale */
|
|
22
|
+
onResized?: (size: {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}) => void;
|
|
26
|
+
/** A ogni cambio di valore le dimensioni tornano a `width`/`height`, anche se invariate */
|
|
27
|
+
sizeResetToken?: number | string;
|
|
17
28
|
}
|
|
18
29
|
declare const TMModal: React.FC<ITMModal>;
|
|
19
30
|
export default TMModal;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect, useRef } from 'react';
|
|
3
3
|
import { Popup } from 'devextreme-react';
|
|
4
|
+
import { ToolbarItem } from 'devextreme-react/popup';
|
|
4
5
|
import styled from 'styled-components';
|
|
5
6
|
import { TMCard } from './TMLayout';
|
|
6
7
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
7
8
|
import { IconWindowMaximize, IconWindowMinimize, svgToString } from '../../helper';
|
|
9
|
+
/** Valori di `height` con cui il popup si dimensiona sul contenuto (vedi applyContentFillLayout) */
|
|
10
|
+
const CONTENT_DRIVEN_HEIGHTS = ['auto', 'max-content', 'min-content', 'fit-content'];
|
|
8
11
|
const StyledModal = styled.div `
|
|
9
12
|
width: ${props => props.$width};
|
|
10
13
|
height: ${props => props.$height};
|
|
@@ -39,10 +42,13 @@ const StyledModalContext = styled.div `
|
|
|
39
42
|
overflow: auto;
|
|
40
43
|
height: 100%;
|
|
41
44
|
`;
|
|
42
|
-
const TMModal = ({ resizable = true, expandable = false, isModal = true, title = '', toolbar, onClose, children, width = '100%', height = '100%', fontSize = FontSize.defaultFontSize, hidePopup = true, askClosingConfirm = false, showCloseButton = true, showHeader = true }) => {
|
|
45
|
+
const TMModal = ({ resizable = true, expandable = false, isModal = true, title = '', toolbar, onClose, children, width = '100%', height = '100%', fontSize = FontSize.defaultFontSize, hidePopup = true, askClosingConfirm = false, showCloseButton = true, showHeader = true, recenterOnResize = false, titleActions, onResized, sizeResetToken }) => {
|
|
43
46
|
const popupRef = useRef(null);
|
|
44
47
|
const [initialWidth, setInitialWidth] = useState(width);
|
|
45
48
|
const [initialHeight, setInitialHeight] = useState(height);
|
|
49
|
+
// Posizione controllata: un nuovo riferimento oggetto forza DevExtreme a riposizionare (ricentrare).
|
|
50
|
+
// Lasciata invariata durante il drag, così lo spostamento manuale viene preservato
|
|
51
|
+
const [position, setPosition] = useState(undefined);
|
|
46
52
|
const [showPopup, setShowPopup] = useState(false);
|
|
47
53
|
const [isResizing, setIsResizing] = useState(false);
|
|
48
54
|
const [isFullScreen, setIsFullScreen] = useState(false);
|
|
@@ -51,6 +57,26 @@ const TMModal = ({ resizable = true, expandable = false, isModal = true, title =
|
|
|
51
57
|
const DEFAULT_MIN_HEIGHT = 400;
|
|
52
58
|
const [minWidth, setMinWidth] = useState(0);
|
|
53
59
|
const [minHeight, setMinHeight] = useState(0);
|
|
60
|
+
/**
|
|
61
|
+
* DevExtreme fissa in px l'altezza del contenuto del popup: se le dimensioni cambiano a popup
|
|
62
|
+
* già aperto (es. cambio step) resta quella del passo precedente e sotto rimane spazio vuoto.
|
|
63
|
+
* Come figlio flex il contenuto riempie il popup senza dipendere da quel calcolo.
|
|
64
|
+
* Non si applica alle altezze dimensionate sul contenuto (`auto`, `max-content`, ...):
|
|
65
|
+
* lì è il contenuto a dare l'altezza al popup e non c'è spazio da riempire.
|
|
66
|
+
*/
|
|
67
|
+
const applyContentFillLayout = () => {
|
|
68
|
+
const content = popupRef.current?.instance()?.content();
|
|
69
|
+
const overlayContent = content?.parentElement;
|
|
70
|
+
if (!content || !overlayContent)
|
|
71
|
+
return;
|
|
72
|
+
const fill = !CONTENT_DRIVEN_HEIGHTS.some(value => initialHeight.trim().startsWith(value));
|
|
73
|
+
overlayContent.style.display = fill ? 'flex' : '';
|
|
74
|
+
overlayContent.style.flexDirection = fill ? 'column' : '';
|
|
75
|
+
content.style.flex = fill ? '1 1 auto' : '';
|
|
76
|
+
// Testata e toolbar inferiore restano alla loro altezza naturale
|
|
77
|
+
overlayContent.querySelectorAll(':scope > .dx-popup-title, :scope > .dx-popup-bottom')
|
|
78
|
+
.forEach(el => { el.style.flexShrink = fill ? '0' : ''; });
|
|
79
|
+
};
|
|
54
80
|
/**
|
|
55
81
|
* Gestore chiamato quando il popup viene mostrato.
|
|
56
82
|
* Calcola e imposta le dimensioni minime del popup in base allo spazio disponibile.
|
|
@@ -59,6 +85,7 @@ const TMModal = ({ resizable = true, expandable = false, isModal = true, title =
|
|
|
59
85
|
const handleShown = () => {
|
|
60
86
|
// Usa requestAnimationFrame per attendere il completamento del rendering
|
|
61
87
|
requestAnimationFrame(() => {
|
|
88
|
+
applyContentFillLayout();
|
|
62
89
|
if (popupRef.current && popupRef.current.instance) {
|
|
63
90
|
const instance = popupRef.current.instance();
|
|
64
91
|
if (instance) {
|
|
@@ -85,14 +112,27 @@ const TMModal = ({ resizable = true, expandable = false, isModal = true, title =
|
|
|
85
112
|
useEffect(() => {
|
|
86
113
|
setInitialWidth(width);
|
|
87
114
|
setInitialHeight(height);
|
|
88
|
-
|
|
115
|
+
// Al cambio di dimensioni (es. cambio step) ricentra il popup con un nuovo riferimento oggetto,
|
|
116
|
+
// annullando l'eventuale spostamento manuale precedente
|
|
117
|
+
if (recenterOnResize)
|
|
118
|
+
setPosition({ my: 'center', at: 'center', of: window });
|
|
119
|
+
// Il token annulla un ridimensionamento manuale, che non cambia width/height
|
|
120
|
+
}, [width, height, recenterOnResize, sizeResetToken]);
|
|
121
|
+
// Dimensioni, testata e schermo pieno fanno rigenerare geometria ed elementi del popup:
|
|
122
|
+
// il layout flex del contenuto va riapplicato dopo il ridisegno (vedi applyContentFillLayout)
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
const rafId = requestAnimationFrame(() => applyContentFillLayout());
|
|
125
|
+
return () => cancelAnimationFrame(rafId);
|
|
126
|
+
}, [initialWidth, initialHeight, title, isFullScreen, showPopup]);
|
|
89
127
|
const handleResizeStart = () => {
|
|
90
128
|
setIsResizing(true);
|
|
91
129
|
};
|
|
92
130
|
const handleResizeEnd = (e) => {
|
|
93
131
|
setIsResizing(false);
|
|
94
|
-
|
|
95
|
-
|
|
132
|
+
// Le dimensioni arrivano in px: senza unità non sarebbero un valore CSS valido
|
|
133
|
+
setInitialWidth(`${e.width}px`);
|
|
134
|
+
setInitialHeight(`${e.height}px`);
|
|
135
|
+
onResized?.({ width: e.width, height: e.height });
|
|
96
136
|
};
|
|
97
137
|
const onHiding = (e) => {
|
|
98
138
|
if (askClosingConfirm)
|
|
@@ -101,15 +141,9 @@ const TMModal = ({ resizable = true, expandable = false, isModal = true, title =
|
|
|
101
141
|
setShowPopup(false);
|
|
102
142
|
onClose && onClose();
|
|
103
143
|
};
|
|
104
|
-
return (_jsx(_Fragment, { children: isModal ? (
|
|
105
|
-
{
|
|
106
|
-
widget: 'dxButton',
|
|
107
|
-
location: 'after',
|
|
108
|
-
options: {
|
|
144
|
+
return (_jsx(_Fragment, { children: isModal ? (_jsxs(Popup, { ref: popupRef, showCloseButton: showHeader ? showCloseButton : false, showTitle: showHeader, animation: undefined, minWidth: minWidth, minHeight: minHeight, maxHeight: '95%', maxWidth: '95%', dragEnabled: !isResizing && !isFullScreen, resizeEnabled: resizable && !isFullScreen, position: expandable && isFullScreen ? { my: 'center', at: 'center', of: window } : position, width: expandable && isFullScreen ? '95%' : initialWidth, height: expandable && isFullScreen ? '95%' : initialHeight, title: title, visible: showPopup, onShown: handleShown, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd, onHiding: onHiding, children: [showHeader && titleActions && (_jsx(ToolbarItem, { toolbar: 'top', location: 'after', render: () => _jsx(_Fragment, { children: titleActions }) })), showHeader && expandable && (_jsx(ToolbarItem, { toolbar: 'top', location: 'after', widget: 'dxButton', options: {
|
|
109
145
|
icon: isFullScreen ? svgToString(_jsx(IconWindowMinimize, {})) : svgToString(_jsx(IconWindowMaximize, {})),
|
|
110
146
|
onClick: () => setIsFullScreen(!isFullScreen)
|
|
111
|
-
}
|
|
112
|
-
}
|
|
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 })] })) }));
|
|
147
|
+
} })), _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
148
|
};
|
|
115
149
|
export default TMModal;
|
|
@@ -10,6 +10,7 @@ export interface ITMPanelProps {
|
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
showHeader?: boolean;
|
|
12
12
|
title?: React.ReactNode;
|
|
13
|
+
enableTitleMarquee?: boolean;
|
|
13
14
|
displayedItemsCount?: number;
|
|
14
15
|
totalItems?: number;
|
|
15
16
|
toolbar?: any;
|
|
@@ -17,9 +18,14 @@ export interface ITMPanelProps {
|
|
|
17
18
|
isVisible?: boolean;
|
|
18
19
|
panelID?: string;
|
|
19
20
|
isActive?: boolean;
|
|
21
|
+
/** Se fornita, in testata compare il bottone di ricarica: finché la Promise è pendente il pannello mostra il loader */
|
|
22
|
+
onRefresh?: () => void | Promise<void>;
|
|
23
|
+
/** Mostra il loader sul contenuto anche per caricamenti non avviati dal bottone di ricarica */
|
|
24
|
+
isRefreshing?: boolean;
|
|
20
25
|
onActivate?: (panelID: string) => void;
|
|
21
26
|
onActiveChanged?: (isActive: boolean) => void;
|
|
22
27
|
onBack?: () => void;
|
|
28
|
+
backCaption?: string;
|
|
23
29
|
onClose?: () => void;
|
|
24
30
|
onHeaderDoubleClick?: () => void;
|
|
25
31
|
onMaximize?: (isMaximized: boolean) => void;
|