@topconsultnpm/sdkui-react 6.20.0-dev1.11 → 6.20.0-dev1.111
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/base/TMTreeView.d.ts +2 -1
- package/lib/components/base/TMTreeView.js +33 -26
- 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();
|
|
@@ -22,10 +22,11 @@ interface ITMTreeViewProps<T extends ITMTreeItem> {
|
|
|
22
22
|
onNodeUpdate?: (updatedNode: T) => void;
|
|
23
23
|
onDataChanged?: (items: T[]) => void;
|
|
24
24
|
shouldDelayFocusOnEvent?: (node: T, event: React.MouseEvent) => boolean;
|
|
25
|
+
autoSelectChildren?: boolean;
|
|
25
26
|
itemsPerPage?: number;
|
|
26
27
|
showLoadMoreButton?: boolean;
|
|
27
28
|
}
|
|
28
|
-
declare const TMTreeView: <T extends ITMTreeItem>({ dataSource, focusedItem, selectedItems, allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, itemsPerPage, showLoadMoreButton }: ITMTreeViewProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare const TMTreeView: <T extends ITMTreeItem>({ dataSource, focusedItem, selectedItems, allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, autoSelectChildren, itemsPerPage, showLoadMoreButton }: ITMTreeViewProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
29
30
|
export default TMTreeView;
|
|
30
31
|
export declare const StyledTreeNode: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
31
32
|
$isSelected?: boolean;
|
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useRef } from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { IconChevronDown, IconChevronRight } from '../../helper';
|
|
5
5
|
import TMButton from './TMButton';
|
|
6
|
-
const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, itemsPerPage = 100, showLoadMoreButton = true }) => {
|
|
6
|
+
const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, autoSelectChildren = true, itemsPerPage = 100, showLoadMoreButton = true }) => {
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
const handleKeyDown = (event) => {
|
|
9
9
|
if (!focusedItem)
|
|
@@ -187,47 +187,51 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
|
|
|
187
187
|
};
|
|
188
188
|
let newSelectedItems;
|
|
189
189
|
if (checked) {
|
|
190
|
-
if (node.isContainer) {
|
|
191
|
-
// Quando selezioni un container, aggiungi il container stesso + tutti i figli
|
|
190
|
+
if (node.isContainer && autoSelectChildren) {
|
|
191
|
+
// Quando selezioni un container, aggiungi il container stesso + tutti i figli (se autoSelectChildren è true)
|
|
192
192
|
const allChildren = flattenTree(node.items || []);
|
|
193
193
|
newSelectedItems = [...selectedItems, node, ...allChildren];
|
|
194
194
|
}
|
|
195
195
|
else if (!selectedItems.some(item => item.key === node.key)) {
|
|
196
|
-
// Quando selezioni un figlio, aggiungi il
|
|
196
|
+
// Quando selezioni un figlio o un container con autoSelectChildren=false, aggiungi solo il nodo
|
|
197
197
|
newSelectedItems = [...selectedItems, node];
|
|
198
|
-
// Verifica se selezionando questo figlio sono ora selezionati tutti i figli del parent
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
// Verifica se selezionando questo figlio sono ora selezionati tutti i figli del parent (solo se autoSelectChildren è true)
|
|
199
|
+
if (autoSelectChildren) {
|
|
200
|
+
const parentsToAdd = findAndCheckParents(dataSource, node, newSelectedItems);
|
|
201
|
+
newSelectedItems = [...newSelectedItems, ...parentsToAdd];
|
|
202
|
+
}
|
|
201
203
|
}
|
|
202
204
|
else {
|
|
203
205
|
newSelectedItems = selectedItems;
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
|
-
else if (node.isContainer) {
|
|
207
|
-
// Quando deselezioni un container, rimuovi il container stesso + tutti i figli
|
|
208
|
+
else if (node.isContainer && autoSelectChildren) {
|
|
209
|
+
// Quando deselezioni un container, rimuovi il container stesso + tutti i figli (solo se autoSelectChildren è true)
|
|
208
210
|
const childKeys = flattenTree(node.items || []).map(item => item.key);
|
|
209
211
|
newSelectedItems = selectedItems.filter(item => item.key !== node.key && !childKeys.includes(item.key));
|
|
210
212
|
}
|
|
211
213
|
else {
|
|
212
|
-
// Quando deselezioni un figlio, rimuovi il
|
|
214
|
+
// Quando deselezioni un figlio o un container con autoSelectChildren=false, rimuovi solo il nodo
|
|
213
215
|
newSelectedItems = selectedItems.filter(item => item.key !== node.key);
|
|
214
|
-
// Se il figlio apparteneva a un parent che era selezionato, rimuovi anche il parent
|
|
215
|
-
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
216
|
+
// Se il figlio apparteneva a un parent che era selezionato, rimuovi anche il parent (solo se autoSelectChildren è true)
|
|
217
|
+
if (autoSelectChildren && !node.isContainer) {
|
|
218
|
+
const removeParentContainers = (items) => {
|
|
219
|
+
const parentsToRemove = [];
|
|
220
|
+
items.forEach(item => {
|
|
221
|
+
if (item.isContainer && item.items) {
|
|
222
|
+
const childKeys = flattenTree(item.items).map(child => child.key);
|
|
223
|
+
if (childKeys.includes(node.key)) {
|
|
224
|
+
parentsToRemove.push(item.key);
|
|
225
|
+
}
|
|
226
|
+
// Ricorsione per parent annidati
|
|
227
|
+
parentsToRemove.push(...removeParentContainers(item.items));
|
|
222
228
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
const parentsToRemove = removeParentContainers(dataSource);
|
|
230
|
-
newSelectedItems = newSelectedItems.filter(item => !parentsToRemove.includes(item.key));
|
|
229
|
+
});
|
|
230
|
+
return parentsToRemove;
|
|
231
|
+
};
|
|
232
|
+
const parentsToRemove = removeParentContainers(dataSource);
|
|
233
|
+
newSelectedItems = newSelectedItems.filter(item => !parentsToRemove.includes(item.key));
|
|
234
|
+
}
|
|
231
235
|
}
|
|
232
236
|
onSelectionChanged?.(newSelectedItems);
|
|
233
237
|
};
|
|
@@ -252,6 +256,9 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
|
|
|
252
256
|
// setTreeData(prevData => collapseAll(prevData));
|
|
253
257
|
// };
|
|
254
258
|
const isIndeterminate = (node) => {
|
|
259
|
+
// Lo stato indeterminate ha senso solo quando autoSelectChildren è true
|
|
260
|
+
if (!autoSelectChildren)
|
|
261
|
+
return false;
|
|
255
262
|
if (!node.isContainer || !node.items)
|
|
256
263
|
return false;
|
|
257
264
|
const childKeys = flattenTree(node.items).map(item => item.key);
|
|
@@ -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;
|