@topconsultnpm/sdkui-react 6.22.0-dev2.9 → 6.22.0-t2
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 +1 -1
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +45 -43
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +1 -1
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +67 -60
- package/lib/components/base/Styled.d.ts +93 -77
- 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.d.ts +2 -0
- package/lib/components/base/TMDataGrid.js +260 -8
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMEditorBase.d.ts +2 -0
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManager.js +5 -3
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.js +11 -2
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +19 -9
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -6
- package/lib/components/base/TMFileManagerUtils.js +37 -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.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 +138 -25
- package/lib/components/base/TMPopUp.js +3 -0
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTooltip.d.ts +2 -1
- package/lib/components/base/TMTooltip.js +24 -8
- package/lib/components/base/TMTreeView.d.ts +14 -8
- package/lib/components/base/TMTreeView.js +108 -67
- 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 +3 -2
- package/lib/components/choosers/TMDcmtTypeChooser.js +4 -3
- package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
- package/lib/components/choosers/TMDistinctValues.js +149 -142
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMMetadataChooser.js +1 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +13 -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.d.ts +3 -3
- package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
- package/lib/components/choosers/TMSelectedValuesSummary.js +91 -0
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMDropDown.d.ts +3 -0
- package/lib/components/editors/TMDropDown.js +197 -5
- package/lib/components/editors/TMEditorStyled.d.ts +20 -42
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/archive/TMArchive.js +17 -3
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/documents/TMBatchUpdateForm.js +19 -5
- 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 +178 -51
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +12 -1
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +77 -7
- package/lib/components/features/documents/TMDcmtIcon.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtIcon.js +5 -3
- package/lib/components/features/documents/TMDcmtPreview.d.ts +8 -6
- package/lib/components/features/documents/TMDcmtPreview.js +10 -6
- 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/TMMasterDetailDcmts.js +95 -33
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +20 -0
- package/lib/components/features/documents/TMMasterInfoFields.js +186 -0
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +3 -3
- package/lib/components/features/documents/TMMergeToPdfForm.js +30 -5
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +46 -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 +69 -20
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +2 -1
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.js +77 -11
- package/lib/components/features/search/TMSearchQueryEditor.js +5 -3
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +13 -3
- package/lib/components/features/search/TMSearchQueryPanel.js +141 -67
- package/lib/components/features/search/TMSearchResult.d.ts +16 -0
- package/lib/components/features/search/TMSearchResult.js +429 -108
- 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/TMTreeSelector.js +109 -64
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
- 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 +18 -7
- package/lib/components/features/workflow/TMWorkflowPopup.js +8 -4
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- 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 +13 -2
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogHeader.js +5 -1
- package/lib/components/grids/TMBlogsPost.d.ts +3 -1
- package/lib/components/grids/TMBlogsPost.js +31 -4
- package/lib/components/grids/TMBlogsPostUtils.d.ts +10 -9
- package/lib/components/grids/TMBlogsPostUtils.js +14 -3
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +3 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +24 -14
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +5 -6
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.js +2 -2
- package/lib/components/layout/panelManager/types.d.ts +3 -0
- package/lib/components/layout/panelManager/utils.js +13 -11
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +14 -10
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMHeader.d.ts +3 -3
- package/lib/components/sidebar/TMHeader.js +30 -20
- 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/TMMidViewer.js +4 -1
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.js +86 -25
- 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/SDKUI_Globals.d.ts +110 -0
- package/lib/helper/SDKUI_Globals.js +151 -0
- package/lib/helper/SDKUI_Localizator.d.ts +44 -0
- package/lib/helper/SDKUI_Localizator.js +440 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +2 -0
- package/lib/helper/TMAppUpdatedModal.js +134 -0
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +280 -279
- package/lib/helper/TMIcons.js +3 -0
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +23 -4
- package/lib/helper/TMUtils.js +24 -2
- 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 +25 -1
- 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 +52 -10
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +113 -0
- package/lib/hooks/useMultiMasterDetailDcmts.js +760 -0
- 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 +236 -0
- package/lib/services/caseflow/CaseFlowService.js +693 -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 -3
- package/package.json +9 -5
package/lib/helper/TMIcons.js
CHANGED
|
@@ -673,6 +673,9 @@ export function IconFileOpenOutline(props) {
|
|
|
673
673
|
export function IconArchiveDetail(props) {
|
|
674
674
|
return (_jsxs("svg", { fontSize: props.fontSize ?? FONTSIZE, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "1em", height: "1em", ...props, children: [" ", _jsx("path", { fill: "currentColor", d: "m20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27M12 17.5L6.5 12H10v-2h4v2h3.5zM5.12 5l.81-1h12l.94 1z" }), " "] }));
|
|
675
675
|
}
|
|
676
|
+
export function IconArchiveMultipleDetailDocuments(props) {
|
|
677
|
+
return (_jsxs("svg", { fontSize: props.fontSize ?? FONTSIZE, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", width: "1em", height: "1em", ...props, children: [_jsx("path", { fill: "currentColor", d: "M40,35v5H8v-5H4v5c0,2.2,1.8,4,4,4h32c2.2,0,4-1.8,4-4v-5H40z" }), _jsxs("g", { fill: "currentColor", children: [_jsx("polygon", { points: "24,23.4 17,15 31,15" }), _jsx("rect", { x: "22", y: "4", width: "4", height: "14" }), _jsx("path", { d: "M31.5,26.9L30.8,28l3.5,1.9l0.6-1.2c1.6-3,2.6-4.7,3.5-5.2C39.3,23,41,23,44,23v-4C36.3,19,35.6,19.4,31.5,26.9z" }), _jsx("polygon", { points: "38.4,31 29.4,35 28,25" }), _jsx("path", { d: "M16.5,26.9l0.6,1.2L13.6,30L13,28.8c-1.6-3-2.6-4.7-3.5-5.2C8.7,23,7,23,4,23v-4C11.7,19,12.4,19.4,16.5,26.9z" }), _jsx("polygon", { points: "20,25 18.6,35 9.6,31" })] })] }));
|
|
678
|
+
}
|
|
676
679
|
export function IconArchiveMaster(props) {
|
|
677
680
|
return (_jsxs("svg", { fontSize: props.fontSize ?? FONTSIZE, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "1em", height: "1em", ...props, children: [" ", _jsx("path", { fill: "currentColor", d: "m20.55 5.22l-1.39-1.68A1.51 1.51 0 0 0 18 3H6c-.47 0-.88.21-1.15.55L3.46 5.22C3.17 5.57 3 6.01 3 6.5V19a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V6.5c0-.49-.17-.93-.45-1.28M12 9.5l5.5 5.5H14v2h-4v-2H6.5zM5.12 5l.82-1h12l.93 1z" }), " "] }));
|
|
678
681
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
interface TMPdfViewerProps {
|
|
2
3
|
pdfBlob: Blob;
|
|
3
4
|
title?: string;
|
|
4
5
|
isResizingActive?: boolean;
|
|
5
6
|
enableFitToWidth?: boolean;
|
|
6
7
|
}
|
|
7
|
-
declare const TMPdfViewer: (props: TMPdfViewerProps) =>
|
|
8
|
+
declare const TMPdfViewer: (props: TMPdfViewerProps) => React.JSX.Element;
|
|
8
9
|
export default TMPdfViewer;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
interface TMToppyMessageProps {
|
|
3
3
|
message: ReactNode;
|
|
4
4
|
titleTooltip?: string;
|
|
5
5
|
maxWidth?: string;
|
|
6
6
|
}
|
|
7
|
-
declare const TMToppyMessage: (props: TMToppyMessageProps) =>
|
|
7
|
+
declare const TMToppyMessage: (props: TMToppyMessageProps) => React.JSX.Element;
|
|
8
8
|
export default TMToppyMessage;
|
package/lib/helper/TMUtils.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const getFullFileExtension: (fileName: string, depth?: number) =>
|
|
|
24
24
|
* Es: pdf.p7m.tsd → pdf, pdf.p7m → pdf, pdf → pdf
|
|
25
25
|
*/
|
|
26
26
|
export declare const getBaseExtension: (ext: string) => string;
|
|
27
|
-
export declare const getFileIcon: (fileExtension: string | undefined, fileCount: number | undefined, tooltipContent?: JSX.Element | string) =>
|
|
27
|
+
export declare const getFileIcon: (fileExtension: string | undefined, fileCount: number | undefined, tooltipContent?: JSX.Element | string) => React.JSX.Element;
|
|
28
28
|
export declare function formatBytes(bytes: number | undefined, decimalPlaces?: number): string;
|
|
29
29
|
export interface RowData {
|
|
30
30
|
[key: string]: string | number | null;
|
|
@@ -42,22 +42,41 @@ export declare const isCreateCertificateEnabled: (widgetsString: string) => bool
|
|
|
42
42
|
export declare const isPdfEditorEnabled: (widgetsString: string) => boolean;
|
|
43
43
|
/** Verifica se l'editor PDF è disponibile: richiede file PDF, licenza attiva e widget abilitato sul tipo documento. */
|
|
44
44
|
export declare const isPdfEditorAvailable: (fromDTD: DcmtTypeDescriptor | undefined, ext: string | undefined) => boolean;
|
|
45
|
+
/** Verifica se il tipo documento è quello delle bozze dei gruppi di lavoro. */
|
|
46
|
+
export declare const isDraftsDTD: (dtd: DcmtTypeDescriptor | undefined) => boolean;
|
|
47
|
+
/** Verifica se il tipo documento non è autorizzato per l'utente corrente. */
|
|
48
|
+
export declare const isNotGrantedDTD: (dtd: DcmtTypeDescriptor | undefined) => boolean;
|
|
49
|
+
/** Verifica se il tipo documento è quello delle bozze dei gruppi di lavoro non autorizzato, e quindi privo di permessi. */
|
|
50
|
+
export declare const isNotGrantedDraftsDTD: (dtd: DcmtTypeDescriptor | undefined) => boolean;
|
|
45
51
|
interface TabItemProps {
|
|
46
52
|
$isSelected: boolean;
|
|
47
53
|
$activeGradient?: string;
|
|
48
54
|
}
|
|
49
|
-
export declare const StyledTabItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
export declare const StyledTabItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
56
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
57
|
+
}, TabItemProps>> & string;
|
|
58
|
+
export declare const StyledTabIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "style"> & {
|
|
59
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
60
|
+
}, TabItemProps>> & string;
|
|
61
|
+
export declare const TMCountBadge: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
62
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
63
|
+
}> & string;
|
|
52
64
|
export declare const PDGS_COLORS: {
|
|
53
65
|
DOSSIER: string;
|
|
54
66
|
DOCUMENT: string;
|
|
55
67
|
WORKING_GROUP: string;
|
|
68
|
+
/** Istanza di CaseFlow: viola, per non confonderla ne' con la pratica (arancio) ne' con il gruppo di lavoro (verde). */
|
|
69
|
+
CASEFLOW: string;
|
|
56
70
|
};
|
|
57
71
|
export declare const getPdgsIconMap: (fontSize?: number) => Map<PdGs, JSX.Element>;
|
|
58
72
|
export declare const convertSearchResultDescriptorToFileItems: (documents: Array<SearchResultDescriptor>) => Array<FileItem>;
|
|
59
73
|
export declare const getAppModuleGradient: (appModuleID: AppModules) => string;
|
|
60
74
|
export declare const getPanelManagerToolbarColor: (appModuleID: AppModules) => string;
|
|
75
|
+
export declare const getAppModuleButtonColors: (appModuleID: AppModules) => {
|
|
76
|
+
base: string;
|
|
77
|
+
hover: string;
|
|
78
|
+
shadow: string;
|
|
79
|
+
};
|
|
61
80
|
export declare const getFileManagerFolderColor: (appModuleID: AppModules) => string;
|
|
62
81
|
type SearchToolbarVisibility = {
|
|
63
82
|
tmSearchResult: boolean;
|
package/lib/helper/TMUtils.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { TMTooltip } from '../components';
|
|
4
4
|
import { IconCADossier, IconKey, IconMenuCAWorkingGroups } from './TMIcons';
|
|
5
|
-
import { AccessLevels, AppModules, DataColumnTypes, DataListCacheService, DcmtTypeListCacheService, LicenseModuleStatus, MetadataDataDomains, MetadataFormats, PdGs, SDK_Globals, SystemMIDs } from '@topconsultnpm/sdk-ts';
|
|
5
|
+
import { AccessLevels, AppModules, DataColumnTypes, DataListCacheService, DcmtTypeListCacheService, LicenseModuleStatus, MetadataDataDomains, MetadataFormats, PdGs, SDK_Globals, SystemMIDs, SystemTIDs } from '@topconsultnpm/sdk-ts';
|
|
6
6
|
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
|
7
7
|
/**
|
|
8
8
|
* Estensioni di firma/marca temporale note che possono avvolgere altre estensioni.
|
|
@@ -242,6 +242,14 @@ export const isPdfEditorAvailable = (fromDTD, ext) => {
|
|
|
242
242
|
const isPdfEditorLicensed = SDK_Globals?.license?.dcmtArchiveLicenses?.[0]?.siX_60007?.status === LicenseModuleStatus.Licensed;
|
|
243
243
|
return isPdfEditorLicensed && isPdfEditorEnabled(fromDTD.widgets);
|
|
244
244
|
};
|
|
245
|
+
/** Valore di customData2 con cui il server marca i tipi documento non autorizzati per l'utente corrente. */
|
|
246
|
+
const NOT_GRANTED_DTD = 'NOTGRANTED';
|
|
247
|
+
/** Verifica se il tipo documento è quello delle bozze dei gruppi di lavoro. */
|
|
248
|
+
export const isDraftsDTD = (dtd) => dtd?.id === SystemTIDs.Drafts;
|
|
249
|
+
/** Verifica se il tipo documento non è autorizzato per l'utente corrente. */
|
|
250
|
+
export const isNotGrantedDTD = (dtd) => dtd?.customData2 === NOT_GRANTED_DTD;
|
|
251
|
+
/** Verifica se il tipo documento è quello delle bozze dei gruppi di lavoro non autorizzato, e quindi privo di permessi. */
|
|
252
|
+
export const isNotGrantedDraftsDTD = (dtd) => !!dtd && !dtd.perm && isDraftsDTD(dtd) && isNotGrantedDTD(dtd);
|
|
245
253
|
export const StyledTabItem = styled.div `
|
|
246
254
|
display: flex;
|
|
247
255
|
align-items: center;
|
|
@@ -270,6 +278,8 @@ export const PDGS_COLORS = {
|
|
|
270
278
|
DOSSIER: '#e65b00',
|
|
271
279
|
DOCUMENT: '#b38600',
|
|
272
280
|
WORKING_GROUP: '#009700',
|
|
281
|
+
/** Istanza di CaseFlow: viola, per non confonderla ne' con la pratica (arancio) ne' con il gruppo di lavoro (verde). */
|
|
282
|
+
CASEFLOW: '#6a3fb5',
|
|
273
283
|
};
|
|
274
284
|
export const getPdgsIconMap = (fontSize = 20) => {
|
|
275
285
|
return new Map([
|
|
@@ -336,7 +346,7 @@ export const getAppModuleGradient = (appModuleID) => {
|
|
|
336
346
|
case AppModules.SURFER:
|
|
337
347
|
return 'linear-gradient(270deg, #46B5A2 16%, #3BAABC 34%, #3BAABC 34%, #3681AD 54%, #3368A5 72%, #2F549D 88%, #304F99 100%)';
|
|
338
348
|
case AppModules.DESIGNER:
|
|
339
|
-
return 'linear-gradient(270deg, #A06A8E 16%, #885C77 34%, #6F4C5F 54%, #5A3446 72%, #482234 100%)
|
|
349
|
+
return 'linear-gradient(270deg, #A06A8E 16%, #885C77 34%, #6F4C5F 54%, #5A3446 72%, #482234 100%)';
|
|
340
350
|
case AppModules.ORCHESTRATOR:
|
|
341
351
|
return 'linear-gradient(270deg, #46B5A2 16%, #3BAA8A 34%, #2F8F6F 54%, #277A5A 72%, #216948 88%, #1d6f42 100%)';
|
|
342
352
|
default:
|
|
@@ -355,6 +365,18 @@ export const getPanelManagerToolbarColor = (appModuleID) => {
|
|
|
355
365
|
return 'transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box';
|
|
356
366
|
}
|
|
357
367
|
};
|
|
368
|
+
export const getAppModuleButtonColors = (appModuleID) => {
|
|
369
|
+
switch (appModuleID) {
|
|
370
|
+
case AppModules.SURFER:
|
|
371
|
+
return { base: '#2559a5', hover: '#1c4783', shadow: 'rgba(37, 89, 165, 0.35)' };
|
|
372
|
+
case AppModules.DESIGNER:
|
|
373
|
+
return { base: '#482234', hover: '#351826', shadow: 'rgba(72, 34, 52, 0.35)' };
|
|
374
|
+
case AppModules.ORCHESTRATOR:
|
|
375
|
+
return { base: '#1d6f42', hover: '#15532f', shadow: 'rgba(29, 111, 66, 0.35)' };
|
|
376
|
+
default:
|
|
377
|
+
return { base: '#2559a5', hover: '#1c4783', shadow: 'rgba(37, 89, 165, 0.35)' };
|
|
378
|
+
}
|
|
379
|
+
};
|
|
358
380
|
export const getFileManagerFolderColor = (appModuleID) => {
|
|
359
381
|
switch (appModuleID) {
|
|
360
382
|
case AppModules.SURFER:
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MetadataFormats } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
/** Testo mostrato in una colonna per una riga: è quello su cui va cercato ciò che l'utente digita */
|
|
3
|
+
export type SearchTextGetter = (rowData: any) => string;
|
|
4
|
+
/** Testo con cui una data viene mostrata nella griglia: è quello che l'utente vede e quindi quello che cerca */
|
|
5
|
+
export declare const getDateDisplayText: (value: any, format: MetadataFormats | undefined, formatCulture: string | undefined | null) => string;
|
|
6
|
+
/** Testo con cui un numero viene mostrato nella griglia (separatore delle migliaia, valuta, decimali) */
|
|
7
|
+
export declare const getNumberDisplayText: (value: any, format: MetadataFormats | undefined, formatCulture: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Dirotta la ricerca della griglia sul testo mostrato, per le colonne indicate (chiave: il `dataField`).
|
|
10
|
+
*
|
|
11
|
+
* La ricerca di DevExtreme lavora sul valore archiviato, quindi non trova nulla dove il testo mostrato è
|
|
12
|
+
* diverso:
|
|
13
|
+
* - **date**, che nei dati sono stringhe ISO: DevExtreme prova a interpretare il testo digitato con il
|
|
14
|
+
* formato della colonna, non riesce (il formato è un formatter personalizzato, non un pattern) e scarta
|
|
15
|
+
* la colonna dalla ricerca — cercando `29/01/2023` non trova nulla;
|
|
16
|
+
* - **numeri formattati**, per lo stesso motivo (separatore delle migliaia, simbolo di valuta);
|
|
17
|
+
* - **liste dati e utenti**, dove viene confrontata la chiave archiviata invece della descrizione
|
|
18
|
+
* visualizzata — cercando `FATTURA` non trova nulla, cercando `TD01` sì.
|
|
19
|
+
*
|
|
20
|
+
* Da passare a `customizeColumns` della griglia. Va fatto lì perché solo lì è disponibile la
|
|
21
|
+
* `calculateFilterExpression` predefinita di DevExtreme, che resta in uso per il filtro di intestazione e
|
|
22
|
+
* per il generatore di filtri: quelli funzionano già correttamente e vanno lasciati intatti.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* const searchTextGetters = useMemo(() => new Map([['TM_1_2', (row) => getDateDisplayText(row?.TM_1_2, format, culture)]]), [...]);
|
|
26
|
+
* const customizeColumns = useMemo(() => customizeSearchByDisplayText(searchTextGetters), [searchTextGetters]);
|
|
27
|
+
*/
|
|
28
|
+
export declare const customizeSearchByDisplayText: (searchTextGetters: Map<string, SearchTextGetter>) => (columns: Array<any>) => void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { formatDateTimeByMetadataFormat, formatNumberByMetadataFormat } from './TMUtils';
|
|
2
|
+
/** Testo con cui una data viene mostrata nella griglia: è quello che l'utente vede e quindi quello che cerca */
|
|
3
|
+
export const getDateDisplayText = (value, format, formatCulture) => {
|
|
4
|
+
if (value === undefined || value === null || value === '')
|
|
5
|
+
return '';
|
|
6
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
7
|
+
return Number.isNaN(date.getTime()) ? '' : formatDateTimeByMetadataFormat(date, format, formatCulture);
|
|
8
|
+
};
|
|
9
|
+
/** Testo con cui un numero viene mostrato nella griglia (separatore delle migliaia, valuta, decimali) */
|
|
10
|
+
export const getNumberDisplayText = (value, format, formatCulture) => {
|
|
11
|
+
if (value === undefined || value === null || value === '')
|
|
12
|
+
return '';
|
|
13
|
+
return formatNumberByMetadataFormat(value, format, formatCulture);
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Dirotta la ricerca della griglia sul testo mostrato, per le colonne indicate (chiave: il `dataField`).
|
|
17
|
+
*
|
|
18
|
+
* La ricerca di DevExtreme lavora sul valore archiviato, quindi non trova nulla dove il testo mostrato è
|
|
19
|
+
* diverso:
|
|
20
|
+
* - **date**, che nei dati sono stringhe ISO: DevExtreme prova a interpretare il testo digitato con il
|
|
21
|
+
* formato della colonna, non riesce (il formato è un formatter personalizzato, non un pattern) e scarta
|
|
22
|
+
* la colonna dalla ricerca — cercando `29/01/2023` non trova nulla;
|
|
23
|
+
* - **numeri formattati**, per lo stesso motivo (separatore delle migliaia, simbolo di valuta);
|
|
24
|
+
* - **liste dati e utenti**, dove viene confrontata la chiave archiviata invece della descrizione
|
|
25
|
+
* visualizzata — cercando `FATTURA` non trova nulla, cercando `TD01` sì.
|
|
26
|
+
*
|
|
27
|
+
* Da passare a `customizeColumns` della griglia. Va fatto lì perché solo lì è disponibile la
|
|
28
|
+
* `calculateFilterExpression` predefinita di DevExtreme, che resta in uso per il filtro di intestazione e
|
|
29
|
+
* per il generatore di filtri: quelli funzionano già correttamente e vanno lasciati intatti.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* const searchTextGetters = useMemo(() => new Map([['TM_1_2', (row) => getDateDisplayText(row?.TM_1_2, format, culture)]]), [...]);
|
|
33
|
+
* const customizeColumns = useMemo(() => customizeSearchByDisplayText(searchTextGetters), [searchTextGetters]);
|
|
34
|
+
*/
|
|
35
|
+
export const customizeSearchByDisplayText = (searchTextGetters) => (columns) => {
|
|
36
|
+
columns.forEach((column) => {
|
|
37
|
+
const getSearchText = column?.dataField ? searchTextGetters.get(column.dataField) : undefined;
|
|
38
|
+
// customizeColumns viene richiamata a ogni aggiornamento delle colonne: senza il marcatore i wrapper si anniderebbero
|
|
39
|
+
if (!getSearchText || column.tmSearchByDisplayText)
|
|
40
|
+
return;
|
|
41
|
+
const defaultCalculateFilterExpression = column.calculateFilterExpression;
|
|
42
|
+
// Senza questo DevExtreme prova a convertire il testo digitato nel tipo della colonna e, non riuscendo, la scarta
|
|
43
|
+
column.parseValue = (text) => text;
|
|
44
|
+
column.calculateFilterExpression = function (filterValue, selectedFilterOperation, target) {
|
|
45
|
+
if (target === 'search')
|
|
46
|
+
return [getSearchText, 'contains', filterValue];
|
|
47
|
+
return defaultCalculateFilterExpression?.apply(this, arguments);
|
|
48
|
+
};
|
|
49
|
+
column.tmSearchByDisplayText = true;
|
|
50
|
+
});
|
|
51
|
+
};
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
+
import { DcmtTypeDescriptor, MetadataDataTypes, MetadataDescriptor, MetadataFormats, RelationDescriptor } from "@topconsultnpm/sdk-ts";
|
|
1
2
|
import { MetadataValueDescriptorEx } from "../ts";
|
|
3
|
+
/** Metadati utente (esclusi quelli di sistema) del tipo documento, in ordine di visualizzazione */
|
|
4
|
+
export declare const getUserMetadataSorted: (dtd: DcmtTypeDescriptor | undefined) => Array<MetadataDescriptor>;
|
|
5
|
+
/** Formatta un valore scalare (non lista dati): date e numeri rispettano Format e FormatCulture del metadato */
|
|
6
|
+
export declare const formatScalarValue: (value: any, dataType: MetadataDataTypes | undefined, format: MetadataFormats | undefined, formatCulture: string | undefined) => string;
|
|
2
7
|
/** Check if dcmtType (mTID) has configured Detail or Many-to-Many relations */
|
|
3
8
|
export declare const hasDetailRelations: (mTID: number | undefined) => Promise<boolean>;
|
|
4
9
|
/** Check if dcmtType (mTID) has configured Master or Many-to-Many relations */
|
|
5
10
|
export declare const hasMasterRelations: (mTID: number | undefined) => Promise<boolean>;
|
|
11
|
+
export declare const getDcmtMetadataByMid: (dcmt: {
|
|
12
|
+
TID?: number;
|
|
13
|
+
DID?: number;
|
|
14
|
+
} | undefined) => Promise<Map<number, any>>;
|
|
15
|
+
export declare const mapAssociationsFromMetadata: (relation: RelationDescriptor, type: "detail" | "master", metadataByMid: Map<number, any>) => Array<{
|
|
16
|
+
mid: number;
|
|
17
|
+
value: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const mapRelationAssociationsToMids: (relation: RelationDescriptor, type: "detail" | "master", dcmt: {
|
|
20
|
+
TID?: number;
|
|
21
|
+
DID?: number;
|
|
22
|
+
} | undefined) => Promise<Array<{
|
|
23
|
+
mid: number;
|
|
24
|
+
value: string;
|
|
25
|
+
}>>;
|
|
6
26
|
export declare const isXMLFileExt: (fileExt: string | undefined) => boolean;
|
|
7
27
|
export declare const getButtonAttributes: (args: string | undefined, formData: MetadataValueDescriptorEx[] | undefined, selectedItems: Array<any> | undefined) => Record<string, any> | undefined;
|
|
8
28
|
export declare const getSelectedItem: (args: string | undefined, formData: MetadataValueDescriptorEx[] | undefined, item: any) => Record<string, any> | undefined;
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
import { RelationCacheService, RelationTypes, SDK_Globals } from "@topconsultnpm/sdk-ts";
|
|
1
|
+
import { MetadataDataTypes, RelationCacheService, RelationTypes, SDK_Globals } from "@topconsultnpm/sdk-ts";
|
|
2
|
+
import { formatDateTimeByMetadataFormat, formatNumberByMetadataFormat } from "./TMUtils";
|
|
3
|
+
/** Metadati utente (esclusi quelli di sistema) del tipo documento, in ordine di visualizzazione */
|
|
4
|
+
export const getUserMetadataSorted = (dtd) => {
|
|
5
|
+
return (dtd?.metadata ?? [])
|
|
6
|
+
.filter(md => md.id !== undefined && md.id > 100 && md.isSystem !== 1)
|
|
7
|
+
.sort((a, b) => (a.ordinalPosition ?? 0) - (b.ordinalPosition ?? 0));
|
|
8
|
+
};
|
|
9
|
+
/** Formatta un valore scalare (non lista dati): date e numeri rispettano Format e FormatCulture del metadato */
|
|
10
|
+
export const formatScalarValue = (value, dataType, format, formatCulture) => {
|
|
11
|
+
if (value === undefined || value === null || value === '')
|
|
12
|
+
return '';
|
|
13
|
+
switch (dataType) {
|
|
14
|
+
case MetadataDataTypes.DateTime: return formatDateTimeByMetadataFormat(value instanceof Date ? value : new Date(value), format, formatCulture);
|
|
15
|
+
case MetadataDataTypes.Number: return formatNumberByMetadataFormat(value, format, formatCulture ?? window.navigator.language);
|
|
16
|
+
default: return String(value);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
2
19
|
/** Check if dcmtType (mTID) has configured Detail or Many-to-Many relations */
|
|
3
20
|
export const hasDetailRelations = async (mTID) => {
|
|
4
21
|
let allRelations = await RelationCacheService.GetAllAsync();
|
|
@@ -13,6 +30,46 @@ export const hasMasterRelations = async (mTID) => {
|
|
|
13
30
|
let rdlManyToMany = allRelations?.filter(o => o.relationType == RelationTypes.ManyToMany && (o.masterTID == mTID || o.detailTID == mTID)) ?? [];
|
|
14
31
|
return rdlManyToMany.length > 0 || rdlOneToMany.length > 0;
|
|
15
32
|
};
|
|
33
|
+
// Legge i metadati di un documento
|
|
34
|
+
export const getDcmtMetadataByMid = async (dcmt) => {
|
|
35
|
+
const metadataMap = new Map();
|
|
36
|
+
if (!dcmt?.TID || !dcmt?.DID)
|
|
37
|
+
return metadataMap; // Documento non identificabile: mappa vuota
|
|
38
|
+
const searchEngine = SDK_Globals.tmSession?.NewSearchEngine();
|
|
39
|
+
if (!searchEngine)
|
|
40
|
+
return metadataMap; // Nessuna sessione attiva: mappa vuota
|
|
41
|
+
const allMetadata = await searchEngine.GetMetadataAsync(dcmt.TID, dcmt.DID, false);
|
|
42
|
+
const row = allMetadata?.dtdResult?.rows?.[0]; // Prima (e unica) riga = il documento richiesto
|
|
43
|
+
const mids = allMetadata?.selectMIDs; // MID nello stesso ordine dei valori di riga
|
|
44
|
+
if (row && mids)
|
|
45
|
+
mids.forEach((mid, index) => metadataMap.set(mid, row[index])); // Accoppia mid -> valore per posizione
|
|
46
|
+
return metadataMap;
|
|
47
|
+
};
|
|
48
|
+
// Mappa le associazioni della relazione nei MID di destinazione, usando i metadati sorgente già letti.
|
|
49
|
+
// 'detail' = archivio dettagli dal master (sorgente item1 -> destinazione item2); 'master' = archivio master dal dettaglio (item2 -> item1).
|
|
50
|
+
// Emette una voce per ogni associazione, anche vuota, per coprire tutti i collegamenti.
|
|
51
|
+
export const mapAssociationsFromMetadata = (relation, type, metadataByMid) => {
|
|
52
|
+
if (!relation.associations || relation.associations.length === 0)
|
|
53
|
+
return []; // Relazione senza collegamenti
|
|
54
|
+
return relation.associations.map(assoc => {
|
|
55
|
+
const sourceMid = type === 'detail' ? (assoc.item1 ?? 0) : (assoc.item2 ?? 0); // MID da cui leggere il valore
|
|
56
|
+
const targetMid = type === 'detail' ? (assoc.item2 ?? 0) : (assoc.item1 ?? 0); // MID da valorizzare
|
|
57
|
+
const value = metadataByMid.get(sourceMid); // Valore sorgente (può mancare)
|
|
58
|
+
return { mid: targetMid, value: value !== undefined && value !== null ? value.toString() : '' }; // Assente/null -> stringa vuota
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
// Legge il documento sorgente (master per 'detail', dettaglio per 'master') e mappa le associazioni nei MID di destinazione.
|
|
62
|
+
// Per letture ripetute dello stesso documento, riusare la mappa e chiamare direttamente `mapAssociationsFromMetadata`.
|
|
63
|
+
export const mapRelationAssociationsToMids = async (relation, type, dcmt) => {
|
|
64
|
+
if (!relation.associations || relation.associations.length === 0)
|
|
65
|
+
return []; // Relazione senza collegamenti
|
|
66
|
+
if (!dcmt?.TID || !dcmt?.DID)
|
|
67
|
+
return []; // Documento sorgente non identificabile
|
|
68
|
+
const metadataByMid = await getDcmtMetadataByMid(dcmt);
|
|
69
|
+
if (metadataByMid.size === 0)
|
|
70
|
+
return []; // Nessun metadato leggibile: [] come nel flusso originale (niente collegamenti a vuoto)
|
|
71
|
+
return mapAssociationsFromMetadata(relation, type, metadataByMid);
|
|
72
|
+
};
|
|
16
73
|
export const isXMLFileExt = (fileExt) => {
|
|
17
74
|
const fileExtension = fileExt?.toLowerCase() ?? '';
|
|
18
75
|
switch (fileExtension) {
|
package/lib/helper/helpers.d.ts
CHANGED
|
@@ -2,6 +2,15 @@ import { Colors as ColorsType } from "../components/base/TMEditorBase";
|
|
|
2
2
|
import { DeviceType } from "../components";
|
|
3
3
|
import { AppModules, DataColumnDescriptor, DcmtTypeDescriptor, ITopMediaSession, MetadataDescriptor, QueryDescriptor, SearchResultDescriptor, TaskDescriptor } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { FileExtensionHandler, FormModes, moduleTypes } from "../ts";
|
|
5
|
+
import React from "react";
|
|
6
|
+
/**
|
|
7
|
+
* Handler di hover per elementi con stili inline: applica `over` all'ingresso del mouse e `out` all'uscita.
|
|
8
|
+
* Da spandere sull'elemento: `{...hoverStyle({ background: 'red' }, { background: 'transparent' })}`
|
|
9
|
+
*/
|
|
10
|
+
export declare const hoverStyle: (over: React.CSSProperties, out: React.CSSProperties) => {
|
|
11
|
+
onMouseEnter: (e: React.MouseEvent<HTMLElement>) => CSSStyleDeclaration & React.CSSProperties;
|
|
12
|
+
onMouseLeave: (e: React.MouseEvent<HTMLElement>) => CSSStyleDeclaration & React.CSSProperties;
|
|
13
|
+
};
|
|
5
14
|
declare const calcResponsiveSizes: (deviceType: DeviceType | undefined, desktopSize: string, tabletSize: string, mobileSize: string) => string;
|
|
6
15
|
declare const taskModalSizes: (deviceType: DeviceType | undefined, formMode: FormModes) => {
|
|
7
16
|
width: string;
|
|
@@ -53,6 +62,8 @@ export declare const getSystemMetadata: (withPerm?: boolean) => MetadataDescript
|
|
|
53
62
|
export declare function deepCompare(obj1: any, obj2: any): boolean;
|
|
54
63
|
export declare const extensionHandler: (fileExt: string | undefined) => FileExtensionHandler;
|
|
55
64
|
export declare const downloadBase64File: (base64Data: string, fileName: string) => void;
|
|
65
|
+
export declare const WHATS_NEWS_FILE_NAME = "what's new";
|
|
66
|
+
export declare const WHATS_NEWS_LINK_URL = "https://www.topconsult.it/it/documentazionetopmedia";
|
|
56
67
|
export declare const TASK_MORE_INFO_PREFIX_NAME: string;
|
|
57
68
|
export declare const isTaskMoreInfo: (taskName: string | undefined) => boolean | undefined;
|
|
58
69
|
export declare const getMoreInfoTasksForDocument: (allTasks: TaskDescriptor[], TID: number | null | undefined, DID: number | null | undefined) => TaskDescriptor[];
|
|
@@ -66,7 +77,7 @@ export { openApps, calcResponsiveDirection, calcResponsiveSizes, taskModalSizes,
|
|
|
66
77
|
export declare function moduleVersion(module: moduleTypes): string;
|
|
67
78
|
export declare function buildtype(module: moduleTypes): string;
|
|
68
79
|
export declare const highlightText: (text: string, searchValue: string) => JSX.Element;
|
|
69
|
-
export declare const renderHighlightedText: (text: string, searchText: string, isSelected: boolean) => string | (string |
|
|
80
|
+
export declare const renderHighlightedText: (text: string, searchText: string, isSelected: boolean) => string | (string | React.JSX.Element)[];
|
|
70
81
|
export declare function versionAndBuildtypeInfo(module: moduleTypes): string;
|
|
71
82
|
export declare const getListMaxItems: (deviceType: DeviceType | undefined) => number;
|
|
72
83
|
export declare const svgToString: (icon: React.ReactElement) => string;
|
package/lib/helper/helpers.js
CHANGED
|
@@ -7,6 +7,14 @@ import { buildTypes, FileExtensionHandler, FormModes, moduleTypes } from "../ts"
|
|
|
7
7
|
import { SDKUI_Localizator } from "./SDKUI_Localizator";
|
|
8
8
|
import ReactDOMServer from "react-dom/server";
|
|
9
9
|
import { DeepCompareHelper } from "./DeepCompareHelper";
|
|
10
|
+
/**
|
|
11
|
+
* Handler di hover per elementi con stili inline: applica `over` all'ingresso del mouse e `out` all'uscita.
|
|
12
|
+
* Da spandere sull'elemento: `{...hoverStyle({ background: 'red' }, { background: 'transparent' })}`
|
|
13
|
+
*/
|
|
14
|
+
export const hoverStyle = (over, out) => ({
|
|
15
|
+
onMouseEnter: (e) => Object.assign(e.currentTarget.style, over),
|
|
16
|
+
onMouseLeave: (e) => Object.assign(e.currentTarget.style, out),
|
|
17
|
+
});
|
|
10
18
|
const calcResponsiveSizes = (deviceType, desktopSize, tabletSize, mobileSize) => {
|
|
11
19
|
if (deviceType === DeviceType.DESKTOP)
|
|
12
20
|
return desktopSize;
|
|
@@ -605,6 +613,8 @@ export const downloadBase64File = (base64Data, fileName) => {
|
|
|
605
613
|
// Libera l'URL del Blob
|
|
606
614
|
URL.revokeObjectURL(blobUrl);
|
|
607
615
|
};
|
|
616
|
+
export const WHATS_NEWS_FILE_NAME = "what's new";
|
|
617
|
+
export const WHATS_NEWS_LINK_URL = 'https://www.topconsult.it/it/documentazionetopmedia';
|
|
608
618
|
export const TASK_MORE_INFO_PREFIX_NAME = `${SDKUI_Localizator.MoreInformation} - `;
|
|
609
619
|
export const isTaskMoreInfo = (taskName) => taskName?.startsWith(TASK_MORE_INFO_PREFIX_NAME);
|
|
610
620
|
// Filtra i task di tipo "More Info" non completati associati a un documento specifico.
|
|
@@ -813,7 +823,21 @@ export var LandingPages;
|
|
|
813
823
|
// #region Exception
|
|
814
824
|
export function getExceptionMessage(ex) {
|
|
815
825
|
let msg = ex.isApiException ? ex.response.title : ex.message;
|
|
816
|
-
|
|
826
|
+
if (msg !== undefined && msg !== null)
|
|
827
|
+
return msg;
|
|
828
|
+
let asString = ex.toString();
|
|
829
|
+
if (asString !== '[object Object]')
|
|
830
|
+
return asString;
|
|
831
|
+
if (ex.errorMessage)
|
|
832
|
+
return ex.errorMessage;
|
|
833
|
+
if (ex.title)
|
|
834
|
+
return ex.title;
|
|
835
|
+
try {
|
|
836
|
+
return JSON.stringify(ex) ?? asString;
|
|
837
|
+
}
|
|
838
|
+
catch {
|
|
839
|
+
return asString;
|
|
840
|
+
}
|
|
817
841
|
}
|
|
818
842
|
export function getContrastColor(inputColor) {
|
|
819
843
|
let hex = inputColor;
|
package/lib/helper/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './Globalization';
|
|
|
5
5
|
export * from './TMIcons';
|
|
6
6
|
export * from './TMImageLibrary';
|
|
7
7
|
export * from './helpers';
|
|
8
|
+
export * from './dataGridSearchHelper';
|
|
8
9
|
export * from './queryHelper';
|
|
9
10
|
export * from './TMUtils';
|
|
10
11
|
export * from './TMCommandsContextMenu';
|
|
@@ -18,3 +19,4 @@ export * from './devextremeCustomMessages';
|
|
|
18
19
|
export * from './ZipManager';
|
|
19
20
|
export * from './certificateImportHelper';
|
|
20
21
|
export * from './grafometricSignaturesCache';
|
|
22
|
+
export * from './TMAppUpdatedModal';
|
package/lib/helper/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export * from './Globalization';
|
|
|
5
5
|
export * from './TMIcons';
|
|
6
6
|
export * from './TMImageLibrary';
|
|
7
7
|
export * from './helpers';
|
|
8
|
+
export * from './dataGridSearchHelper';
|
|
8
9
|
export * from './queryHelper';
|
|
9
10
|
export * from './TMUtils';
|
|
10
11
|
export * from './TMCommandsContextMenu';
|
|
@@ -18,3 +19,4 @@ export * from './devextremeCustomMessages';
|
|
|
18
19
|
export * from './ZipManager';
|
|
19
20
|
export * from './certificateImportHelper';
|
|
20
21
|
export * from './grafometricSignaturesCache';
|
|
22
|
+
export * from './TMAppUpdatedModal';
|
|
@@ -5,7 +5,10 @@ export type TID_Alias = {
|
|
|
5
5
|
alias: string | undefined;
|
|
6
6
|
};
|
|
7
7
|
export declare const getTIDsByQd: (qd: QueryDescriptor | undefined) => TID_Alias[];
|
|
8
|
-
|
|
8
|
+
/** Restituisce i tipi documento (con metadati) referenziati da qd.
|
|
9
|
+
* Con refreshCache = true i descrittori vengono riletti dal server, così la lista dei metadati
|
|
10
|
+
* recepisce quelli aggiunti o rimossi dopo il popolamento della cache. */
|
|
11
|
+
export declare const getDcmtTypesByQdAsync: (qd: QueryDescriptor, refreshCache?: boolean) => Promise<import("@topconsultnpm/sdk-ts").DcmtTypeDescriptor[]>;
|
|
9
12
|
export declare const displayMetadataValue: (md: MetadataDescriptor | undefined, value: string | undefined, valueEmptyDescription?: string) => string;
|
|
10
13
|
export declare const IsParametricQuery: (qd: QueryDescriptor | undefined) => boolean;
|
|
11
14
|
export declare const addHiddenSelectItem: (select: SelectItem[], tid: number | undefined, mid: SystemMIDsAsNumber) => void;
|
|
@@ -14,6 +17,8 @@ export declare function addWhereClausesForConnect(qd: QueryDescriptor): void;
|
|
|
14
17
|
export declare function getDefaultOperator(dataDomain: MetadataDataDomains | undefined, dataType: MetadataDataTypes | undefined): QueryOperators.Equal | QueryOperators.Contain | QueryOperators.In;
|
|
15
18
|
export declare const getQD: (tid: number | undefined, easyOr: boolean, newMaxDcmtsToBeReturned: number) => Promise<QueryDescriptor | undefined>;
|
|
16
19
|
export declare const getWorkItemSetIDAsync: (vid: number, did: number) => Promise<string | undefined>;
|
|
20
|
+
/** Id assegnato alla ricerca di sistema con tutti i documenti: non è in cache, va ricostruita a runtime con getSysAllDcmtsSQD */
|
|
21
|
+
export declare const SYS_ALL_DCMTS_SQD_ID = 1;
|
|
17
22
|
export declare const getSysAllDcmtsSQD: (tid: number | undefined, easyOr: boolean) => Promise<SavedQueryDescriptor>;
|
|
18
23
|
export declare const searchResultToMetadataValues: (tid: number | undefined, dtd: DataTableDescriptor | undefined, rows: string[], mids: number[], metadata: MetadataDescriptor[], layoutMode: LayoutModes, isReadOnlyOrigin?: boolean) => MetadataValueDescriptorEx[];
|
|
19
24
|
export declare const handleArchiveVisibility: (md: MetadataDescriptor) => boolean;
|
|
@@ -15,8 +15,11 @@ export const getTIDsByQd = (qd) => {
|
|
|
15
15
|
}
|
|
16
16
|
return tids;
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/** Restituisce i tipi documento (con metadati) referenziati da qd.
|
|
19
|
+
* Con refreshCache = true i descrittori vengono riletti dal server, così la lista dei metadati
|
|
20
|
+
* recepisce quelli aggiunti o rimossi dopo il popolamento della cache. */
|
|
21
|
+
export const getDcmtTypesByQdAsync = async (qd, refreshCache = false) => {
|
|
22
|
+
return await DcmtTypeListCacheService.GetFromQdAsync(qd, undefined, false, refreshCache);
|
|
20
23
|
};
|
|
21
24
|
export const displayMetadataValue = (md, value, valueEmptyDescription = "") => {
|
|
22
25
|
if (!value)
|
|
@@ -251,9 +254,11 @@ export const getWorkItemSetIDAsync = async (vid, did) => {
|
|
|
251
254
|
let result = await SDK_Globals.tmSession?.NewSearchEngine().SearchByIDAsync(qd);
|
|
252
255
|
return result?.dtdResult?.rows?.[0]?.[0];
|
|
253
256
|
};
|
|
257
|
+
/** Id assegnato alla ricerca di sistema con tutti i documenti: non è in cache, va ricostruita a runtime con getSysAllDcmtsSQD */
|
|
258
|
+
export const SYS_ALL_DCMTS_SQD_ID = 1;
|
|
254
259
|
export const getSysAllDcmtsSQD = async (tid, easyOr) => {
|
|
255
260
|
let sqd = new SavedQueryDescriptor();
|
|
256
|
-
sqd.id =
|
|
261
|
+
sqd.id = SYS_ALL_DCMTS_SQD_ID;
|
|
257
262
|
sqd.masterTID = tid;
|
|
258
263
|
sqd.isEasyWhere = 1;
|
|
259
264
|
sqd.name = SDKUI_Localizator.AllDcmts;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DataColumnDescriptor, DataColumnTypes, MetadataDescriptor, MetadataFormats } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
/**
|
|
3
|
+
* Funzioni condivise dalle due sorgenti di TMDistinctValues (valori distinti e ricerca rapida):
|
|
4
|
+
* stanno fuori dagli hook perché non dipendono da alcuno stato.
|
|
5
|
+
*/
|
|
6
|
+
export declare const withRowIndex: <T>(rows: Array<T>) => T[];
|
|
7
|
+
export declare const toGridDataType: (dataType: DataColumnTypes | undefined) => "string" | "number" | "datetime" | "boolean";
|
|
8
|
+
export declare const getMetadataName: (columnMd: MetadataDescriptor | undefined) => string | undefined;
|
|
9
|
+
export declare const getDateDisplayFormat: (format: MetadataFormats | undefined, formatCulture: string | undefined | null) => {
|
|
10
|
+
formatter: (value: string | number | Date) => string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Risolve il MID della colonna di un risultato di ricerca: la proprietà estesa è la fonte principale,
|
|
14
|
+
* in mancanza resta l'allineamento posizionale tra selectMIDs e colonne del risultato.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getColumnMid: (column: DataColumnDescriptor | undefined, selectMIDs: number[] | undefined, columnIndex: number) => number;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DataColumnTypes, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { formatDateTimeByMetadataFormat } from '../helper';
|
|
3
|
+
/**
|
|
4
|
+
* Funzioni condivise dalle due sorgenti di TMDistinctValues (valori distinti e ricerca rapida):
|
|
5
|
+
* stanno fuori dagli hook perché non dipendono da alcuno stato.
|
|
6
|
+
*/
|
|
7
|
+
// rowIndex è la chiave delle griglie di TMDistinctValues: va riallineato all'ordine finale delle righe
|
|
8
|
+
export const withRowIndex = (rows) => {
|
|
9
|
+
rows.forEach((row, index) => { row.rowIndex = index; });
|
|
10
|
+
return rows;
|
|
11
|
+
};
|
|
12
|
+
export const toGridDataType = (dataType) => {
|
|
13
|
+
switch (dataType) {
|
|
14
|
+
case DataColumnTypes.DateTime: return 'datetime';
|
|
15
|
+
case DataColumnTypes.Bool: return 'boolean';
|
|
16
|
+
case DataColumnTypes.Number: return 'number';
|
|
17
|
+
default: return 'string';
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
// Nome del metadato con cui viene intestata la colonna, nella lingua scelta dall'utente
|
|
21
|
+
export const getMetadataName = (columnMd) => (SDK_Globals.useLocalizedName ? columnMd?.nameLoc : columnMd?.name) ?? columnMd?.name ?? columnMd?.nameLoc ?? undefined;
|
|
22
|
+
// Le date vanno mostrate con il formato definito sul metadato, come nel risultato di ricerca
|
|
23
|
+
export const getDateDisplayFormat = (format, formatCulture) => ({
|
|
24
|
+
// La griglia passa al formatter un oggetto Date già istanziato, ma il valore può arrivare anche come stringa
|
|
25
|
+
formatter: (value) => formatDateTimeByMetadataFormat(value instanceof Date ? value : new Date(value), format, formatCulture)
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Risolve il MID della colonna di un risultato di ricerca: la proprietà estesa è la fonte principale,
|
|
29
|
+
* in mancanza resta l'allineamento posizionale tra selectMIDs e colonne del risultato.
|
|
30
|
+
*/
|
|
31
|
+
export const getColumnMid = (column, selectMIDs, columnIndex) => Number(column?.extendedProperties?.['MID'] ?? 0) || (selectMIDs?.[columnIndex] ?? 0);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { MetadataValueDescriptorEx } from '../ts';
|
|
3
|
+
/** Modalità "aggiungi a elenco": il form non archivia a sistema, restituisce i metadati al chiamante (TMMultiMasterDetailDcmts). */
|
|
4
|
+
export interface ArchiveListMode {
|
|
5
|
+
/** true quando si modifica una riga già presente nell'elenco ("Modifica" al posto di "Aggiungi"). */
|
|
6
|
+
isEditingRow: boolean;
|
|
7
|
+
/** Restituisce metadati e file al chiamante, che aggiunge o aggiorna la riga nell'elenco (senza archiviare). */
|
|
8
|
+
onUpsertRow: (metadataValues: Array<MetadataValueDescriptorEx>, file: File | undefined, tid?: number) => void;
|
|
9
|
+
}
|
|
10
|
+
interface UseArchiveListFormParams {
|
|
11
|
+
/** Assente = modalità "aggiungi a elenco" spenta. */
|
|
12
|
+
mode?: ArchiveListMode;
|
|
13
|
+
/** Valori della riga in modifica, con cui pre-compilare il form. */
|
|
14
|
+
editingRowValues?: Array<{
|
|
15
|
+
mid: number;
|
|
16
|
+
value: string;
|
|
17
|
+
}>;
|
|
18
|
+
/** Template vuoto del form. */
|
|
19
|
+
formDataOrig: Array<MetadataValueDescriptorEx>;
|
|
20
|
+
/** Ref ai valori correnti del form (per leggerli al submit senza stale closure). */
|
|
21
|
+
formDataRef: MutableRefObject<Array<MetadataValueDescriptorEx>>;
|
|
22
|
+
/** Ref al file caricato. */
|
|
23
|
+
dcmtFileRef: MutableRefObject<File | null>;
|
|
24
|
+
tid?: number;
|
|
25
|
+
isModal?: boolean;
|
|
26
|
+
/** Id del form, usato come parentId del message box quando è in modale. */
|
|
27
|
+
id?: string;
|
|
28
|
+
/** Svuota il form dopo aver restituito i valori. */
|
|
29
|
+
clearForm: () => void;
|
|
30
|
+
}
|
|
31
|
+
/** Isola la logica della modalità "aggiungi a elenco": valori di riferimento, submit e chiusura del form. */
|
|
32
|
+
export declare const useArchiveListForm: ({ mode, editingRowValues, formDataOrig, formDataRef, dcmtFileRef, tid, isModal, id, clearForm, }: UseArchiveListFormParams) => {
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
isEditingRow: boolean;
|
|
35
|
+
referenceValues: MetadataValueDescriptorEx[];
|
|
36
|
+
submit: () => void;
|
|
37
|
+
requestClose: (isModified: boolean, onClose?: () => void) => boolean;
|
|
38
|
+
};
|
|
39
|
+
export {};
|