@topconsultnpm/sdkui-react 6.21.0-dev1.5 → 6.21.0-dev1.51
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 +2 -2
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +43 -19
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +1 -1
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +79 -27
- package/lib/components/base/Styled.d.ts +76 -40
- package/lib/components/base/TMAreaManager.js +28 -11
- package/lib/components/base/TMFileManagerDataGridView.js +2 -2
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -2
- package/lib/components/base/TMPanel.js +1 -0
- package/lib/components/base/TMTreeView.d.ts +5 -3
- package/lib/components/choosers/TMDataListItemChooser.js +25 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.js +50 -23
- package/lib/components/choosers/TMUserChooser.js +3 -1
- package/lib/components/editors/TMDropDown.js +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +42 -10
- package/lib/components/editors/TMFormulaEditor.js +15 -3
- package/lib/components/editors/TMMetadataEditor.js +4 -3
- package/lib/components/editors/TMMetadataValues.js +1 -1
- package/lib/components/features/archive/TMArchive.js +1 -1
- package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtBlog.js +2 -2
- package/lib/components/features/documents/TMDcmtForm.js +11 -7
- package/lib/components/features/documents/TMDcmtPreview.d.ts +5 -3
- package/lib/components/features/documents/TMDragDropOverlay.js +7 -2
- package/lib/components/features/documents/TMFileUploader.js +5 -4
- package/lib/components/features/documents/TMMasterDetailDcmts.js +74 -21
- package/lib/components/features/documents/TMRelationViewer.d.ts +6 -1
- package/lib/components/features/documents/TMRelationViewer.js +44 -7
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.js +2 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +13 -1
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -3
- package/lib/components/features/search/TMSearchResult.js +16 -3
- package/lib/components/features/search/TMViewHistoryDcmt.js +6 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +5 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +7 -1
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -1
- package/lib/components/features/workflow/diagram/xmlParser.js +13 -14
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +15 -5
- package/lib/components/forms/TMChooserForm.js +25 -2
- package/lib/components/grids/TMBlogsPost.js +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +5 -2
- package/lib/components/pages/TMPage.js +4 -2
- package/lib/components/query/TMQueryCountButton.d.ts +11 -0
- package/lib/components/query/TMQueryCountButton.js +32 -0
- package/lib/components/query/TMQueryEditor.d.ts +10 -6
- package/lib/components/query/TMQueryEditor.js +41 -4
- package/lib/components/query/TMQuerySummary.js +3 -2
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -2
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +2 -2
- package/lib/helper/SDKUI_Globals.d.ts +2 -0
- package/lib/helper/SDKUI_Localizator.d.ts +1 -0
- package/lib/helper/SDKUI_Localizator.js +10 -0
- package/lib/helper/TMPdfViewer.js +143 -86
- package/lib/helper/TMUtils.d.ts +4 -3
- package/lib/helper/TMUtils.js +12 -0
- package/lib/helper/checkinCheckoutManager.d.ts +7 -2
- package/lib/helper/checkinCheckoutManager.js +220 -11
- package/lib/hooks/useCheckInOutOperations.d.ts +1 -1
- package/lib/hooks/useCheckInOutOperations.js +9 -4
- package/lib/hooks/useDcmtOperations.d.ts +1 -0
- package/lib/hooks/useDcmtOperations.js +74 -4
- package/lib/hooks/useDocumentOperations.js +20 -6
- package/lib/hooks/useForm.js +20 -14
- package/lib/hooks/useInputDialog.d.ts +2 -0
- package/lib/hooks/useInputDialog.js +37 -0
- package/lib/hooks/useQueryParametersDialog.js +5 -5
- package/lib/services/platform_services.d.ts +1 -1
- package/lib/services/platform_services.js +8 -0
- package/package.json +54 -55
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import FileManager, { Column, Details, ItemView, Permissions, Notifications, ContextMenu, Toolbar, Item } from 'devextreme-react/file-manager';
|
|
4
|
-
import { FileDescriptor, FileFormats, FileTransferModes, SDK_Localizator, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
4
|
+
import { FileDescriptor, FileFormats, FileTransferModes, SDK_Localizator, SDK_Globals, AppModules } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
import CustomFileSystemProvider from 'devextreme/file_management/custom_provider';
|
|
6
6
|
import FileSystemError from "devextreme/file_management/error";
|
|
7
7
|
import Button from "devextreme/ui/button";
|
|
8
8
|
import { alert, confirm } from "devextreme/ui/dialog";
|
|
9
9
|
import { loadMessages } from 'devextreme/localization';
|
|
10
|
-
import { Globalization, IconAll, IconCloud, IconFolder, IconFolderForCSS, IconSelected, SDKUI_Localizator, svgToString } from '../../helper';
|
|
10
|
+
import { getFileManagerFolderColor, Globalization, IconAll, IconCloud, IconFolder, IconFolderForCSS, IconSelected, SDKUI_Localizator, svgToString } from '../../helper';
|
|
11
11
|
import { TMExceptionBoxManager } from './TMPopUp';
|
|
12
12
|
import ShowAlert from './TMAlert';
|
|
13
13
|
import { TMLayoutWaitingContainer } from './TMWaitPanel';
|
|
14
14
|
import TMCounterContainer, { CounterItemKey } from './TMCounterContainer';
|
|
15
15
|
import { IconPdf, IconTxt, IconXls, IconDocx, IconImage, IconZip, IconXml, IconMp4, IconEmail, IconPpt, IconSigned, IconExe, IconHtml, IconDwg, IconDicom, IconSlddrw } from '../../assets/thumbnails';
|
|
16
|
-
import { TMColors } from '../../utils/theme';
|
|
17
16
|
import styled from 'styled-components';
|
|
18
17
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
19
18
|
export class TMFileSystemItem {
|
|
@@ -25,8 +24,10 @@ export class TMFileSystemItem {
|
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
let abortController = new AbortController();
|
|
28
|
-
const
|
|
29
|
-
const
|
|
27
|
+
const generateSvgDataUrl = (color) => {
|
|
28
|
+
const svgString = encodeURIComponent(renderToStaticMarkup(_jsx(IconFolderForCSS, { fill: color })));
|
|
29
|
+
return `data:image/svg+xml,${svgString}`;
|
|
30
|
+
};
|
|
30
31
|
const StyledFileManagerWrapper = styled.div `
|
|
31
32
|
.dx-filemanager .dx-treeview-item .dx-icon-folder {
|
|
32
33
|
display: none !important;
|
|
@@ -44,7 +45,7 @@ const StyledFileManagerWrapper = styled.div `
|
|
|
44
45
|
width: 20px;
|
|
45
46
|
height: 20px;
|
|
46
47
|
transform: translateY(-50%);
|
|
47
|
-
background-image: url("${
|
|
48
|
+
background-image: url("${props => generateSvgDataUrl(props.$folderColor)}");
|
|
48
49
|
background-size: contain;
|
|
49
50
|
background-repeat: no-repeat;
|
|
50
51
|
display: inline-block;
|
|
@@ -390,7 +391,9 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
390
391
|
const deleteItem = async (item) => {
|
|
391
392
|
const ad = item.dataItem.dataItem;
|
|
392
393
|
const aid = ad.id;
|
|
393
|
-
const
|
|
394
|
+
const subFolderOld = item.parentPath === ad.name ? '' : item.parentPath.replace(ad.name + '/', '');
|
|
395
|
+
const subFolder = getSubFolder(item.parentPath, ad.name);
|
|
396
|
+
console.log("Delete item with subfolder: ", subFolder, " old subfolder: ", subFolderOld);
|
|
394
397
|
const tms = props.tmSession ?? SDK_Globals.tmSession;
|
|
395
398
|
if (item.isDirectory) {
|
|
396
399
|
await tms?.NewAreaEngine().DeleteFoldersAsync(aid, subFolder, [item.name]).catch((err) => { throw new FileSystemError(5, item, err.message ?? SDKUI_Localizator.GetFolderDeletionErrorMessage); });
|
|
@@ -594,16 +597,29 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
594
597
|
throw new FileSystemError(5, undefined, error.message ?? SDKUI_Localizator.Error);
|
|
595
598
|
}
|
|
596
599
|
};
|
|
600
|
+
const getSubFolder = (dir, startStr) => {
|
|
601
|
+
//Se devo controllare che inizi per il nome dell'area, se non inizia ritorno la dir così com'è (caso di file aperto da percorso completo)
|
|
602
|
+
if (startStr && !dir.startsWith(startStr)) {
|
|
603
|
+
return dir;
|
|
604
|
+
}
|
|
605
|
+
//In tutti gli altri casi rimuovo la prima cartella del percorso (che corrisponde al nome dell'area) e la restituisco come subfolder
|
|
606
|
+
const parts = dir.split("/");
|
|
607
|
+
console.log(parts);
|
|
608
|
+
let subFolder = parts.slice(1).join("/");
|
|
609
|
+
console.log(subFolder);
|
|
610
|
+
return subFolder;
|
|
611
|
+
};
|
|
597
612
|
const onCurrentDirectoryChanged = (e) => {
|
|
598
613
|
setCurrentRoute(e.directory.path);
|
|
599
614
|
setFocusedFileSystemItem(e.directory);
|
|
615
|
+
console.log("Current directory changed: ", e.directory);
|
|
600
616
|
if (e.directory.path === '' && e.directory.name === '')
|
|
601
617
|
return;
|
|
602
618
|
let ad = e.directory.dataItem.dataItem;
|
|
603
619
|
if (!ad)
|
|
604
620
|
return;
|
|
605
621
|
let aid = ad.id;
|
|
606
|
-
let subFolder = e.directory.path
|
|
622
|
+
let subFolder = getSubFolder(e.directory.path);
|
|
607
623
|
setAreaFolder(getAreaPath(aid, subFolder));
|
|
608
624
|
e.component.option("fileSystemProvider").getItems(e.directory).then((items) => {
|
|
609
625
|
setParentDirectoryFileSystemItems(items);
|
|
@@ -632,7 +648,7 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
632
648
|
};
|
|
633
649
|
const customizeIcon = useCallback((fileSystemItem) => {
|
|
634
650
|
if (fileSystemItem.isDirectory) {
|
|
635
|
-
return svgToString(_jsx(IconFolder, { fontSize: 20, color:
|
|
651
|
+
return svgToString(_jsx(IconFolder, { fontSize: 20, color: getFileManagerFolderColor(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER) }));
|
|
636
652
|
}
|
|
637
653
|
else {
|
|
638
654
|
const fileExtension = fileSystemItem.getFileExtension();
|
|
@@ -723,11 +739,12 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
723
739
|
alert(`"${e.name}" ${SDKUI_Localizator.FolderExist}`, SDKUI_Localizator.Attention);
|
|
724
740
|
}
|
|
725
741
|
};
|
|
726
|
-
|
|
742
|
+
const folderColor = getFileManagerFolderColor(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER);
|
|
743
|
+
return (_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsxs(StyledFileManagerWrapper, { "$folderColor": folderColor, style: { width: "100%", height: "100%" }, children: [_jsxs(FileManager, { width: props.width, ref: fileManagerRef, height: `calc(${props.height} - 30px)`, onItemMoving: onItemCopying, onItemCopying: onItemCopying, onFileUploading: onFileUploading, fileSystemProvider: areaProvider, customizeThumbnail: customizeIcon, rootFolderName: SDK_Localizator.Areas, onSelectionChanged: onSelectionChanged, onDirectoryCreating: onDirectoryCreating, onFocusedItemChanged: onFocusedItemChanged, onSelectedFileOpened: onSelectedFileOpened, onContextMenuItemClick: onContextMenuItemClick,
|
|
727
744
|
/* onItemMoved={() => setCounter(counter => counter + 1)}
|
|
728
745
|
onItemCopied={() => setCounter(counter => counter + 1)}
|
|
729
746
|
onItemDeleted={() => setCounter(counter => counter - 1)}
|
|
730
747
|
onFileUploaded={() => setCounter(counter => counter + 1)} */
|
|
731
|
-
onCurrentDirectoryChanged: onCurrentDirectoryChanged, selectionMode: props.selectionMode === 'single' ? 'single' : selectionMode, children: [_jsxs(Toolbar, { children: [_jsx(Item, { name: "showNavPane", visible: true }), _jsx(Item, { name: "create", visible: true }), _jsx(Item, { name: "upload", visible: true }), _jsx(Item, { name: "separator", location: 'after' }), _jsx(Item, { name: "switchView", visible: true }), _jsx(Item, { name: "refresh", visible: true })] }), _jsx(ContextMenu, { items: ["create", "upload", "rename", "move", "copy", "delete", "refresh", "download"] }), _jsx(Permissions, { copy: focusedFileSystemItem && focusedFileSystemItem.name !== "" &&
|
|
748
|
+
onCurrentDirectoryChanged: onCurrentDirectoryChanged, selectionMode: props.selectionMode === 'single' ? 'single' : selectionMode, children: [_jsxs(Toolbar, { children: [_jsx(Item, { name: "showNavPane", visible: true }), _jsx(Item, { name: "create", visible: true }), _jsx(Item, { name: "upload", visible: true }), _jsx(Item, { name: "separator", location: 'after' }), _jsx(Item, { name: "switchView", visible: true }), _jsx(Item, { name: "refresh", visible: true })] }), _jsx(ContextMenu, { items: ["create", "upload", "rename", "move", "copy", "delete", "refresh", "download"] }), _jsx(Permissions, { copy: focusedFileSystemItem && focusedFileSystemItem.name !== "" && getSubFolder(focusedFileSystemItem.path).length > 0, move: focusedFileSystemItem && focusedFileSystemItem.name !== "" && getSubFolder(focusedFileSystemItem.path).length > 0, create: focusedFileSystemItem && focusedFileSystemItem.name !== "", upload: focusedFileSystemItem && focusedFileSystemItem.name !== "", rename: focusedFileSystemItem && focusedFileSystemItem.name !== "" && getSubFolder(focusedFileSystemItem.path).length > 0, delete: focusedFileSystemItem && focusedFileSystemItem.name !== "" && getSubFolder(focusedFileSystemItem.path).length > 0, download: true }), _jsx(ItemView, { children: _jsxs(Details, { children: [_jsx(Column, { dataField: "thumbnail", cssClass: 'file-thumbnail' }, "thumbnail"), _jsx(Column, { dataField: "name", caption: SDKUI_Localizator.Name }, "name"), _jsx(Column, { dataField: 'size', width: '120px', alignment: 'center', dataType: 'number', caption: SDKUI_Localizator.File_Size }, "size"), _jsx(Column, { dataField: 'dateModified', width: '160px', alignment: 'center', dataType: 'datetime', caption: SDKUI_Localizator.Date_Modified }, "dateModified")] }) }), _jsx(Notifications, { showPopup: true, showPanel: true })] }), _jsx("div", { style: { width: "100%", height: "30px", overflowY: "hidden" }, children: _jsx(TMCounterContainer, { items: counterValues }) })] }) }));
|
|
732
749
|
};
|
|
733
750
|
export default TMAreaManager;
|
|
@@ -59,7 +59,7 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
59
59
|
const lockMode = checkoutDate && checkoutUsedId && userID && userID !== checkoutUsedId;
|
|
60
60
|
const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", findCheckOutUserName(checkOutUserName, checkOutUserID) ?? '-', " (ID: ", checkOutUserID, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", version ?? 1] }) }), _jsx("hr", {}), _jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Type }), ": ", ext] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.CreationTime }), ": ", Globalization.getDateTimeDisplayValue(creationTime?.toString())] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.LastUpdateTime }), ": ", Globalization.getDateTimeDisplayValue(lastUpdateTime?.toString())] })] })] })] });
|
|
61
61
|
return _jsxs("div", { style: { display: "inline-flex", alignItems: "center", gap: "4px" }, children: [editMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-edit" }) }), lockMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-lock" }) }), renderHighlightedText(cellData.value, searchText, false)] });
|
|
62
|
-
}, [searchText]);
|
|
62
|
+
}, [searchText, findCheckOutUserName]);
|
|
63
63
|
const cellExtRender = useCallback((cellData) => {
|
|
64
64
|
const item = cellData.data;
|
|
65
65
|
const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", item.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", item.did ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", item.tid ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", item.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", item.updaterName ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", item.version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(item.size ?? 0)] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.creationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime)] })] }));
|
|
@@ -85,7 +85,7 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
85
85
|
{ dataField: "lastUpdateTime", caption: SDKUI_Localizator.LastUpdateTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
|
|
86
86
|
{ dataField: "creationTime", caption: SDKUI_Localizator.CreationTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
|
|
87
87
|
];
|
|
88
|
-
}, [searchText]);
|
|
88
|
+
}, [searchText, cellNameRender]);
|
|
89
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);
|
|
90
90
|
};
|
|
91
91
|
export default TMFileManagerDataGridView;
|
|
@@ -40,11 +40,15 @@ export declare const colors: {
|
|
|
40
40
|
LIGHT_YELLOW: string;
|
|
41
41
|
MEDIUM_GREEN: string;
|
|
42
42
|
};
|
|
43
|
-
export declare const TMFileItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
43
|
+
export declare const TMFileItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$backgroundColor" | "$textColor" | "$bgHoverColor"> & {
|
|
44
44
|
$backgroundColor?: string;
|
|
45
45
|
$textColor?: string;
|
|
46
46
|
$bgHoverColor?: string;
|
|
47
|
-
}
|
|
47
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$backgroundColor" | "$textColor" | "$bgHoverColor"> & {
|
|
48
|
+
$backgroundColor?: string;
|
|
49
|
+
$textColor?: string;
|
|
50
|
+
$bgHoverColor?: string;
|
|
51
|
+
}, never>>> & string;
|
|
48
52
|
export declare const findFileItems: (items: Array<FileItem>, id: number) => FileItem | undefined;
|
|
49
53
|
export declare const setFolderTreeViewItems: (items: Array<FileItem>) => Array<TMFileManagerTreeViewDirectory>;
|
|
50
54
|
export declare const buildFolderHierarchy: (fileSystemTree: WGTreeDescriptor | undefined, draftsFile: SearchResultDescriptor | undefined, archivedDocuments: Array<SearchResultDescriptor> | undefined, participants: Array<UserDescriptor> | undefined) => {
|
|
@@ -26,6 +26,7 @@ const StyledPanelContainer = styled.div `
|
|
|
26
26
|
height: ${({ $isMaximized }) => $isMaximized ? `calc(100vh - 50px - (${Gutters.getGutters()}px * 2))` : '100%'};
|
|
27
27
|
z-index: ${({ $isMaximized }) => $isMaximized ? 2000 : 'auto'};
|
|
28
28
|
margin: ${({ $isMaximized }) => $isMaximized ? `${Gutters.getGutters()}px` : '0'};
|
|
29
|
+
outline: none;
|
|
29
30
|
/* transition: all 0.2s; */
|
|
30
31
|
`;
|
|
31
32
|
const StyledPanelHeader = styled.div `
|
|
@@ -30,7 +30,9 @@ interface ITMTreeViewProps<T extends ITMTreeItem> {
|
|
|
30
30
|
}
|
|
31
31
|
declare const TMTreeView: <T extends ITMTreeItem>({ dataSource, focusedItem, selectedItems, allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, onItemContextMenu, autoSelectChildren, itemsPerPage, showLoadMoreButton }: ITMTreeViewProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
export default TMTreeView;
|
|
33
|
-
export declare const StyledTreeNode: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
33
|
+
export declare const StyledTreeNode: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isSelected"> & {
|
|
34
34
|
$isSelected?: boolean;
|
|
35
|
-
}
|
|
36
|
-
|
|
35
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isSelected"> & {
|
|
36
|
+
$isSelected?: boolean;
|
|
37
|
+
}, never>>> & string;
|
|
38
|
+
export declare const StyledStickyPaginator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
@@ -1,17 +1,40 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useRef, useState } from 'react';
|
|
2
|
+
import React, { useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { SDK_Localizator, DataListCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { StyledDivHorizontal } from '../base/Styled';
|
|
5
5
|
import { IconSearch, SDKUI_Localizator, TMImageLibrary } from '../../helper';
|
|
6
|
+
import { TMColors } from '../../utils/theme';
|
|
6
7
|
import TMSpinner from '../base/TMSpinner';
|
|
8
|
+
import TMTooltip from '../base/TMTooltip';
|
|
7
9
|
import TMSummary from '../editors/TMSummary';
|
|
8
10
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
9
11
|
import TMDataListItemViewer from '../viewers/TMDataListItemViewer';
|
|
10
12
|
const TMDataListItemChooser = ({ labelColor, width = '100%', dataListId, icon, backgroundColor, showBorder = true, readOnly, openChooserBySingleClick, buttons = [], elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, titleForm, showClearButton = false, validationItems = [], onValueChanged, updateIsModalOpen }) => {
|
|
11
13
|
const [showChooser, setShowChooser] = useState(false);
|
|
12
14
|
const renderTemplate = () => {
|
|
15
|
+
const MAX_VISIBLE_ITEMS = 3;
|
|
16
|
+
const MAX_TOOLTIP_ITEMS = 50;
|
|
13
17
|
const isPlaceholder = values?.[0] === placeHolder;
|
|
14
|
-
|
|
18
|
+
const remainingCount = (values?.length ?? 0) - MAX_VISIBLE_ITEMS;
|
|
19
|
+
const totalCount = values?.length ?? 0;
|
|
20
|
+
const allValuesTooltip = values && values.length > MAX_TOOLTIP_ITEMS
|
|
21
|
+
? values.slice(0, MAX_TOOLTIP_ITEMS).join(', ') + ` ... (+${values.length - MAX_TOOLTIP_ITEMS})`
|
|
22
|
+
: values?.join(', ') ?? '';
|
|
23
|
+
return (_jsxs(StyledDivHorizontal, { style: { width: '100%', justifyContent: 'flex-start', color: isPlaceholder ? '#a9a9a9' : 'inherit', alignItems: 'center' }, children: [values && values.length > 0 && _jsxs(StyledDivHorizontal, { style: { alignItems: 'center', gap: '8px' }, children: [totalCount > MAX_VISIBLE_ITEMS && _jsx(TMTooltip, { content: _jsx("div", { style: { maxWidth: '300px', wordWrap: 'break-word', whiteSpace: 'pre-wrap' }, children: allValuesTooltip }), children: _jsx(StyledDivHorizontal, { style: { alignItems: 'center', gap: '4px' }, children: _jsx("span", { style: {
|
|
24
|
+
backgroundColor: TMColors.primary + '15',
|
|
25
|
+
color: TMColors.primary,
|
|
26
|
+
borderRadius: '4px',
|
|
27
|
+
padding: '2px 6px',
|
|
28
|
+
fontSize: '11px',
|
|
29
|
+
fontWeight: 600,
|
|
30
|
+
letterSpacing: '0.3px'
|
|
31
|
+
}, children: totalCount }) }) }), values.slice(0, MAX_VISIBLE_ITEMS).map((v, index) => (_jsx(React.Fragment, { children: _jsxs("span", { style: { display: 'inline-flex', alignItems: 'center' }, children: [_jsx(TMDataListItemViewer, { dataListId: dataListId, value: v, width: 'auto', showTooltip: false }), index < Math.min(values.length, MAX_VISIBLE_ITEMS) - 1 && _jsx("span", { style: { marginLeft: 0 }, children: "," })] }) }, index)))] }), values && values.length > MAX_VISIBLE_ITEMS &&
|
|
32
|
+
_jsx(TMTooltip, { content: _jsx("div", { style: { maxWidth: '300px', wordWrap: 'break-word', whiteSpace: 'pre-wrap' }, children: (() => {
|
|
33
|
+
const remainingValues = values.slice(MAX_VISIBLE_ITEMS);
|
|
34
|
+
return remainingValues.length > MAX_TOOLTIP_ITEMS
|
|
35
|
+
? remainingValues.slice(0, MAX_TOOLTIP_ITEMS).join(', ') + ` ... (+${remainingValues.length - MAX_TOOLTIP_ITEMS})`
|
|
36
|
+
: remainingValues.join(', ');
|
|
37
|
+
})() }), children: _jsx("p", { style: { marginLeft: '10px' }, children: `(+${remainingCount} ${remainingCount === 1 ? 'altro' : 'altri'})` }) })] }));
|
|
15
38
|
};
|
|
16
39
|
const summaryInputRef = useRef(null);
|
|
17
40
|
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { ref: summaryInputRef, placeHolder: placeHolder, labelColor: labelColor, width: width, icon: icon, buttons: buttons, readOnly: readOnly, backgroundColor: backgroundColor, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => {
|
|
@@ -39,4 +39,4 @@ interface ITMDynDataListItemChooserFormProps extends ITMChooserFormProps<DataLis
|
|
|
39
39
|
dynDL?: DynamicDataListDescriptor;
|
|
40
40
|
searchResult?: SearchResultDescriptor;
|
|
41
41
|
}
|
|
42
|
-
export declare const TMDynDataListItemChooserForm:
|
|
42
|
+
export declare const TMDynDataListItemChooserForm: (props: ITMDynDataListItemChooserFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -53,17 +53,20 @@ const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChoo
|
|
|
53
53
|
return await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(tid, md?.id, layoutMode, queryParamsDynDataList ?? [])
|
|
54
54
|
.catch((err) => { throw err; });
|
|
55
55
|
};
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
58
|
-
return "";
|
|
59
|
-
if (!values || values.length <= 0)
|
|
60
|
-
return "";
|
|
61
|
-
if (!values[0])
|
|
56
|
+
const getValueDescription = (value) => {
|
|
57
|
+
if (!value)
|
|
62
58
|
return "";
|
|
63
59
|
if (!dynDl)
|
|
64
|
-
return
|
|
65
|
-
let description = dataSource?.dtdResult?.rows?.filter(o => o[dynDl.selectItemForValue ?? 0] ==
|
|
66
|
-
return description ??
|
|
60
|
+
return value;
|
|
61
|
+
let description = dataSource?.dtdResult?.rows?.filter(o => o[dynDl.selectItemForValue ?? 0] == value)?.[0]?.[dynDl.selectItemForDescription ?? 0];
|
|
62
|
+
return description ?? value;
|
|
63
|
+
};
|
|
64
|
+
const getDescriptions = (maxItems = 3) => {
|
|
65
|
+
if (!Array.isArray(values))
|
|
66
|
+
return [];
|
|
67
|
+
if (!values || values.length <= 0)
|
|
68
|
+
return [];
|
|
69
|
+
return values.slice(0, maxItems).map(v => getValueDescription(v)).filter(d => d !== "");
|
|
67
70
|
};
|
|
68
71
|
const getIcon = () => {
|
|
69
72
|
if (!Array.isArray(values))
|
|
@@ -75,14 +78,37 @@ const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChoo
|
|
|
75
78
|
if (FormulaHelper.isFormula(values?.[0]))
|
|
76
79
|
return null;
|
|
77
80
|
if (!dynDl)
|
|
78
|
-
return
|
|
79
|
-
let description = dataSource?.dtdResult?.rows?.filter(o => o[dynDl.selectItemForValue ?? 0]
|
|
80
|
-
return description ?
|
|
81
|
+
return null;
|
|
82
|
+
let description = dataSource?.dtdResult?.rows?.filter(o => o[dynDl.selectItemForValue ?? 0]?.toString().toLowerCase() === values?.[0]?.toString().toLowerCase())?.[0]?.[dynDl.selectItemForDescription ?? 0];
|
|
83
|
+
return description ? null :
|
|
81
84
|
_jsx(TMTooltip, { content: SDKUI_Localizator.ValueNotPresent, children: _jsx(IconWarning, { color: TMColors.warning }) });
|
|
82
85
|
};
|
|
83
86
|
const renderTemplate = () => {
|
|
87
|
+
const MAX_VISIBLE_ITEMS = 3;
|
|
88
|
+
const MAX_TOOLTIP_ITEMS = 50;
|
|
84
89
|
const isPlaceholder = values?.[0] === placeHolder;
|
|
85
|
-
|
|
90
|
+
const descriptions = getDescriptions(MAX_VISIBLE_ITEMS);
|
|
91
|
+
const remainingCount = (values?.length ?? 0) - MAX_VISIBLE_ITEMS;
|
|
92
|
+
const totalCount = values?.length ?? 0;
|
|
93
|
+
const allDescriptionsArray = values?.map(v => getValueDescription(v)).filter(d => d !== "") ?? [];
|
|
94
|
+
const allDescriptions = allDescriptionsArray.length > MAX_TOOLTIP_ITEMS
|
|
95
|
+
? allDescriptionsArray.slice(0, MAX_TOOLTIP_ITEMS).join(', ') + ` ... (+${allDescriptionsArray.length - MAX_TOOLTIP_ITEMS})`
|
|
96
|
+
: allDescriptionsArray.join(', ');
|
|
97
|
+
return (_jsxs(StyledDivHorizontal, { style: { width: '100%', color: isPlaceholder ? '#a9a9a9' : 'inherit', alignItems: 'center' }, children: [dataSource && descriptions.length > 0 && _jsxs(StyledDivHorizontal, { style: { alignItems: 'center', gap: '8px' }, children: [totalCount > MAX_VISIBLE_ITEMS && _jsx(TMTooltip, { content: _jsx("div", { style: { maxWidth: '300px', wordWrap: 'break-word', whiteSpace: 'pre-wrap' }, children: allDescriptions }), children: _jsx(StyledDivHorizontal, { style: { alignItems: 'center', gap: '4px' }, children: _jsx("span", { style: {
|
|
98
|
+
backgroundColor: TMColors.primary + '15',
|
|
99
|
+
color: TMColors.primary,
|
|
100
|
+
borderRadius: '4px',
|
|
101
|
+
padding: '2px 6px',
|
|
102
|
+
fontSize: '11px',
|
|
103
|
+
fontWeight: 600,
|
|
104
|
+
letterSpacing: '0.3px'
|
|
105
|
+
}, children: totalCount }) }) }), getIcon(), _jsx("p", { children: descriptions.join(', ') })] }), values && values.length > MAX_VISIBLE_ITEMS &&
|
|
106
|
+
_jsx(TMTooltip, { content: _jsx("div", { style: { maxWidth: '300px', wordWrap: 'break-word', whiteSpace: 'pre-wrap' }, children: (() => {
|
|
107
|
+
const remainingArray = values.slice(MAX_VISIBLE_ITEMS).map(v => getValueDescription(v));
|
|
108
|
+
return remainingArray.length > MAX_TOOLTIP_ITEMS
|
|
109
|
+
? remainingArray.slice(0, MAX_TOOLTIP_ITEMS).join(', ') + ` ... (+${remainingArray.length - MAX_TOOLTIP_ITEMS})`
|
|
110
|
+
: remainingArray.join(', ');
|
|
111
|
+
})() }), children: _jsx("p", { style: { marginLeft: '10px' }, children: `(+${remainingCount} ${remainingCount === 1 ? 'altro' : 'altri'})` }) })] }));
|
|
86
112
|
};
|
|
87
113
|
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { placeHolder: placeHolder, width: width, icon: icon, labelColor: labelColor, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, readOnly: readOnly, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => {
|
|
88
114
|
if (!readOnly) {
|
|
@@ -135,9 +161,10 @@ const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChoo
|
|
|
135
161
|
export default TMDynDataListItemChooser;
|
|
136
162
|
const cellRenderIcon = () => _jsx(IconDetails, {});
|
|
137
163
|
export const TMDynDataListItemChooserForm = (props) => {
|
|
164
|
+
const { TID, MID, layoutMode, dynDL, searchResult, selectedIDs, title, width, height, onChoose } = props;
|
|
138
165
|
// Generate unique keys for all columns
|
|
139
|
-
const uniqueKeys = generateUniqueColumnKeys(
|
|
140
|
-
const dataColumns =
|
|
166
|
+
const uniqueKeys = generateUniqueColumnKeys(searchResult?.dtdResult?.columns, searchResult?.fromTID);
|
|
167
|
+
const dataColumns = searchResult?.dtdResult?.columns?.map((col, index) => {
|
|
141
168
|
const isVisible = col.extendedProperties?.["Visibility"] != "Hidden";
|
|
142
169
|
const dataType = () => {
|
|
143
170
|
switch (col.dataType) {
|
|
@@ -149,23 +176,23 @@ export const TMDynDataListItemChooserForm = (props) => {
|
|
|
149
176
|
};
|
|
150
177
|
return { dataField: uniqueKeys[index], caption: col.caption, visible: isVisible, dataType: dataType(), format: col.dataType === DataColumnTypes.DateTime ? Globalization.getDateDisplayFormat() : "" };
|
|
151
178
|
});
|
|
152
|
-
const keyValue = uniqueKeys[
|
|
179
|
+
const keyValue = uniqueKeys[dynDL?.selectItemForValue ?? 0] ?? '';
|
|
153
180
|
const getItems = async (refreshCache) => {
|
|
154
|
-
if (!
|
|
181
|
+
if (!searchResult)
|
|
155
182
|
return [];
|
|
156
183
|
if (refreshCache)
|
|
157
184
|
DataListCacheService.RemoveAll();
|
|
158
185
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.DataList} ...` });
|
|
159
|
-
let result = await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(
|
|
186
|
+
let result = await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(TID, MID, layoutMode, [])
|
|
160
187
|
.catch((err) => { TMSpinner.hide(); TMExceptionBoxManager.show({ exception: err }); });
|
|
161
188
|
TMSpinner.hide();
|
|
162
189
|
return result ? searchResultDescriptorToSimpleArray(result) ?? [] : [];
|
|
163
190
|
};
|
|
164
191
|
const getTitle = () => {
|
|
165
|
-
let
|
|
166
|
-
if (
|
|
167
|
-
|
|
168
|
-
return
|
|
192
|
+
let titleDataList = SDK_Localizator.DataList;
|
|
193
|
+
if (title)
|
|
194
|
+
titleDataList += `: ${title}`;
|
|
195
|
+
return titleDataList;
|
|
169
196
|
};
|
|
170
|
-
return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: props.allowMultipleSelection, width:
|
|
197
|
+
return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: props.allowMultipleSelection, width: width, height: height, keyName: keyValue ?? '', showDefaultColumns: false, hasShowId: false, columns: dataColumns, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, dataSource: searchResultDescriptorToSimpleArray(searchResult) ?? [], getItems: getItems, onClose: props.onClose, onChoose: (IDs) => onChoose?.(IDs) }));
|
|
171
198
|
};
|
|
@@ -37,7 +37,9 @@ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh
|
|
|
37
37
|
const dataColumns = useMemo(() => {
|
|
38
38
|
return [
|
|
39
39
|
{ dataField: 'domain', caption: SDKUI_Localizator.Domain, dataType: 'string' },
|
|
40
|
-
{ dataField: 'name', caption: SDKUI_Localizator.UserName, dataType: 'string' }
|
|
40
|
+
{ dataField: 'name', caption: SDKUI_Localizator.UserName, dataType: 'string' },
|
|
41
|
+
{ dataField: 'fn', caption: SDKUI_Localizator.User_FirstName, dataType: 'string' },
|
|
42
|
+
{ dataField: 'ln', caption: SDKUI_Localizator.User_LastName, dataType: 'string' }
|
|
41
43
|
];
|
|
42
44
|
}, []);
|
|
43
45
|
const getItems = async (refreshCache) => {
|
|
@@ -54,9 +54,9 @@ const StyledDropDownEditorButton = styled.div `
|
|
|
54
54
|
align-items: center;
|
|
55
55
|
cursor: pointer;
|
|
56
56
|
`;
|
|
57
|
-
const TMDropDown = ({ validationItems = [], disabled = false, elementStyle, isModifiedWhen, labelPosition = 'left', label, icon, width = '100%', fontSize = FontSize.defaultFontSize, dataSource, value, onValueChanged, buttons = [], }) => {
|
|
57
|
+
const TMDropDown = ({ validationItems = [], disabled = false, elementStyle, isModifiedWhen, labelPosition = 'left', label, icon, width = '100%', fontSize = FontSize.defaultFontSize, dataSource, value, onValueChanged, buttons = [], placeHolder, }) => {
|
|
58
58
|
const [isFocused, setIsFocused] = useState(false);
|
|
59
|
-
const renderedLeftLabelTextBox = () => (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, children: label }), _jsxs(StyledDropDownWrapper, { "$width": width, children: [
|
|
59
|
+
const renderedLeftLabelTextBox = () => (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, children: label }), _jsxs(StyledDropDownWrapper, { "$width": width, children: [_jsxs(StyledDropDown, { value: value, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), "$disabled": disabled, disabled: disabled, "$fontSize": fontSize, "$isModified": isModifiedWhen, "$vil": validationItems, onChange: onValueChanged, children: [placeHolder && _jsx("option", { value: "", disabled: true, hidden: true, children: placeHolder }), dataSource?.map((data, index) => (_jsx("option", { value: data.value, children: data.display }, index)))] }), buttons.length > 0 && (_jsx(ButtonsContainer, { children: buttons.map((buttonItem) => (_jsx(StyledDropDownEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text))) })), _jsx(CustomArrow, {})] }), _jsx(TMVilViewer, { vil: validationItems })] }) })] }));
|
|
60
60
|
return _jsx("div", { style: elementStyle, children: renderedLeftLabelTextBox() });
|
|
61
61
|
};
|
|
62
62
|
export default TMDropDown;
|
|
@@ -2,10 +2,22 @@ import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
|
2
2
|
export declare const TMEditorsDefaultBorderRadius = "5px";
|
|
3
3
|
export declare const TMEditorsDefaultLabelFontSize = "0.9rem";
|
|
4
4
|
export declare const editorColorManager: (validationItems: ValidationItem[]) => string;
|
|
5
|
-
export declare const StyledEditorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
5
|
+
export declare const StyledEditorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$width"> & {
|
|
6
6
|
$width: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
7
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$width"> & {
|
|
8
|
+
$width: string;
|
|
9
|
+
}, never>>> & string;
|
|
10
|
+
export declare const StyledEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$disabled" | "$isMobile" | "$width" | "$type" | "$borderRadius" | "$fontSize" | "$vil" | "$isModified" | "$maxValue"> & {
|
|
11
|
+
$vil: ValidationItem[];
|
|
12
|
+
$width: string;
|
|
13
|
+
$type: string;
|
|
14
|
+
$isModified: boolean;
|
|
15
|
+
$maxValue: number;
|
|
16
|
+
$fontSize: string;
|
|
17
|
+
$disabled: boolean;
|
|
18
|
+
$isMobile?: boolean;
|
|
19
|
+
$borderRadius?: string;
|
|
20
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "$disabled" | "$isMobile" | "$width" | "$type" | "$borderRadius" | "$fontSize" | "$vil" | "$isModified" | "$maxValue"> & {
|
|
9
21
|
$vil: ValidationItem[];
|
|
10
22
|
$width: string;
|
|
11
23
|
$type: string;
|
|
@@ -15,20 +27,40 @@ export declare const StyledEditor: import("styled-components/dist/types").IStyle
|
|
|
15
27
|
$disabled: boolean;
|
|
16
28
|
$isMobile?: boolean;
|
|
17
29
|
$borderRadius?: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const StyledEditorIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
30
|
+
}, never>>> & string;
|
|
31
|
+
export declare const StyledEditorIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$disabled" | "$vil" | "$isModified"> & {
|
|
20
32
|
$vil: ValidationItem[];
|
|
21
33
|
$disabled: boolean;
|
|
22
34
|
$isModified: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
35
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$disabled" | "$vil" | "$isModified"> & {
|
|
36
|
+
$vil: ValidationItem[];
|
|
37
|
+
$disabled: boolean;
|
|
38
|
+
$isModified: boolean;
|
|
39
|
+
}, never>>> & string;
|
|
40
|
+
export declare const StyledEditorLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$disabled" | "$fontSize" | "$isFocused" | "$labelPosition"> & {
|
|
25
41
|
$isFocused: boolean;
|
|
26
42
|
$labelPosition: "right" | "left" | "top";
|
|
27
43
|
$disabled: boolean;
|
|
28
44
|
$fontSize?: string;
|
|
29
45
|
$color?: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
46
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$disabled" | "$fontSize" | "$isFocused" | "$labelPosition"> & {
|
|
47
|
+
$isFocused: boolean;
|
|
48
|
+
$labelPosition: "right" | "left" | "top";
|
|
49
|
+
$disabled: boolean;
|
|
50
|
+
$fontSize?: string;
|
|
51
|
+
$color?: string;
|
|
52
|
+
}, never>>> & string;
|
|
53
|
+
export declare const StyledTextareaEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$maxHeight" | "$disabled" | "$isMobile" | "$width" | "$borderRadius" | "$fontSize" | "$vil" | "$isModified" | "$resize"> & {
|
|
54
|
+
$vil: ValidationItem[];
|
|
55
|
+
$width: string;
|
|
56
|
+
$isModified: boolean;
|
|
57
|
+
$fontSize: string;
|
|
58
|
+
$disabled: boolean;
|
|
59
|
+
$isMobile?: boolean;
|
|
60
|
+
$maxHeight?: string;
|
|
61
|
+
$borderRadius?: string;
|
|
62
|
+
$resize?: boolean;
|
|
63
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "$maxHeight" | "$disabled" | "$isMobile" | "$width" | "$borderRadius" | "$fontSize" | "$vil" | "$isModified" | "$resize"> & {
|
|
32
64
|
$vil: ValidationItem[];
|
|
33
65
|
$width: string;
|
|
34
66
|
$isModified: boolean;
|
|
@@ -38,4 +70,4 @@ export declare const StyledTextareaEditor: import("styled-components/dist/types"
|
|
|
38
70
|
$maxHeight?: string;
|
|
39
71
|
$borderRadius?: string;
|
|
40
72
|
$resize?: boolean;
|
|
41
|
-
}
|
|
73
|
+
}, never>>> & string;
|
|
@@ -132,12 +132,24 @@ const TMFormulaEditor = (props) => {
|
|
|
132
132
|
const renderTreeViewItem = useCallback((item) => {
|
|
133
133
|
return (_jsxs(StyledDivHorizontal, { style: { display: 'flex', gap: '5px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }, children: [renderFormulaIcon(item.icon, item.tid, item.md), _jsx("p", { style: { verticalAlign: 'middle', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }, children: item.text })] }));
|
|
134
134
|
}, []);
|
|
135
|
+
const translateDescInFormula = (text) => {
|
|
136
|
+
switch (text) {
|
|
137
|
+
case `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithoutLogin})`:
|
|
138
|
+
return `[dbo].[TM_GetViewLink](NULL, NULL, NULL, 0, {@TID}, {@DID}, 1, NULL, 0)`;
|
|
139
|
+
case `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithLogin})`:
|
|
140
|
+
return `[dbo].[TM_GetViewLink](NULL, 'ASKLOGIN', NULL, 0, {@TID}, {@DID}, 1, NULL, 0)`;
|
|
141
|
+
case `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithDate})`:
|
|
142
|
+
return `[dbo].[TM_GetViewLink](NULL, NULL, NULL, 0, {@TID}, {@DID}, 1, CONVERT(VARCHAR, {@CreationTime}+30, 126), 0)`;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
return text;
|
|
146
|
+
};
|
|
135
147
|
const handleTreeViewItemClick = (e) => {
|
|
136
148
|
if (!e)
|
|
137
149
|
return;
|
|
138
150
|
if (e.itemData?.hasItems)
|
|
139
151
|
return;
|
|
140
|
-
insertText(e.itemData?.text);
|
|
152
|
+
insertText(translateDescInFormula(e.itemData?.text));
|
|
141
153
|
};
|
|
142
154
|
return (_jsx(TMApplyForm, { isModal: props.isModal, formMode: props.formMode, isModified: formData.expression !== formDataOrig.expression, exception: exception, validationItems: validationItems, title: SDKUI_Localizator.Formula, hasNavigation: false, showBack: props.showBack, height: '600px', width: '800px', onApply: () => applyData(), onClose: props.onClose, onUndo: () => {
|
|
143
155
|
setFormData(formDataOrig);
|
|
@@ -705,13 +717,13 @@ export class FormulaHelper {
|
|
|
705
717
|
static jsonItems_LoadFunctions_Link() {
|
|
706
718
|
let items = [{
|
|
707
719
|
id: '3_4_1',
|
|
708
|
-
text: `TM_GetViewLink (${SDKUI_Localizator.
|
|
720
|
+
text: `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithoutLogin})`,
|
|
709
721
|
icon: FormulaIconTypes.Function,
|
|
710
722
|
expanded: false,
|
|
711
723
|
hasItems: false,
|
|
712
724
|
}, {
|
|
713
725
|
id: '3_4_2',
|
|
714
|
-
text: `TM_GetViewLink (${SDKUI_Localizator.
|
|
726
|
+
text: `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithLogin})`,
|
|
715
727
|
icon: FormulaIconTypes.Function,
|
|
716
728
|
expanded: false,
|
|
717
729
|
hasItems: false,
|
|
@@ -79,11 +79,12 @@ const TMMetadataEditor = ({ isSelected = false, customLabel, isReadOnly, isLexPr
|
|
|
79
79
|
if (value?.startsWith("{@QueryParam") || value == "{@UserName}" || value == "{@UserID}" || queryOperator == QueryOperators.Custom || isEditable)
|
|
80
80
|
return _jsx(TMTextBox, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: (modulesWithLabelTop || showLabelTop) ? (customLabel ?? md?.nameLoc) : undefined, icon: showLabelTop ? icon : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'text', maxLength: isEditable ? undefined : maxLength, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
81
81
|
if (md?.dataDomain == MetadataDataDomains.DynamicDataList)
|
|
82
|
-
return _jsx(TMDynDataListItemChooser, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', titleForm: md.nameLoc, readOnly: isReadOnlyResult, layoutMode: layoutMode, isModifiedWhen: isModifiedWhenInternal(), label: (modulesWithLabelTop || showLabelTop) ? (customLabel ?? md?.nameLoc) : undefined, icon: showLabelTop ? icon : undefined, validationItems: validationItems, disabled: disabled, md: md, tid: tid, openChooserBySingleClick: openChooserBySingleClick, queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, onCascadeUpdateMIDs: onCascadeUpdateMIDs, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: multipleSelectionIsenabled, values: value ?
|
|
83
|
-
|
|
82
|
+
return _jsx(TMDynDataListItemChooser, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', titleForm: md.nameLoc, readOnly: isReadOnlyResult, layoutMode: layoutMode, isModifiedWhen: isModifiedWhenInternal(), label: (modulesWithLabelTop || showLabelTop) ? (customLabel ?? md?.nameLoc) : undefined, icon: showLabelTop ? icon : undefined, validationItems: validationItems, disabled: disabled, md: md, tid: tid, openChooserBySingleClick: openChooserBySingleClick, queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, onCascadeUpdateMIDs: onCascadeUpdateMIDs, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: multipleSelectionIsenabled, values: value ? value.split(',').filter(v => v.trim() !== '') : [], showClearButton: !isReadOnlyResult, onValueChanged: (IDs) => {
|
|
83
|
+
const filteredIDs = IDs?.filter(id => id.trim() !== '');
|
|
84
|
+
if (!filteredIDs || filteredIDs.length <= 0)
|
|
84
85
|
onValueChanged?.(undefined);
|
|
85
86
|
else
|
|
86
|
-
onValueChanged?.(
|
|
87
|
+
onValueChanged?.(filteredIDs.join(","));
|
|
87
88
|
}, updateIsModalOpen: updateIsModalOpen });
|
|
88
89
|
if (md?.dataDomain == MetadataDataDomains.DataList)
|
|
89
90
|
return _jsx(TMDataListItemChooser, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', titleForm: md.nameLoc, readOnly: isReadOnlyResult, isModifiedWhen: isModifiedWhenInternal(), label: (modulesWithLabelTop || showLabelTop) ? (customLabel ?? md?.nameLoc) : undefined, icon: showLabelTop ? icon : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, dataListId: md.dataListID, openChooserBySingleClick: openChooserBySingleClick, allowMultipleSelection: multipleSelectionIsenabled, values: value?.split(',').map((item) => !item.startsWith("'") ? item : item.slice(1, -1)) ?? [], showClearButton: !isReadOnlyResult, onValueChanged: (IDs) => {
|
|
@@ -769,5 +769,5 @@ const TMLayoutTabPanel = React.memo(({ tabItems }) => {
|
|
|
769
769
|
fontSize: '0.85em',
|
|
770
770
|
color: '#7f1d1d',
|
|
771
771
|
lineHeight: 1.4
|
|
772
|
-
}, children: error.message })] }, idx))) })] }), children: _jsx(StyledErrorBadge, { children: tabItem.errorCount > 99 ? '99+' : tabItem.errorCount }) }))] })), children: _jsx("div", { style: { width: '100%' }, children: tabItem.content }) }, `tab-${tabItem.layoutItemID}`))) }));
|
|
772
|
+
}, children: error.message })] }, idx))) })] }), children: _jsx(StyledErrorBadge, { children: tabItem.errorCount > 99 ? '99+' : tabItem.errorCount }) }))] })), children: _jsx("div", { style: { width: '100%', overflowX: 'auto' }, children: _jsx("div", { style: { minWidth: 'max-content' }, children: tabItem.content }) }) }, `tab-${tabItem.layoutItemID}`))) }));
|
|
773
773
|
});
|
|
@@ -77,7 +77,7 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
77
77
|
if (onDcmtTypeSelect)
|
|
78
78
|
onDcmtTypeSelect(tidToUse);
|
|
79
79
|
passToSearch(tidToUse, outputMids);
|
|
80
|
-
} : undefined, isSharedDcmt: isSharedArchive, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, currentTID, currentTID === inputTID ? inputDID : undefined), openFileUploaderPdfEditor: openFileUploaderPdfEditor, onScanRequest: onScanRequest }, currentTID)
|
|
80
|
+
} : undefined, showBackButton: false, isSharedDcmt: isSharedArchive, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, currentTID, currentTID === inputTID ? inputDID : undefined), openFileUploaderPdfEditor: openFileUploaderPdfEditor, onScanRequest: onScanRequest }, currentTID)
|
|
81
81
|
:
|
|
82
82
|
_jsx(TMPanel, { title: 'Archiviazione', allowMaximize: false, children: _jsxs(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: [_jsx(StyledToppyTextContainer, { children: _jsx(StyledToppyText, { children: SDKUI_Localizator.DcmtTypeSelect }) }), _jsx(StyledToppyImage, { src: Logo, alt: 'Toppy' })] }) }), [currentTID, deviceType, mruTIDs, inputFile, currentInputMids, enableDragDropOverlay, isSharedArchive, allTasks]);
|
|
83
83
|
const allInitialPanelVisibility = {
|
|
@@ -6,6 +6,7 @@ interface ITMDcmtBlogProps {
|
|
|
6
6
|
isVisible?: boolean;
|
|
7
7
|
fetchBlogDataTrigger?: number;
|
|
8
8
|
onRefreshBlogDatagrid?: () => Promise<void>;
|
|
9
|
+
showFloatingCommentButton?: boolean;
|
|
9
10
|
allTasks?: Array<TaskDescriptor>;
|
|
10
11
|
getAllTasks?: () => Promise<void>;
|
|
11
12
|
deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
@@ -8,7 +8,7 @@ import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
|
8
8
|
import TMBlogsPost from '../../grids/TMBlogsPost';
|
|
9
9
|
import TMSpinner from '../../base/TMSpinner';
|
|
10
10
|
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
11
|
-
const TMDcmtBlog = ({ tid, did, isVisible, fetchBlogDataTrigger, onRefreshBlogDatagrid, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers }) => {
|
|
11
|
+
const TMDcmtBlog = ({ tid, did, isVisible, fetchBlogDataTrigger, onRefreshBlogDatagrid, showFloatingCommentButton = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers }) => {
|
|
12
12
|
const [blogsDatasource, setBlogsDatasource] = useState([]);
|
|
13
13
|
const [hasLoadedDataOnce, setHasLoadedDataOnce] = useState(false); //traccia se *qualsiasi* dato è stato caricato per la prima volta
|
|
14
14
|
const [lastLoadedDid, setLastLoadedDid] = useState(undefined); // `lastLoadedDid` tiene traccia dell'ultimo `did` per cui abbiamo caricato i dati
|
|
@@ -74,7 +74,7 @@ const TMDcmtBlog = ({ tid, did, isVisible, fetchBlogDataTrigger, onRefreshBlogDa
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
return (_jsxs("div", { style: { width: '100%', height: '100%' }, children: [_jsx(StyledContainer, { children: _jsx(StyledSectionContainer, { style: { position: 'relative' }, children: _jsx(StyledBoardContainer, { children: !did ? _jsx(TMNothingToShow, { text: `${SDKUI_Localizator.NoDcmtSelected}.`, secondText: `${SDKUI_Localizator.BlogCase} - ${SDKUI_Localizator.NotAvailable}`, icon: _jsx(IconBoard, { fontSize: 96 }) }) :
|
|
77
|
-
_jsx(TMBlogsPost, { context: { engine: 'SearchEngine', object: { tid, did } }, id: "dcmt-blog", displayMode: 'chat', scrollToSelected: true, posts: blogsDatasource, showExtendedAttachments: false, showFloatingCommentButton:
|
|
77
|
+
_jsx(TMBlogsPost, { context: { engine: 'SearchEngine', object: { tid, did } }, id: "dcmt-blog", displayMode: 'chat', scrollToSelected: true, posts: blogsDatasource, showExtendedAttachments: false, showFloatingCommentButton: showFloatingCommentButton, showCommentFormCallback: showCommentFormCallback, refreshCallback: refreshCallback, contextMenuParams: {
|
|
78
78
|
isShowHideFilterEnabled: true,
|
|
79
79
|
isShowHideIDEnaled: true,
|
|
80
80
|
isCommentEnabled: true,
|