@topconsultnpm/sdkui-react 6.20.0-dev1.11 → 6.20.0-dev1.110
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/assets/Toppy-help-center.png +0 -0
- package/lib/assets/headergradient.svg +87 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +285 -28
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +8 -1
- package/lib/components/NewComponents/ContextMenu/hooks.js +80 -8
- package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
- package/lib/components/NewComponents/ContextMenu/index.js +2 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +9 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +157 -37
- package/lib/components/NewComponents/ContextMenu/types.d.ts +14 -1
- package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +563 -112
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +21 -5
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +210 -58
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +8 -2
- package/lib/components/base/TMAccordionNew.js +35 -14
- package/lib/components/base/TMCustomButton.js +61 -17
- package/lib/components/base/TMDataGrid.d.ts +7 -4
- package/lib/components/base/TMDataGrid.js +153 -11
- package/lib/components/base/TMDropDownMenu.js +19 -18
- package/lib/components/base/TMFileManager.d.ts +4 -3
- package/lib/components/base/TMFileManager.js +32 -24
- package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
- package/lib/components/base/TMFileManagerDataGridView.js +1 -11
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
- package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
- package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
- package/lib/components/base/TMListView.js +33 -15
- package/lib/components/base/TMPanel.d.ts +1 -1
- package/lib/components/base/TMPanel.js +1 -1
- package/lib/components/choosers/TMDistinctValues.js +2 -2
- package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +8 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMUserChooser.d.ts +0 -5
- package/lib/components/choosers/TMUserChooser.js +25 -45
- package/lib/components/editors/TMDateBox.js +18 -9
- package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
- package/lib/components/editors/TMLocalizedTextBox.js +16 -14
- package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
- package/lib/components/editors/TMMetadataTextBox.js +92 -0
- package/lib/components/editors/TMMetadataValues.js +23 -5
- package/lib/components/editors/TMTextArea.js +18 -30
- package/lib/components/editors/TMTextBox.d.ts +1 -1
- package/lib/components/editors/TMTextBox.js +6 -3
- package/lib/components/editors/TMTextExpression.js +6 -91
- package/lib/components/features/archive/TMArchive.js +2 -2
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +460 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
- package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
- package/lib/components/features/documents/TMDcmtForm.js +457 -206
- package/lib/components/features/documents/TMDcmtPreview.js +44 -110
- package/lib/components/features/documents/TMDcmtTasks.js +9 -9
- package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
- package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
- package/lib/components/features/documents/TMRelationViewer.js +2 -2
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +2 -2
- package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
- package/lib/components/features/search/TMSearch.d.ts +3 -0
- package/lib/components/features/search/TMSearch.js +50 -11
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +29 -21
- package/lib/components/features/search/TMSearchResult.d.ts +3 -0
- package/lib/components/features/search/TMSearchResult.js +208 -250
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.js +205 -169
- package/lib/components/features/search/TMSignSettingsForm.js +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
- package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
- package/lib/components/features/search/TMViewHistoryDcmt.js +2 -2
- package/lib/components/features/tasks/TMTaskForm.js +20 -1
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
- package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
- package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
- package/lib/components/features/tasks/TMTasksUtils.js +43 -36
- package/lib/components/features/tasks/TMTasksView.js +28 -19
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +139 -34
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +12 -7
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
- package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
- package/lib/components/forms/Login/LoginValidatorService.js +7 -2
- package/lib/components/forms/Login/TMLoginForm.js +34 -6
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +56 -31
- package/lib/components/grids/TMRecentsManager.js +20 -10
- package/lib/components/index.d.ts +6 -3
- package/lib/components/index.js +6 -3
- package/lib/components/query/TMQueryEditor.d.ts +2 -1
- package/lib/components/query/TMQueryEditor.js +92 -92
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/settings/SettingsAppearance.js +99 -30
- package/lib/components/sidebar/TMHeader.js +7 -7
- package/lib/components/sidebar/TMSidebar.d.ts +0 -1
- package/lib/components/sidebar/TMSidebar.js +16 -44
- package/lib/components/sidebar/TMSidebarItem.js +34 -17
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +35 -71
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
- package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +22 -0
- package/lib/helper/SDKUI_Globals.js +10 -1
- package/lib/helper/SDKUI_Localizator.d.ts +17 -1
- package/lib/helper/SDKUI_Localizator.js +167 -1
- package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
- package/lib/helper/TMCommandsContextMenu.js +15 -4
- package/lib/helper/TMIcons.d.ts +4 -0
- package/lib/helper/TMIcons.js +13 -3
- package/lib/helper/TMPdfViewer.d.ts +8 -0
- package/lib/helper/TMPdfViewer.js +373 -0
- package/lib/helper/checkinCheckoutManager.d.ts +31 -1
- package/lib/helper/checkinCheckoutManager.js +112 -30
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +28 -1
- package/lib/helper/helpers.js +130 -3
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +1 -1
- package/lib/helper/queryHelper.js +33 -3
- package/lib/helper/workItemsHelper.d.ts +6 -0
- package/lib/helper/workItemsHelper.js +230 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
- package/lib/hooks/useCheckInOutOperations.js +223 -0
- package/lib/hooks/useDataListItem.d.ts +12 -0
- package/lib/hooks/useDataListItem.js +132 -0
- package/lib/hooks/useDataUserIdItem.d.ts +10 -0
- package/lib/hooks/useDataUserIdItem.js +96 -0
- package/lib/hooks/useMetadataExpression.d.ts +19 -0
- package/lib/hooks/useMetadataExpression.js +99 -0
- package/lib/hooks/useSettingsFeedback.d.ts +11 -0
- package/lib/hooks/useSettingsFeedback.js +38 -0
- package/lib/hooks/useWorkflowApprove.d.ts +4 -0
- package/lib/hooks/useWorkflowApprove.js +14 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -2
- package/lib/services/platform_services.d.ts +3 -3
- package/lib/ts/types.d.ts +61 -1
- package/lib/utils/theme.d.ts +1 -1
- package/lib/utils/theme.js +1 -1
- package/package.json +7 -4
- package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
- package/lib/components/NewComponents/Notification/Notification.js +0 -60
- package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
- package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
- package/lib/components/NewComponents/Notification/index.d.ts +0 -2
- package/lib/components/NewComponents/Notification/index.js +0 -2
- package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
- package/lib/components/NewComponents/Notification/styles.js +0 -180
- package/lib/components/NewComponents/Notification/types.d.ts +0 -18
- package/lib/components/NewComponents/Notification/types.js +0 -1
- package/lib/components/base/TMContextMenu.d.ts +0 -25
- package/lib/components/base/TMContextMenu.js +0 -109
- package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
- package/lib/components/base/TMContextMenuOLD.js +0 -56
- package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
- package/lib/components/base/TMFloatingToolbar.js +0 -101
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
- package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { FileItem
|
|
1
|
+
import { FileItem } from "./TMFileManagerUtils";
|
|
2
2
|
import { UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { TMContextMenuItemProps } from "../NewComponents/ContextMenu/types";
|
|
3
4
|
interface TMFileManagerDataGridViewProps {
|
|
4
5
|
items: Array<FileItem>;
|
|
5
6
|
allUsers: Array<UserDescriptor>;
|
|
@@ -7,7 +8,7 @@ interface TMFileManagerDataGridViewProps {
|
|
|
7
8
|
handleFocusedFile: (fileItem: FileItem | undefined) => void;
|
|
8
9
|
selectedFiles: Array<FileItem>;
|
|
9
10
|
handleSelectedFiles: (fileItems: Array<FileItem>) => void;
|
|
10
|
-
fileContextMenuItems: Array<
|
|
11
|
+
fileContextMenuItems: Array<TMContextMenuItemProps>;
|
|
11
12
|
searchText: string;
|
|
12
13
|
userID?: number;
|
|
13
14
|
onDoubleClickHandler?: (fileItem: FileItem | undefined) => void;
|
|
@@ -48,16 +48,6 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
48
48
|
if (onDoubleClickHandler)
|
|
49
49
|
onDoubleClickHandler(e.data);
|
|
50
50
|
}, [onDoubleClickHandler]);
|
|
51
|
-
const onContextMenuPreparing = (e) => {
|
|
52
|
-
if (e === undefined)
|
|
53
|
-
return;
|
|
54
|
-
if (e.target === 'content') {
|
|
55
|
-
if (handleFocusedFile && e.row)
|
|
56
|
-
handleFocusedFile(e.row.data);
|
|
57
|
-
e.items = e.items || [];
|
|
58
|
-
e.items = fileContextMenuItems ? [...fileContextMenuItems] : [];
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
51
|
const cellDefaultRender = useCallback((cellData) => {
|
|
62
52
|
const value = cellData.value ?? '';
|
|
63
53
|
return renderHighlightedText(value.toString(), searchText, false);
|
|
@@ -96,6 +86,6 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
96
86
|
{ dataField: "creationTime", caption: SDKUI_Localizator.CreationTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
|
|
97
87
|
];
|
|
98
88
|
}, [searchText]);
|
|
99
|
-
return _jsx(TMDataGrid, { dataSource: items ?? [], dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, onFocusedRowChanged: onFocusedRowChanged, onSelectionChanged: onSelectionChanged, onCellDblClick: onCellDblClick,
|
|
89
|
+
return _jsx(TMDataGrid, { dataSource: items ?? [], dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, onFocusedRowChanged: onFocusedRowChanged, onSelectionChanged: onSelectionChanged, onCellDblClick: onCellDblClick, customContextMenuItems: fileContextMenuItems, showSearchPanel: false, noDataText: SDKUI_Localizator.FolderIsEmpty }, items.length);
|
|
100
90
|
};
|
|
101
91
|
export default TMFileManagerDataGridView;
|
|
@@ -10,7 +10,13 @@ export interface TMFileManagerThumbnailItemsProps {
|
|
|
10
10
|
selectedFiles: Array<FileItem>;
|
|
11
11
|
handleSelectedFiles: (fileItems: Array<FileItem>) => void;
|
|
12
12
|
searchText: string;
|
|
13
|
-
|
|
13
|
+
setThumbViewContextMenuControl: React.Dispatch<React.SetStateAction<{
|
|
14
|
+
visible: boolean;
|
|
15
|
+
position: {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
}>>;
|
|
14
20
|
onDoubleClick?: (file: FileItem) => void;
|
|
15
21
|
userID?: number;
|
|
16
22
|
}
|
|
@@ -6,7 +6,7 @@ import TMTooltip from './TMTooltip';
|
|
|
6
6
|
import TMDcmtIcon from '../features/documents/TMDcmtIcon';
|
|
7
7
|
const TMFileManagerThumbnailItems = (props) => {
|
|
8
8
|
// Destructuring props for cleaner usage
|
|
9
|
-
const { items, allUsers, paginatedItems, selectedFiles, searchText, userID, onDoubleClick, handleSelectedFiles, handleFocusedFile,
|
|
9
|
+
const { items, allUsers, paginatedItems, selectedFiles, searchText, userID, onDoubleClick, handleSelectedFiles, handleFocusedFile, setThumbViewContextMenuControl } = props;
|
|
10
10
|
// Ref for the scrollable container
|
|
11
11
|
const containerRef = useRef(null);
|
|
12
12
|
// Stores index of the last selected item for shift selection
|
|
@@ -109,7 +109,10 @@ const TMFileManagerThumbnailItems = (props) => {
|
|
|
109
109
|
// Right-click to open context menu and set focus
|
|
110
110
|
const onContextMenu = useCallback((e, item) => {
|
|
111
111
|
e.preventDefault();
|
|
112
|
-
|
|
112
|
+
setThumbViewContextMenuControl({
|
|
113
|
+
visible: true,
|
|
114
|
+
position: { x: e.clientX, y: e.clientY }
|
|
115
|
+
});
|
|
113
116
|
handleFocusedFile(item);
|
|
114
117
|
}, []);
|
|
115
118
|
const findCheckOutUserName = useCallback((item) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { FileItem
|
|
2
|
+
import { FileItem } from "./TMFileManagerUtils";
|
|
3
3
|
import { UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
4
|
+
import { TMContextMenuItemProps } from '../NewComponents/ContextMenu/types';
|
|
4
5
|
interface TMFileManagerThumbnailsViewProps {
|
|
5
6
|
items: Array<FileItem>;
|
|
6
7
|
allUsers: Array<UserDescriptor>;
|
|
@@ -8,12 +9,24 @@ interface TMFileManagerThumbnailsViewProps {
|
|
|
8
9
|
handleFocusedFile: (fileItem: FileItem | undefined) => void;
|
|
9
10
|
selectedFiles: Array<FileItem>;
|
|
10
11
|
handleSelectedFiles: (fileItems: Array<FileItem>) => void;
|
|
11
|
-
fileContextMenuItems: Array<
|
|
12
|
+
fileContextMenuItems: Array<TMContextMenuItemProps>;
|
|
12
13
|
searchText: string;
|
|
13
14
|
userID?: number;
|
|
14
15
|
onDoubleClickHandler?: (fileItem: FileItem | undefined) => void;
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
thumbViewContextMenuControl: {
|
|
17
|
+
visible: boolean;
|
|
18
|
+
position: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
setThumbViewContextMenuControl: React.Dispatch<React.SetStateAction<{
|
|
24
|
+
visible: boolean;
|
|
25
|
+
position: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
}>>;
|
|
17
30
|
}
|
|
18
31
|
declare const TMFileManagerThumbnailsView: (props: TMFileManagerThumbnailsViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
32
|
export default TMFileManagerThumbnailsView;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useState } from "react";
|
|
3
3
|
import { TMFileManagerPageSize } from "./TMFileManagerUtils";
|
|
4
|
-
import {
|
|
4
|
+
import { Pagination, ScrollView } from "devextreme-react";
|
|
5
|
+
import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
|
|
5
6
|
import TMFileManagerThumbnailItems from "./TMFileManagerThumbnailItems";
|
|
6
7
|
import { SDKUI_Localizator } from "../../helper";
|
|
7
8
|
const TMFileManagerThumbnailsView = (props) => {
|
|
8
|
-
const { items, allUsers, focusedFile, handleFocusedFile, selectedFiles = [], handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler,
|
|
9
|
+
const { items, allUsers, focusedFile, handleFocusedFile, selectedFiles = [], handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler, thumbViewContextMenuControl, setThumbViewContextMenuControl } = props;
|
|
9
10
|
const PAGE_SIZES = [TMFileManagerPageSize.Small, TMFileManagerPageSize.Medium, TMFileManagerPageSize.Large];
|
|
10
11
|
const initPageSize = TMFileManagerPageSize.Small;
|
|
11
12
|
const showPagination = (items?.length ?? 0) > initPageSize;
|
|
@@ -26,7 +27,7 @@ const TMFileManagerThumbnailsView = (props) => {
|
|
|
26
27
|
}, []);
|
|
27
28
|
// Handle closing the context menu
|
|
28
29
|
const closeViewContextMenu = useCallback(() => {
|
|
29
|
-
|
|
30
|
+
setThumbViewContextMenuControl(prev => ({ ...prev, visible: false }));
|
|
30
31
|
}, []);
|
|
31
32
|
const onBackgroundContextMenu = (event) => {
|
|
32
33
|
if (event === undefined)
|
|
@@ -34,13 +35,24 @@ const TMFileManagerThumbnailsView = (props) => {
|
|
|
34
35
|
if (event.target.closest('.tm-file-manager-thumbnail-items'))
|
|
35
36
|
return;
|
|
36
37
|
event.preventDefault();
|
|
37
|
-
|
|
38
|
+
setThumbViewContextMenuControl({
|
|
39
|
+
visible: true,
|
|
40
|
+
position: { x: event.clientX, y: event.clientY }
|
|
41
|
+
});
|
|
38
42
|
handleFocusedFile?.(undefined);
|
|
39
43
|
handleSelectedFiles?.([]);
|
|
40
44
|
};
|
|
41
45
|
return items.length > 0 ?
|
|
42
|
-
_jsxs("div", { style: { width: "100%", height: "100%" }, onContextMenu: onBackgroundContextMenu, children: [_jsx(ScrollView, { width: "100%", height: showPagination ? "calc(100% - 50px)" : "100%", useNative: true, direction: 'vertical', children: _jsx(TMFileManagerThumbnailItems, { items: items, allUsers: allUsers, paginatedItems: paginatedItems, focusedFile: focusedFile, selectedFiles: selectedFiles, userID: userID, searchText: searchText, handleFocusedFile: handleFocusedFile, handleSelectedFiles: handleSelectedFiles, onDoubleClick: handleItemDoubleClick,
|
|
46
|
+
_jsxs("div", { id: "file-manager-thumbnails-view", style: { width: "100%", height: "100%" }, onContextMenu: onBackgroundContextMenu, children: [_jsx(ScrollView, { width: "100%", height: showPagination ? "calc(100% - 50px)" : "100%", useNative: true, direction: 'vertical', children: _jsx(TMFileManagerThumbnailItems, { items: items, allUsers: allUsers, paginatedItems: paginatedItems, focusedFile: focusedFile, selectedFiles: selectedFiles, userID: userID, searchText: searchText, handleFocusedFile: handleFocusedFile, handleSelectedFiles: handleSelectedFiles, onDoubleClick: handleItemDoubleClick, setThumbViewContextMenuControl: setThumbViewContextMenuControl }) }), showPagination && _jsx(Pagination, { height: "50px", showInfo: true, showNavigationButtons: true, allowedPageSizes: PAGE_SIZES, displayMode: 'compact', itemCount: items.length, pageIndex: pageIndex, pageSize: pageSize, onPageIndexChange: setPageIndex, onPageSizeChange: setPageSize }), _jsx(TMContextMenu, { items: fileContextMenuItems, target: "#file-manager-thumbnails-view", externalControl: {
|
|
47
|
+
visible: thumbViewContextMenuControl.visible,
|
|
48
|
+
position: thumbViewContextMenuControl.position,
|
|
49
|
+
onClose: closeViewContextMenu
|
|
50
|
+
} })] })
|
|
43
51
|
:
|
|
44
|
-
_jsxs("div", { onContextMenu: onBackgroundContextMenu, style: { width: "100%", height: "100%", display: 'flex', justifyContent: 'center', alignItems: 'center', marginTop: '10px' }, children: [SDKUI_Localizator.FolderIsEmpty,
|
|
52
|
+
_jsxs("div", { id: "file-manager-thumbnails-view-empty", onContextMenu: onBackgroundContextMenu, style: { width: "100%", height: "100%", display: 'flex', justifyContent: 'center', alignItems: 'center', marginTop: '10px' }, children: [SDKUI_Localizator.FolderIsEmpty, _jsx(TMContextMenu, { items: fileContextMenuItems, target: "#file-manager-thumbnails-view-empty", externalControl: {
|
|
53
|
+
visible: thumbViewContextMenuControl.visible,
|
|
54
|
+
position: thumbViewContextMenuControl.position,
|
|
55
|
+
onClose: closeViewContextMenu
|
|
56
|
+
} })] });
|
|
45
57
|
};
|
|
46
58
|
export default TMFileManagerThumbnailsView;
|
|
@@ -19,18 +19,6 @@ export interface FileItem {
|
|
|
19
19
|
size?: number;
|
|
20
20
|
version?: number;
|
|
21
21
|
}
|
|
22
|
-
export interface TMFileManagerContextMenuItem {
|
|
23
|
-
text: string;
|
|
24
|
-
icon: string;
|
|
25
|
-
onClick?: (param?: any) => void;
|
|
26
|
-
operationType?: 'singleRow' | 'multiRow';
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
id?: string;
|
|
29
|
-
items?: Array<TMFileManagerContextMenuItem>;
|
|
30
|
-
beginGroup?: boolean;
|
|
31
|
-
tooltip?: string;
|
|
32
|
-
visible?: boolean;
|
|
33
|
-
}
|
|
34
22
|
export interface TMFileManagerTreeViewDirectory {
|
|
35
23
|
id: number;
|
|
36
24
|
text: string;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { ObjectClasses } from '@topconsultnpm/sdk-ts';
|
|
5
|
-
import TMContextMenu
|
|
5
|
+
import TMContextMenu from '../NewComponents/ContextMenu/TMContextMenu';
|
|
6
6
|
import { IconApply, IconCloseCircle, IconColumns, IconDown, IconHide, IconShow, IconUp, IconVisible } from '../../helper/TMIcons';
|
|
7
7
|
import { TMSearchBar } from '../sidebar/TMHeader';
|
|
8
8
|
import TMTooltip from './TMTooltip';
|
|
@@ -26,9 +26,17 @@ const TMListView = ({ customGroupingHeaders, headerBackGroundColor, header, show
|
|
|
26
26
|
const [isFocused, setIsFocused] = useState(false);
|
|
27
27
|
const [showOrderMenu, setShowOrderMenu] = useState(false);
|
|
28
28
|
const [showOrderOptions, setShowOrderOptions] = useState(false);
|
|
29
|
+
const [contextMenuVisible, setContextMenuVisible] = useState(false);
|
|
30
|
+
const [contextMenuPosition, setContextMenuPosition] = useState({ x: 0, y: 0 });
|
|
31
|
+
const [orderMenuVisible, setOrderMenuVisible] = useState(false);
|
|
32
|
+
const [orderMenuPosition, setOrderMenuPosition] = useState({ x: 0, y: 0 });
|
|
29
33
|
useEffect(() => { setCurrentDataSource(dataSource); }, [dataSource]);
|
|
30
|
-
const openContextMenu = (e) => {
|
|
31
|
-
|
|
34
|
+
const openContextMenu = (e) => {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
setIsFocused(true);
|
|
37
|
+
setContextMenuVisible(true);
|
|
38
|
+
setContextMenuPosition({ x: e.clientX, y: e.clientY });
|
|
39
|
+
};
|
|
32
40
|
useEffect(() => { if (orderBy) {
|
|
33
41
|
setOrderedBy(orderBy);
|
|
34
42
|
} }, [orderBy]);
|
|
@@ -235,10 +243,10 @@ const TMListView = ({ customGroupingHeaders, headerBackGroundColor, header, show
|
|
|
235
243
|
for (let key of searchKeys) {
|
|
236
244
|
arr.push({
|
|
237
245
|
disabled: !localShowId && key === exprKey,
|
|
238
|
-
|
|
239
|
-
onItemClick: () => { setOrderedBy(key); setShowOrderOptions(false); },
|
|
246
|
+
onClick: () => { setOrderedBy(key); setShowOrderOptions(false); setOrderMenuVisible(false); },
|
|
240
247
|
icon: _jsx(IconColumns, { fontSize: 16 }),
|
|
241
|
-
|
|
248
|
+
name: key,
|
|
249
|
+
rightIcon: key === orderedBy ? _jsx(IconApply, { fontSize: 14, color: 'gray' }) : undefined
|
|
242
250
|
});
|
|
243
251
|
}
|
|
244
252
|
}
|
|
@@ -328,16 +336,16 @@ const TMListView = ({ customGroupingHeaders, headerBackGroundColor, header, show
|
|
|
328
336
|
if (showSearch === undefined) {
|
|
329
337
|
items.push({
|
|
330
338
|
icon: localShowSearch ? _jsx(IconHide, { fontSize: 16 }) : _jsx(IconShow, { fontSize: 16 }),
|
|
331
|
-
|
|
332
|
-
|
|
339
|
+
onClick: () => setLocalShowSearch(!localShowSearch),
|
|
340
|
+
name: localShowSearch ? SDKUI_Localizator.HideSearch : SDKUI_Localizator.ShowSearch
|
|
333
341
|
});
|
|
334
342
|
}
|
|
335
343
|
// Add ID menu item only if showId prop is undefined
|
|
336
344
|
if (showId === undefined) {
|
|
337
345
|
items.push({
|
|
338
346
|
icon: localShowId ? _jsx(IconHide, { fontSize: 16 }) : _jsx(IconShow, { fontSize: 16 }),
|
|
339
|
-
|
|
340
|
-
|
|
347
|
+
onClick: () => setLocalShowId(!localShowId),
|
|
348
|
+
name: localShowId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show,
|
|
341
349
|
});
|
|
342
350
|
}
|
|
343
351
|
// Add order menu item only if grouping length is zero
|
|
@@ -345,21 +353,31 @@ const TMListView = ({ customGroupingHeaders, headerBackGroundColor, header, show
|
|
|
345
353
|
items.push({
|
|
346
354
|
icon: showOrderMenu ? _jsx(IconHide, { fontSize: 16 }) : _jsx(IconShow, { fontSize: 16 }),
|
|
347
355
|
disabled: searchKeys.length === 0,
|
|
348
|
-
|
|
349
|
-
|
|
356
|
+
onClick: () => setShowOrderMenu(!showOrderMenu),
|
|
357
|
+
name: showOrderMenu ? 'Nascondi menu di ordinamento' : 'Mostra menu di ordinamento'
|
|
350
358
|
});
|
|
351
359
|
}
|
|
352
360
|
return items;
|
|
353
361
|
};
|
|
354
362
|
const contextMenuItems = generateContextMenuItems(localShowSearch, localShowId, showOrderMenu, grouping, searchKeys);
|
|
355
|
-
return (_jsxs(StyledListViewContainer, { ref: contRef, onContextMenu: openContextMenu, children: [
|
|
356
|
-
|
|
363
|
+
return (_jsxs(StyledListViewContainer, { ref: contRef, onContextMenu: openContextMenu, children: [contextMenuItems.length > 0 && (_jsx(TMContextMenu, { items: contextMenuItems, externalControl: {
|
|
364
|
+
visible: contextMenuVisible,
|
|
365
|
+
position: contextMenuPosition,
|
|
366
|
+
onClose: () => setContextMenuVisible(false)
|
|
367
|
+
} })), showOrderOptions && orderRef.current && (_jsx(TMContextMenu, { items: orderMenuItems(), externalControl: {
|
|
368
|
+
visible: orderMenuVisible || showOrderOptions,
|
|
369
|
+
position: {
|
|
370
|
+
x: orderRef.current.getBoundingClientRect().left,
|
|
371
|
+
y: orderRef.current.getBoundingClientRect().top - (searchKeys.length * 30) - 10
|
|
372
|
+
},
|
|
373
|
+
onClose: () => { setOrderMenuVisible(false); setShowOrderOptions(false); }
|
|
374
|
+
} })), header && _jsx("div", { style: { width: '100%', height: '40px', backgroundColor: headerBackGroundColor ?? `${customColor}30`, marginBottom: '3px', display: 'flex', alignItems: 'center' }, children: header }), localShowSearch &&
|
|
357
375
|
_jsx(StyledSearchContainer, { children: _jsxs(StyledSearchContainer, { children: [_jsx(TMSearchBar, { marginLeft: '0px', maxWidth: '300px', searchValue: searchValue, onSearchValueChanged: (e) => setSearchValue(e) }), _jsx(TMTooltip, { content: 'Nascondi ricerca', children: _jsx(IconCloseCircle, { style: { cursor: 'pointer' }, color: 'red', fontSize: 14, onClick: () => { setSearchValue(''); setLocalShowSearch(false); } }) })] }) }), _jsx("div", { ref: listRef, onClick: () => setIsFocused(true), style: { width: '100%', overflow: 'auto', height: listHeight() }, children: currentDataSource.length > 0 ?
|
|
358
376
|
grouping.length === 0 ? memoList : groupedMemoList :
|
|
359
377
|
searchValue.length > 0 ? _jsx("div", { style: { width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "No data found" }) :
|
|
360
378
|
_jsx("div", { style: { width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "No data" }) }), (searchValue.length > 0 || showOrderMenu) &&
|
|
361
379
|
_jsxs(StyledListViewFooter, { "$bgColor": `${customColor}20`, children: [showOrderMenu &&
|
|
362
|
-
_jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: 5 }, children: [_jsx("div", { style: { width: 'max-content' }, children: "Ordinato per" }), _jsx("div", { ref: orderRef, onClick: () => { setShowOrderOptions(!showOrderOptions); }, style: { cursor: 'pointer', fontWeight: 'bold' }, children: orderedBy.length > 0 ? orderedBy : 'Nulla' }), orderedBy.length > 0 && _jsxs(TMTooltip, { content: orderDir ? 'ASC' : 'DESC', children: [" ", orderDir ? _jsx(IconUp, { style: { cursor: 'pointer' }, onClick: () => setOrderDir(false), fontSize: 14 }) : _jsx(IconDown, { style: { cursor: 'pointer' }, onClick: () => setOrderDir(true), fontSize: 14 }), " "] }), _jsx(TMTooltip, { content: 'Annulla ordinamento', children: _jsx(IconCloseCircle, { style: { cursor: 'pointer' }, color: 'red', fontSize: 14, onClick: () => { setOrderedBy(''); setShowOrderMenu(false); setShowOrderOptions(false); } }) })] }), searchValue.length > 0 && _jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', justifyContent: 'flex-end', gap: 5 }, children: [_jsx(TMTooltip, { content: 'Visibili', children: _jsx(IconVisible, { fontSize: 14 }) }), currentDataSource.length] })] })] }));
|
|
380
|
+
_jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: 5 }, children: [_jsx("div", { style: { width: 'max-content' }, children: "Ordinato per" }), _jsx("div", { ref: orderRef, onClick: () => { setShowOrderOptions(!showOrderOptions); setOrderMenuVisible(!orderMenuVisible); }, style: { cursor: 'pointer', fontWeight: 'bold' }, children: orderedBy.length > 0 ? orderedBy : 'Nulla' }), orderedBy.length > 0 && _jsxs(TMTooltip, { content: orderDir ? 'ASC' : 'DESC', children: [" ", orderDir ? _jsx(IconUp, { style: { cursor: 'pointer' }, onClick: () => setOrderDir(false), fontSize: 14 }) : _jsx(IconDown, { style: { cursor: 'pointer' }, onClick: () => setOrderDir(true), fontSize: 14 }), " "] }), _jsx(TMTooltip, { content: 'Annulla ordinamento', children: _jsx(IconCloseCircle, { style: { cursor: 'pointer' }, color: 'red', fontSize: 14, onClick: () => { setOrderedBy(''); setShowOrderMenu(false); setShowOrderOptions(false); } }) })] }), searchValue.length > 0 && _jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', justifyContent: 'flex-end', gap: 5 }, children: [_jsx(TMTooltip, { content: 'Visibili', children: _jsx(IconVisible, { fontSize: 14 }) }), currentDataSource.length] })] })] }));
|
|
363
381
|
};
|
|
364
382
|
export default TMListView;
|
|
365
383
|
export const CustomListViewHeader = (props) => {
|
|
@@ -133,7 +133,7 @@ onActivate, onBack, onClose, onHeaderDoubleClick, onMaximize, onActiveChanged },
|
|
|
133
133
|
};
|
|
134
134
|
return (_jsxs(StyledPanelContainer, { ref: panelRef, "$isMaximized": onMaximize ? false : isMaximized, style: {
|
|
135
135
|
visibility: isVisible ? 'visible' : 'hidden',
|
|
136
|
-
}, tabIndex: -1, onFocus: !isControlled ? handleFocusUncontrolled : undefined, onBlur: !isControlled ? handleBlurUncontrolled : undefined, onClick: handleActivation, children: [showHeader &&
|
|
136
|
+
}, tabIndex: -1, onFocus: !isControlled ? handleFocusUncontrolled : undefined, onBlur: !isControlled ? handleBlurUncontrolled : undefined, onClick: handleActivation, onContextMenu: (e) => e.preventDefault(), children: [showHeader &&
|
|
137
137
|
_jsx(StyledPanelHeader, { "$backgroundColor": backgroundColor, "$color": color, "$isActive": currentIsActive, onDoubleClick: () => {
|
|
138
138
|
if (onHeaderDoubleClick)
|
|
139
139
|
onHeaderDoubleClick();
|
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
3
3
|
import { LayoutModes, MetadataDataDomains, AccessLevels, MetadataDataTypes, SDK_Globals, DcmtTypeListCacheService, DataColumnTypes } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { SDKUI_Localizator, stringIsNullOrEmpty } from '../../helper';
|
|
6
|
-
import TMDataGrid from '../base/TMDataGrid';
|
|
6
|
+
import TMDataGrid, { TMDataGridPageSize } from '../base/TMDataGrid';
|
|
7
7
|
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
8
8
|
import TMSpinner from '../base/TMSpinner';
|
|
9
9
|
import TMCheckBox from '../editors/TMCheckBox';
|
|
@@ -131,7 +131,7 @@ const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppend
|
|
|
131
131
|
return md.dataDomain === undefined || md.dataDomain === MetadataDataDomains.None;
|
|
132
132
|
};
|
|
133
133
|
const renderContent = () => {
|
|
134
|
-
return (_jsxs(StyledDistinctValues, { children: [isVisibleAppend() && _jsx(TMCheckBox, { elementStyle: { position: 'absolute', right: '15px', top: '15px', zIndex: 10000 }, label: 'Accoda', value: isAppendMode, onValueChanged: () => { setIsAppendMode(!isAppendMode); } }), _jsx(TMDataGrid, { focusedRowKey: focusedItem ? focusedItem.rowIndex : undefined, selection: { showCheckBoxesMode: 'none' }, searchPanel: { highlightCaseSensitive: true, visible: true }, dataColumns: customColumns, dataSource: dataSource, keyExpr: 'rowIndex', height: 'calc(100%)', onFocusedRowChanged: onFocusedRowChanged, paging: { pageSize: 30 }, summary: customSummary })] }));
|
|
134
|
+
return (_jsxs(StyledDistinctValues, { children: [isVisibleAppend() && _jsx(TMCheckBox, { elementStyle: { position: 'absolute', right: '15px', top: '15px', zIndex: 10000 }, label: 'Accoda', value: isAppendMode, onValueChanged: () => { setIsAppendMode(!isAppendMode); } }), _jsx(TMDataGrid, { focusedRowKey: focusedItem ? focusedItem.rowIndex : undefined, selection: { showCheckBoxesMode: 'none' }, searchPanel: { highlightCaseSensitive: true, visible: true }, dataColumns: customColumns, dataSource: dataSource, keyExpr: 'rowIndex', height: 'calc(100%)', onFocusedRowChanged: onFocusedRowChanged, paging: { pageSize: 30 }, summary: customSummary, onRowDblClick: () => !isAppendMode && onClosePanelCallback?.(), pageSize: TMDataGridPageSize.Medium })] }));
|
|
135
135
|
};
|
|
136
136
|
return (_jsx(_Fragment, { children: isModal
|
|
137
137
|
? _jsx(TMModal, { title: SDKUI_Localizator.DistinctValues + (md?.nameLoc ? ` (${md?.nameLoc})` : ''), height: '600px', width: '500px', resizable: true, onClose: onClosePanelCallback, children: renderContent() })
|
|
@@ -17,6 +17,6 @@ const TMInvoiceRetrieveFormats = ({ value, valueOrig, onValueChanged, valuesToEx
|
|
|
17
17
|
}
|
|
18
18
|
return dataSource;
|
|
19
19
|
};
|
|
20
|
-
return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.
|
|
20
|
+
return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.defaultMargin, width: width }, dataSource: getDataSource(), value: value, onValueChanged: (e) => { onValueChanged?.(e.target.value); }, isModifiedWhen: value != valueOrig, width: width }));
|
|
21
21
|
};
|
|
22
22
|
export default TMInvoiceRetrieveFormats;
|
|
@@ -13,8 +13,15 @@ import TMChooserForm from '../forms/TMChooserForm';
|
|
|
13
13
|
import TMSpinner from '../base/TMSpinner';
|
|
14
14
|
const TMMetadataChooser = ({ tmSession, dataSource, showEditButton = true, buttons = [], disabled, validationItems, getColorIndex, showCompleteMetadataName, qdShowOnlySelectItems, borderRadius = '4px', fontSize = FontSize.defaultFontSize, backgroundColor, openEditorOnSummaryClick, showBorder = true, showId = false, elementStyle, allowMultipleSelection, allowSysMetadata, showSysMetadataDirectly, value, values, isModifiedWhen, tids, label, width, height, showClearButton, qd, placeHolder, filterMetadata, onValueChanged }) => {
|
|
15
15
|
const [showChooser, setShowChooser] = useState(false);
|
|
16
|
+
const getinputMd = () => {
|
|
17
|
+
if (values && values.length > 0 && values[0].mid && values[0].mid < 0) {
|
|
18
|
+
let md = dataSource?.find((md) => md.id === values[0].mid);
|
|
19
|
+
return md;
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
};
|
|
16
23
|
const renderTemplate = useMemo(() => {
|
|
17
|
-
return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { children: placeHolder })] }));
|
|
24
|
+
return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && values.length > 0 && values[0].mid && values[0].mid > 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 0 && values[0].mid && values[0].mid < 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], inputMd: getinputMd(), showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { children: placeHolder })] }));
|
|
18
25
|
}, [values, tmSession, showId, showCompleteMetadataName, placeHolder]);
|
|
19
26
|
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { label: label, width: width, height: height, disabled: disabled, validationItems: validationItems, backgroundColor: backgroundColor, buttons: buttons, placeHolder: placeHolder, fontSize: fontSize, showBorder: showBorder, borderRadius: borderRadius, hasValue: values && values.length > 0, showClearButton: showClearButton, showEditButton: showEditButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), openEditorOnSummaryClick: openEditorOnSummaryClick, onEditorClick: () => !disabled && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, template: renderTemplate, onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined }), showChooser &&
|
|
20
27
|
_jsx(TMMetadataChooserForm, { tmSession: tmSession, allowMultipleSelection: allowMultipleSelection, height: '500px', width: '600px', allowSysMetadata: allowSysMetadata, showSysMetadataDirectly: showSysMetadataDirectly, getColorIndex: getColorIndex, dataSource: dataSource, tids: tids, qd: qd, qdShowOnlySelectItems: qdShowOnlySelectItems, filterMetadata: filterMetadata, selectedIDs: values, onClose: () => setShowChooser(false), onChoose: (tid_mids) => { onValueChanged?.(tid_mids); } })] }));
|
|
@@ -17,6 +17,6 @@ const TMOrderRetrieveFormats = ({ value, valueOrig, onValueChanged, valuesToExcl
|
|
|
17
17
|
}
|
|
18
18
|
return dataSource;
|
|
19
19
|
};
|
|
20
|
-
return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.
|
|
20
|
+
return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.defaultMargin, width: width }, dataSource: getDataSource(), value: value, isModifiedWhen: value != valueOrig, onValueChanged: (e) => { onValueChanged?.(e.target.value); }, width: width }));
|
|
21
21
|
};
|
|
22
22
|
export default TMOrderRetrieveFormats;
|
|
@@ -30,11 +30,6 @@ interface ITMUserChooserFormProps extends ITMChooserFormProps<UserDescriptor> {
|
|
|
30
30
|
allowShowAllUsers?: boolean;
|
|
31
31
|
}
|
|
32
32
|
export declare const TMUserChooserForm: React.FunctionComponent<ITMUserChooserFormProps>;
|
|
33
|
-
export declare const TMUserIdViewer: ({ userId, showIcon, noneSelectionText }: {
|
|
34
|
-
userId?: number;
|
|
35
|
-
showIcon?: boolean;
|
|
36
|
-
noneSelectionText?: string;
|
|
37
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
38
33
|
export declare const TMUserIcon: ({ ud }: {
|
|
39
34
|
ud?: UserDescriptor;
|
|
40
35
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { OwnershipLevels, SDK_Localizator, UserLevels, UserListCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
|
-
import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator,
|
|
5
|
-
import { StyledDivHorizontal
|
|
4
|
+
import { SDKUI_Localizator, IconSearch, IconUserLevelMember, IconUserLevelAdministrator, IconUserLevelSystemAdministrator, IconUserLevelAutonomousAdministrator, LocalizeOwnershipLevels, LocalizeUserLevels, IconShowAllUsersOff, IconShowAllUsers } from '../../helper';
|
|
5
|
+
import { StyledDivHorizontal } from '../base/Styled';
|
|
6
6
|
import TMSpinner from '../base/TMSpinner';
|
|
7
|
-
import TMTooltip from '../base/TMTooltip';
|
|
8
7
|
import TMSummary from '../editors/TMSummary';
|
|
9
8
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
10
|
-
import { TMColors } from '../../utils/theme';
|
|
11
|
-
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
12
9
|
import TMButton from '../base/TMButton';
|
|
10
|
+
import TMDataUserIdItemViewer from '../viewers/TMDataUserIdItemViewer';
|
|
13
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 }) => {
|
|
14
12
|
const [showChooser, setShowChooser] = useState(initialShowChooser);
|
|
15
13
|
useEffect(() => {
|
|
@@ -18,7 +16,7 @@ const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon,
|
|
|
18
16
|
const summaryInputRef = useRef(null);
|
|
19
17
|
const renderTemplate = () => {
|
|
20
18
|
const isPlaceholder = values?.[0] === placeHolder;
|
|
21
|
-
return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [values && values.length > 0 && _jsx(
|
|
19
|
+
return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px', color: isPlaceholder ? '#a9a9a9' : 'inherit' }, children: [values && values.length > 0 && _jsx(TMDataUserIdItemViewer, { userId: values?.[0], showIcon: true }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
|
22
20
|
};
|
|
23
21
|
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { ref: summaryInputRef, width: width, disabled: disabled, placeHolder: placeHolder, readOnly: readOnly, labelColor: labelColor, icon: icon, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, openEditorOnSummaryClick: openChooserBySingleClick, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
|
24
22
|
_jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, allowShowAllUsers: allowShowAllUsers, onClose: () => {
|
|
@@ -67,40 +65,6 @@ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh
|
|
|
67
65
|
const customButton = (allowShowAllUsers && dataSource) ? (_jsx(TMButton, { btnStyle: 'toolbar', caption: showingAllUsers ? SDKUI_Localizator.HideAll : SDKUI_Localizator.ShowAll, onClick: handleToggleAllUsers, icon: showingAllUsers ? _jsx(IconShowAllUsersOff, {}) : _jsx(IconShowAllUsers, {}) })) : undefined;
|
|
68
66
|
return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: allowMultipleSelection, startWithShowOnlySelectedItems: startWithShowOnlySelectedItems, hasShowOnlySelectedItems: hasShowOnlySelectedItems, width: width, height: height, manageUseLocalizedName: false, columns: columns ?? dataColumns, showDefaultColumns: false, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, dataSource: currentDataSource, getItems: getItems, hasShowId: !hideShowId, hideRefresh: hideRefresh, customButtons: customButton, onClose: onClose, onChoose: (IDs) => onChoose?.(IDs) }));
|
|
69
67
|
};
|
|
70
|
-
export const TMUserIdViewer = ({ userId, showIcon = false, noneSelectionText = `<${SDKUI_Localizator.NoneSelection}>` }) => {
|
|
71
|
-
const [ud, setUd] = useState();
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
if (!userId || userId <= 0) {
|
|
74
|
-
setUd(undefined);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.Users} ...` });
|
|
78
|
-
UserListCacheService.GetAsync(userId).then((ud) => { setUd(ud); TMSpinner.hide(); }).catch((err) => { TMExceptionBoxManager.show({ exception: err }); });
|
|
79
|
-
}, [userId]);
|
|
80
|
-
const getIcon = () => {
|
|
81
|
-
if (!showIcon)
|
|
82
|
-
return null;
|
|
83
|
-
if (!userId)
|
|
84
|
-
return null;
|
|
85
|
-
return ud ?
|
|
86
|
-
_jsx(TMUserIcon, { ud: ud })
|
|
87
|
-
:
|
|
88
|
-
_jsx(TMTooltip, { content: SDKUI_Localizator.ValueNotPresent, children: _jsx(IconWarning, { color: TMColors.warning }) });
|
|
89
|
-
};
|
|
90
|
-
const getDescription = () => {
|
|
91
|
-
if (!userId)
|
|
92
|
-
return undefined;
|
|
93
|
-
return ud ? getCompleteUserName(ud.domain, ud.name) : userId.toString() ?? noneSelectionText;
|
|
94
|
-
};
|
|
95
|
-
return (_jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '4px' }, children: [getIcon(), _jsx("span", { children: getDescription() })] })
|
|
96
|
-
// <StyledDivHorizontal>
|
|
97
|
-
// {getIcon()}
|
|
98
|
-
// <p style={{ textAlign: 'left', marginLeft: showIcon ? '5px' : '', opacity: ud ? 1 : 0.5 }}>
|
|
99
|
-
// {getDescription()}
|
|
100
|
-
// </p>
|
|
101
|
-
// </StyledDivHorizontal>
|
|
102
|
-
);
|
|
103
|
-
};
|
|
104
68
|
export const TMUserIcon = ({ ud }) => {
|
|
105
69
|
if (!ud)
|
|
106
70
|
return null;
|
|
@@ -109,12 +73,28 @@ export const TMUserIcon = ({ ud }) => {
|
|
|
109
73
|
return (_jsx(TMUserTooltip, { ud: ud, children: icon }));
|
|
110
74
|
};
|
|
111
75
|
export const TMUserTooltip = ({ ud, children }) => {
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
76
|
+
const buildTitle = (ud) => {
|
|
77
|
+
if (!ud)
|
|
78
|
+
return '';
|
|
79
|
+
const isExpired = User_IsExpired(ud);
|
|
80
|
+
return [
|
|
81
|
+
`ID: ${ud.id ?? ''}`,
|
|
82
|
+
`${SDKUI_Localizator.Name}: ${getCompleteUserName(ud.domain, ud.name) ?? ''}`,
|
|
83
|
+
ud.description && `${SDKUI_Localizator.Description}: ${ud.description}`,
|
|
84
|
+
ud.type && `${SDKUI_Localizator.Type}: ${ud.type}`,
|
|
85
|
+
ud.level && `${SDKUI_Localizator.UserLevel}: ${LocalizeUserLevels(ud.level) ?? ''}`,
|
|
86
|
+
`${SDKUI_Localizator.Valid}: ${isExpired ? SDKUI_Localizator.No : SDKUI_Localizator.Yes}`,
|
|
87
|
+
`${SDKUI_Localizator.Disabled}: ${ud.disabled ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}`,
|
|
88
|
+
`---`,
|
|
89
|
+
`${SDKUI_Localizator.OwnerName}: ${ud.ownerName ?? ''} (${ud.ownerID ?? ''})`,
|
|
90
|
+
`${SDKUI_Localizator.OwnershipLevel}: ${LocalizeOwnershipLevels(ud.ownershipLevel) ?? ''}`,
|
|
91
|
+
`${SDKUI_Localizator.CreationTime}: ${ud.creationTime?.toDateString() ?? ''}`,
|
|
92
|
+
`${SDKUI_Localizator.LastUpdateTime}: ${ud.lastUpdateTime?.toDateString() ?? ''}`
|
|
93
|
+
]
|
|
94
|
+
.filter(Boolean)
|
|
95
|
+
.join('\n');
|
|
116
96
|
};
|
|
117
|
-
return (_jsx(
|
|
97
|
+
return (_jsx("div", { title: buildTitle(ud), children: children }));
|
|
118
98
|
};
|
|
119
99
|
const getCompleteUserName = (domain, name) => {
|
|
120
100
|
if (!name)
|
|
@@ -10,27 +10,36 @@ const TMDateBox = (props) => {
|
|
|
10
10
|
let htmlElement = dateBoxRef?.current?.instance().element();
|
|
11
11
|
if (!htmlElement)
|
|
12
12
|
return;
|
|
13
|
-
let
|
|
13
|
+
let borderColor = props.isModifiedWhen ? TMColors.tertiary : TMColors.border_normal;
|
|
14
|
+
let textColor = props.isModifiedWhen ? TMColors.isModified : TMColors.text_normal;
|
|
14
15
|
let inputContainer = htmlElement.getElementsByClassName("dx-texteditor-input-container")[0];
|
|
15
16
|
if (inputContainer) {
|
|
16
17
|
inputContainer.style.background = props.readOnly ? 'linear-gradient(white 20%, #d6d6d6 80%)' : '';
|
|
17
|
-
inputContainer.style.color = props.readOnly ? '#525252' :
|
|
18
|
+
inputContainer.style.color = props.readOnly ? '#525252' : textColor;
|
|
19
|
+
}
|
|
20
|
+
let input = htmlElement.querySelector(".dx-texteditor-input");
|
|
21
|
+
if (input) {
|
|
22
|
+
if (!props.readOnly) {
|
|
23
|
+
input.style.color = textColor;
|
|
24
|
+
}
|
|
25
|
+
input.style.fontSize = 'var(--base-font-size)';
|
|
26
|
+
input.style.fontFamily = 'var(--base-font-family)';
|
|
18
27
|
}
|
|
19
28
|
let label = htmlElement.getElementsByClassName("dx-label")[0];
|
|
20
29
|
if (label) {
|
|
21
|
-
label.style.borderBottomColor =
|
|
30
|
+
label.style.borderBottomColor = borderColor;
|
|
22
31
|
}
|
|
23
32
|
let labelBefore = htmlElement.getElementsByClassName("dx-label-before")[0];
|
|
24
33
|
if (labelBefore) {
|
|
25
|
-
labelBefore.style.borderBottomColor =
|
|
26
|
-
labelBefore.style.borderTopColor =
|
|
27
|
-
labelBefore.style.borderInlineStartColor =
|
|
34
|
+
labelBefore.style.borderBottomColor = borderColor;
|
|
35
|
+
labelBefore.style.borderTopColor = borderColor;
|
|
36
|
+
labelBefore.style.borderInlineStartColor = borderColor;
|
|
28
37
|
}
|
|
29
38
|
let labelAfter = htmlElement.getElementsByClassName("dx-label-after")[0];
|
|
30
39
|
if (labelAfter) {
|
|
31
|
-
labelAfter.style.borderBottomColor =
|
|
32
|
-
labelAfter.style.borderTopColor =
|
|
33
|
-
labelAfter.style.borderInlineEndColor =
|
|
40
|
+
labelAfter.style.borderBottomColor = borderColor;
|
|
41
|
+
labelAfter.style.borderTopColor = borderColor;
|
|
42
|
+
labelAfter.style.borderInlineEndColor = borderColor;
|
|
34
43
|
}
|
|
35
44
|
}, [props.isModifiedWhen, props.readOnly]);
|
|
36
45
|
const dateBoxRef = useRef(null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CultureIDs } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { CultureIDs, QueryDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
export declare const getCultureIDImg: (cultureID: CultureIDs) => any;
|
|
5
5
|
interface TMLocalizedTextBoxProps {
|
|
@@ -13,6 +13,8 @@ interface TMLocalizedTextBoxProps {
|
|
|
13
13
|
value_ES?: string;
|
|
14
14
|
value_DE?: string;
|
|
15
15
|
validationItems?: ValidationItem[];
|
|
16
|
+
qd?: QueryDescriptor;
|
|
17
|
+
tid?: number;
|
|
16
18
|
onValueChanged: (lang: CultureIDs, value: string) => void;
|
|
17
19
|
}
|
|
18
20
|
declare const TMLocalizedTextBox: React.FC<TMLocalizedTextBoxProps>;
|