@topconsultnpm/sdkui-react 6.21.0-t1 → 6.21.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 +22 -1
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +4 -4
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +10 -10
- package/lib/components/base/Styled.d.ts +1 -1
- package/lib/components/base/TMAccordionNew.d.ts +1 -0
- package/lib/components/base/TMAccordionNew.js +6 -5
- package/lib/components/base/TMAreaManager.js +30 -3
- package/lib/components/base/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +2 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMDataGrid.js +14 -4
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMDataGridExportForm.js +19 -8
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.js +4 -4
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +3 -3
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +7 -0
- package/lib/components/base/TMFileManagerUtils.js +14 -1
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +2 -1
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMModal.d.ts +1 -0
- package/lib/components/base/TMModal.js +4 -4
- package/lib/components/base/TMPanel.d.ts +7 -4
- package/lib/components/base/TMPanel.js +58 -26
- package/lib/components/base/TMPopUp.d.ts +1 -0
- package/lib/components/base/TMPopUp.js +59 -2
- package/lib/components/base/TMSpinner.d.ts +5 -2
- package/lib/components/base/TMSpinner.js +33 -6
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +1 -1
- package/lib/components/base/TMTreeView.js +24 -17
- package/lib/components/base/TMUserAvatar.d.ts +2 -1
- package/lib/components/base/TMVilViewer.d.ts +2 -1
- package/lib/components/base/TMWaitPanel.d.ts +5 -2
- package/lib/components/base/TMWaitPanel.js +14 -9
- package/lib/components/choosers/TMDistinctValues.js +35 -21
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.js +6 -1
- package/lib/components/choosers/TMGroupChooser.js +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMUserChooser.d.ts +6 -2
- package/lib/components/choosers/TMUserChooser.js +7 -5
- package/lib/components/editors/TMDateBox.js +4 -2
- package/lib/components/editors/TMEditorStyled.d.ts +6 -6
- package/lib/components/editors/TMFormulaEditor.d.ts +4 -1
- package/lib/components/editors/TMFormulaEditor.js +125 -22
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMMetadataEditor.js +6 -2
- package/lib/components/editors/TMMetadataValues.js +25 -7
- package/lib/components/editors/TMRadioButton.js +7 -5
- package/lib/components/editors/TMTextArea.d.ts +2 -0
- package/lib/components/editors/TMTextArea.js +6 -3
- package/lib/components/editors/TMTextBox.d.ts +2 -0
- package/lib/components/editors/TMTextBox.js +3 -3
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/archive/TMArchive.js +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/blog/TMBlogCommentForm.js +5 -2
- package/lib/components/features/documents/TMCopyToFolderForm.d.ts +24 -0
- package/lib/components/features/documents/TMCopyToFolderForm.js +401 -0
- package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtForm.js +166 -54
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +259 -60
- package/lib/components/features/documents/TMDcmtIcon.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtIcon.js +1 -1
- package/lib/components/features/documents/TMDcmtPreview.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtPreview.js +2 -2
- package/lib/components/features/documents/TMDcmtTasks.d.ts +3 -1
- package/lib/components/features/documents/TMDcmtTasks.js +2 -2
- package/lib/components/features/documents/TMDownloadRelationViewerSection.d.ts +23 -0
- package/lib/components/features/documents/TMDownloadRelationViewerSection.js +173 -0
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +1 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +28 -9
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +24 -0
- package/lib/components/features/documents/TMMergeToPdfForm.js +309 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +13 -0
- package/lib/components/features/documents/TMRelationViewer.js +80 -6
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +58 -0
- package/lib/components/features/documents/copyAndMergeDcmtsShared.js +266 -0
- package/lib/components/features/search/SignatureParamsManager.d.ts +70 -0
- package/lib/components/features/search/SignatureParamsManager.js +145 -0
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +18 -0
- package/lib/components/features/search/TMMetadataOutputForm.js +225 -0
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +18 -0
- package/lib/components/features/search/TMMetadataSorterForm.js +243 -0
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +3 -3
- package/lib/components/features/search/TMSavedQuerySelector.js +3 -2
- package/lib/components/features/search/TMSearch.d.ts +4 -1
- package/lib/components/features/search/TMSearch.js +16 -10
- package/lib/components/features/search/TMSearchQueryEditor.js +14 -8
- package/lib/components/features/search/TMSearchQueryPanel.js +250 -59
- package/lib/components/features/search/TMSearchResult.d.ts +3 -0
- package/lib/components/features/search/TMSearchResult.js +154 -38
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
- package/lib/components/features/search/TMViewHistoryDcmt.js +2 -3
- package/lib/components/features/search/metadataFormHelper.d.ts +16 -0
- package/lib/components/features/search/metadataFormHelper.js +77 -0
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
- package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
- package/lib/components/features/workflow/TMWorkflowPopup.js +3 -0
- package/lib/components/features/workflow/diagram/queryDescriptorParser.js +3 -6
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/Login/TMLoginForm.d.ts +9 -0
- package/lib/components/forms/Login/TMLoginForm.js +76 -3
- package/lib/components/forms/TMChooserForm.d.ts +2 -1
- package/lib/components/forms/TMResultDialog.d.ts +1 -1
- package/lib/components/forms/TMResultDialog.js +4 -2
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +3 -1
- package/lib/components/grids/TMBlogAttachments.js +39 -13
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.js +12 -4
- package/lib/components/grids/TMBlogsPostUtils.d.ts +10 -9
- package/lib/components/grids/TMBlogsPostUtils.js +14 -18
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +1 -1
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/pages/TMPage.js +3 -1
- package/lib/components/query/TMQueryEditor.js +2 -2
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- package/lib/components/sidebar/TMHeader.d.ts +3 -3
- package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.js +1 -1
- package/lib/components/wizard/TMWizard.d.ts +1 -0
- package/lib/components/wizard/TMWizard.js +5 -3
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/GlobalStyles.js +6 -0
- package/lib/helper/MergePdfManager.d.ts +45 -0
- package/lib/helper/MergePdfManager.js +148 -0
- package/lib/helper/SDKUI_Globals.d.ts +15 -0
- package/lib/helper/SDKUI_Globals.js +16 -1
- package/lib/helper/SDKUI_Localizator.d.ts +112 -2
- package/lib/helper/SDKUI_Localizator.js +1120 -12
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +278 -278
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMPdfViewer.js +25 -24
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +25 -1
- package/lib/helper/TMUtils.js +72 -0
- package/lib/helper/ZipManager.d.ts +56 -0
- package/lib/helper/ZipManager.js +127 -0
- package/lib/helper/checkinCheckoutManager.d.ts +4 -3
- package/lib/helper/checkinCheckoutManager.js +29 -11
- package/lib/helper/helpers.d.ts +3 -2
- package/lib/helper/helpers.js +1 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +4 -3
- package/lib/hooks/useDataUserIdItem.js +6 -4
- package/lib/hooks/useDcmtOperations.d.ts +26 -2
- package/lib/hooks/useDcmtOperations.js +292 -38
- package/lib/hooks/useDocumentOperations.d.ts +3 -0
- package/lib/hooks/useDocumentOperations.js +254 -26
- package/lib/hooks/useForm.js +5 -2
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/hooks/useRelatedDocuments.js +4 -4
- package/lib/hooks/useResizeObserver.d.ts +1 -1
- package/lib/hooks/useResizeObserver.js +16 -15
- package/lib/services/platform_services.d.ts +7 -6
- package/lib/ts/types.d.ts +3 -1
- package/lib/ts/types.js +1 -0
- package/package.json +15 -7
|
@@ -9,23 +9,28 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
|
|
|
9
9
|
if (!focusedItem)
|
|
10
10
|
return;
|
|
11
11
|
let newFocusedItem = null;
|
|
12
|
+
let handled = false;
|
|
12
13
|
switch (event.key) {
|
|
13
14
|
case 'ArrowDown':
|
|
14
15
|
newFocusedItem = findNextItem(dataSource, focusedItem);
|
|
16
|
+
handled = true;
|
|
15
17
|
break;
|
|
16
18
|
case 'ArrowUp':
|
|
17
19
|
newFocusedItem = findPreviousItem(dataSource, focusedItem);
|
|
20
|
+
handled = true;
|
|
18
21
|
break;
|
|
19
22
|
case '+':
|
|
20
23
|
if (!focusedItem.expanded) {
|
|
21
24
|
handleNodeToggle(focusedItem.key, false);
|
|
22
25
|
newFocusedItem = { ...focusedItem, expanded: true };
|
|
26
|
+
handled = true;
|
|
23
27
|
}
|
|
24
28
|
break;
|
|
25
29
|
case '-':
|
|
26
30
|
if (focusedItem.expanded) {
|
|
27
31
|
handleNodeToggle(focusedItem.key, false);
|
|
28
32
|
newFocusedItem = { ...focusedItem, expanded: false };
|
|
33
|
+
handled = true;
|
|
29
34
|
}
|
|
30
35
|
break;
|
|
31
36
|
// case ' ':
|
|
@@ -40,12 +45,17 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
|
|
|
40
45
|
default:
|
|
41
46
|
break;
|
|
42
47
|
}
|
|
48
|
+
if (handled) {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
event.stopPropagation();
|
|
51
|
+
}
|
|
43
52
|
if (newFocusedItem)
|
|
44
53
|
onFocusedItemChanged?.(newFocusedItem);
|
|
45
54
|
};
|
|
46
|
-
|
|
55
|
+
// Usa capture: true per intercettare l'evento PRIMA che DevExtreme Popup lo gestisca
|
|
56
|
+
window.addEventListener('keydown', handleKeyDown, true);
|
|
47
57
|
return () => {
|
|
48
|
-
window.removeEventListener('keydown', handleKeyDown);
|
|
58
|
+
window.removeEventListener('keydown', handleKeyDown, true);
|
|
49
59
|
};
|
|
50
60
|
}, [focusedItem, dataSource, onFocusedItemChanged]);
|
|
51
61
|
const findNextItem = (nodes, currentItem) => {
|
|
@@ -128,22 +138,19 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
|
|
|
128
138
|
}
|
|
129
139
|
if (delayFocus) {
|
|
130
140
|
// Logica per il ritardo del focus (es. click singolo su icona desktop, gestito dal padre)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
// Il focus viene ritardato per permettere al doppio click di registrarsi sull'icona,
|
|
142
|
+
// ma il focus avviene comunque (sia con click singolo che doppio)
|
|
143
|
+
if (!clickTimeoutRef.current) {
|
|
144
|
+
// Primo click: imposta il timer per il focus
|
|
145
|
+
lastClickedNodeKeyRef.current = node.key;
|
|
146
|
+
clickTimeoutRef.current = setTimeout(() => {
|
|
147
|
+
onFocusedItemChanged?.(node);
|
|
148
|
+
clickTimeoutRef.current = null;
|
|
149
|
+
lastClickedNodeKeyRef.current = undefined;
|
|
150
|
+
}, 200);
|
|
138
151
|
}
|
|
139
|
-
//
|
|
140
|
-
|
|
141
|
-
clickTimeoutRef.current = setTimeout(() => {
|
|
142
|
-
// Se il timer scade, significa che è stato solo un click singolo.
|
|
143
|
-
onFocusedItemChanged?.(node);
|
|
144
|
-
clickTimeoutRef.current = null;
|
|
145
|
-
lastClickedNodeKeyRef.current = undefined;
|
|
146
|
-
}, 200);
|
|
152
|
+
// Se c'è già un timer attivo (secondo click di doppio click), non fare nulla
|
|
153
|
+
// Il focus avverrà comunque quando scade il timer del primo click
|
|
147
154
|
}
|
|
148
155
|
else {
|
|
149
156
|
// Logica per il focus immediato (per tutti gli altri click, o se shouldDelayFocusOnEvent è false)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface TMUserAvatarProps {
|
|
2
3
|
displayName: string;
|
|
3
4
|
nameForColorCalculation: string;
|
|
4
5
|
tooltipName?: string;
|
|
5
6
|
returnType?: 'jsx' | 'svg';
|
|
6
7
|
}
|
|
7
|
-
declare const TMUserAvatar: (props: TMUserAvatarProps) => string |
|
|
8
|
+
declare const TMUserAvatar: (props: TMUserAvatarProps) => string | React.JSX.Element;
|
|
8
9
|
export default TMUserAvatar;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
declare const TMVilViewer: ({ vil }: {
|
|
3
4
|
vil?: ValidationItem[];
|
|
4
|
-
}) =>
|
|
5
|
+
}) => React.JSX.Element | null;
|
|
5
6
|
export default TMVilViewer;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ITMLayoutContainerProps } from './TMLayout';
|
|
2
3
|
interface ITMWaitPanelProps {
|
|
3
4
|
title?: string;
|
|
@@ -12,8 +13,9 @@ interface ITMWaitPanelProps {
|
|
|
12
13
|
isCancelable?: boolean;
|
|
13
14
|
abortController?: AbortController;
|
|
14
15
|
onAbortClick?: (abortController: AbortController | undefined) => void;
|
|
16
|
+
useHighZIndex?: boolean;
|
|
15
17
|
}
|
|
16
|
-
export declare const TMWaitPanel: (props: ITMWaitPanelProps) =>
|
|
18
|
+
export declare const TMWaitPanel: (props: ITMWaitPanelProps) => React.JSX.Element;
|
|
17
19
|
interface ITMLayoutWaitingContainerProps extends ITMLayoutContainerProps {
|
|
18
20
|
showWaitPanel?: boolean;
|
|
19
21
|
waitPanelTitle?: string;
|
|
@@ -27,6 +29,7 @@ interface ITMLayoutWaitingContainerProps extends ITMLayoutContainerProps {
|
|
|
27
29
|
waitPanelMaxValueSecondary?: number;
|
|
28
30
|
isCancelable?: boolean;
|
|
29
31
|
abortController?: AbortController;
|
|
32
|
+
usePortal?: boolean;
|
|
30
33
|
}
|
|
31
|
-
export declare const TMLayoutWaitingContainer: ({ showWaitPanel, showWaitPanelPrimary, showWaitPanelSecondary, waitPanelTitle, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, isCancelable, abortController, gap, onClick, justifyContent, alignItems, children, direction }: ITMLayoutWaitingContainerProps) =>
|
|
34
|
+
export declare const TMLayoutWaitingContainer: ({ showWaitPanel, showWaitPanelPrimary, showWaitPanelSecondary, waitPanelTitle, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, isCancelable, abortController, usePortal, gap, onClick, justifyContent, alignItems, children, direction }: ITMLayoutWaitingContainerProps) => React.JSX.Element;
|
|
32
35
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
import TMLayoutContainer from './TMLayout';
|
|
4
5
|
import { SDKUI_Localizator } from '../../helper';
|
|
@@ -8,7 +9,7 @@ const StyledWaitPanelOverlay = styled.div `
|
|
|
8
9
|
position: fixed;
|
|
9
10
|
top: 0;
|
|
10
11
|
left: 0;
|
|
11
|
-
z-index: 1501;
|
|
12
|
+
z-index: ${props => props.$useHighZIndex ? 2000000001 : 1501};
|
|
12
13
|
transition: all;
|
|
13
14
|
overflow: visible;
|
|
14
15
|
background-color: rgba(0, 0, 0, 0.4);
|
|
@@ -18,13 +19,16 @@ const StyledWaitPanel = styled.div `
|
|
|
18
19
|
top: 50%;
|
|
19
20
|
left: 50%;
|
|
20
21
|
transform: translate(-50%, -50%);
|
|
21
|
-
width: 300px;
|
|
22
|
-
|
|
22
|
+
width: 300px;
|
|
23
|
+
max-width: calc(100% - 20px);
|
|
24
|
+
height: auto;
|
|
25
|
+
max-height: calc(100% - 20px);
|
|
23
26
|
background: white;
|
|
24
27
|
border-radius: 8px;
|
|
25
28
|
padding: 10px;
|
|
26
29
|
text-align: center;
|
|
27
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
|
30
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
|
31
|
+
overflow: auto;
|
|
28
32
|
`;
|
|
29
33
|
const StyledTitle = styled.h2 ` margin: 0; font-size: 1.5em; color: #333; `;
|
|
30
34
|
const StyledProgressBarContainer = styled.div ` width: 100%; height: 20px; background: #e0e0e0; border-radius: 10px; overflow: hidden; margin: 20px 0; `;
|
|
@@ -33,7 +37,7 @@ const StyledProgressText = styled.p ` font-weight: bold; color: #333; margin: 0;
|
|
|
33
37
|
const StyledMessage = styled.p ` color: #666; font-size: 0.9em; margin-top: 10px; `;
|
|
34
38
|
const StyledAbortButton = styled.button ` background: #ff4d4d; color: white; border: none; border-radius: 5px; padding: 10px 20px; font-size: 1em; cursor: pointer; margin-top: 20px; &:hover { background: #ff6666; } `;
|
|
35
39
|
export const TMWaitPanel = (props) => {
|
|
36
|
-
const { title, showPrimary, textPrimary, valuePrimary, maxValuePrimary, showSecondary, textSecondary, valueSecondary, maxValueSecondary, isCancelable, abortController, onAbortClick } = props;
|
|
40
|
+
const { title, showPrimary, textPrimary, valuePrimary, maxValuePrimary, showSecondary, textSecondary, valueSecondary, maxValueSecondary, isCancelable, abortController, onAbortClick, useHighZIndex } = props;
|
|
37
41
|
const calculateProgress = (value = 0, maxValue = 0) => {
|
|
38
42
|
if (maxValue === 0)
|
|
39
43
|
return 0;
|
|
@@ -42,10 +46,11 @@ export const TMWaitPanel = (props) => {
|
|
|
42
46
|
};
|
|
43
47
|
let progressValue1 = calculateProgress(valuePrimary, maxValuePrimary);
|
|
44
48
|
let progressValue2 = calculateProgress(valueSecondary, maxValueSecondary);
|
|
45
|
-
return (_jsx(StyledWaitPanelOverlay, { children: _jsxs(StyledWaitPanel, {
|
|
49
|
+
return (_jsx(StyledWaitPanelOverlay, { "$useHighZIndex": useHighZIndex, children: _jsxs(StyledWaitPanel, { children: [_jsx(StyledTitle, { children: title }), showPrimary &&
|
|
46
50
|
_jsxs("div", { style: { width: '100%', height: '100px' }, children: [_jsx(StyledProgressBarContainer, { children: _jsx(StyledProgressBar, { style: { width: `${progressValue1.toFixed(2)}%` } }) }), _jsxs(StyledProgressText, { children: [progressValue1.toFixed(2), "%"] }), _jsx(StyledMessage, { children: textPrimary })] }), showSecondary &&
|
|
47
51
|
_jsxs("div", { style: { width: '100%', height: '100px' }, children: [_jsx(StyledProgressBarContainer, { children: _jsx(StyledProgressBar, { style: { width: `${progressValue2.toFixed(2)}%` } }) }), _jsxs(StyledProgressText, { children: [progressValue2.toFixed(2), "%"] }), _jsx(StyledMessage, { children: textSecondary })] }), isCancelable && _jsx(StyledAbortButton, { onClick: () => onAbortClick?.(abortController), children: SDKUI_Localizator.Abort })] }) }));
|
|
48
52
|
};
|
|
49
|
-
export const TMLayoutWaitingContainer = ({ showWaitPanel, showWaitPanelPrimary, showWaitPanelSecondary, waitPanelTitle, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, isCancelable, abortController, gap = 3, onClick, justifyContent = 'flex-start', alignItems = 'flex-start', children, direction = 'vertical' }) => {
|
|
50
|
-
|
|
53
|
+
export const TMLayoutWaitingContainer = ({ showWaitPanel, showWaitPanelPrimary, showWaitPanelSecondary, waitPanelTitle, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, isCancelable, abortController, usePortal = false, gap = 3, onClick, justifyContent = 'flex-start', alignItems = 'flex-start', children, direction = 'vertical' }) => {
|
|
54
|
+
const waitPanelElement = showWaitPanel ? (_jsx(TMWaitPanel, { title: waitPanelTitle, showPrimary: showWaitPanelPrimary, textPrimary: waitPanelTextPrimary, valuePrimary: waitPanelValuePrimary, maxValuePrimary: waitPanelMaxValuePrimary, showSecondary: showWaitPanelSecondary, textSecondary: waitPanelTextSecondary, valueSecondary: waitPanelValueSecondary, maxValueSecondary: waitPanelMaxValueSecondary, isCancelable: isCancelable, abortController: abortController, onAbortClick: (abortController) => { setTimeout(() => { abortController?.abort(); }, 1000); }, useHighZIndex: usePortal })) : null;
|
|
55
|
+
return (_jsxs(_Fragment, { children: [usePortal && waitPanelElement && createPortal(waitPanelElement, document.body), _jsxs(TMLayoutContainer, { gap: gap, justifyContent: justifyContent, alignItems: alignItems, direction: direction, children: [children, !usePortal && waitPanelElement] })] }));
|
|
51
56
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { LayoutModes, MetadataDataDomains, AccessLevels, MetadataDataTypes, SDK_Globals, DcmtTypeListCacheService, DataColumnTypes } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { LayoutModes, MetadataDataDomains, AccessLevels, MetadataDataTypes, SDK_Globals, DcmtTypeListCacheService, DataColumnTypes, DataListViewModes } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { SDKUI_Localizator, stringIsNullOrEmpty } from '../../helper';
|
|
6
6
|
import TMDataGrid, { TMDataGridPageSize } from '../base/TMDataGrid';
|
|
@@ -9,14 +9,17 @@ import TMSpinner from '../base/TMSpinner';
|
|
|
9
9
|
import TMCheckBox from '../editors/TMCheckBox';
|
|
10
10
|
import TMPanel from '../base/TMPanel';
|
|
11
11
|
import TMModal from '../base/TMModal';
|
|
12
|
+
import { useDataListItem } from '../../hooks/useDataListItem';
|
|
13
|
+
import { useDataUserIdItem } from '../../hooks/useDataUserIdItem';
|
|
12
14
|
const StyledDistinctValues = styled.div `display: flex; flex-direction: column; height: 100%; overflow: hidden; gap: 10px;`;
|
|
13
|
-
const StyledPanelContainer = styled.div ` width: 100%; height: 100%; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; `;
|
|
14
15
|
const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppendMode = true, showHeader = true, isModal, separator = " ", onSelectionChanged, onClosePanelCallback }) => {
|
|
15
16
|
const [focusedItem, setFocusedItem] = useState();
|
|
16
17
|
const [dataSource, setDataSource] = useState([]);
|
|
17
18
|
const [isAppendMode, setIsAppendMode] = useState(false);
|
|
18
19
|
const [md, setMd] = useState();
|
|
19
20
|
const [currentValue, setCurrentValue] = useState('');
|
|
21
|
+
const { loadDataListsAsync, renderDataListCell, dataListsCache } = useDataListItem();
|
|
22
|
+
const { loadUsersAsync, renderUserIdViewer, usersCache } = useDataUserIdItem();
|
|
20
23
|
useEffect(() => {
|
|
21
24
|
getDistictValuesAsync();
|
|
22
25
|
}, [mid]);
|
|
@@ -57,8 +60,23 @@ const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppend
|
|
|
57
60
|
try {
|
|
58
61
|
TMSpinner.show({ description: 'Caricamento dei valori distinti...' });
|
|
59
62
|
let dtd = await DcmtTypeListCacheService.GetAsync(tid, true);
|
|
60
|
-
|
|
63
|
+
const currentMd = dtd?.metadata?.find(o => o.id === mid);
|
|
64
|
+
setMd(currentMd);
|
|
61
65
|
let result = await SDK_Globals.tmSession?.NewSearchEngine().GetDistinctValuesAsync(tid, mid, 10000);
|
|
66
|
+
// Load DataList or UserID cache based on metadata domain
|
|
67
|
+
if (currentMd?.dataDomain === MetadataDataDomains.DataList && currentMd.dataListID) {
|
|
68
|
+
await loadDataListsAsync(new Set([currentMd.dataListID]));
|
|
69
|
+
}
|
|
70
|
+
if (currentMd?.dataDomain === MetadataDataDomains.UserID && result?.dtdResult?.rows) {
|
|
71
|
+
const userIDs = new Set();
|
|
72
|
+
result.dtdResult.rows.forEach((row) => {
|
|
73
|
+
const userId = Number(row[0]);
|
|
74
|
+
if (userId && userId > 0) {
|
|
75
|
+
userIDs.add(userId);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
await loadUsersAsync(userIDs);
|
|
79
|
+
}
|
|
62
80
|
setDataSource(convertDataTableToObject(result?.dtdResult));
|
|
63
81
|
}
|
|
64
82
|
catch (e) {
|
|
@@ -69,31 +87,27 @@ const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppend
|
|
|
69
87
|
TMSpinner.hide();
|
|
70
88
|
}
|
|
71
89
|
};
|
|
72
|
-
const getDcmtTypeAsync = async () => {
|
|
73
|
-
if (!tid)
|
|
74
|
-
return;
|
|
75
|
-
try {
|
|
76
|
-
TMSpinner.show({ description: 'Caricamento dei valori distinti...' });
|
|
77
|
-
let dtd = await DcmtTypeListCacheService.GetAsync(tid, true);
|
|
78
|
-
setMd(dtd?.metadata?.find(o => o.id === mid));
|
|
79
|
-
}
|
|
80
|
-
catch (e) {
|
|
81
|
-
let err = e;
|
|
82
|
-
TMExceptionBoxManager.show({ exception: err });
|
|
83
|
-
}
|
|
84
|
-
finally {
|
|
85
|
-
TMSpinner.hide();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
90
|
const onFocusedRowChanged = useCallback((e) => {
|
|
89
91
|
setFocusedItem(e.row?.data);
|
|
90
92
|
}, []);
|
|
93
|
+
const valueCellRender = useCallback((cellData) => {
|
|
94
|
+
if (!cellData || cellData.value === undefined)
|
|
95
|
+
return null;
|
|
96
|
+
if (md?.dataDomain === MetadataDataDomains.DataList && md.dataListID) {
|
|
97
|
+
return renderDataListCell(cellData.value, md.dataListID, md.dataListViewMode ?? DataListViewModes.None);
|
|
98
|
+
}
|
|
99
|
+
if (md?.dataDomain === MetadataDataDomains.UserID) {
|
|
100
|
+
return renderUserIdViewer(Number(cellData.value), true);
|
|
101
|
+
}
|
|
102
|
+
return _jsx("div", { children: cellData.text });
|
|
103
|
+
}, [md, renderDataListCell, renderUserIdViewer]);
|
|
91
104
|
const customColumns = useMemo(() => {
|
|
105
|
+
const needsCellRender = md?.dataDomain === MetadataDataDomains.DataList || md?.dataDomain === MetadataDataDomains.UserID;
|
|
92
106
|
return ([
|
|
93
|
-
{ dataField: 'value', dataType: md?.dataType === MetadataDataTypes.DateTime ? 'date' : 'string', caption: md?.nameLoc, width: 'min-content' },
|
|
107
|
+
{ dataField: 'value', dataType: md?.dataType === MetadataDataTypes.DateTime ? 'date' : 'string', caption: md?.nameLoc, width: 'min-content', ...(needsCellRender && { cellRender: valueCellRender }) },
|
|
94
108
|
{ dataField: 'Count', dataType: 'number', caption: 'N°' }
|
|
95
109
|
]);
|
|
96
|
-
}, [md]);
|
|
110
|
+
}, [md, valueCellRender]);
|
|
97
111
|
const customSummary = useMemo(() => {
|
|
98
112
|
return ({
|
|
99
113
|
totalItems: [
|
|
@@ -39,4 +39,4 @@ interface ITMDynDataListItemChooserFormProps extends ITMChooserFormProps<DataLis
|
|
|
39
39
|
dynDL?: DynamicDataListDescriptor;
|
|
40
40
|
searchResult?: SearchResultDescriptor;
|
|
41
41
|
}
|
|
42
|
-
export declare const TMDynDataListItemChooserForm: (props: ITMDynDataListItemChooserFormProps) =>
|
|
42
|
+
export declare const TMDynDataListItemChooserForm: (props: ITMDynDataListItemChooserFormProps) => React.JSX.Element;
|
|
@@ -84,10 +84,15 @@ const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChoo
|
|
|
84
84
|
_jsx(TMTooltip, { content: SDKUI_Localizator.ValueNotPresent, children: _jsx(IconWarning, { color: TMColors.warning }) });
|
|
85
85
|
};
|
|
86
86
|
const renderTemplate = () => {
|
|
87
|
+
const isPlaceholder = values?.[0] === placeHolder;
|
|
88
|
+
// Selezione singola: mostra direttamente il primo valore
|
|
89
|
+
if (!allowMultipleSelection) {
|
|
90
|
+
const singleDescription = getValueDescription(values?.[0]);
|
|
91
|
+
return (_jsx(StyledDivHorizontal, { style: { width: '100%', color: isPlaceholder ? '#a9a9a9' : 'inherit', alignItems: 'center' }, children: dataSource && singleDescription && _jsxs(StyledDivHorizontal, { style: { alignItems: 'center', gap: '8px' }, children: [getIcon(), _jsx("p", { children: singleDescription })] }) }));
|
|
92
|
+
}
|
|
87
93
|
const MIN_COUNT_FOR_BADGE = 1;
|
|
88
94
|
const MAX_VISIBLE_ITEMS = 3;
|
|
89
95
|
const MAX_TOOLTIP_ITEMS = 50;
|
|
90
|
-
const isPlaceholder = values?.[0] === placeHolder;
|
|
91
96
|
const descriptions = getDescriptions(MAX_VISIBLE_ITEMS);
|
|
92
97
|
const remainingCount = (values?.length ?? 0) - MAX_VISIBLE_ITEMS;
|
|
93
98
|
const totalCount = values?.length ?? 0;
|
|
@@ -11,7 +11,7 @@ export const TMGroupChooserForm = (props) => {
|
|
|
11
11
|
TMSpinner.hide();
|
|
12
12
|
return items ?? [];
|
|
13
13
|
};
|
|
14
|
-
return (_jsx(TMChooserForm, { title: SDK_Localizator.Groups, allowMultipleSelection: props.allowMultipleSelection, width: props.width, height: props.height, manageUseLocalizedName: true, hasShowOnlySelectedItems: true, selectedIDs: props.selectedIDs, startWithShowOnlySelectedItems: false, cellRenderIcon: () => _jsx(IconUserGroup, { color: '#767676' }), dataSource: props.dataSource, getItems: getItems, onClose: props.onClose, onChoose: (IDs) => { props.onChoose?.(IDs); } }));
|
|
14
|
+
return (_jsx(TMChooserForm, { title: SDK_Localizator.Groups, allowMultipleSelection: props.allowMultipleSelection, width: props.width, height: props.height, manageUseLocalizedName: props.manageUseLocalizedName ?? true, hasShowOnlySelectedItems: true, selectedIDs: props.selectedIDs, startWithShowOnlySelectedItems: false, cellRenderIcon: () => _jsx(IconUserGroup, { color: '#767676' }), dataSource: props.dataSource, getItems: getItems, onClose: props.onClose, onChoose: (IDs) => { props.onChoose?.(IDs); } }));
|
|
15
15
|
};
|
|
16
16
|
export const TMGroupIdViewer = (props) => {
|
|
17
17
|
const [group, setGroup] = useState(null);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { InvoiceRetrieveFormats } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
import { ITMEnumDataBinding } from '../../ts';
|
|
3
|
-
declare const TMInvoiceRetrieveFormats: ({ value, valueOrig, onValueChanged, valuesToExclude, label, width }: ITMEnumDataBinding<InvoiceRetrieveFormats>) =>
|
|
4
|
+
declare const TMInvoiceRetrieveFormats: ({ value, valueOrig, onValueChanged, valuesToExclude, label, width }: ITMEnumDataBinding<InvoiceRetrieveFormats>) => React.JSX.Element;
|
|
4
5
|
export default TMInvoiceRetrieveFormats;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { OrderRetrieveFormats } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
import { ITMEnumDataBinding } from '../../ts';
|
|
3
|
-
declare const TMOrderRetrieveFormats: ({ value, valueOrig, onValueChanged, valuesToExclude, label, width }: ITMEnumDataBinding<OrderRetrieveFormats>) =>
|
|
4
|
+
declare const TMOrderRetrieveFormats: ({ value, valueOrig, onValueChanged, valuesToExclude, label, width }: ITMEnumDataBinding<OrderRetrieveFormats>) => React.JSX.Element;
|
|
4
5
|
export default TMOrderRetrieveFormats;
|
|
@@ -19,13 +19,13 @@ export declare const TMRelationIdViewer: ({ relationType, relationId, showIcon,
|
|
|
19
19
|
relationId?: number;
|
|
20
20
|
showIcon?: boolean;
|
|
21
21
|
noneSelectionText?: string;
|
|
22
|
-
}) =>
|
|
22
|
+
}) => React.JSX.Element;
|
|
23
23
|
export declare const TMRelationIcon: ({ rd, relationType }: {
|
|
24
24
|
rd: RelationDescriptor | undefined;
|
|
25
25
|
relationType?: RelationTypes;
|
|
26
|
-
}) =>
|
|
26
|
+
}) => React.JSX.Element;
|
|
27
27
|
export declare const TMRelationTooltip: ({ rd, relationType, children }: {
|
|
28
28
|
rd?: RelationDescriptor;
|
|
29
29
|
relationType: RelationTypes | undefined;
|
|
30
30
|
children: React.ReactNode;
|
|
31
|
-
}) =>
|
|
31
|
+
}) => React.JSX.Element;
|
|
@@ -16,6 +16,8 @@ interface ITMUserChooserProps extends ITMChooserProps {
|
|
|
16
16
|
initialShowChooser?: boolean;
|
|
17
17
|
/** Allow showing all users with toggle button */
|
|
18
18
|
allowShowAllUsers?: boolean;
|
|
19
|
+
/** If true, uses UserListCacheService.GetAllAdminAsync() instead of GetAllAsync() */
|
|
20
|
+
adminMode?: boolean;
|
|
19
21
|
/** Funzione per aggiornare lo stato di apertura della modale */
|
|
20
22
|
updateIsModalOpen?: (isOpen: boolean) => void;
|
|
21
23
|
}
|
|
@@ -30,12 +32,14 @@ interface ITMUserChooserFormProps extends ITMChooserFormProps<UserDescriptor> {
|
|
|
30
32
|
hideShowId?: boolean;
|
|
31
33
|
/** Allow showing all users with toggle button */
|
|
32
34
|
allowShowAllUsers?: boolean;
|
|
35
|
+
/** If true, uses UserListCacheService.GetAllAdminAsync() instead of GetAllAsync() */
|
|
36
|
+
adminMode?: boolean;
|
|
33
37
|
}
|
|
34
38
|
export declare const TMUserChooserForm: React.FunctionComponent<ITMUserChooserFormProps>;
|
|
35
39
|
export declare const TMUserIcon: ({ ud }: {
|
|
36
40
|
ud?: UserDescriptor;
|
|
37
|
-
}) =>
|
|
41
|
+
}) => React.JSX.Element | null;
|
|
38
42
|
export declare const TMUserTooltip: ({ ud, children }: {
|
|
39
43
|
ud?: UserDescriptor;
|
|
40
44
|
children: React.ReactNode;
|
|
41
|
-
}) =>
|
|
45
|
+
}) => React.JSX.Element;
|
|
@@ -8,7 +8,7 @@ import TMSummary from '../editors/TMSummary';
|
|
|
8
8
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
9
9
|
import TMButton from '../base/TMButton';
|
|
10
10
|
import TMDataUserIdItemViewer from '../viewers/TMDataUserIdItemViewer';
|
|
11
|
-
const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon, width, dataSource, backgroundColor, openChooserBySingleClick, buttons = [], disabled = false, showBorder = true, hideRefresh = false, hideShowId = false, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], onValueChanged, showClearButton, initialShowChooser = false, allowShowAllUsers = false, updateIsModalOpen }) => {
|
|
11
|
+
const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon, width, dataSource, backgroundColor, openChooserBySingleClick, buttons = [], disabled = false, showBorder = true, hideRefresh = false, hideShowId = false, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], onValueChanged, showClearButton, initialShowChooser = false, allowShowAllUsers = false, adminMode = false, updateIsModalOpen }) => {
|
|
12
12
|
const [showChooser, setShowChooser] = useState(initialShowChooser);
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
setShowChooser(initialShowChooser);
|
|
@@ -24,14 +24,14 @@ const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon,
|
|
|
24
24
|
updateIsModalOpen?.(true);
|
|
25
25
|
}
|
|
26
26
|
}, elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, openEditorOnSummaryClick: openChooserBySingleClick, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
|
27
|
-
_jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, allowShowAllUsers: allowShowAllUsers, onClose: () => {
|
|
27
|
+
_jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, allowShowAllUsers: allowShowAllUsers, adminMode: adminMode, onClose: () => {
|
|
28
28
|
setShowChooser(false);
|
|
29
29
|
summaryInputRef.current?.focus();
|
|
30
30
|
updateIsModalOpen?.(false);
|
|
31
31
|
}, onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
|
|
32
32
|
};
|
|
33
33
|
export default TMUserChooser;
|
|
34
|
-
export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh = false, hideShowId = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose, allowShowAllUsers = false }) => {
|
|
34
|
+
export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh = false, hideShowId = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose, allowShowAllUsers = false, adminMode = false }) => {
|
|
35
35
|
const [currentDataSource, setCurrentDataSource] = useState(dataSource);
|
|
36
36
|
const [showingAllUsers, setShowingAllUsers] = useState(false);
|
|
37
37
|
const dataColumns = useMemo(() => {
|
|
@@ -45,8 +45,10 @@ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh
|
|
|
45
45
|
const getItems = async (refreshCache) => {
|
|
46
46
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.Users} ...` });
|
|
47
47
|
if (refreshCache)
|
|
48
|
-
UserListCacheService.RemoveAll();
|
|
49
|
-
let allUsers =
|
|
48
|
+
adminMode ? UserListCacheService.RemoveAllAdmin() : UserListCacheService.RemoveAll();
|
|
49
|
+
let allUsers = adminMode
|
|
50
|
+
? await UserListCacheService.GetAllAdminAsync()
|
|
51
|
+
: await UserListCacheService.GetAllAsync();
|
|
50
52
|
let users = filter ? allUsers?.filter(filter) : allUsers;
|
|
51
53
|
TMSpinner.hide();
|
|
52
54
|
return users;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { useEffect, useId, useRef } from 'react';
|
|
3
3
|
import { DateBox } from 'devextreme-react';
|
|
4
4
|
import { DateDisplayTypes, Globalization } from '../../helper';
|
|
5
5
|
import { TMColors } from '../../utils/theme';
|
|
6
6
|
import TMVilViewer from '../base/TMVilViewer';
|
|
7
7
|
const TMDateBox = (props) => {
|
|
8
8
|
const resetTimeToZero = props.resetTimeToZeroOnKeyPress ?? true;
|
|
9
|
+
const autoId = useId();
|
|
10
|
+
const effectiveInputAttr = { id: autoId, ...props.inputAttr };
|
|
9
11
|
useEffect(() => {
|
|
10
12
|
let htmlElement = dateBoxRef?.current?.instance().element();
|
|
11
13
|
if (!htmlElement)
|
|
@@ -63,7 +65,7 @@ const TMDateBox = (props) => {
|
|
|
63
65
|
return "datetime";
|
|
64
66
|
return props.dateDisplayType == DateDisplayTypes.Date ? "date" : "time";
|
|
65
67
|
};
|
|
66
|
-
return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', padding: props.padding }, children: [props.icon && (_jsx("span", { style: { marginRight: '8px', marginTop: '8px', display: 'flex', alignItems: 'center' }, children: props.icon })), _jsxs("div", { onContextMenu: (e) => e.stopPropagation(), style: { display: 'flex', flexDirection: 'column', gap: '5px', width: '100%' }, children: [_jsx(DateBox, { readOnly: props.readOnly, ref: dateBoxRef, showClearButton: props.showClearButton, dateSerializationFormat: props.useDateSerializationFormat ? 'yyyy-MM-ddTHH:mm:ss' : undefined, disabled: props.disabled, displayFormat: props.displayFormat ?? Globalization.getDateDisplayFormat(props.dateDisplayType), dropDownOptions: dropDownOptions, label: props.label, labelMode: 'static', type: getType(), useMaskBehavior: true, height: '28px', value: props.value, width: props.width, valueChangeEvent: 'keyup input change', onValueChange: (e) => { props.onValueChange?.(e); }, onInitialized: (e) => { props.onInitialized?.(e); }, onContentReady: (e) => { props.onContentReady?.(e); }, placeholder: props.placeholder, onKeyUp: (e) => {
|
|
68
|
+
return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', padding: props.padding }, children: [props.icon && (_jsx("span", { style: { marginRight: '8px', marginTop: '8px', display: 'flex', alignItems: 'center' }, children: props.icon })), _jsxs("div", { onContextMenu: (e) => e.stopPropagation(), style: { display: 'flex', flexDirection: 'column', gap: '5px', width: '100%' }, children: [_jsx(DateBox, { readOnly: props.readOnly, ref: dateBoxRef, showClearButton: props.showClearButton, dateSerializationFormat: props.useDateSerializationFormat ? 'yyyy-MM-ddTHH:mm:ss' : undefined, disabled: props.disabled, displayFormat: props.displayFormat ?? Globalization.getDateDisplayFormat(props.dateDisplayType), dropDownOptions: dropDownOptions, label: props.label, labelMode: 'static', type: getType(), useMaskBehavior: true, height: '28px', value: props.value, width: props.width, valueChangeEvent: 'keyup input change', onValueChange: (e) => { props.onValueChange?.(e); }, onInitialized: (e) => { props.onInitialized?.(e); }, onContentReady: (e) => { props.onContentReady?.(e); }, placeholder: props.placeholder, ...(props.name && { name: props.name }), inputAttr: effectiveInputAttr, onKeyUp: (e) => {
|
|
67
69
|
if (e.event?.code == "Space") {
|
|
68
70
|
const currentDate = new Date();
|
|
69
71
|
currentDate.setHours(0, 0, 0, 0);
|
|
@@ -7,7 +7,7 @@ export declare const StyledEditorContainer: import("styled-components/dist/types
|
|
|
7
7
|
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$width"> & {
|
|
8
8
|
$width: string;
|
|
9
9
|
}, never>>> & string;
|
|
10
|
-
export declare const StyledEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$
|
|
10
|
+
export declare const StyledEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$width" | "$borderRadius" | "$fontSize" | "$type" | "$disabled" | "$vil" | "$isModified" | "$maxValue" | "$isMobile"> & {
|
|
11
11
|
$vil: ValidationItem[];
|
|
12
12
|
$width: string;
|
|
13
13
|
$type: string;
|
|
@@ -17,7 +17,7 @@ export declare const StyledEditor: import("styled-components/dist/types").IStyle
|
|
|
17
17
|
$disabled: boolean;
|
|
18
18
|
$isMobile?: boolean;
|
|
19
19
|
$borderRadius?: string;
|
|
20
|
-
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$
|
|
20
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$width" | "$borderRadius" | "$fontSize" | "$type" | "$disabled" | "$vil" | "$isModified" | "$maxValue" | "$isMobile"> & {
|
|
21
21
|
$vil: ValidationItem[];
|
|
22
22
|
$width: string;
|
|
23
23
|
$type: string;
|
|
@@ -37,20 +37,20 @@ export declare const StyledEditorIcon: import("styled-components/dist/types").IS
|
|
|
37
37
|
$disabled: boolean;
|
|
38
38
|
$isModified: boolean;
|
|
39
39
|
}, never>>> & string;
|
|
40
|
-
export declare const StyledEditorLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$
|
|
40
|
+
export declare const StyledEditorLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$fontSize" | "$disabled" | "$isFocused" | "$labelPosition"> & {
|
|
41
41
|
$isFocused: boolean;
|
|
42
42
|
$labelPosition: "right" | "left" | "top";
|
|
43
43
|
$disabled: boolean;
|
|
44
44
|
$fontSize?: string;
|
|
45
45
|
$color?: string;
|
|
46
|
-
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$
|
|
46
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$fontSize" | "$disabled" | "$isFocused" | "$labelPosition"> & {
|
|
47
47
|
$isFocused: boolean;
|
|
48
48
|
$labelPosition: "right" | "left" | "top";
|
|
49
49
|
$disabled: boolean;
|
|
50
50
|
$fontSize?: string;
|
|
51
51
|
$color?: string;
|
|
52
52
|
}, never>>> & string;
|
|
53
|
-
export declare const StyledTextareaEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$
|
|
53
|
+
export declare const StyledTextareaEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$width" | "$maxHeight" | "$borderRadius" | "$fontSize" | "$disabled" | "$vil" | "$isModified" | "$isMobile" | "$resize"> & {
|
|
54
54
|
$vil: ValidationItem[];
|
|
55
55
|
$width: string;
|
|
56
56
|
$isModified: boolean;
|
|
@@ -60,7 +60,7 @@ export declare const StyledTextareaEditor: import("styled-components/dist/types"
|
|
|
60
60
|
$maxHeight?: string;
|
|
61
61
|
$borderRadius?: string;
|
|
62
62
|
$resize?: boolean;
|
|
63
|
-
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$
|
|
63
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$width" | "$maxHeight" | "$borderRadius" | "$fontSize" | "$disabled" | "$vil" | "$isModified" | "$isMobile" | "$resize"> & {
|
|
64
64
|
$vil: ValidationItem[];
|
|
65
65
|
$width: string;
|
|
66
66
|
$isModified: boolean;
|
|
@@ -27,11 +27,14 @@ export declare class FormulaDescriptor {
|
|
|
27
27
|
mid?: number;
|
|
28
28
|
metadataDataTypeDest?: MetadataDataTypes;
|
|
29
29
|
tid?: number;
|
|
30
|
+
description?: string;
|
|
31
|
+
syntax?: string;
|
|
30
32
|
}
|
|
31
|
-
export declare const renderFormulaIcon: (iconType: FormulaIconTypes, tid?: number, md?: MetadataDescriptor) =>
|
|
33
|
+
export declare const renderFormulaIcon: (iconType: FormulaIconTypes, tid?: number, md?: MetadataDescriptor) => React.JSX.Element;
|
|
32
34
|
declare const TMFormulaEditor: React.FunctionComponent<ITMApplyFormProps<FormulaDescriptor>>;
|
|
33
35
|
export default TMFormulaEditor;
|
|
34
36
|
export declare class FormulaHelper {
|
|
37
|
+
static translateDescInFormula: (text: string, returnType?: string) => string;
|
|
35
38
|
static isFormula(value: string | undefined): boolean;
|
|
36
39
|
static removeFormulaTag(value: string | undefined): string | undefined;
|
|
37
40
|
static addFormulaTag(value: string | undefined): string | undefined;
|