@topconsultnpm/sdkui-react 6.20.0-dev1.72 → 6.20.0-dev1.74
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/base/TMFileManager.js +14 -14
- package/lib/components/features/documents/TMDcmtTasks.js +9 -9
- package/lib/components/features/tasks/TMTasksUtils.js +3 -3
- package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
- package/lib/helper/TMCommandsContextMenu.js +15 -4
- package/lib/index.js +2 -2
- package/package.json +3 -3
|
@@ -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;
|
|
@@ -497,21 +497,21 @@ export const createTasksMenuItems = (taskDescriptor, showId, setShowId, showSear
|
|
|
497
497
|
onClick: () => setShowSearch(prevShowSearch => !prevShowSearch),
|
|
498
498
|
disabled: false,
|
|
499
499
|
beginGroup: true,
|
|
500
|
-
operationType: '
|
|
500
|
+
operationType: 'multiRow'
|
|
501
501
|
},
|
|
502
502
|
{
|
|
503
503
|
name: showId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show,
|
|
504
504
|
icon: _jsx("span", { className: showId ? "dx-icon-eyeclose" : "dx-icon-eyeopen" }),
|
|
505
505
|
onClick: () => setShowId(prevShowId => !prevShowId),
|
|
506
506
|
disabled: false,
|
|
507
|
-
operationType: '
|
|
507
|
+
operationType: 'multiRow'
|
|
508
508
|
},
|
|
509
509
|
{
|
|
510
510
|
name: SDKUI_Localizator.Refresh,
|
|
511
511
|
icon: _jsx("span", { className: "dx-icon-refresh" }),
|
|
512
512
|
onClick: () => getAllTasks(),
|
|
513
513
|
disabled: false,
|
|
514
|
-
operationType: '
|
|
514
|
+
operationType: 'multiRow'
|
|
515
515
|
},
|
|
516
516
|
];
|
|
517
517
|
// Apply filters
|
|
@@ -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
|
});
|
package/lib/index.js
CHANGED
|
@@ -12,5 +12,5 @@ export * from './hooks/useRelatedDocuments';
|
|
|
12
12
|
export * from './hooks/useSettingsFeedback';
|
|
13
13
|
export * from './services';
|
|
14
14
|
import config from 'devextreme/core/config';
|
|
15
|
-
// DevExtreme License Key (valid for v25.
|
|
16
|
-
config({ licenseKey: '
|
|
15
|
+
// DevExtreme License Key (valid for v25.2 and earlier versions)
|
|
16
|
+
config({ licenseKey: 'ewogICJmb3JtYXQiOiAxLAogICJjdXN0b21lcklkIjogIjE1ODg1NDc4LTNjNTItNGUzYy1hNDI1LTU5NjAzMzQ0ZDVjMyIsCiAgIm1heFZlcnNpb25BbGxvd2VkIjogMjUyCn0=.ClI5PeQ2vnl48q0hwdwPHM6oDArs6XTeZ9u4JfN6kxaHoKgszVywO996SluAQfPdFhtzWz6OZsyDdenKv28UU2dOF5wppP88hGEJ17PAg+N/OpUkL1L/CMFNXlOIsYd2517GWA==' });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
-
"version": "6.20.0-dev1.
|
|
3
|
+
"version": "6.20.0-dev1.74",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@topconsultnpm/sdk-ts": "6.20.0-dev1.5",
|
|
44
44
|
"buffer": "^6.0.3",
|
|
45
|
-
"devextreme": "25.
|
|
46
|
-
"devextreme-react": "25.
|
|
45
|
+
"devextreme": "25.2.4",
|
|
46
|
+
"devextreme-react": "25.2.4",
|
|
47
47
|
"exceljs": "^4.4.0",
|
|
48
48
|
"htmlparser2": "^10.0.0",
|
|
49
49
|
"pdfjs-dist": "5.4.296",
|