@topconsultnpm/sdkui-react 6.22.0-t2 → 6.22.0-t3
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/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +15 -15
- package/lib/components/base/Styled.js +7 -5
- package/lib/components/base/TMAccordionNew.js +7 -7
- package/lib/components/base/TMAlert.d.ts +32 -32
- package/lib/components/base/TMAlert.js +6 -8
- package/lib/components/base/TMAreaManager.js +53 -55
- package/lib/components/base/TMButton.js +4 -4
- package/lib/components/base/TMClosableList.js +3 -3
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.d.ts +2 -0
- package/lib/components/base/TMDataGrid.js +35 -7
- package/lib/components/base/TMDropDownMenu.js +1 -1
- package/lib/components/base/TMFileManagerDataGridView.js +1 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +2 -2
- 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.js +1 -1
- package/lib/components/base/TMPanel.js +8 -8
- package/lib/components/base/TMPopUp.js +2 -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.d.ts +2 -1
- package/lib/components/base/TMSpinner.js +9 -7
- package/lib/components/base/TMTab.js +2 -2
- package/lib/components/base/TMTabControl.d.ts +106 -0
- package/lib/components/base/TMTabControl.js +664 -0
- package/lib/components/base/TMToggleButton.js +2 -2
- package/lib/components/base/TMToolbarCard.js +3 -3
- package/lib/components/base/TMTreeView.js +35 -3
- package/lib/components/base/TMWaitPanel.js +3 -3
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +169 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +320 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +53 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +274 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- 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 +1 -1
- package/lib/components/choosers/TMDiskChooser.js +1 -1
- package/lib/components/choosers/TMDistinctValues.js +28 -19
- package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMImageIDChooser.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +2 -2
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/choosers/TMQuickSearchInfo.js +4 -4
- package/lib/components/choosers/TMQuickSearchSettingsForm.js +1 -1
- package/lib/components/choosers/TMRelationChooser.js +1 -1
- package/lib/components/choosers/TMSelectedValuesSummary.js +1 -3
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMCheckBox.js +1 -1
- package/lib/components/editors/TMDropDown.js +7 -7
- package/lib/components/editors/TMEditorStyled.d.ts +1 -1
- 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 +6 -6
- 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 +7 -2
- package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +29 -0
- package/lib/components/features/assistant/TMHelpOnLineChat.js +1384 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +4 -4
- package/lib/components/features/assistant/TMToppySpeechBubble.js +1 -1
- package/lib/components/features/assistant/dataset/Designer-Suggested-Questions.json +102 -0
- package/lib/components/features/assistant/dataset/Login-Suggested-Questions.json +32 -0
- package/lib/components/features/assistant/dataset/Surfer-Suggested-Questions.json +102 -0
- package/lib/components/features/documents/TMBatchUpdateForm.js +4 -5
- package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
- package/lib/components/features/documents/TMDcmtForm.js +53 -64
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +2 -2
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -3
- package/lib/components/features/documents/TMDcmtIcon.js +3 -5
- package/lib/components/features/documents/TMDcmtPreview.js +6 -4
- package/lib/components/features/documents/TMDcmtTasks.js +2 -9
- package/lib/components/features/documents/TMDownloadRelationViewerSection.js +1 -1
- package/lib/components/features/documents/TMFileUploader.js +7 -7
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +55 -130
- package/lib/components/features/documents/TMMasterInfoFields.js +4 -5
- package/lib/components/features/documents/TMMergeToPdfForm.js +56 -54
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +3 -6
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +1 -1
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +4 -4
- package/lib/components/features/documents/TMRelationViewer.d.ts +16 -9
- package/lib/components/features/documents/TMRelationViewer.js +240 -168
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +1 -1
- package/lib/components/features/documents/relationTreeState.d.ts +32 -0
- package/lib/components/features/documents/relationTreeState.js +89 -0
- 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.d.ts +1 -1
- package/lib/components/features/search/TMSearch.js +71 -12
- package/lib/components/features/search/TMSearchQueryEditor.js +2 -2
- package/lib/components/features/search/TMSearchQueryPanel.js +1 -5
- package/lib/components/features/search/TMSearchResult.d.ts +5 -0
- package/lib/components/features/search/TMSearchResult.js +34 -18
- package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
- package/lib/components/features/search/TMTreeSelector.js +38 -36
- package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
- 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 +97 -102
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +92 -92
- package/lib/components/features/workflow/TMWorkflowPopup.js +2 -2
- 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/TMResultDialog.js +1 -1
- package/lib/components/forms/TMSaveForm.js +3 -3
- package/lib/components/grids/TMBlogAttachments.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +92 -96
- package/lib/components/grids/TMBlogsPostUtils.js +1 -1
- package/lib/components/grids/TMRecentsManager.js +4 -4
- package/lib/components/grids/TMValidationItemsList.js +1 -1
- package/lib/components/index.d.ts +6 -0
- package/lib/components/index.js +5 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +3 -3
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
- package/lib/components/layout/panelManager/TMPanelWrapper.js +1 -1
- package/lib/components/pages/TMPage.js +30 -32
- package/lib/components/query/TMQueryCountButton.js +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +3 -0
- package/lib/components/query/TMQueryEditor.js +9 -8
- package/lib/components/sidebar/TMCommandsPanel.js +1 -1
- package/lib/components/sidebar/TMHeader.d.ts +1 -0
- package/lib/components/sidebar/TMHeader.js +9 -9
- package/lib/components/sidebar/TMSidebar.js +1 -1
- package/lib/components/sidebar/TMSidebarItem.js +1 -1
- package/lib/components/viewers/TMMidViewer.js +2 -2
- package/lib/components/viewers/TMTidViewer.js +3 -3
- package/lib/components/wizard/TMStepIndicator.js +3 -3
- package/lib/helper/Enum_Localizator.d.ts +4 -4
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/Globalization.d.ts +1 -1
- package/lib/helper/SDKUI_Localizator.d.ts +736 -712
- package/lib/helper/SDKUI_Localizator.js +240 -0
- package/lib/helper/TMAppUpdatedModal.js +2 -2
- package/lib/helper/TMIcons.js +1 -3
- package/lib/helper/TMPdfViewer.js +1 -1
- package/lib/helper/TMToppyMessage.js +1 -1
- package/lib/helper/TMUtils.js +1 -1
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +1 -1
- package/lib/helper/dcmtsHelper.d.ts +4 -2
- package/lib/helper/dcmtsHelper.js +3 -1
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/helper/helpers.js +2 -2
- package/lib/hooks/tmDistinctValuesGridHelper.d.ts +1 -1
- package/lib/hooks/useCaseFlowApprove.d.ts +3 -3
- package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +14 -34
- package/lib/hooks/useDcmtOperations.d.ts +3 -12
- package/lib/hooks/useDcmtOperations.js +187 -179
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +16 -27
- package/lib/hooks/useInputDialog.js +1 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +1 -16
- package/lib/hooks/useMultiMasterDetailDcmts.js +65 -67
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useQueryParametersDialog.js +1 -1
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/caseflow/CaseFlowService.d.ts +47 -6
- package/lib/services/caseflow/CaseFlowService.js +82 -14
- package/lib/services/platform_services.d.ts +4 -4
- package/package.json +9 -10
|
@@ -56,4 +56,4 @@ export declare const getDcmtInfosToDownload: (selectedDcmtInfos: Array<DcmtInfo>
|
|
|
56
56
|
* - i default della classe
|
|
57
57
|
* Nota: destinationFolder e zipPassword vengono sempre resettati per sicurezza.
|
|
58
58
|
*/
|
|
59
|
-
export declare const buildInitialDownloadSettings: (saved: DocumentDownloadSettings | undefined, defaultInvoiceFormat: DocumentDownloadSettings[
|
|
59
|
+
export declare const buildInitialDownloadSettings: (saved: DocumentDownloadSettings | undefined, defaultInvoiceFormat: DocumentDownloadSettings['invoiceFormat'], defaultOrderFormat: DocumentDownloadSettings['orderFormat']) => DocumentDownloadSettings;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { RelationTreeItem } from './TMRelationViewer';
|
|
2
|
+
/**
|
|
3
|
+
* Conserva lo stato di un albero delle correlazioni (nodi espansi e fuoco) attraverso
|
|
4
|
+
* un refresh che ricarica i dati da zero. I nodi non sono confrontabili per `key`, che
|
|
5
|
+
* contiene un GUID rigenerato ad ogni caricamento: si usa un percorso costruito sui campi.
|
|
6
|
+
*/
|
|
7
|
+
export interface RelationTreeState {
|
|
8
|
+
/** Documenti di input a cui lo stato si riferisce: non va applicato ad altri */
|
|
9
|
+
inputKey: string;
|
|
10
|
+
expandedPaths: string[];
|
|
11
|
+
/**
|
|
12
|
+
* Documenti espansi che avevano già i figli caricati. Quelli espansi ma vuoti
|
|
13
|
+
* (es. il root) non vanno ricaricati: mostrerebbero più di quanto c'era prima.
|
|
14
|
+
*/
|
|
15
|
+
loadedPaths: string[];
|
|
16
|
+
focusedPath?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Carica i figli di un documento durante il ripristino. */
|
|
19
|
+
export type LoadChildrenFn = (node: RelationTreeItem) => Promise<RelationTreeItem[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Fotografa lo stato dell'albero.
|
|
22
|
+
* `previousFocusedPath` viene usato quando il fuoco è già stato azzerato dall'esterno.
|
|
23
|
+
*/
|
|
24
|
+
export declare const collectRelationTreeState: (nodes: RelationTreeItem[], inputKey: string, focusedKey: string | undefined, previousFocusedPath?: string) => RelationTreeState;
|
|
25
|
+
/**
|
|
26
|
+
* Riapplica lo stato all'albero appena caricato. I nodi che non compaiono nello stato,
|
|
27
|
+
* o che non esistono più (es. documento cancellato), restano chiusi: il confronto per
|
|
28
|
+
* percorso è tollerante per costruzione.
|
|
29
|
+
*/
|
|
30
|
+
export declare const applyRelationTreeState: (nodes: RelationTreeItem[], state: RelationTreeState, loadChildren: LoadChildrenFn, isAborted: () => boolean) => Promise<RelationTreeItem[]>;
|
|
31
|
+
/** Cerca un nodo per percorso, per rimettere il fuoco dov'era. */
|
|
32
|
+
export declare const findRelationNodeByPath: (nodes: RelationTreeItem[], path: string) => RelationTreeItem | null;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/** I nodi generati (messaggi informativi, separatori) non hanno identità stabile. */
|
|
2
|
+
const hasStableIdentity = (node) => !node.isInfoMessage && !node.isSeparator;
|
|
3
|
+
const getNodeIdentity = (node) => node.isDcmt
|
|
4
|
+
? `d:${node.tid ?? ''}:${node.did ?? ''}:${node.relationId ?? ''}`
|
|
5
|
+
: `c:${node.tid ?? ''}:${node.relationId ?? ''}:${node.name ?? ''}`;
|
|
6
|
+
/** Il percorso include i padri: lo stesso documento può comparire sotto padri diversi. */
|
|
7
|
+
const getNodePath = (node, parentPath) => {
|
|
8
|
+
const identity = getNodeIdentity(node);
|
|
9
|
+
return parentPath ? `${parentPath}>${identity}` : identity;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Fotografa lo stato dell'albero.
|
|
13
|
+
* `previousFocusedPath` viene usato quando il fuoco è già stato azzerato dall'esterno.
|
|
14
|
+
*/
|
|
15
|
+
export const collectRelationTreeState = (nodes, inputKey, focusedKey, previousFocusedPath) => {
|
|
16
|
+
const expandedPaths = [];
|
|
17
|
+
const loadedPaths = [];
|
|
18
|
+
let focusedPath;
|
|
19
|
+
const collect = (items, parentPath) => {
|
|
20
|
+
for (const node of items) {
|
|
21
|
+
if (!hasStableIdentity(node))
|
|
22
|
+
continue;
|
|
23
|
+
const path = getNodePath(node, parentPath);
|
|
24
|
+
if (node.expanded)
|
|
25
|
+
expandedPaths.push(path);
|
|
26
|
+
if (node.expanded && node.isDcmt && node.items)
|
|
27
|
+
loadedPaths.push(path);
|
|
28
|
+
// Entro la stessa istanza montata la key è univoca
|
|
29
|
+
if (focusedKey && node.key === focusedKey)
|
|
30
|
+
focusedPath = path;
|
|
31
|
+
if (node.items)
|
|
32
|
+
collect(node.items, path);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
collect(nodes, '');
|
|
36
|
+
return { inputKey, expandedPaths, loadedPaths, focusedPath: focusedPath ?? previousFocusedPath };
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Riapplica lo stato all'albero appena caricato. I nodi che non compaiono nello stato,
|
|
40
|
+
* o che non esistono più (es. documento cancellato), restano chiusi: il confronto per
|
|
41
|
+
* percorso è tollerante per costruzione.
|
|
42
|
+
*/
|
|
43
|
+
export const applyRelationTreeState = async (nodes, state, loadChildren, isAborted) => {
|
|
44
|
+
const expandedPaths = new Set(state.expandedPaths);
|
|
45
|
+
const loadedPaths = new Set(state.loadedPaths);
|
|
46
|
+
const apply = async (items, parentPath) => {
|
|
47
|
+
const result = [];
|
|
48
|
+
for (const node of items) {
|
|
49
|
+
if (!hasStableIdentity(node)) {
|
|
50
|
+
result.push(node);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const path = getNodePath(node, parentPath);
|
|
54
|
+
const wasExpanded = expandedPaths.has(path);
|
|
55
|
+
let children = node.items;
|
|
56
|
+
let isLoaded = node.isLoaded;
|
|
57
|
+
let itemsCount = node.itemsCount;
|
|
58
|
+
// I figli dei documenti sono lazy: vanno ricaricati se l'utente li aveva aperti
|
|
59
|
+
if (wasExpanded && node.isDcmt && !children && loadedPaths.has(path) && !isAborted()) {
|
|
60
|
+
children = await loadChildren(node);
|
|
61
|
+
isLoaded = true;
|
|
62
|
+
itemsCount = children.length;
|
|
63
|
+
}
|
|
64
|
+
const updatedItems = children ? await apply(children, path) : children;
|
|
65
|
+
result.push({ ...node, expanded: wasExpanded, items: updatedItems, isLoaded, itemsCount });
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
};
|
|
69
|
+
return await apply(nodes, '');
|
|
70
|
+
};
|
|
71
|
+
/** Cerca un nodo per percorso, per rimettere il fuoco dov'era. */
|
|
72
|
+
export const findRelationNodeByPath = (nodes, path) => {
|
|
73
|
+
const find = (items, parentPath) => {
|
|
74
|
+
for (const node of items) {
|
|
75
|
+
if (!hasStableIdentity(node))
|
|
76
|
+
continue;
|
|
77
|
+
const currentPath = getNodePath(node, parentPath);
|
|
78
|
+
if (currentPath === path)
|
|
79
|
+
return node;
|
|
80
|
+
if (node.items) {
|
|
81
|
+
const found = find(node.items, currentPath);
|
|
82
|
+
if (found)
|
|
83
|
+
return found;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
};
|
|
88
|
+
return find(nodes, '');
|
|
89
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { SDK_Localizator, SelectItem, SelectItemVisibilities } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { IconAddCircleOutline, IconApply, IconClear, IconDelete, IconDraggabledots, IconUndo, SDKUI_Localizator } from "../../../helper";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { OrderByItem, SDK_Localizator } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { IconAddCircleOutline, IconApply, IconClear, IconDelete, IconDraggabledots, IconUndo, SDKUI_Localizator } from "../../../helper";
|
|
@@ -181,7 +181,7 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
|
181
181
|
overflow: 'auto'
|
|
182
182
|
}, children: dataSource.slice(0, showAllRoot || searchText.length > 0 ? dataSource.length : initialSQDsMaxItems).filter(o => searchText.length <= 0 || (searchText.length > 0 && o.name?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())) || o.description?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())).map((sqd, index) => {
|
|
183
183
|
const isCurrent = selectedItem?.id == sqd.id;
|
|
184
|
-
return (_jsx(StyledSqdItem, { id: `sqd-item-${sqd.id}`,
|
|
184
|
+
return (_jsx(StyledSqdItem, { id: `sqd-item-${sqd.id}`, $isMobile: isMobile, onClick: () => {
|
|
185
185
|
setSelectedItem(sqd);
|
|
186
186
|
onItemClick?.(sqd);
|
|
187
187
|
}, onContextMenu: (e) => {
|
|
@@ -227,6 +227,6 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
|
227
227
|
visible: contextMenuState.visible,
|
|
228
228
|
position: contextMenuState.position,
|
|
229
229
|
onClose: () => setContextMenuState(prev => ({ ...prev, visible: false, sqd: null }))
|
|
230
|
-
} }), _jsxs(StyledOffCanvasPanel, { ref: panelRef,
|
|
230
|
+
} }), _jsxs(StyledOffCanvasPanel, { ref: panelRef, $isOpen: isMobile && infoSQD !== undefined, children: [_jsxs(StyledDivHorizontal, { style: { gap: 10, padding: '10px 8px', width: '100%', alignItems: 'center' }, children: [_jsx("p", { style: { fontSize: '1.1rem', fontWeight: 'bold' }, children: `${SDK_Localizator.SavedQuery} - ${SDKUI_Localizator.About}` }), _jsx(IconCloseOutline, { style: { marginLeft: 'auto', cursor: 'pointer' }, onClick: () => setInfoSQD(undefined) })] }), getTooltipBySqd(infoSQD)] })] }));
|
|
231
231
|
});
|
|
232
232
|
export default TMSavedQuerySelector;
|
|
@@ -46,5 +46,5 @@ interface ITMSearchProps {
|
|
|
46
46
|
fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>;
|
|
47
47
|
graphometricManager?: IGraphometricManagerProp;
|
|
48
48
|
}
|
|
49
|
-
declare const TMSearch: React.
|
|
49
|
+
declare const TMSearch: (props: ITMSearchProps) => React.JSX.Element;
|
|
50
50
|
export default TMSearch;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { SavedQueryCacheService, DcmtTypeListCacheService, SDK_Localizator, LayoutModes } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import TMSavedQuerySelector from './TMSavedQuerySelector';
|
|
5
5
|
import TMTreeSelector from './TMTreeSelector';
|
|
6
|
-
import { TabPanel, Item } from 'devextreme-react/tab-panel';
|
|
7
6
|
import TMSearchQueryPanel, { refreshLastSearch } from './TMSearchQueryPanel';
|
|
8
7
|
import { getSysAllDcmtsSQD, SYS_ALL_DCMTS_SQD_ID, IconFilter, IconRecentlyViewed, IconSavedQuery, IconTree, mergeSearchResultsAppend, removeMruTid, SDKUI_Globals, SDKUI_Localizator, updateMruTids } from '../../../helper';
|
|
9
8
|
import TMSearchResult from './TMSearchResult';
|
|
9
|
+
import TMTabControl, { TMTabPanel, useTMTabs } from '../../base/TMTabControl';
|
|
10
10
|
import TMRecentsManager from '../../grids/TMRecentsManager';
|
|
11
11
|
import { SearchResultContext } from '../../../ts';
|
|
12
12
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
@@ -20,7 +20,7 @@ var TMSearchViews;
|
|
|
20
20
|
TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
|
|
21
21
|
TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
|
|
22
22
|
})(TMSearchViews || (TMSearchViews = {}));
|
|
23
|
-
const
|
|
23
|
+
const TMSearchInstance = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, showTodoDcmtForm, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, passToArchiveCallback, onCurrentTIDChangedCallback, onlyShowSearchQueryPanel, onReferenceClick, refreshFavoriteSavedQueries, inputDID, formAutoOpen, fetchRemoteCertificates, graphometricManager, onSelectedNameChanged }) => {
|
|
24
24
|
const [allSQDs, setAllSQDs] = useState([]);
|
|
25
25
|
const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
|
|
26
26
|
const [currentSQD, setCurrentSQD] = useState();
|
|
@@ -34,6 +34,20 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
34
34
|
const [lastQdSearched, setLastQdSearched] = useState();
|
|
35
35
|
const [showSearchResults, setShowSearchResults] = useState(!onlyShowSearchQueryPanel);
|
|
36
36
|
const [maxDcmtsToBeReturned, setMaxDcmtsToBeReturned] = useState(SDKUI_Globals.userSettings.searchSettings?.maxDcmtsToBeReturned ?? 1000);
|
|
37
|
+
// Il titolo del tab e' il nome del tipo documento dell'ultima scelta dell'utente, sia questa fatta
|
|
38
|
+
// dall'albero, dalle scorciatoie o da una ricerca rapida (di cui conta il tipo documento, non il nome).
|
|
39
|
+
// La callback sta in un ref cosi non entra nelle dipendenze di effetti e memo.
|
|
40
|
+
const selectedNameRef = useRef(onSelectedNameChanged);
|
|
41
|
+
selectedNameRef.current = onSelectedNameChanged;
|
|
42
|
+
// Il nome del tipo documento scelto arriva dal descrittore, che qui e' gia' in cache
|
|
43
|
+
const notifySelectedTIDAsync = useCallback(async (tid) => {
|
|
44
|
+
if (!tid || !selectedNameRef.current)
|
|
45
|
+
return;
|
|
46
|
+
const dtd = await DcmtTypeListCacheService.GetAsync(tid);
|
|
47
|
+
const name = dtd?.nameLoc ?? dtd?.name;
|
|
48
|
+
if (name)
|
|
49
|
+
selectedNameRef.current(name);
|
|
50
|
+
}, []);
|
|
37
51
|
const deviceType = useDeviceType();
|
|
38
52
|
useEffect(() => {
|
|
39
53
|
if (onCurrentTIDChangedCallback) {
|
|
@@ -47,6 +61,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
47
61
|
useEffect(() => {
|
|
48
62
|
if (!inputTID)
|
|
49
63
|
return;
|
|
64
|
+
notifySelectedTIDAsync(inputTID);
|
|
50
65
|
setCurrentTID(inputTID);
|
|
51
66
|
setCurrentSearchView(TMSearchViews.Search);
|
|
52
67
|
}, [inputTID]);
|
|
@@ -54,6 +69,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
54
69
|
const loadSqd = async () => {
|
|
55
70
|
try {
|
|
56
71
|
const resultSqd = await SavedQueryCacheService.GetAsync(inputSqdID);
|
|
72
|
+
notifySelectedTIDAsync(resultSqd?.masterTID);
|
|
57
73
|
await setSQDAsync(resultSqd);
|
|
58
74
|
// Mostra la vista Search per visualizzare i filtri della SavedQuery caricata
|
|
59
75
|
setCurrentSearchView(TMSearchViews.Search);
|
|
@@ -141,12 +157,13 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
141
157
|
setCurrentMruTID(0);
|
|
142
158
|
};
|
|
143
159
|
const onSQDItemClick = useCallback(async (sqd, setSqdAsync) => {
|
|
160
|
+
notifySelectedTIDAsync(sqd.masterTID);
|
|
144
161
|
// Forza ricaricamento completo se la query è già selezionata
|
|
145
162
|
if (sqd.id === currentSQD?.id) {
|
|
146
163
|
await setSqdAsync(undefined);
|
|
147
164
|
}
|
|
148
165
|
await setSqdAsync(sqd);
|
|
149
|
-
}, [currentSQD]);
|
|
166
|
+
}, [currentSQD, notifySelectedTIDAsync]);
|
|
150
167
|
const onSQDDeleted = useCallback(async (sqd, sqdToBeSet, setSqdAsync) => {
|
|
151
168
|
await loadDataSQDsAsync(true, sqd.masterTID);
|
|
152
169
|
if (sqdToBeSet)
|
|
@@ -230,30 +247,35 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
230
247
|
const isTabletOrMobile = deviceType === DeviceType.TABLET || deviceType === DeviceType.MOBILE;
|
|
231
248
|
// --- JSX WRAPPERS ---
|
|
232
249
|
const tmTreeSelectorElement = useMemo(() => _jsx(TMTreeSelectorWrapper, { isMobile: isTabletOrMobile, onSelectedTIDChanged: (tid) => {
|
|
250
|
+
notifySelectedTIDAsync(tid);
|
|
233
251
|
setCurrentTID(tid);
|
|
234
252
|
if (tid && mruTIDs.includes(tid))
|
|
235
253
|
setCurrentMruTID(tid);
|
|
236
254
|
else
|
|
237
255
|
setCurrentMruTID(0);
|
|
238
|
-
} }), [isTabletOrMobile, mruTIDs]);
|
|
256
|
+
} }), [isTabletOrMobile, mruTIDs, notifySelectedTIDAsync]);
|
|
239
257
|
const tmRecentsManagerElement = useMemo(() => _jsx(TMRecentsManagerWrapper, { mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
|
258
|
+
notifySelectedTIDAsync(tid);
|
|
240
259
|
setCurrentMruTID(tid);
|
|
241
260
|
setCurrentTID(tid);
|
|
242
261
|
}, onDeletedTID: (tid) => {
|
|
243
262
|
let newMruTIDS = removeMruTid(SDKUI_Globals.userSettings.searchSettings.mruTIDs, tid);
|
|
244
263
|
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS;
|
|
245
264
|
setMruTIDs(newMruTIDS);
|
|
246
|
-
} }), [mruTIDs, currentMruTID, deviceType]);
|
|
265
|
+
} }), [mruTIDs, currentMruTID, deviceType, notifySelectedTIDAsync]);
|
|
247
266
|
const tmSearchQueryPanelElement = useMemo(() => _jsx(TMSearchQueryPanelWrapper, { isSearchViewOnScreen: currentSearchView === TMSearchViews.Search, passToArchiveCallback: passToArchiveCallback, isExpertMode: isExpertMode, showBackToResultButton: searchResult.length > 0, fromDTD: fromDTD, SQD: currentSQD, inputMids: inputMids, maxDcmtsToBeReturned: maxDcmtsToBeReturned, onBackToResult: () => { if (onlyShowSearchQueryPanel)
|
|
248
267
|
setShowSearchResults(true); setCurrentSearchView(TMSearchViews.Result); }, onSearchCompleted: handleSearchCompleted, onRefreshRequested: refreshSearchQueryPanelAsync, onDcmtTypeReloaded: handleDcmtTypeReloaded, onSqdSaved: async (newSqd) => {
|
|
249
268
|
await loadDataSQDsAsync(true, newSqd.masterTID);
|
|
250
269
|
await setSQDAsync(newSqd);
|
|
251
270
|
} }), [fromDTD, showSearchResults, setShowSearchResults, currentSQD, currentSearchView, isExpertMode, mruTIDs, searchResult, passToArchiveCallback, inputMids, maxDcmtsToBeReturned, handleSearchCompleted, refreshSearchQueryPanelAsync, handleDcmtTypeReloaded, onlyShowSearchQueryPanel]);
|
|
252
|
-
|
|
271
|
+
// I due tab delle ricerche rapide nell'ordine in cui compaiono: il primo c'e' solo con un tipo
|
|
272
|
+
// documento o una ricerca rapida correnti. currentSQDMode resta la posizione nell'elenco visibile.
|
|
273
|
+
const sqdTabIds = useMemo(() => (currentTID || currentSQD) ? ['byTID', 'all'] : ['all'], [currentTID, currentSQD]);
|
|
274
|
+
const tmSavedQuerySelectorElement = useMemo(() => _jsxs(TMTabControl, { variant: 'module', style: { height: '100%', width: '100%' }, contentStyle: { display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0 }, selectedId: sqdTabIds[currentSQDMode] ?? sqdTabIds[sqdTabIds.length - 1], onSelectedIdChange: (id) => setCurrentSQDMode(sqdTabIds.indexOf(id)), children: [_jsx(TMTabPanel, { id: 'byTID', label: fromDTD?.nameLoc, visible: !!(currentTID || currentSQD), children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: false, items: filteredByTIDSQDs, selectedId: currentSQD?.id, onRefreshData: () => { loadDataSQDsAsync(true); }, onItemClick: (sqd) => {
|
|
253
275
|
onSQDItemClick(sqd, setSQDAsync);
|
|
254
|
-
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync), refreshFavoriteSavedQueries: refreshFavoriteSavedQueries }) })
|
|
276
|
+
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync), refreshFavoriteSavedQueries: refreshFavoriteSavedQueries }) }), _jsx(TMTabPanel, { id: 'all', label: SDKUI_Localizator.AllFemale, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: true, items: allSQDs, manageDefault: false, onItemClick: (sqd) => {
|
|
255
277
|
onSQDItemClick(sqd, setSQDAsync);
|
|
256
|
-
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? undefined : currentSQD, setSQDAsync), refreshFavoriteSavedQueries: refreshFavoriteSavedQueries }) })] }), [currentSQDMode, currentTID, currentSQD, fromDTD, filteredByTIDSQDs, allSQDs]);
|
|
278
|
+
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? undefined : currentSQD, setSQDAsync), refreshFavoriteSavedQueries: refreshFavoriteSavedQueries }) })] }), [currentSQDMode, sqdTabIds, currentTID, currentSQD, fromDTD, filteredByTIDSQDs, allSQDs]);
|
|
257
279
|
// Returns the current panelLayout from user settings, falling back to an empty object if not present.
|
|
258
280
|
const getPanelLayoutSetting = () => {
|
|
259
281
|
return SDKUI_Globals.userSettings.searchSettings.panelLayout ?? {};
|
|
@@ -343,10 +365,47 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
343
365
|
return (_jsxs(_Fragment, { children: [onlyShowSearchQueryPanel
|
|
344
366
|
// Il pannello di ricerca resta montato anche quando sono a schermo i risultati: tornando
|
|
345
367
|
// indietro si ritrova l'ultima ricerca impostata, senza rimontaggi che ne resettano i filtri
|
|
346
|
-
? _jsx(StyledMultiViewPanel, {
|
|
347
|
-
: _jsx(StyledMultiViewPanel, {
|
|
368
|
+
? _jsx(StyledMultiViewPanel, { $isVisible: !showSearchResults, children: _jsx(TMPanelManagerProvider, { panels: singlePanelDefinition, initialVisibility: singlePanelVisibility, defaultDimensions: singlePanelDimensions, initialDimensions: singlePanelDimensions, initialMobilePanelId: 'TMSearchQueryPanel', children: tmSearchQueryPanelElement }) })
|
|
369
|
+
: _jsx(StyledMultiViewPanel, { $isVisible: currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true, minPanelSizePx: !isMobile ? 250 : 150 }) }) }), showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onClose: () => { if (onlyShowSearchQueryPanel)
|
|
348
370
|
setShowSearchResults(false); setCurrentSearchView(TMSearchViews.Search); }, backCaption: onlyShowSearchQueryPanel ? SDKUI_Localizator.BackToSearch : undefined, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, openFileUploaderPdfEditor: openFileUploaderPdfEditor, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, inputDID: inputDID, formAutoOpen: formAutoOpen, fetchRemoteCertificates: fetchRemoteCertificates, graphometricManager: graphometricManager })] }));
|
|
349
371
|
};
|
|
372
|
+
const ENABLE_SEARCH_TABS = false;
|
|
373
|
+
// Ogni tab e' un TMSearch completo e indipendente: TMTabControl li tiene tutti montati, cosi piu ricerche
|
|
374
|
+
// restano vive insieme, ognuna con i suoi tipi documento, i suoi filtri e i suoi risultati.
|
|
375
|
+
const TMSearch = (props) => {
|
|
376
|
+
const { isVisible, inputTID, inputSqdID, inputDID, onlyShowSearchQueryPanel, onCurrentTIDChangedCallback } = props;
|
|
377
|
+
const tabs = useTMTabs({ label: SDKUI_Localizator.Search });
|
|
378
|
+
// Tab attivo leggibile senza rilanciare l'effetto qui sotto a ogni cambio tab
|
|
379
|
+
const activeIdRef = useRef(tabs.activeId);
|
|
380
|
+
activeIdRef.current = tabs.activeId;
|
|
381
|
+
// Titoli correnti leggibili dalla callback senza rigenerarla a ogni rinomina
|
|
382
|
+
const itemsRef = useRef(tabs.items);
|
|
383
|
+
itemsRef.current = tabs.items;
|
|
384
|
+
// Il titolo del tab e' il nome appena selezionato; se un altro tab ha gia' quel titolo si numera
|
|
385
|
+
// tra parentesi a partire da 2: NomeTipoDocumento, NomeTipoDocumento (2), NomeTipoDocumento (3)...
|
|
386
|
+
const setTabTitle = useCallback((id, name) => {
|
|
387
|
+
const used = new Set(itemsRef.current.filter(t => t.id !== id).map(t => t.label));
|
|
388
|
+
let label = name;
|
|
389
|
+
for (let i = 2; used.has(label); i++)
|
|
390
|
+
label = `${name} (${i})`;
|
|
391
|
+
tabs.rename(id, label);
|
|
392
|
+
}, [tabs.rename]);
|
|
393
|
+
// Una richiesta dall'esterno (tipo documento, ricerca rapida, documento) riguarda il tab a video in
|
|
394
|
+
// quel momento: gli altri restano sulla ricerca che stanno svolgendo.
|
|
395
|
+
const [inputsTabId, setInputsTabId] = useState(tabs.activeId);
|
|
396
|
+
useEffect(() => { setInputsTabId(activeIdRef.current); }, [inputTID, inputSqdID, inputDID]);
|
|
397
|
+
// Nella modalita a solo pannello di ricerca (es. abbinamento molti a molti) i tab non servono,
|
|
398
|
+
// cosi come non servono finche' i tab non vengono rilasciati
|
|
399
|
+
if (!ENABLE_SEARCH_TABS || onlyShowSearchQueryPanel)
|
|
400
|
+
return _jsx(TMSearchInstance, { ...props });
|
|
401
|
+
return (_jsx(TMTabControl, { ...tabs.controlProps, contentAnimation: 'none', onTabRename: undefined, variant: 'module', style: { height: '100%', width: '100%' }, contentStyle: { display: 'flex', flex: 1, minHeight: 0, position: 'relative' }, children: tabs.items.map(t => {
|
|
402
|
+
const isActiveTab = t.id === tabs.activeId;
|
|
403
|
+
const hasInputs = t.id === inputsTabId;
|
|
404
|
+
return (_jsx(TMTabPanel, { id: t.id, label: t.label, children: _jsx(TMSearchInstance, { ...props, isVisible: isVisible && isActiveTab, inputTID: hasInputs ? inputTID : undefined, inputSqdID: hasInputs ? inputSqdID : undefined, inputDID: hasInputs ? inputDID : undefined,
|
|
405
|
+
// Il tipo documento corrente lo comunica solo il tab a video
|
|
406
|
+
onCurrentTIDChangedCallback: isActiveTab ? onCurrentTIDChangedCallback : undefined, onSelectedNameChanged: (name) => setTabTitle(t.id, name) }) }, t.id));
|
|
407
|
+
}) }));
|
|
408
|
+
};
|
|
350
409
|
export default TMSearch;
|
|
351
410
|
const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
352
411
|
const { setPanelVisibilityById, toggleMaximize, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { LayoutModes, DcmtTypeListCacheService, PlatformObjectValidator, MetadataDataTypes, QueryOperators, DataListCacheService, MetadataDataDomains, SDK_Localizator, UserListCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
@@ -375,7 +375,7 @@ const WhereItemRow = React.memo(({ whereItem, index, dcmtTypesList, isExpertMode
|
|
|
375
375
|
};
|
|
376
376
|
// --- Rendering ---
|
|
377
377
|
if (isCompactView) {
|
|
378
|
-
return (_jsx(StyledMetadataListItem, { id: `wi-item-${whereItem.mid}`, onClick: () => onItemSelect(whereItem.tid, whereItem.mid), onFocus: () => onItemSelect(whereItem.tid, whereItem.mid),
|
|
378
|
+
return (_jsx(StyledMetadataListItem, { id: `wi-item-${whereItem.mid}`, onClick: () => onItemSelect(whereItem.tid, whereItem.mid), onFocus: () => onItemSelect(whereItem.tid, whereItem.mid), $backgroundColor: !PlatformObjectValidator.WhereItemHasValues(whereItem) ? `${TMColors.primary}66` : 'rgba(236, 202, 156, 1)', $hoverColor: !PlatformObjectValidator.WhereItemHasValues(whereItem) ? `${TMColors.primary}33` : 'rgba(236, 202, 156, .5)', children: _jsx(TMSearchWhereItemCard, { isSelected: isSelected, index: index, whereItem: whereItem, showEditor: currentEditingMID === whereItem.mid, isEditableList: isEditable, queryParamsDynDataList: queryParamsDynDataList, onWhereItemChange: onItemChange, onHideEditor: onHideMobileEditor, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, onCascadeUpdateMIDs: onCascadeUpdateMIDs, updateIsModalOpen: updateIsModalOpen }) }));
|
|
379
379
|
}
|
|
380
380
|
return (_jsxs(React.Fragment, { children: [_jsx("div", { id: `wi-item-${whereItem.mid}`, style: { gridColumn: 1 }, children: _jsx(TMMidViewer, { color: TMColors.primaryColor, isMetadataSelected: isSelected, showIcon: true, tid_mid: { tid: whereItem?.tid, mid: whereItem?.mid, aliasTID: whereItem?.alias } }) }), _jsx("div", { style: { gridColumn: 2, paddingLeft: '5px', paddingRight: '5px' }, children: _jsx(TMDropDownMenu, { backgroundColor: colorOperator, color: getOperatorColor(), items: queryOperatorsItems, content: _jsx(StyledItemWrapper, { children: LocalizeQueryOperators(whereItem.operator) }) }) }), _jsxs("div", { style: { gridColumn: 3, position: 'relative' }, onClick: () => onItemSelect(whereItem.tid, whereItem.mid), onFocus: () => onItemSelect(whereItem.tid, whereItem.mid), children: [_jsx(TMSearchWhereItemEditor, { isSelected: isSelected, openChooserBySingleClick: !isSelected, whereItem: whereItem, index: index, isEditableList: isEditable, queryParamsDynDataList: queryParamsDynDataList, onValueChanged: (values) => {
|
|
381
381
|
onItemChange({ ...whereItem, value1: values[0], value2: values[1] });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { PlatformObjectValidator, QueryDescriptor, WhereItem, SDK_Localizator, SelectItemVisibilities, SDK_Globals, SavedQueryCacheService, SearchEngine, QueryOperators, AccessLevelsEx, AccessLevels } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
@@ -515,7 +515,6 @@ export const refreshLastSearch = async (qd) => {
|
|
|
515
515
|
return;
|
|
516
516
|
let searchResults = [];
|
|
517
517
|
try {
|
|
518
|
-
TMSpinner.show({ description: `${SDKUI_Localizator.Search} ...`, backgroundColor: 'transparent' });
|
|
519
518
|
let result = await SDK_Globals.tmSession?.NewSearchEngine().SearchByIDAsync(qd);
|
|
520
519
|
let dcmtsFound = result?.dcmtsFound ?? 0;
|
|
521
520
|
if (dcmtsFound <= 0)
|
|
@@ -526,9 +525,6 @@ export const refreshLastSearch = async (qd) => {
|
|
|
526
525
|
catch (ex) {
|
|
527
526
|
TMExceptionBoxManager.show({ title: SDKUI_Localizator.Search, exception: ex });
|
|
528
527
|
}
|
|
529
|
-
finally {
|
|
530
|
-
TMSpinner.hide();
|
|
531
|
-
}
|
|
532
528
|
return searchResults;
|
|
533
529
|
};
|
|
534
530
|
// =============================================================================
|
|
@@ -23,6 +23,11 @@ interface ITMSearchResultProps {
|
|
|
23
23
|
openDcmtFormAsModal?: boolean;
|
|
24
24
|
showSearchResultSidebar?: boolean;
|
|
25
25
|
showDcmtFormSidebar?: boolean;
|
|
26
|
+
/** Mostra accanto alla griglia il selettore dei tipi documento trovati:
|
|
27
|
+
* su desktop sono affiancati (30/70),
|
|
28
|
+
* su mobile si naviga a step tra selettore e risultati.
|
|
29
|
+
* Se il risultato ha un solo tipo documento il selettore resta chiuso
|
|
30
|
+
* e lo spazio va tutto alla griglia, riapribile dal menu "Altro" */
|
|
26
31
|
showSelector?: boolean;
|
|
27
32
|
showToolbarHeader?: boolean;
|
|
28
33
|
showBackButton?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { LoadIndicator } from 'devextreme-react';
|
|
@@ -16,11 +16,10 @@ import TMAccordionNew from '../../base/TMAccordionNew';
|
|
|
16
16
|
import TMButton from '../../base/TMButton';
|
|
17
17
|
import TMDataGrid, { TMDataGridPageSize } from '../../base/TMDataGrid';
|
|
18
18
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
19
|
-
import { TMLayoutItem, TMSplitterLayout } from '../../base/TMLayout';
|
|
19
|
+
import TMLayoutContainer, { TMLayoutItem, TMSplitterLayout } from '../../base/TMLayout';
|
|
20
20
|
import { ButtonNames, TMExceptionBoxManager, TMMessageBoxManager } from '../../base/TMPopUp';
|
|
21
21
|
import TMSpinner from '../../base/TMSpinner';
|
|
22
22
|
import { StyledMultiViewPanel } from '../../base/Styled';
|
|
23
|
-
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
24
23
|
import TMMetadataValues from '../../editors/TMMetadataValues';
|
|
25
24
|
import TMTidViewer from '../../viewers/TMTidViewer';
|
|
26
25
|
import { useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
@@ -34,7 +33,6 @@ import TMDcmtPreview from '../documents/TMDcmtPreview';
|
|
|
34
33
|
import { WorkFlowOperationButtons } from '../workflow/TMWorkflowPopup';
|
|
35
34
|
// Local
|
|
36
35
|
import TMSearchResultFloatingActionButton from './TMSearchResultFloatingActionButton';
|
|
37
|
-
let abortControllerLocal = new AbortController();
|
|
38
36
|
//#region Helper Methods
|
|
39
37
|
export const getSearchResultCountersSingleCategory = (searchResults) => {
|
|
40
38
|
// let totDcmtTypes = searchResults.length;
|
|
@@ -322,6 +320,15 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, graphome
|
|
|
322
320
|
createTaskFromDocumentOrWorkItem();
|
|
323
321
|
}
|
|
324
322
|
};
|
|
323
|
+
const handleRefreshClick = onRefreshSearchAsyncDatagrid ? async () => {
|
|
324
|
+
TMSpinner.show({ description: `${SDKUI_Localizator.UpdateInProgress}`, backgroundColor: 'transparent' });
|
|
325
|
+
try {
|
|
326
|
+
await onRefreshSearchAsyncDatagrid();
|
|
327
|
+
}
|
|
328
|
+
finally {
|
|
329
|
+
TMSpinner.hide();
|
|
330
|
+
}
|
|
331
|
+
} : undefined;
|
|
325
332
|
const { operationItems, selectedDcmtInfos, renderFloatingBar, renderDcmtOperations, features, } = useDocumentOperations({
|
|
326
333
|
context: context,
|
|
327
334
|
documentData: {
|
|
@@ -335,7 +342,7 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, graphome
|
|
|
335
342
|
searchResult: selectedSearchResult,
|
|
336
343
|
datagridUtility: {
|
|
337
344
|
visibleItems,
|
|
338
|
-
onRefreshSearchAsyncDatagrid,
|
|
345
|
+
onRefreshSearchAsyncDatagrid: handleRefreshClick,
|
|
339
346
|
onRefreshDataRowsAsync,
|
|
340
347
|
refreshFocusedDataRowAsync,
|
|
341
348
|
onRefreshBlogDatagrid,
|
|
@@ -362,6 +369,7 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, graphome
|
|
|
362
369
|
allowRelations,
|
|
363
370
|
showTodoDcmtForm,
|
|
364
371
|
graphometricManager,
|
|
372
|
+
showSelector,
|
|
365
373
|
},
|
|
366
374
|
tasks: {
|
|
367
375
|
allTasks: allTasks,
|
|
@@ -396,7 +404,7 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, graphome
|
|
|
396
404
|
openTaskFormHandler,
|
|
397
405
|
},
|
|
398
406
|
});
|
|
399
|
-
const { isOpenDcmtForm, isDcmtFormModal, openFormHandler, dcmtFormLayoutMode, onDcmtFormOpenChange, showSearchTMDatagrid, showDcmtTypesSelection, showExportForm, updateBatchUpdateForm, closeDcmtFormHandler, handleSignApprove,
|
|
407
|
+
const { isOpenDcmtForm, isDcmtFormModal, openFormHandler, dcmtFormLayoutMode, onDcmtFormOpenChange, showSearchTMDatagrid, showDcmtTypesSelection, showExportForm, updateBatchUpdateForm, closeDcmtFormHandler, handleSignApprove, dcmtOperations: { downloadDcmtsAsync, runOperationAsync, }, relatedDocumentsInfo: { isOpenDetails, isOpenMaster, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability, }, toppyOperations: { showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, updateShowApprovePopup, updateShowRejectPopup, updateShowReAssignPopup, updateShowMoreInfoPopup } } = features;
|
|
400
408
|
// ----- Azioni della colonna di riga (showActionsColumn) -----------------------------------------
|
|
401
409
|
// Le voci di operationItems agiscono sui documenti selezionati o, in mancanza, su quello a fuoco:
|
|
402
410
|
// non accettano una riga come argomento. Il click sull'icona quindi azzera la selezione e porta il
|
|
@@ -621,11 +629,11 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, graphome
|
|
|
621
629
|
}, [currentMetadataValues]);
|
|
622
630
|
const getTitleHeader = () => {
|
|
623
631
|
let counters = (showSelector && disableAccordionIfSingleCategory && searchResults.length > 1) ? getSearchResultCountersSingleCategory(searchResults) : "";
|
|
624
|
-
if (title)
|
|
625
|
-
return title + counters;
|
|
626
632
|
// Nome del tipo documento selezionato, accodato al titolo
|
|
627
633
|
const selectedDcmtTypeName = selectedSearchResult?.fromName ?? (searchResults?.length === 1 ? searchResults[0]?.fromName : undefined);
|
|
628
634
|
const withSelectedDcmtTypeName = (baseTitle) => selectedDcmtTypeName ? `${baseTitle} - ${selectedDcmtTypeName}` : baseTitle;
|
|
635
|
+
if (title)
|
|
636
|
+
return withSelectedDcmtTypeName(title) + counters;
|
|
629
637
|
let titleHeader = withSelectedDcmtTypeName('Ricerca per metadati');
|
|
630
638
|
switch (context) {
|
|
631
639
|
case SearchResultContext.MASTER_DETAIL:
|
|
@@ -765,12 +773,12 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, graphome
|
|
|
765
773
|
&& !showTodoDcmtForm);
|
|
766
774
|
}, [showToppyForApprove, showToppyDraggableHelpCenter, selectedDocs, showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, editPdfForm, openS4TViewer, showTodoDcmtForm]);
|
|
767
775
|
const searchResutlToolbar = _jsxs(_Fragment, { children: [context === SearchResultContext.FAVORITES_AND_RECENTS &&
|
|
768
|
-
_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick:
|
|
776
|
+
_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: handleRefreshClick }), _jsx(TMContextMenu, { items: operationItems, trigger: "left", children: _jsx(IconMenuVertical, { color: 'white', cursor: 'pointer' }) }), showToolbarCloseButton && onClose &&
|
|
769
777
|
_jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconCloseOutline, { color: 'white' }), caption: SDKUI_Localizator.Close, onClick: onClose })] });
|
|
770
778
|
const tmSearchResult = useMemo(() => (!searchResults || searchResults.length <= 0)
|
|
771
779
|
? _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), showNoDcmtFoundMessage && _jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoDcmtFound }), openAddDocumentForm && _jsx("div", { style: { marginTop: "10px" }, children: _jsx(TMButton, { fontSize: "15px", icon: _jsx("i", { className: 'dx-icon-share' }), caption: SDKUI_Localizator.Share, onClick: openAddDocumentForm }) })] })
|
|
772
780
|
:
|
|
773
|
-
_jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs("div", { ref: floatingBarContainerRef, style: { position: 'relative', height: '100%', width: '100%' }, children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && !isSteppedLayout && !isSelectorCollapsed, start: splitterSizes, children: [showSelector ?
|
|
781
|
+
_jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs("div", { ref: floatingBarContainerRef, style: { position: 'relative', height: '100%', width: '100%' }, children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: isSteppedLayout ? 'hidden' : 'visible', separatorSize: Gutters.getGutters(), separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && !isSteppedLayout && !isSelectorCollapsed, start: splitterSizes, children: [showSelector ?
|
|
774
782
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, selectedSearchResult: selectedSearchResult, autoSelectFirst: !isMobile || hasSingleDcmtType, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
775
783
|
:
|
|
776
784
|
_jsx(_Fragment, {}), _jsx(TMLayoutItem, { children: _jsx(TMSearchResultGrid, { openInOffice: openInOffice, fromDTD: fromDTD, operationItems: operationItems, allUsers: allUsers, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, showExportForm: showExportForm, onFocusedItemChanged: handleFocusedItemChangedFromGrid, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync({ inputDcmts, downloadType, downloadMode, onFileDownloaded: onFileOpened, confirmAttachments }), lastUpdateSearchTime: lastUpdateSearchTime, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], onSelectionChanged: (items) => { setSelectedItems(items); }, onDblClick: () => openFormHandler(LayoutModes.Update), showSearchTMDatagrid: showSearchTMDatagrid, onVisibleItemChanged: setVisibleItems, updateDataColumnsFromDataGrid: updateDataColumnsFromDataGrid, updateDataSourceFromDataGrid: updateDataSourceFromDataGrid, updateSelectedRowKeysFromDataGrid: updateSelectedRowKeysFromDataGrid, disableAutoFocus: autoFocusFirstRow === false && isFirstAutoFocusRef.current, dcmtsReturned: dcmtsReturned, dcmtsFound: dcmtsFound, showCounterConfig: showCounterConfig, counterConfig: counterConfig, showActionsColumn: showActionsColumn, compactPager: compactPager, onRowActionRequest: requestRowAction }) })] }), renderFloatingBar] }), _jsx(TMToppyDraggableHelpCenter, { usePortal: toppyHelpCenterUsePortal, isVisible: isToppyHelpCenterVisible, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { dtd: fromDTD, deviceType: deviceType, onApprove: () => {
|
|
@@ -876,7 +884,7 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, graphome
|
|
|
876
884
|
if (!ftExplanation) {
|
|
877
885
|
return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Nessuna info disponibile per questo documento" }), " "] }));
|
|
878
886
|
}
|
|
879
|
-
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', overflow: 'hidden', width: '100%' }, children: [_jsx("div", { style: { padding: '10px', overflow: 'auto', flex: 1 }, children: _jsx("div", { dangerouslySetInnerHTML: { __html: ftExplanation } }) }), _jsxs(StyledIndexingInfoSection, { children: [_jsxs(StyledIndexingToggle, { onClick: handleToggleIndexingInfo, disabled: loadingIndexingInfo, children: [_jsx(StyledLeftContent, { children: _jsx("span", { children: SDKUI_Localizator.IndexingInformation }) }), _jsx(StyledRightContent, { children: _jsx(StyledChevron, {
|
|
887
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', overflow: 'hidden', width: '100%' }, children: [_jsx("div", { style: { padding: '10px', overflow: 'auto', flex: 1 }, children: _jsx("div", { dangerouslySetInnerHTML: { __html: ftExplanation } }) }), _jsxs(StyledIndexingInfoSection, { children: [_jsxs(StyledIndexingToggle, { onClick: handleToggleIndexingInfo, disabled: loadingIndexingInfo, children: [_jsx(StyledLeftContent, { children: _jsx("span", { children: SDKUI_Localizator.IndexingInformation }) }), _jsx(StyledRightContent, { children: _jsx(StyledChevron, { $isOpen: showIndexingInfo, children: "\u25BC" }) })] }), showIndexingInfo && indexingInfo && (_jsxs(StyledIndexingInfoBox, { children: [_jsx("div", { dangerouslySetInnerHTML: { __html: indexingInfo } }), loadingIndexingInfo && (_jsxs("div", { style: { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', background: 'rgba(255, 255, 255, 0.9)', padding: '10px', borderRadius: '4px', boxShadow: '0 2px 8px rgba(0,0,0,0.15)' }, children: [SDKUI_Localizator.Loading, "..."] }))] }))] })] }));
|
|
880
888
|
}, [selectedSearchResult, focusedItem, indexingInfo, showIndexingInfo, loadingIndexingInfo]);
|
|
881
889
|
/**
|
|
882
890
|
* Su mobile i pannelli si mostrano uno per volta, quindi il layout non va ricordato; con groupId
|
|
@@ -979,17 +987,17 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, graphome
|
|
|
979
987
|
], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview, tmFullTextSearch, showToolbarHeader, context, isMobile, backHandler, backHandlerSecondary, isClosable, onBack, backCaption]);
|
|
980
988
|
/** Contenuto del panel manager: con groupId sta nel provider del contenitore, altrimenti in quello qui sotto */
|
|
981
989
|
const panelManagerContent = (_jsxs(_Fragment, { children: [_jsx(PanelDisabledStateHandler, { isBoardDisabled: isBoardDisabled, savedBlogVisible: savedBlogVisible }), isLayoutPersisted && _jsx(SavedLayoutSyncHandler, { disabledPanelIds: disabledLayoutPanelIds }), _jsx(ShowMainPanelBridge, { showMainPanelRef: showMainPanelRef }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar })] }));
|
|
982
|
-
return (_jsxs(StyledMultiViewPanel, {
|
|
990
|
+
return (_jsxs(StyledMultiViewPanel, { $isVisible: isVisible, children: [_jsx(StyledMultiViewPanel, { $isVisible: (!isOpenDcmtForm || isDcmtFormModal) && !isOpenDetails && !isOpenMaster, style: {
|
|
983
991
|
display: 'flex',
|
|
984
992
|
flexDirection: isMobile ? 'column' : 'row',
|
|
985
993
|
justifyContent: 'space-between',
|
|
986
994
|
gap: Gutters.getGutters(),
|
|
987
995
|
width: '100%',
|
|
988
996
|
height: '100%',
|
|
989
|
-
}, children: _jsx(
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
997
|
+
}, children: _jsx(TMLayoutContainer, { direction: 'vertical', children: (groupId && groupId.length > 0) ? panelManagerContent
|
|
998
|
+
// Senza le prop di persistenza il provider si comporta come quello base:
|
|
999
|
+
// i contesti che non ricordano il layout restano come prima
|
|
1000
|
+
: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmSearchResult', isPersistenceEnabled: isLayoutPersisted && hasSearchResultPanelLayout(), persistPanelStates: isLayoutPersisted ? (state) => saveSearchResultPanelLayout(state, disabledLayoutPanelIds) : undefined, persistedPanelStates: isLayoutPersisted ? getSearchResultPanelLayout() : undefined, children: panelManagerContent }) }) }), renderDcmtOperations] }));
|
|
993
1001
|
};
|
|
994
1002
|
export default TMSearchResult;
|
|
995
1003
|
/** Cerca una voce di operazione per id, anche dentro i sottomenu */
|
|
@@ -1392,6 +1400,14 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
|
|
|
1392
1400
|
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
1393
1401
|
setDataSource(newDataSource);
|
|
1394
1402
|
}, [lastUpdateSearchTime]);
|
|
1403
|
+
const gridSorting = useMemo(() => ({ mode: 'multiple' }), []);
|
|
1404
|
+
const gridSelection = useMemo(() => ({ mode: allowMultipleSelection ? 'multiple' : 'single' }), [allowMultipleSelection]);
|
|
1405
|
+
const useNativeScrollbar = SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar === 1;
|
|
1406
|
+
const gridScrolling = useMemo(() => ({
|
|
1407
|
+
columnRenderingMode: 'virtual',
|
|
1408
|
+
rowRenderingMode: 'standard',
|
|
1409
|
+
useNative: useNativeScrollbar
|
|
1410
|
+
}), [useNativeScrollbar]);
|
|
1395
1411
|
// Handles selection change in the data grid
|
|
1396
1412
|
const handleSelectionChange = useCallback((e) => {
|
|
1397
1413
|
if (onSelectionChanged === undefined)
|
|
@@ -1506,7 +1522,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
|
|
|
1506
1522
|
const gridCounterConfig = showCounterConfig
|
|
1507
1523
|
? { ...counterConfig, show: true, items: counterConfig?.items ?? defaultCounterItems }
|
|
1508
1524
|
: { show: false };
|
|
1509
|
-
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [!isDataGridReady && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: '10px' }, children: [_jsx(LoadIndicator, { height: 60, width: 60 }), _jsx("div", { children: SDKUI_Localizator.Loading })] })), isDataGridReady && _jsx(TMDataGrid, { ref: dataGridRef, id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, customizeColumns: customizeColumns, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: disableAutoFocus ? undefined : Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearchTMDatagrid, showFilterPanel: true, sorting:
|
|
1525
|
+
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [!isDataGridReady && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: '10px' }, children: [_jsx(LoadIndicator, { height: 60, width: 60 }), _jsx("div", { children: SDKUI_Localizator.Loading })] })), isDataGridReady && _jsx(TMDataGrid, { ref: dataGridRef, id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, customizeColumns: customizeColumns, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: disableAutoFocus ? undefined : Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearchTMDatagrid, showFilterPanel: true, sorting: gridSorting, selection: gridSelection, scrolling: gridScrolling, pageSize: pageSize, compactPager: compactPager, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, showHeaderColumnChooser: true, onKeyDown: onKeyDown, customContextMenuItems: operationItems, counterConfig: gridCounterConfig })] });
|
|
1510
1526
|
};
|
|
1511
1527
|
//#region TMSearchResultSelector
|
|
1512
1528
|
const StyledItemTemplate = styled.div `
|
|
@@ -1634,7 +1650,7 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
|
|
|
1634
1650
|
renderItem: (result, isSelected) => (_jsxs("div", { style: { width: '100%', padding: '5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(TMTidViewer, { tid: result.fromTID, did: Number(result.dtdResult?.rows?.[0]?.[1]), showIcon: true }), _jsx("div", { style: { padding: 3, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: 'white', color: 'gray', borderRadius: 3 }, children: result.dcmtsReturned })] })),
|
|
1635
1651
|
itemHeight: 40
|
|
1636
1652
|
})), [sortedCategories, groupedResults, searchResults]);
|
|
1637
|
-
const renderCategoryItems = (category) => (_jsx("div", { style: { padding: '5px', height: '100%', overflow: 'auto' }, children: groupedResults[category].map((result, index) => (_jsx(MemoizedStyledItemTemplate, {
|
|
1653
|
+
const renderCategoryItems = (category) => (_jsx("div", { style: { padding: '5px', height: '100%', overflow: 'auto' }, children: groupedResults[category].map((result, index) => (_jsx(MemoizedStyledItemTemplate, { $isSelected: selectedResult === result, onClick: () => handleSelect(result, true), children: renderItemTemplate(result) }, index))) }));
|
|
1638
1654
|
if (disableAccordionIfSingleCategory && sortedCategories.length === 1) {
|
|
1639
1655
|
const category = sortedCategories[0];
|
|
1640
1656
|
return renderCategoryItems(category);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { SDK_Globals, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { IconCopy, IconDownload, IconWarning, IconCheck, getExceptionMessage, SDKUI_Localizator, IconCircleInfo, IconRefresh } from "../../../helper";
|