@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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Guscio statico del wait panel: montato una sola volta e mai ri-renderizzato, il manager lo aggiorna via DOM. Le props sono valori iniziali. */
|
|
3
|
+
/** Nodi DOM mutabili di cui il manager ha bisogno per aggiornare il pannello senza React. */
|
|
4
|
+
export interface ITMWaitPanelNodes {
|
|
5
|
+
/** Layer di conferma dell'interruzione: il manager lo accende via style.display. */
|
|
6
|
+
confirm: HTMLElement;
|
|
7
|
+
title: HTMLElement;
|
|
8
|
+
subtitle: HTMLElement;
|
|
9
|
+
percent: HTMLElement;
|
|
10
|
+
fill: HTMLElement;
|
|
11
|
+
elapsed: HTMLElement;
|
|
12
|
+
remaining: HTMLElement;
|
|
13
|
+
okValue: HTMLElement;
|
|
14
|
+
warningValue: HTMLElement;
|
|
15
|
+
errorValue: HTMLElement;
|
|
16
|
+
abortButton: HTMLButtonElement | null;
|
|
17
|
+
/** Presenti solo con `showSecondary`: riga di avanzamento dell'operazione di dettaglio. */
|
|
18
|
+
secondaryText: HTMLElement | null;
|
|
19
|
+
secondaryPercent: HTMLElement | null;
|
|
20
|
+
secondaryFill: HTMLElement | null;
|
|
21
|
+
}
|
|
22
|
+
export interface ITMWaitPanelViewProps {
|
|
23
|
+
/** Valore iniziale del titolo. */
|
|
24
|
+
title?: string;
|
|
25
|
+
/** Valore iniziale del sottotitolo. */
|
|
26
|
+
subtitle?: string;
|
|
27
|
+
/** Mostra il bottone di interruzione. */
|
|
28
|
+
cancelable?: boolean;
|
|
29
|
+
/** Mostra la riga "trascorsi / rimanenti". */
|
|
30
|
+
showEta?: boolean;
|
|
31
|
+
/** Mostra le tre pill numeriche ok / warning / error, sempre visibili anche a 0. */
|
|
32
|
+
showCounters?: boolean;
|
|
33
|
+
/** Riserva la seconda barra, quella dell'operazione di dettaglio (es. i byte del file in corso). */
|
|
34
|
+
showSecondary?: boolean;
|
|
35
|
+
/** Valore iniziale del testo della barra secondaria. */
|
|
36
|
+
secondaryText?: string;
|
|
37
|
+
/** Didascalia fissa sopra la barra principale, es. "Documenti". Vuota: non viene resa. */
|
|
38
|
+
primaryLabel?: string;
|
|
39
|
+
/** Didascalia fissa sopra la barra secondaria, es. "File corrente". Vuota: non viene resa. */
|
|
40
|
+
secondaryLabel?: string;
|
|
41
|
+
/** z-index dell'overlay: il manager lo incrementa per i pannelli annidati. */
|
|
42
|
+
zIndex?: number;
|
|
43
|
+
/** L'utente ha premuto Interrompi: il manager chiede conferma. */
|
|
44
|
+
onAbort?: () => void;
|
|
45
|
+
/** Conferma data: interrompere davvero. */
|
|
46
|
+
onConfirmYes?: () => void;
|
|
47
|
+
/** Conferma negata: riprendere. */
|
|
48
|
+
onConfirmNo?: () => void;
|
|
49
|
+
/** Invocato dopo il commit con i nodi DOM da aggiornare imperativamente. */
|
|
50
|
+
onMount?: (nodes: ITMWaitPanelNodes) => void;
|
|
51
|
+
}
|
|
52
|
+
declare const TMWaitPanelView: ({ title, subtitle, cancelable, showEta, showCounters, showSecondary, secondaryText, primaryLabel, secondaryLabel, zIndex, onAbort, onConfirmYes, onConfirmNo, onMount }: ITMWaitPanelViewProps) => React.JSX.Element;
|
|
53
|
+
export default TMWaitPanelView;
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useLayoutEffect, useRef } from 'react';
|
|
3
|
+
import styled, { keyframes } from 'styled-components';
|
|
4
|
+
import toppy from '../../../assets/Toppy-generico.png';
|
|
5
|
+
import { AppModules, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
6
|
+
import { getAppModuleButtonColors, SDKUI_Localizator } from '../../../helper';
|
|
7
|
+
import TMWaitPanelConfirm from './TMWaitPanelConfirm';
|
|
8
|
+
/** Colore della barra per applicazione, da getAppModuleButtonColors. SDK_Globals.tmSession lancia senza sessione. */
|
|
9
|
+
const getProgressColor = () => {
|
|
10
|
+
let appModuleID = AppModules.SURFER;
|
|
11
|
+
try {
|
|
12
|
+
appModuleID = SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER;
|
|
13
|
+
}
|
|
14
|
+
catch { /* nessuna sessione: resta il default */ }
|
|
15
|
+
return getAppModuleButtonColors(appModuleID).base;
|
|
16
|
+
};
|
|
17
|
+
const fadeIn = keyframes `
|
|
18
|
+
from { opacity: 0; }
|
|
19
|
+
to { opacity: 1; }
|
|
20
|
+
`;
|
|
21
|
+
// Sfondo su uno pseudo-elemento: il layer composito dell'animazione sgranerebbe Toppy.
|
|
22
|
+
const StyledOverlay = styled.div `
|
|
23
|
+
position: fixed;
|
|
24
|
+
inset: 0;
|
|
25
|
+
z-index: ${props => props.$zIndex};
|
|
26
|
+
|
|
27
|
+
&::before {
|
|
28
|
+
content: '';
|
|
29
|
+
position: absolute;
|
|
30
|
+
inset: 0;
|
|
31
|
+
background-color: rgba(17, 24, 39, 0.16);
|
|
32
|
+
animation: ${fadeIn} 140ms ease-out;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
const StyledCard = styled.div `
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 50%;
|
|
38
|
+
left: 50%;
|
|
39
|
+
transform: translate(-50%, -50%);
|
|
40
|
+
width: 420px;
|
|
41
|
+
max-width: calc(100% - 24px);
|
|
42
|
+
max-height: calc(100% - 24px);
|
|
43
|
+
overflow-y: auto;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
padding: 22px 24px 18px 24px;
|
|
46
|
+
background: #ffffff;
|
|
47
|
+
border-radius: 16px;
|
|
48
|
+
box-shadow: 0 18px 48px rgba(16, 24, 40, 0.22);
|
|
49
|
+
font-family: inherit;
|
|
50
|
+
`;
|
|
51
|
+
const StyledHeader = styled.div `
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: 16px;
|
|
56
|
+
`;
|
|
57
|
+
// Ritaglio dal contenitore, non object-fit: cover darebbe un'altezza frazionaria e sgranerebbe l'immagine.
|
|
58
|
+
const StyledToppyClip = styled.div `
|
|
59
|
+
height: 61px;
|
|
60
|
+
width: 68px;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
flex: 0 0 auto;
|
|
63
|
+
`;
|
|
64
|
+
const StyledToppy = styled.img `
|
|
65
|
+
display: block;
|
|
66
|
+
width: 68px;
|
|
67
|
+
height: 79px;
|
|
68
|
+
user-select: none;
|
|
69
|
+
-webkit-user-drag: none;
|
|
70
|
+
`;
|
|
71
|
+
const StyledHeaderText = styled.div `
|
|
72
|
+
flex: 1;
|
|
73
|
+
min-width: 0;
|
|
74
|
+
`;
|
|
75
|
+
const StyledTitle = styled.div `
|
|
76
|
+
font-size: 17px;
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
color: #1f2937;
|
|
79
|
+
line-height: 1.3;
|
|
80
|
+
overflow-wrap: anywhere;
|
|
81
|
+
`;
|
|
82
|
+
const StyledSubtitle = styled.div `
|
|
83
|
+
margin-top: 3px;
|
|
84
|
+
font-size: 13px;
|
|
85
|
+
color: #6b7280;
|
|
86
|
+
line-height: 1.3;
|
|
87
|
+
font-variant-numeric: tabular-nums;
|
|
88
|
+
overflow-wrap: anywhere;
|
|
89
|
+
`;
|
|
90
|
+
// Didascalia di una barra: con due avanzamenti e' l'unica cosa che dice quale sia quale.
|
|
91
|
+
const StyledBarLabel = styled.div `
|
|
92
|
+
margin-top: 18px;
|
|
93
|
+
font-size: 11px;
|
|
94
|
+
font-weight: 700;
|
|
95
|
+
letter-spacing: 0.04em;
|
|
96
|
+
text-transform: uppercase;
|
|
97
|
+
color: #9aa3b2;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
text-overflow: ellipsis;
|
|
100
|
+
white-space: nowrap;
|
|
101
|
+
`;
|
|
102
|
+
const StyledPercentRow = styled.div `
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: row;
|
|
105
|
+
align-items: flex-end;
|
|
106
|
+
justify-content: space-between;
|
|
107
|
+
flex-wrap: wrap;
|
|
108
|
+
gap: 8px 12px;
|
|
109
|
+
margin-top: ${props => (props.$hasLabel ? '4px' : '18px')};
|
|
110
|
+
`;
|
|
111
|
+
const StyledPercent = styled.div `
|
|
112
|
+
font-size: 34px;
|
|
113
|
+
font-weight: 700;
|
|
114
|
+
color: #111827;
|
|
115
|
+
line-height: 1;
|
|
116
|
+
font-variant-numeric: tabular-nums;
|
|
117
|
+
`;
|
|
118
|
+
const StyledCounters = styled.div `
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: row;
|
|
121
|
+
align-items: center;
|
|
122
|
+
gap: 6px;
|
|
123
|
+
padding-bottom: 3px;
|
|
124
|
+
`;
|
|
125
|
+
const StyledPill = styled.span `
|
|
126
|
+
display: inline-flex;
|
|
127
|
+
flex-direction: row;
|
|
128
|
+
align-items: center;
|
|
129
|
+
gap: 4px;
|
|
130
|
+
padding: 2px 8px 2px 6px;
|
|
131
|
+
border-radius: 999px;
|
|
132
|
+
font-size: 12px;
|
|
133
|
+
font-weight: 600;
|
|
134
|
+
line-height: 18px;
|
|
135
|
+
color: ${props => props.$color};
|
|
136
|
+
background: ${props => props.$background};
|
|
137
|
+
font-variant-numeric: tabular-nums;
|
|
138
|
+
|
|
139
|
+
svg { flex: 0 0 auto; }
|
|
140
|
+
`;
|
|
141
|
+
const StyledTrack = styled.div `
|
|
142
|
+
margin-top: 12px;
|
|
143
|
+
width: 100%;
|
|
144
|
+
height: 8px;
|
|
145
|
+
border-radius: 999px;
|
|
146
|
+
background: #e8edf4;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
`;
|
|
149
|
+
const StyledFill = styled.div `
|
|
150
|
+
width: 100%;
|
|
151
|
+
height: 100%;
|
|
152
|
+
background: ${props => props.$color};
|
|
153
|
+
transform: scaleX(0);
|
|
154
|
+
transform-origin: left center;
|
|
155
|
+
transition: transform 120ms linear;
|
|
156
|
+
will-change: transform;
|
|
157
|
+
`;
|
|
158
|
+
const StyledTimeRow = styled.div `
|
|
159
|
+
display: flex;
|
|
160
|
+
flex-direction: row;
|
|
161
|
+
align-items: center;
|
|
162
|
+
justify-content: space-between;
|
|
163
|
+
gap: 12px;
|
|
164
|
+
margin-top: 8px;
|
|
165
|
+
font-size: 12px;
|
|
166
|
+
color: #8a94a6;
|
|
167
|
+
font-variant-numeric: tabular-nums;
|
|
168
|
+
`;
|
|
169
|
+
// Seconda barra: come la principale ma piu' piccola e in tono minore.
|
|
170
|
+
const StyledSecondary = styled.div `
|
|
171
|
+
margin-top: ${props => (props.$hasLabel ? '4px' : '14px')};
|
|
172
|
+
`;
|
|
173
|
+
const StyledSecondaryRow = styled.div `
|
|
174
|
+
display: flex;
|
|
175
|
+
flex-direction: row;
|
|
176
|
+
align-items: baseline;
|
|
177
|
+
justify-content: space-between;
|
|
178
|
+
gap: 12px;
|
|
179
|
+
font-size: 12px;
|
|
180
|
+
color: #6b7280;
|
|
181
|
+
font-variant-numeric: tabular-nums;
|
|
182
|
+
`;
|
|
183
|
+
const StyledSecondaryText = styled.span `
|
|
184
|
+
overflow: hidden;
|
|
185
|
+
text-overflow: ellipsis;
|
|
186
|
+
white-space: nowrap;
|
|
187
|
+
`;
|
|
188
|
+
const StyledSecondaryTrack = styled.div `
|
|
189
|
+
margin-top: 5px;
|
|
190
|
+
width: 100%;
|
|
191
|
+
height: 5px;
|
|
192
|
+
border-radius: 999px;
|
|
193
|
+
background: #eef1f6;
|
|
194
|
+
overflow: hidden;
|
|
195
|
+
`;
|
|
196
|
+
const StyledSecondaryFill = styled.div `
|
|
197
|
+
width: 100%;
|
|
198
|
+
height: 100%;
|
|
199
|
+
background: ${props => props.$color};
|
|
200
|
+
opacity: 0.55;
|
|
201
|
+
transform: scaleX(0);
|
|
202
|
+
transform-origin: left center;
|
|
203
|
+
transition: transform 120ms linear;
|
|
204
|
+
will-change: transform;
|
|
205
|
+
`;
|
|
206
|
+
const StyledFooter = styled.div `
|
|
207
|
+
display: flex;
|
|
208
|
+
flex-direction: row;
|
|
209
|
+
justify-content: flex-end;
|
|
210
|
+
margin-top: 18px;
|
|
211
|
+
`;
|
|
212
|
+
const StyledAbortButton = styled.button `
|
|
213
|
+
padding: 9px 18px;
|
|
214
|
+
border: 1px solid #d5dbe5;
|
|
215
|
+
border-radius: 10px;
|
|
216
|
+
background: #ffffff;
|
|
217
|
+
color: #374151;
|
|
218
|
+
font-size: 13px;
|
|
219
|
+
font-family: inherit;
|
|
220
|
+
cursor: pointer;
|
|
221
|
+
transition: background-color 120ms ease, border-color 120ms ease;
|
|
222
|
+
|
|
223
|
+
&:hover:not(:disabled) { background: #f3f5f9; border-color: #c3cbd8; }
|
|
224
|
+
&:active:not(:disabled) { background: #e9edf4; }
|
|
225
|
+
&:disabled { cursor: default; opacity: 0.55; }
|
|
226
|
+
`;
|
|
227
|
+
const IconOk = () => (_jsx("svg", { width: '13', height: '13', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: '3', strokeLinecap: 'round', strokeLinejoin: 'round', children: _jsx("polyline", { points: '20 6 9 17 4 12' }) }));
|
|
228
|
+
const IconWarning = () => (_jsxs("svg", { width: '13', height: '13', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: '2.4', strokeLinecap: 'round', strokeLinejoin: 'round', children: [_jsx("path", { d: 'M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z' }), _jsx("line", { x1: '12', y1: '9', x2: '12', y2: '13' }), _jsx("line", { x1: '12', y1: '17', x2: '12.01', y2: '17' })] }));
|
|
229
|
+
const IconError = () => (_jsxs("svg", { width: '13', height: '13', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: '3', strokeLinecap: 'round', strokeLinejoin: 'round', children: [_jsx("line", { x1: '18', y1: '6', x2: '6', y2: '18' }), _jsx("line", { x1: '6', y1: '6', x2: '18', y2: '18' })] }));
|
|
230
|
+
const TMWaitPanelView = ({ title = '', subtitle = '', cancelable = false, showEta = true, showCounters = true, showSecondary = false, secondaryText = '', primaryLabel = '', secondaryLabel = '', zIndex = 2147483601, onAbort, onConfirmYes, onConfirmNo, onMount }) => {
|
|
231
|
+
const confirmRef = useRef(null);
|
|
232
|
+
const titleRef = useRef(null);
|
|
233
|
+
const subtitleRef = useRef(null);
|
|
234
|
+
const percentRef = useRef(null);
|
|
235
|
+
const fillRef = useRef(null);
|
|
236
|
+
const elapsedRef = useRef(null);
|
|
237
|
+
const remainingRef = useRef(null);
|
|
238
|
+
const okValueRef = useRef(null);
|
|
239
|
+
const warningValueRef = useRef(null);
|
|
240
|
+
const errorValueRef = useRef(null);
|
|
241
|
+
const abortRef = useRef(null);
|
|
242
|
+
const secondaryTextRef = useRef(null);
|
|
243
|
+
const secondaryPercentRef = useRef(null);
|
|
244
|
+
const secondaryFillRef = useRef(null);
|
|
245
|
+
useLayoutEffect(() => {
|
|
246
|
+
if (!confirmRef.current || !titleRef.current || !subtitleRef.current || !percentRef.current || !fillRef.current)
|
|
247
|
+
return;
|
|
248
|
+
if (!elapsedRef.current || !remainingRef.current)
|
|
249
|
+
return;
|
|
250
|
+
if (!okValueRef.current || !warningValueRef.current || !errorValueRef.current)
|
|
251
|
+
return;
|
|
252
|
+
onMount?.({
|
|
253
|
+
confirm: confirmRef.current,
|
|
254
|
+
title: titleRef.current,
|
|
255
|
+
subtitle: subtitleRef.current,
|
|
256
|
+
percent: percentRef.current,
|
|
257
|
+
fill: fillRef.current,
|
|
258
|
+
elapsed: elapsedRef.current,
|
|
259
|
+
remaining: remainingRef.current,
|
|
260
|
+
okValue: okValueRef.current,
|
|
261
|
+
warningValue: warningValueRef.current,
|
|
262
|
+
errorValue: errorValueRef.current,
|
|
263
|
+
abortButton: abortRef.current,
|
|
264
|
+
secondaryText: secondaryTextRef.current,
|
|
265
|
+
secondaryPercent: secondaryPercentRef.current,
|
|
266
|
+
secondaryFill: secondaryFillRef.current,
|
|
267
|
+
});
|
|
268
|
+
// Montaggio una tantum: da qui in avanti il manager aggiorna il pannello via DOM, non via render.
|
|
269
|
+
}, []);
|
|
270
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledOverlay, { $zIndex: zIndex, children: _jsxs(StyledCard, { role: 'dialog', "aria-live": 'polite', children: [_jsxs(StyledHeader, { children: [_jsx(StyledToppyClip, { children: _jsx(StyledToppy, { src: toppy, alt: '', draggable: false }) }), _jsxs(StyledHeaderText, { children: [_jsx(StyledTitle, { ref: titleRef, children: title }), _jsx(StyledSubtitle, { ref: subtitleRef, children: subtitle })] })] }), primaryLabel && _jsx(StyledBarLabel, { children: primaryLabel }), _jsxs(StyledPercentRow, { $hasLabel: !!primaryLabel, children: [_jsx(StyledPercent, { ref: percentRef, children: "0.00%" }), _jsxs(StyledCounters, { style: { display: showCounters ? 'flex' : 'none' }, children: [_jsxs(StyledPill, { $color: '#3E7B1C', $background: '#E8F5E0', children: [_jsx(IconOk, {}), _jsx("span", { ref: okValueRef, children: "0" })] }), _jsxs(StyledPill, { $color: '#8A6D00', $background: '#FBF3CF', children: [_jsx(IconWarning, {}), _jsx("span", { ref: warningValueRef, children: "0" })] }), _jsxs(StyledPill, { $color: '#B00F2B', $background: '#FBE1E6', children: [_jsx(IconError, {}), _jsx("span", { ref: errorValueRef, children: "0" })] })] })] }), _jsx(StyledTrack, { children: _jsx(StyledFill, { ref: fillRef, $color: getProgressColor() }) }), _jsxs(StyledTimeRow, { style: { visibility: showEta ? 'visible' : 'hidden' }, children: [_jsx("span", { ref: elapsedRef }), _jsx("span", { ref: remainingRef })] }), showSecondary && secondaryLabel && _jsx(StyledBarLabel, { children: secondaryLabel }), showSecondary &&
|
|
271
|
+
_jsxs(StyledSecondary, { $hasLabel: !!secondaryLabel, children: [_jsxs(StyledSecondaryRow, { children: [_jsx(StyledSecondaryText, { ref: secondaryTextRef, children: secondaryText }), _jsx("span", { ref: secondaryPercentRef, children: "0.00%" })] }), _jsx(StyledSecondaryTrack, { children: _jsx(StyledSecondaryFill, { ref: secondaryFillRef, $color: getProgressColor() }) })] }), cancelable &&
|
|
272
|
+
_jsx(StyledFooter, { children: _jsx(StyledAbortButton, { ref: abortRef, type: 'button', onClick: onAbort, children: SDKUI_Localizator.Abort }) })] }) }), _jsx(TMWaitPanelConfirm, { ref: confirmRef, zIndex: zIndex + 1, onYes: onConfirmYes, onNo: onConfirmNo })] }));
|
|
273
|
+
};
|
|
274
|
+
export default TMWaitPanelView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TMWaitPanelManager';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TMWaitPanelManager';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { IconSearch, SDKUI_Localizator } from '../../helper';
|
|
@@ -64,7 +64,7 @@ const TMCultureIDPicker = ({ selectedValue, onSelectCultureID, placeHolder, widt
|
|
|
64
64
|
const isPlaceholder = selectedValue === placeHolder;
|
|
65
65
|
return (_jsxs(StyledDivHorizontal, { style: { width: '100%', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [selectedValue && _jsx("img", { src: getCultureIDImg(selectedValue), alt: "Lang", width: 16, height: 16, style: { marginRight: '8px' } }), selectedValue && _jsx("p", { children: getCultureIDName(selectedValue) })] }));
|
|
66
66
|
};
|
|
67
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { width: width, icon: icon, buttons: buttons, readOnly: readOnly, backgroundColor: backgroundColor, showBorder: true, hasValue: selectedValue !== undefined, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowPicker(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, label: label, openEditorOnSummaryClick: openChooserBySingleClick, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showPicker && _jsx(TMModal, { title: label || SDKUI_Localizator.Select, onClose: () => setShowPicker(false), isModal: true, width: "450px", height: "255px", children: _jsx(PickerContainer, { children: _jsx(ItemsContainer, { children: CULTUREIDs_DATASOURCE.map(item => (_jsxs(CultureItem, {
|
|
67
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { width: width, icon: icon, buttons: buttons, readOnly: readOnly, backgroundColor: backgroundColor, showBorder: true, hasValue: selectedValue !== undefined, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowPicker(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, label: label, openEditorOnSummaryClick: openChooserBySingleClick, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showPicker && _jsx(TMModal, { title: label || SDKUI_Localizator.Select, onClose: () => setShowPicker(false), isModal: true, width: "450px", height: "255px", children: _jsx(PickerContainer, { children: _jsx(ItemsContainer, { children: CULTUREIDs_DATASOURCE.map(item => (_jsxs(CultureItem, { $isSelected: item.value === selectedValue, onClick: () => {
|
|
68
68
|
onSelectCultureID(item.value);
|
|
69
69
|
setShowPicker(false);
|
|
70
70
|
}, children: [_jsx(FlagIcon, { children: item.icon }), _jsx("span", { children: item.display })] }, item.value))) }) }) })] }));
|
|
@@ -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, { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { SDK_Localizator, DataListCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { StyledDivHorizontal } from '../base/Styled';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import styled, { keyframes } from 'styled-components';
|
|
4
4
|
import { DataListCacheService, SDK_Localizator, ObjectClasses, JobTypes } from '@topconsultnpm/sdk-ts';
|
|
@@ -255,6 +255,6 @@ const TMDataListItemPicker = ({ dataListID, selectedValue, onItemSelect, onItemE
|
|
|
255
255
|
if (!dataList || !items || items.length === 0) {
|
|
256
256
|
return (_jsxs(PickerContainer, { children: [_jsx(Label, { children: dataList ? `${SDK_Localizator.DataList}: ${dataList.name}` : SDKUI_Localizator.NoDataToDisplay }), _jsx(ItemsContainer, { children: allowEdit && (_jsxs(AddButton, { onClick: handleCreateNew, children: ["+ ", SDKUI_Localizator.NewMale] })) }), !allowEdit && _jsx("p", { children: SDKUI_Localizator.NoDataToDisplay })] }));
|
|
257
257
|
}
|
|
258
|
-
return (_jsxs(PickerContainer, { children: [_jsx(Label, { children: `${SDK_Localizator.DataList}: ${dataList.name}` }), _jsxs(ItemsContainer, { children: [items.map((item, index) => (_jsxs(ItemWrapper, { children: [_jsxs(StatusItem, {
|
|
258
|
+
return (_jsxs(PickerContainer, { children: [_jsx(Label, { children: `${SDK_Localizator.DataList}: ${dataList.name}` }), _jsxs(ItemsContainer, { children: [items.map((item, index) => (_jsxs(ItemWrapper, { children: [_jsxs(StatusItem, { $isSelected: item.value === selectedValue, $index: index, onClick: () => onItemSelect(item), onDoubleClick: () => allowEdit && handleEdit(item), children: [item.imageID && _jsx(TMImageLibrary, { imageID: item.imageID }), _jsx("span", { children: item.name })] }), allowEdit && (_jsx(DeleteButton, { onClick: (e) => handleDelete(item, e), title: SDKUI_Localizator.Delete || 'Delete', "aria-label": "Delete item", children: _jsx(IconDelete, { fontSize: 16 }) }))] }, item.value))), allowEdit && (_jsxs(AddButton, { onClick: handleCreateNew, children: ["+ ", SDKUI_Localizator.NewMale] }))] }), _jsx(TMDataListItemEditor, { isOpen: showEditDialog, item: editingItem, isCreating: isCreating, onClose: handleCloseDialog, onSave: handleSave })] }));
|
|
259
259
|
};
|
|
260
260
|
export default TMDataListItemPicker;
|
|
@@ -1,13 +1,14 @@
|
|
|
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 { AccessLevelsEx, DcmtTypeListCacheService, SDK_Globals, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import TMSpinner from '../base/TMSpinner';
|
|
5
5
|
import { IconSearch, SDKUI_Localizator } from '../../helper';
|
|
6
|
+
import { FontSize } from '../../utils/theme';
|
|
6
7
|
import { StyledDivHorizontal } from '../base/Styled';
|
|
7
8
|
import TMTidViewer, { TMDcmtTypeIcon } from '../viewers/TMTidViewer';
|
|
8
9
|
import TMSummary from '../editors/TMSummary';
|
|
9
10
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
10
|
-
const TMDcmtTypeChooser = ({ tmSession, dataSource, disabled, backgroundColor, filter, accessFilter = 'all', showEditButton = true, borderRadius = '4px', buttons = [], placeHolder = `<${SDKUI_Localizator.NoneSelection}>`, openEditorOnSummaryClick, showBorder = true, showId = false, elementStyle, allowMultipleSelection, ShowOnlyDcmtTypes, ShowOnlySAP, filterTemplateTID, values, isModifiedWhen, label, width, height, showClearButton = false, validationItems = [], onValueChanged, updateIsModalOpen }) => {
|
|
11
|
+
const TMDcmtTypeChooser = ({ tmSession, dataSource, disabled, backgroundColor, icon, filter, accessFilter = 'all', showEditButton = true, borderRadius = '4px', fontSize = FontSize.defaultFontSize, buttons = [], placeHolder = `<${SDKUI_Localizator.NoneSelection}>`, openEditorOnSummaryClick, showBorder = true, showId = false, elementStyle, allowMultipleSelection, ShowOnlyDcmtTypes, ShowOnlySAP, filterTemplateTID, values, isModifiedWhen, label, width, height, showClearButton = false, validationItems = [], onValueChanged, updateIsModalOpen }) => {
|
|
11
12
|
const [showChooser, setShowChooser] = useState(false);
|
|
12
13
|
useEffect(() => {
|
|
13
14
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.ListDcmtTypeOrView} ...` });
|
|
@@ -15,9 +16,9 @@ const TMDcmtTypeChooser = ({ tmSession, dataSource, disabled, backgroundColor, f
|
|
|
15
16
|
DcmtTypeListCacheService.GetFromTIDsAsync(values, false, tms).then(() => { TMSpinner.hide(); });
|
|
16
17
|
}, [values]);
|
|
17
18
|
const renderTemplate = () => {
|
|
18
|
-
return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && _jsx(TMTidViewer, { tmSession: tmSession, tid: values[0], showIcon: true, showId: showId, noneSelectionText: placeHolder }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
|
19
|
+
return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && _jsx(TMTidViewer, { tmSession: tmSession, tid: values[0], color: 'inherit', showIcon: true, showId: showId, noneSelectionText: placeHolder }), values && values.length > 1 && _jsx("p", { style: { margin: 0, marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
|
19
20
|
};
|
|
20
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, borderRadius: borderRadius, hasValue: values && values.length > 0, showClearButton: showClearButton, showEditButton: showEditButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => {
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { backgroundColor: backgroundColor, icon: icon, disabled: disabled, fontSize: fontSize, buttons: buttons, showBorder: showBorder, borderRadius: borderRadius, hasValue: values && values.length > 0, showClearButton: showClearButton, showEditButton: showEditButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => {
|
|
21
22
|
if (!disabled) {
|
|
22
23
|
setShowChooser(true);
|
|
23
24
|
updateIsModalOpen?.(true);
|
|
@@ -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, useMemo, useState } from 'react';
|
|
3
3
|
import { SDK_Localizator, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { StyledDivHorizontal } from '../base/Styled';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LayoutModes } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { TMDistinctValuesEventArgs } from '../../hooks/useTMDistinctValuesSelection';
|
|
3
4
|
interface ITMDistinctValues {
|
|
4
5
|
tid: number | undefined;
|
|
5
6
|
mid: number | undefined;
|
|
@@ -8,14 +9,15 @@ interface ITMDistinctValues {
|
|
|
8
9
|
allowAppendMode?: boolean;
|
|
9
10
|
showHeader?: boolean;
|
|
10
11
|
isModal?: boolean;
|
|
11
|
-
onSelectionChanged?: (e:
|
|
12
|
+
onSelectionChanged?: (e: TMDistinctValuesEventArgs) => void;
|
|
12
13
|
onClosePanelCallback?: () => void;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Pannello da cui si preleva il valore di un campo del form scegliendolo fra quelli già archiviati.
|
|
17
|
+
*
|
|
18
|
+
* Le due sorgenti (valori distinti del metadato e ricerca rapida su una ricerca salvata) stanno in due hook
|
|
19
|
+
* dedicati che espongono la stessa interfaccia (righe, colonne, conteggi): qui restano la composizione,
|
|
20
|
+
* la scelta della sorgente da mostrare e il render.
|
|
21
|
+
*/
|
|
20
22
|
declare const TMDistinctValues: React.FC<ITMDistinctValues>;
|
|
21
23
|
export default TMDistinctValues;
|