@topconsultnpm/sdkui-react 6.20.0-dev1.71 → 6.20.0-dev1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +1 -1
- package/lib/components/base/TMFileManager.js +14 -14
- package/lib/components/features/documents/TMDcmtTasks.js +9 -9
- package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
- package/lib/helper/TMCommandsContextMenu.js +15 -4
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { extractTextsFromDirectory, findFileItems, setFolderTreeViewItems } from "./TMFileManagerUtils";
|
|
4
4
|
import { DeviceType, useDeviceType } from "./TMDeviceProvider";
|
|
5
|
-
import { formatBytes, Globalization, IconDashboard, IconFolder, IconHide, IconList, IconMenuVertical, IconRefresh, IconShow, SDKUI_Globals, SDKUI_Localizator,
|
|
5
|
+
import { formatBytes, Globalization, IconDashboard, IconFolder, IconHide, IconList, IconMenuVertical, IconRefresh, IconShow, SDKUI_Globals, SDKUI_Localizator, TMCommandsContextMenu, TMConditionalWrapper } from "../../helper";
|
|
6
6
|
import TMTooltip from "./TMTooltip";
|
|
7
7
|
import { TMColors } from "../../utils/theme";
|
|
8
8
|
import TMPanel from "./TMPanel";
|
|
@@ -98,18 +98,18 @@ const TMFileManager = (props) => {
|
|
|
98
98
|
const onBackCallback = useCallback(() => {
|
|
99
99
|
setOpenDraftList(false);
|
|
100
100
|
}, []);
|
|
101
|
-
const toolbar = useMemo(() =>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
101
|
+
const toolbar = useMemo(() => _jsx(TMCommandsContextMenu, { target: '#TMPanel-FileManager-Commands-Header', menuItems: [
|
|
102
|
+
{
|
|
103
|
+
icon: isLeftPanelCollapsed ? _jsx(IconShow, {}) : _jsx(IconHide, {}),
|
|
104
|
+
onClick: () => setIsLeftPanelCollapsed(prev => !prev),
|
|
105
|
+
text: isLeftPanelCollapsed ? SDKUI_Localizator.ShowLeftPanel : SDKUI_Localizator.HideLeftPanel,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
icon: _jsx(IconRefresh, {}),
|
|
109
|
+
onClick: async () => await refreshCallback(),
|
|
110
|
+
text: SDKUI_Localizator.Refresh,
|
|
111
|
+
},
|
|
112
|
+
], showEvent: "click", children: _jsx(IconMenuVertical, { id: "TMPanel-FileManager-Commands-Header", color: 'white', cursor: 'pointer' }) }), [isLeftPanelCollapsed]);
|
|
113
113
|
// Handle closing the context menu
|
|
114
114
|
const closeTreeViewContextMenu = useCallback(() => {
|
|
115
115
|
setTreeViewAnchor(null);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import { IconMenuVertical, IconRefresh, SDKUI_Localizator,
|
|
3
|
+
import { IconMenuVertical, IconRefresh, SDKUI_Localizator, TMCommandsContextMenu } from "../../../helper";
|
|
4
4
|
import { DeviceType, useDeviceType } from "../../base/TMDeviceProvider";
|
|
5
5
|
import { useTMPanelManagerContext } from "../../layout/panelManager/TMPanelManagerContext";
|
|
6
6
|
import TMPanel from "../../base/TMPanel";
|
|
@@ -12,13 +12,13 @@ const TMDcmtTasks = (props) => {
|
|
|
12
12
|
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
|
13
13
|
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
14
14
|
const { togglePanelVisibility, toggleMaximize, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
15
|
-
const toolbar = useMemo(() =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
const toolbar = useMemo(() => _jsx(TMCommandsContextMenu, { target: '#TMTaksPanel-Commands-Header', showEvent: "click", menuItems: [
|
|
16
|
+
{
|
|
17
|
+
icon: _jsx(IconRefresh, {}),
|
|
18
|
+
onClick: async () => await getAllTasks(),
|
|
19
|
+
text: SDKUI_Localizator.Refresh,
|
|
20
|
+
},
|
|
21
|
+
], children: _jsx(IconMenuVertical, { id: "TMTaksPanel-Commands-Header", color: 'white', cursor: 'pointer' }) }), []);
|
|
22
22
|
return _jsx("div", { style: { width: "100%", height: "100%", position: 'relative' }, children: _jsx(TMPanel, { title: SDKUI_Localizator.Widget_Activities, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onClose: countVisibleLeafPanels() > 1 ? () => togglePanelVisibility("tmDcmtTasks") : undefined, onMaximize: countVisibleLeafPanels() > 1 ? () => toggleMaximize("tmDcmtTasks") : undefined, toolbar: toolbar, children: _jsx(TMTasksPanelContent, { id: "dcmtTasks", taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: () => { return Promise.resolve(); }, handleNavigateToDossiers: () => { return Promise.resolve(); }, afterTaskSaved: afterTaskSaved }) }) });
|
|
23
23
|
};
|
|
24
24
|
export default TMDcmtTasks;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { HidingEvent } from "devextreme/ui/context_menu";
|
|
3
3
|
interface TMCommandsContextMenuProps {
|
|
4
|
-
target
|
|
4
|
+
target?: string | Element | undefined;
|
|
5
5
|
menuItems: Array<any>;
|
|
6
6
|
id?: string;
|
|
7
7
|
showEvent?: string | {
|
|
@@ -9,6 +9,8 @@ interface TMCommandsContextMenuProps {
|
|
|
9
9
|
name?: string;
|
|
10
10
|
} | undefined;
|
|
11
11
|
onHiding?: ((e: HidingEvent<any>) => void) | undefined;
|
|
12
|
+
trigger?: 'right' | 'left';
|
|
13
|
+
children?: React.ReactNode;
|
|
12
14
|
}
|
|
13
|
-
export declare const TMCommandsContextMenu: React.MemoExoticComponent<({ target, menuItems, id, showEvent, onHiding }: TMCommandsContextMenuProps) => import("react/jsx-runtime").JSX.Element>;
|
|
15
|
+
export declare const TMCommandsContextMenu: React.MemoExoticComponent<({ target, menuItems, id, showEvent, onHiding, trigger, children }: TMCommandsContextMenuProps) => import("react/jsx-runtime").JSX.Element>;
|
|
14
16
|
export {};
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { ContextMenu } from "
|
|
4
|
-
export const TMCommandsContextMenu = React.memo(({ target, menuItems, id, showEvent = 'contextmenu', onHiding }) => {
|
|
5
|
-
|
|
2
|
+
import React, { useMemo } from "react";
|
|
3
|
+
import { ContextMenu } from "../components/NewComponents/ContextMenu";
|
|
4
|
+
export const TMCommandsContextMenu = React.memo(({ target, menuItems, id, showEvent = 'contextmenu', onHiding, trigger = 'left', children }) => {
|
|
5
|
+
// Convert DevExtreme menu items format to TMContextMenu format
|
|
6
|
+
const convertedItems = useMemo(() => {
|
|
7
|
+
return menuItems.map(item => ({
|
|
8
|
+
name: item.text,
|
|
9
|
+
icon: item.icon,
|
|
10
|
+
onClick: item.onClick,
|
|
11
|
+
disabled: item.disabled,
|
|
12
|
+
beginGroup: item.beginGroup,
|
|
13
|
+
visible: item.visible,
|
|
14
|
+
}));
|
|
15
|
+
}, [menuItems]);
|
|
16
|
+
return (_jsx(ContextMenu, { target: typeof target === 'string' ? target : undefined, items: convertedItems, trigger: trigger, children: children }));
|
|
6
17
|
});
|