@topconsultnpm/sdkui-react 6.22.0-t1 → 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/ContextMenu/styles.d.ts +45 -43
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +80 -73
- package/lib/components/base/Styled.d.ts +92 -76
- 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.d.ts +13 -0
- package/lib/components/base/TMButton.js +139 -7
- package/lib/components/base/TMClosableList.js +3 -3
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.d.ts +4 -0
- package/lib/components/base/TMDataGrid.js +292 -12
- package/lib/components/base/TMDataGridExportForm.js +39 -30
- package/lib/components/base/TMDropDownMenu.js +1 -1
- package/lib/components/base/TMEditorBase.d.ts +2 -0
- package/lib/components/base/TMFileManager.js +5 -3
- package/lib/components/base/TMFileManagerDataGridView.js +12 -3
- package/lib/components/base/TMFileManagerThumbnailItems.js +20 -10
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -6
- package/lib/components/base/TMFileManagerUtils.js +37 -1
- package/lib/components/base/TMLayout.d.ts +2 -2
- package/lib/components/base/TMLayout.js +3 -3
- package/lib/components/base/TMList.js +1 -1
- package/lib/components/base/TMListView.js +3 -3
- package/lib/components/base/TMModal.d.ts +11 -0
- package/lib/components/base/TMModal.js +47 -13
- package/lib/components/base/TMPanel.d.ts +6 -0
- package/lib/components/base/TMPanel.js +141 -28
- package/lib/components/base/TMPopUp.js +5 -2
- package/lib/components/base/TMResizableMenu.js +2 -2
- package/lib/components/base/TMRightSidebar.js +1 -1
- package/lib/components/base/TMShowAllOrMaxItemsButton.js +1 -1
- package/lib/components/base/TMSpinner.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/TMTooltip.d.ts +2 -1
- package/lib/components/base/TMTooltip.js +24 -8
- package/lib/components/base/TMTreeView.d.ts +13 -7
- package/lib/components/base/TMTreeView.js +143 -70
- 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 +5 -4
- package/lib/components/choosers/TMDiskChooser.js +1 -1
- package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
- package/lib/components/choosers/TMDistinctValues.js +157 -141
- package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMImageIDChooser.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +3 -3
- package/lib/components/choosers/TMPathChooser.js +17 -34
- 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.js +1 -1
- package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
- package/lib/components/choosers/TMSelectedValuesSummary.js +89 -0
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMCheckBox.js +1 -1
- package/lib/components/editors/TMDateBox.d.ts +16 -1
- package/lib/components/editors/TMDateBox.js +90 -22
- package/lib/components/editors/TMDropDown.d.ts +3 -0
- package/lib/components/editors/TMDropDown.js +197 -5
- package/lib/components/editors/TMEditorStyled.d.ts +21 -43
- 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/TMMetadataEditor.d.ts +5 -1
- package/lib/components/editors/TMMetadataEditor.js +27 -23
- 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.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +25 -17
- package/lib/components/editors/TMTextBox.d.ts +2 -0
- package/lib/components/editors/TMTextBox.js +32 -21
- package/lib/components/editors/TMTextExpression.js +1 -1
- package/lib/components/features/archive/TMArchive.js +24 -5
- 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 +22 -9
- package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
- 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 +281 -113
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +11 -0
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +79 -9
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -3
- package/lib/components/features/documents/TMDcmtIcon.js +8 -8
- package/lib/components/features/documents/TMDcmtPreview.d.ts +7 -5
- package/lib/components/features/documents/TMDcmtPreview.js +16 -10
- 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 +95 -108
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +20 -0
- package/lib/components/features/documents/TMMasterInfoFields.js +185 -0
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +83 -56
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +46 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +320 -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 +29 -9
- package/lib/components/features/documents/TMRelationViewer.js +310 -208
- 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 +172 -34
- package/lib/components/features/search/TMSearchQueryEditor.js +7 -5
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +14 -4
- package/lib/components/features/search/TMSearchQueryPanel.js +153 -62
- package/lib/components/features/search/TMSearchResult.d.ts +21 -0
- package/lib/components/features/search/TMSearchResult.js +461 -152
- package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
- package/lib/components/features/search/TMTreeSelector.js +130 -83
- 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.d.ts +10 -0
- package/lib/components/features/workflow/TMWorkflowPopup.js +9 -5
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +4 -4
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
- 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 +14 -3
- package/lib/components/grids/TMBlogHeader.js +5 -1
- package/lib/components/grids/TMBlogsPost.d.ts +2 -0
- package/lib/components/grids/TMBlogsPost.js +122 -99
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +15 -4
- package/lib/components/grids/TMRecentsManager.js +4 -4
- package/lib/components/grids/TMValidationItemsList.js +1 -1
- package/lib/components/index.d.ts +6 -0
- package/lib/components/index.js +5 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +25 -15
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +4 -5
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
- package/lib/components/layout/panelManager/TMPanelWrapper.js +3 -3
- package/lib/components/layout/panelManager/types.d.ts +3 -0
- package/lib/components/layout/panelManager/utils.js +13 -11
- package/lib/components/pages/TMPage.js +30 -32
- package/lib/components/query/TMQueryCountButton.js +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +17 -10
- package/lib/components/query/TMQueryEditor.js +9 -8
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMCommandsPanel.js +1 -1
- package/lib/components/sidebar/TMHeader.d.ts +1 -0
- package/lib/components/sidebar/TMHeader.js +37 -27
- package/lib/components/sidebar/TMSidebar.js +1 -1
- package/lib/components/sidebar/TMSidebarItem.js +1 -1
- package/lib/components/viewers/TMMidViewer.js +6 -3
- package/lib/components/viewers/TMTidViewer.js +89 -28
- package/lib/components/wizard/TMStepIndicator.js +3 -3
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/devextreme-license.d.ts +1 -0
- package/lib/devextreme-license.js +3 -0
- package/lib/helper/Enum_Localizator.d.ts +4 -4
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/Globalization.d.ts +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +110 -0
- package/lib/helper/SDKUI_Globals.js +151 -0
- package/lib/helper/SDKUI_Localizator.d.ts +756 -677
- package/lib/helper/SDKUI_Localizator.js +790 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +2 -0
- package/lib/helper/TMAppUpdatedModal.js +134 -0
- package/lib/helper/TMIcons.d.ts +1 -0
- package/lib/helper/TMIcons.js +4 -3
- package/lib/helper/TMPdfViewer.js +1 -1
- package/lib/helper/TMToppyMessage.js +1 -1
- package/lib/helper/TMUtils.d.ts +51 -4
- package/lib/helper/TMUtils.js +273 -12
- 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/dataGridSearchHelper.d.ts +28 -0
- package/lib/helper/dataGridSearchHelper.js +51 -0
- package/lib/helper/dcmtsHelper.d.ts +22 -0
- package/lib/helper/dcmtsHelper.js +60 -1
- package/lib/helper/helpers.d.ts +24 -2
- package/lib/helper/helpers.js +59 -3
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +6 -1
- package/lib/helper/queryHelper.js +8 -3
- package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
- package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
- package/lib/hooks/useArchiveListForm.d.ts +39 -0
- package/lib/hooks/useArchiveListForm.js +46 -0
- package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
- package/lib/hooks/useCaseFlowApprove.js +157 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +14 -34
- package/lib/hooks/useDataUserIdItem.d.ts +1 -0
- package/lib/hooks/useDataUserIdItem.js +1 -0
- package/lib/hooks/useDcmtOperations.d.ts +3 -12
- package/lib/hooks/useDcmtOperations.js +187 -179
- package/lib/hooks/useDocumentOperations.d.ts +5 -0
- package/lib/hooks/useDocumentOperations.js +64 -33
- package/lib/hooks/useInputDialog.js +1 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +98 -0
- package/lib/hooks/useMultiMasterDetailDcmts.js +758 -0
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useQueryParametersDialog.js +1 -1
- package/lib/hooks/useRelatedDocuments.d.ts +1 -0
- package/lib/hooks/useRelatedDocuments.js +22 -27
- package/lib/hooks/useShowDossiersV5.d.ts +12 -0
- package/lib/hooks/useShowDossiersV5.js +37 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
- package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
- package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
- package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
- package/lib/hooks/useTMDistinctValuesSource.js +105 -0
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -2
- package/lib/services/caseflow/CaseFlowService.d.ts +277 -0
- package/lib/services/caseflow/CaseFlowService.js +761 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.d.ts +28 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.js +121 -0
- package/lib/services/caseflow/caseFlowNameCache.d.ts +32 -0
- package/lib/services/caseflow/caseFlowNameCache.js +116 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.d.ts +61 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.js +113 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/index.js +4 -0
- package/lib/services/platform_services.d.ts +4 -4
- package/package.json +16 -13
|
@@ -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,17 +1,17 @@
|
|
|
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
|
-
import { getSysAllDcmtsSQD, IconFilter, IconRecentlyViewed, IconSavedQuery, IconTree, removeMruTid, SDKUI_Globals, SDKUI_Localizator, updateMruTids } from '../../../helper';
|
|
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';
|
|
13
13
|
import { StyledMultiViewPanel } from '../../base/Styled';
|
|
14
|
-
import { useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
14
|
+
import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
15
15
|
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
16
16
|
import { TMPanelManagerWithPersistenceProvider } from '../../layout/panelManager/TMPanelManagerWithPersistenceProvider';
|
|
17
17
|
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
@@ -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();
|
|
@@ -32,8 +32,22 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
32
32
|
const [currentSearchView, setCurrentSearchView] = useState(TMSearchViews.Search);
|
|
33
33
|
const [currentSQDMode, setCurrentSQDMode] = useState(1);
|
|
34
34
|
const [lastQdSearched, setLastQdSearched] = useState();
|
|
35
|
-
const [showSearchResults, setShowSearchResults] = useState(
|
|
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,17 +157,54 @@ 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)
|
|
153
170
|
await setSqdAsync?.(sqdToBeSet);
|
|
154
171
|
}, []);
|
|
172
|
+
// --- REFRESH DEI PANNELLI ---
|
|
173
|
+
// Scorciatoie: rilegge dal server l'elenco dei tipi documento, così le scorciatoie riflettono
|
|
174
|
+
// quelli aggiunti o rimossi. La nuova identità di mruTIDs fa ricaricare i descrittori a TMRecentsManager.
|
|
175
|
+
const refreshRecentsAsync = useCallback(async () => {
|
|
176
|
+
DcmtTypeListCacheService.RemoveAllWithoutMetadata();
|
|
177
|
+
await DcmtTypeListCacheService.GetAllWithoutMetadataAsync();
|
|
178
|
+
setMruTIDs([...SDKUI_Globals.userSettings.searchSettings.mruTIDs]);
|
|
179
|
+
}, []);
|
|
180
|
+
// Ricerche rapide: invalida la cache delle saved query e ricarica l'elenco del tipo documento corrente
|
|
181
|
+
const refreshSavedQueriesAsync = useCallback(async () => {
|
|
182
|
+
// loadDataSQDsAsync riporta la selezione sulla prima tab: il refresh non deve spostare quella scelta dall'utente
|
|
183
|
+
const sqdMode = currentSQDMode;
|
|
184
|
+
await loadDataSQDsAsync(true, fromDTD?.id ?? currentTID);
|
|
185
|
+
setCurrentSQDMode(sqdMode);
|
|
186
|
+
}, [fromDTD?.id, currentTID, currentSQDMode]);
|
|
187
|
+
// Pannello dei metadati: rilegge dal server i metadati del tipo documento e la definizione della
|
|
188
|
+
// ricerca rapida corrente, con cui il pannello ricostruisce i filtri (i valori digitati vengono persi)
|
|
189
|
+
const refreshSearchQueryPanelAsync = useCallback(async () => {
|
|
190
|
+
const tid = fromDTD?.id ?? currentTID;
|
|
191
|
+
if (!tid)
|
|
192
|
+
return;
|
|
193
|
+
const dtd = await DcmtTypeListCacheService.GetAsync(tid, true, undefined, false, true);
|
|
194
|
+
setFromDTD(dtd);
|
|
195
|
+
// Passare da undefined forza la ricostruzione dei filtri anche quando la query selezionata non cambia
|
|
196
|
+
const sqdToRestore = currentSQD;
|
|
197
|
+
SavedQueryCacheService.Remove();
|
|
198
|
+
await setSQDAsync(undefined);
|
|
199
|
+
// La ricerca di sistema non è in cache: va ricostruita, così recepisce i metadati appena riletti
|
|
200
|
+
await setSQDAsync(sqdToRestore?.id === SYS_ALL_DCMTS_SQD_ID ? await getSysAllDcmtsSQD(tid, false) : sqdToRestore);
|
|
201
|
+
// mruTIDs è tra le dipendenze perché setSQDAsync lo legge
|
|
202
|
+
}, [fromDTD?.id, currentTID, currentSQD, mruTIDs]);
|
|
203
|
+
// Prima di ogni ricerca il pannello rilegge i metadati del tipo documento: si recepisce il descrittore
|
|
204
|
+
// aggiornato, così anche il resto della vista (titoli, badge, form dei metadati) lavora sulla lista corrente
|
|
205
|
+
const handleDcmtTypeReloaded = useCallback((dtd) => {
|
|
206
|
+
setFromDTD(dtd);
|
|
207
|
+
}, []);
|
|
155
208
|
const onRefreshSearchAsyncDatagrid = async () => {
|
|
156
209
|
try {
|
|
157
210
|
if (lastQdSearched) {
|
|
@@ -164,46 +217,65 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
164
217
|
console.error("Error refreshing search:", error);
|
|
165
218
|
}
|
|
166
219
|
};
|
|
220
|
+
const handleSearchCompleted = useCallback((searchResult, qd, append) => {
|
|
221
|
+
if (searchResult.length <= 0) {
|
|
222
|
+
// In ricerca normale un array vuoto resetta i risultati; in accoda si mantiene il set accumulato
|
|
223
|
+
if (!append)
|
|
224
|
+
setSearchResult(searchResult);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
const newResult = searchResult[0];
|
|
228
|
+
// In modalità accoda unisce il nuovo risultato a quello precedente (più recenti in cima).
|
|
229
|
+
setSearchResult(prev => {
|
|
230
|
+
if (append && prev.length > 0 && prev[0]?.fromTID === newResult?.fromTID) {
|
|
231
|
+
const merged = mergeSearchResultsAppend(prev[0], newResult);
|
|
232
|
+
return merged ? [merged] : searchResult;
|
|
233
|
+
}
|
|
234
|
+
return searchResult;
|
|
235
|
+
});
|
|
236
|
+
setLastQdSearched(qd);
|
|
237
|
+
setCurrentSearchView(TMSearchViews.Result);
|
|
238
|
+
// Salvataggio ultimi 10 TIDs
|
|
239
|
+
let fromTID = searchResult?.[0].fromTID;
|
|
240
|
+
let newMruTIDS = updateMruTids(SDKUI_Globals.userSettings.searchSettings.mruTIDs, fromTID);
|
|
241
|
+
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS;
|
|
242
|
+
setMruTIDs(newMruTIDS);
|
|
243
|
+
setCurrentMruTID(fromTID);
|
|
244
|
+
setShowSearchResults(true);
|
|
245
|
+
}, []);
|
|
167
246
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
168
247
|
const isTabletOrMobile = deviceType === DeviceType.TABLET || deviceType === DeviceType.MOBILE;
|
|
169
248
|
// --- JSX WRAPPERS ---
|
|
170
249
|
const tmTreeSelectorElement = useMemo(() => _jsx(TMTreeSelectorWrapper, { isMobile: isTabletOrMobile, onSelectedTIDChanged: (tid) => {
|
|
250
|
+
notifySelectedTIDAsync(tid);
|
|
171
251
|
setCurrentTID(tid);
|
|
172
252
|
if (tid && mruTIDs.includes(tid))
|
|
173
253
|
setCurrentMruTID(tid);
|
|
174
254
|
else
|
|
175
255
|
setCurrentMruTID(0);
|
|
176
|
-
} }), [isTabletOrMobile, mruTIDs]);
|
|
256
|
+
} }), [isTabletOrMobile, mruTIDs, notifySelectedTIDAsync]);
|
|
177
257
|
const tmRecentsManagerElement = useMemo(() => _jsx(TMRecentsManagerWrapper, { mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
|
258
|
+
notifySelectedTIDAsync(tid);
|
|
178
259
|
setCurrentMruTID(tid);
|
|
179
260
|
setCurrentTID(tid);
|
|
180
261
|
}, onDeletedTID: (tid) => {
|
|
181
262
|
let newMruTIDS = removeMruTid(SDKUI_Globals.userSettings.searchSettings.mruTIDs, tid);
|
|
182
263
|
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS;
|
|
183
264
|
setMruTIDs(newMruTIDS);
|
|
184
|
-
} }), [mruTIDs, currentMruTID, deviceType]);
|
|
185
|
-
const tmSearchQueryPanelElement = useMemo(() => _jsx(TMSearchQueryPanelWrapper, { passToArchiveCallback: passToArchiveCallback, isExpertMode: isExpertMode, showBackToResultButton: searchResult.length > 0, fromDTD: fromDTD, SQD: currentSQD, inputMids: inputMids, maxDcmtsToBeReturned: maxDcmtsToBeReturned, onBackToResult: () => {
|
|
186
|
-
|
|
187
|
-
if (searchResult.length <= 0)
|
|
188
|
-
return;
|
|
189
|
-
setLastQdSearched(qd);
|
|
190
|
-
setCurrentSearchView(TMSearchViews.Result);
|
|
191
|
-
// Salvataggio ultimi 10 TIDs
|
|
192
|
-
let fromTID = searchResult?.[0].fromTID;
|
|
193
|
-
let newMruTIDS = updateMruTids(SDKUI_Globals.userSettings.searchSettings.mruTIDs, fromTID);
|
|
194
|
-
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS;
|
|
195
|
-
setMruTIDs(newMruTIDS);
|
|
196
|
-
setCurrentMruTID(fromTID);
|
|
197
|
-
setShowSearchResults(true);
|
|
198
|
-
}, onSqdSaved: async (newSqd) => {
|
|
265
|
+
} }), [mruTIDs, currentMruTID, deviceType, notifySelectedTIDAsync]);
|
|
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)
|
|
267
|
+
setShowSearchResults(true); setCurrentSearchView(TMSearchViews.Result); }, onSearchCompleted: handleSearchCompleted, onRefreshRequested: refreshSearchQueryPanelAsync, onDcmtTypeReloaded: handleDcmtTypeReloaded, onSqdSaved: async (newSqd) => {
|
|
199
268
|
await loadDataSQDsAsync(true, newSqd.masterTID);
|
|
200
269
|
await setSQDAsync(newSqd);
|
|
201
|
-
} }), [fromDTD, showSearchResults, setShowSearchResults, currentSQD, isExpertMode, mruTIDs, searchResult, passToArchiveCallback, inputMids, maxDcmtsToBeReturned]);
|
|
202
|
-
|
|
270
|
+
} }), [fromDTD, showSearchResults, setShowSearchResults, currentSQD, currentSearchView, isExpertMode, mruTIDs, searchResult, passToArchiveCallback, inputMids, maxDcmtsToBeReturned, handleSearchCompleted, refreshSearchQueryPanelAsync, handleDcmtTypeReloaded, onlyShowSearchQueryPanel]);
|
|
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) => {
|
|
203
275
|
onSQDItemClick(sqd, setSQDAsync);
|
|
204
|
-
}, 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) => {
|
|
205
277
|
onSQDItemClick(sqd, setSQDAsync);
|
|
206
|
-
}, 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]);
|
|
207
279
|
// Returns the current panelLayout from user settings, falling back to an empty object if not present.
|
|
208
280
|
const getPanelLayoutSetting = () => {
|
|
209
281
|
return SDKUI_Globals.userSettings.searchSettings.panelLayout ?? {};
|
|
@@ -250,7 +322,14 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
250
322
|
{
|
|
251
323
|
id: 'TMRecentsManager',
|
|
252
324
|
name: SDKUI_Localizator.Shortcuts,
|
|
253
|
-
contentOptions: {
|
|
325
|
+
contentOptions: {
|
|
326
|
+
component: tmRecentsManagerElement,
|
|
327
|
+
panelContainer: {
|
|
328
|
+
title: SDKUI_Localizator.Shortcuts,
|
|
329
|
+
totalItems: mruTIDs.length,
|
|
330
|
+
onRefresh: refreshRecentsAsync
|
|
331
|
+
}
|
|
332
|
+
},
|
|
254
333
|
toolbarOptions: { icon: _jsx(IconRecentlyViewed, { fontSize: 24 }), visible: true, orderNumber: 2, isActive: allInitialPanelVisibility['TMRecentsManager'] }
|
|
255
334
|
},
|
|
256
335
|
{
|
|
@@ -262,11 +341,70 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
262
341
|
{
|
|
263
342
|
id: 'TMSavedQuerySelector',
|
|
264
343
|
name: SDK_Localizator.SavedQueries,
|
|
265
|
-
contentOptions: {
|
|
344
|
+
contentOptions: {
|
|
345
|
+
component: tmSavedQuerySelectorElement,
|
|
346
|
+
panelContainer: {
|
|
347
|
+
title: SDK_Localizator.SavedQueries,
|
|
348
|
+
onRefresh: refreshSavedQueriesAsync
|
|
349
|
+
}
|
|
350
|
+
},
|
|
266
351
|
toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
|
|
267
352
|
}
|
|
268
|
-
], [tmTreeSelectorElement, showSearchResults, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs]);
|
|
269
|
-
|
|
353
|
+
], [tmTreeSelectorElement, showSearchResults, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs, refreshRecentsAsync, refreshSavedQueriesAsync]);
|
|
354
|
+
// Quando è visibile solo il pannello di ricerca (es. modale di abbinamento molti a molti) serve
|
|
355
|
+
const singlePanelVisibility = { 'TMSearchQueryPanel': true };
|
|
356
|
+
const singlePanelDimensions = { 'TMSearchQueryPanel': { width: '100%', height: '100%' } };
|
|
357
|
+
const singlePanelDefinition = useMemo(() => [
|
|
358
|
+
{
|
|
359
|
+
id: 'TMSearchQueryPanel',
|
|
360
|
+
name: fromDTD?.nameLoc ?? SDKUI_Localizator.Search_Metadata,
|
|
361
|
+
contentOptions: { component: tmSearchQueryPanelElement },
|
|
362
|
+
toolbarOptions: { icon: _jsx(IconFilter, { fontSize: 24 }), visible: false, orderNumber: 1, isActive: true }
|
|
363
|
+
}
|
|
364
|
+
], [tmSearchQueryPanelElement, fromDTD]);
|
|
365
|
+
return (_jsxs(_Fragment, { children: [onlyShowSearchQueryPanel
|
|
366
|
+
// Il pannello di ricerca resta montato anche quando sono a schermo i risultati: tornando
|
|
367
|
+
// indietro si ritrova l'ultima ricerca impostata, senza rimontaggi che ne resettano i filtri
|
|
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)
|
|
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 })] }));
|
|
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
|
+
}) }));
|
|
270
408
|
};
|
|
271
409
|
export default TMSearch;
|
|
272
410
|
const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
@@ -285,11 +423,11 @@ const TMRecentsManagerWrapper = ({ mruTIDs, currentMruTID, deviceType, onSelecte
|
|
|
285
423
|
onDeletedTID?.(tid);
|
|
286
424
|
} }));
|
|
287
425
|
};
|
|
288
|
-
const TMSearchQueryPanelWrapper = ({ fromDTD, SQD, isExpertMode, showBackToResultButton, onSearchCompleted, onSqdSaved, onBackToResult, passToArchiveCallback, inputMids, maxDcmtsToBeReturned }) => {
|
|
426
|
+
const TMSearchQueryPanelWrapper = ({ isSearchViewOnScreen, fromDTD, SQD, isExpertMode, showBackToResultButton, onSearchCompleted, onSqdSaved, onBackToResult, passToArchiveCallback, inputMids, maxDcmtsToBeReturned, onRefreshRequested, onDcmtTypeReloaded }) => {
|
|
289
427
|
const { setPanelVisibilityById, toggleMaximize, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
290
428
|
const deviceType = useDeviceType();
|
|
291
429
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
292
|
-
return (_jsx(TMSearchQueryPanel, { onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('TMSearchQueryPanel', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("TMSearchQueryPanel") : undefined, isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: SQD, inputMids: inputMids, onSearchCompleted: onSearchCompleted, onSqdSaved: onSqdSaved, showBackToResultButton: showBackToResultButton, onBackToResult: onBackToResult, passToArchiveCallback: passToArchiveCallback, maxDcmtsToBeReturned: maxDcmtsToBeReturned }));
|
|
430
|
+
return (_jsx(TMSearchQueryPanel, { isSearchViewOnScreen: isSearchViewOnScreen, onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('TMSearchQueryPanel', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("TMSearchQueryPanel") : undefined, isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: SQD, inputMids: inputMids, onSearchCompleted: onSearchCompleted, onRefreshRequested: onRefreshRequested, onDcmtTypeReloaded: onDcmtTypeReloaded, onSqdSaved: onSqdSaved, showBackToResultButton: showBackToResultButton, onBackToResult: onBackToResult, passToArchiveCallback: passToArchiveCallback, maxDcmtsToBeReturned: maxDcmtsToBeReturned }));
|
|
293
431
|
};
|
|
294
432
|
const TMSavedQuerySelectorWrapper = ({ items, selectedId, allowShowSearch, manageDefault, onRefreshData, onItemClick, onDeleted, refreshFavoriteSavedQueries }) => {
|
|
295
433
|
const { setPanelVisibilityById } = 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';
|
|
@@ -58,10 +58,12 @@ const TMSearchQueryEditor = ({ qd, dcmtTypesList = [], isExpertMode = SDKUI_Glob
|
|
|
58
58
|
const handleItemSelect = useCallback((tid, mid) => {
|
|
59
59
|
if (currentEditingMID !== mid)
|
|
60
60
|
setCurrentEditingMID(mid);
|
|
61
|
-
if (!focusedTidMid || mid !== focusedTidMid.mid) {
|
|
62
|
-
|
|
61
|
+
if (!focusedTidMid || mid !== focusedTidMid.mid || tid !== focusedTidMid.tid) {
|
|
62
|
+
const newFocusedTidMid = { tid: tid, mid: mid };
|
|
63
|
+
setFocusedTidMid(newFocusedTidMid);
|
|
64
|
+
onFocusedMetadataChanged?.(newFocusedTidMid);
|
|
63
65
|
}
|
|
64
|
-
}, [currentEditingMID, focusedTidMid]);
|
|
66
|
+
}, [currentEditingMID, focusedTidMid, onFocusedMetadataChanged]);
|
|
65
67
|
const handleAdvancedMenuClick = useCallback((e) => {
|
|
66
68
|
if (e.button === AdvancedMenuButtons.MakeEditable && e.mid) {
|
|
67
69
|
addOrRemoveEditableList(e.mid);
|
|
@@ -373,7 +375,7 @@ const WhereItemRow = React.memo(({ whereItem, index, dcmtTypesList, isExpertMode
|
|
|
373
375
|
};
|
|
374
376
|
// --- Rendering ---
|
|
375
377
|
if (isCompactView) {
|
|
376
|
-
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 }) }));
|
|
377
379
|
}
|
|
378
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) => {
|
|
379
381
|
onItemChange({ ...whereItem, value1: values[0], value2: values[1] });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DcmtTypeDescriptor, QueryDescriptor, SavedQueryDescriptor, SearchResultDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
interface ITMSearchQueryPanelProps {
|
|
4
|
+
isSearchViewOnScreen?: boolean;
|
|
4
5
|
fromDTD?: DcmtTypeDescriptor;
|
|
5
6
|
SQD?: SavedQueryDescriptor;
|
|
6
7
|
isExpertMode?: boolean;
|
|
@@ -12,7 +13,7 @@ interface ITMSearchQueryPanelProps {
|
|
|
12
13
|
onBack?: () => void;
|
|
13
14
|
onBackToResult?: () => void;
|
|
14
15
|
onSqdSaved?: (newSqd: SavedQueryDescriptor) => void;
|
|
15
|
-
onSearchCompleted?: (searchResult: SearchResultDescriptor[], qd: QueryDescriptor | undefined) => void;
|
|
16
|
+
onSearchCompleted?: (searchResult: SearchResultDescriptor[], qd: QueryDescriptor | undefined, append?: boolean) => void;
|
|
16
17
|
onClosePanel?: () => void;
|
|
17
18
|
allowMaximize?: boolean;
|
|
18
19
|
onMaximizePanel?: () => void;
|
|
@@ -21,10 +22,19 @@ interface ITMSearchQueryPanelProps {
|
|
|
21
22
|
value: string;
|
|
22
23
|
}>, tid?: number) => void;
|
|
23
24
|
maxDcmtsToBeReturned?: number;
|
|
25
|
+
onRefreshRequested?: () => Promise<void>;
|
|
26
|
+
/** Notifica il tipo documento riletto dal server prima di ogni ricerca, così il chiamante allinea il proprio descrittore */
|
|
27
|
+
onDcmtTypeReloaded?: (dtd: DcmtTypeDescriptor) => void;
|
|
24
28
|
}
|
|
25
29
|
declare const TMSearchQueryPanel: React.FunctionComponent<ITMSearchQueryPanelProps>;
|
|
26
30
|
export default TMSearchQueryPanel;
|
|
27
31
|
export declare const refreshLastSearch: (qd: QueryDescriptor | undefined) => Promise<SearchResultDescriptor[] | undefined>;
|
|
28
|
-
export declare const StyledToppyTextContainer: import("styled-components/dist/types").IStyledComponentBase<"web",
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
export declare const StyledToppyTextContainer: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
33
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
34
|
+
}> & string;
|
|
35
|
+
export declare const StyledToppyText: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "style"> & {
|
|
36
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
37
|
+
}> & string;
|
|
38
|
+
export declare const StyledToppyImage: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "style"> & {
|
|
39
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
40
|
+
}> & string;
|