@topconsultnpm/sdkui-react-beta 6.10.53 → 6.10.54
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import FileManager, { Column, Details, ItemView, Permissions, Notifications, ContextMenu, Toolbar, Item } from 'devextreme-react/file-manager';
|
|
4
4
|
import { FileDescriptor, FileFormats, FileTransferModes, SDK_Localizator, SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
|
|
5
5
|
import CustomFileSystemProvider from 'devextreme/file_management/custom_provider';
|
|
@@ -7,12 +7,11 @@ 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,
|
|
10
|
+
import { Globalization, IconAll, IconCloud, IconSelected, SDKUI_Localizator } 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
|
-
import { IconPdf, IconXls, IconTxt, IconXml, IconDwg, IconDicom, IconSlddrw, IconMp4, IconDocx, IconPpt, IconEmail, IconExe, IconHtml, IconSigned, IconImage, IconZip } from '../../assets/thumbnails';
|
|
16
15
|
export class TMFileSystemItem {
|
|
17
16
|
constructor() {
|
|
18
17
|
this.name = "";
|
|
@@ -574,49 +573,49 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
574
573
|
}
|
|
575
574
|
setFocusedFileSystemItem(e.item);
|
|
576
575
|
};
|
|
577
|
-
const customizeIcon = useCallback((fileSystemItem) => {
|
|
576
|
+
/* const customizeIcon = useCallback((fileSystemItem: FileSystemItem) => {
|
|
578
577
|
if (fileSystemItem.isDirectory) {
|
|
579
|
-
return IconFolder
|
|
578
|
+
return IconFolder
|
|
580
579
|
}
|
|
581
580
|
else {
|
|
582
|
-
const fileExtension = fileSystemItem.getFileExtension()
|
|
581
|
+
const fileExtension = fileSystemItem.getFileExtension()
|
|
583
582
|
switch (fileExtension.toLowerCase()) {
|
|
584
583
|
case '.pdf':
|
|
585
|
-
return IconPdf
|
|
584
|
+
return IconPdf
|
|
586
585
|
case '.xls':
|
|
587
586
|
case '.xlsx':
|
|
588
587
|
case '.csv':
|
|
589
|
-
return IconXls
|
|
588
|
+
return IconXls
|
|
590
589
|
case '.txt':
|
|
591
|
-
return IconTxt
|
|
590
|
+
return IconTxt
|
|
592
591
|
case '.xml':
|
|
593
|
-
return IconXml
|
|
592
|
+
return IconXml
|
|
594
593
|
case '.dwg':
|
|
595
|
-
return IconDwg
|
|
594
|
+
return IconDwg
|
|
596
595
|
case '.dcm':
|
|
597
|
-
return IconDicom
|
|
596
|
+
return IconDicom
|
|
598
597
|
case '.slddrw':
|
|
599
|
-
return IconSlddrw
|
|
598
|
+
return IconSlddrw
|
|
600
599
|
case '.mp4':
|
|
601
|
-
return IconMp4
|
|
600
|
+
return IconMp4
|
|
602
601
|
case '.doc':
|
|
603
602
|
case '.docx':
|
|
604
603
|
case '.dotx':
|
|
605
604
|
case '.rtf':
|
|
606
|
-
return IconDocx
|
|
605
|
+
return IconDocx
|
|
607
606
|
case '.ppt':
|
|
608
607
|
case '.pptx':
|
|
609
|
-
return IconPpt
|
|
608
|
+
return IconPpt
|
|
610
609
|
case '.msg':
|
|
611
610
|
case '.eml':
|
|
612
|
-
return IconEmail
|
|
611
|
+
return IconEmail
|
|
613
612
|
case '.exe':
|
|
614
|
-
return IconExe
|
|
613
|
+
return IconExe
|
|
615
614
|
case '.htm':
|
|
616
615
|
case '.html':
|
|
617
|
-
return IconHtml
|
|
616
|
+
return IconHtml
|
|
618
617
|
case '.p7m':
|
|
619
|
-
return IconSigned
|
|
618
|
+
return IconSigned
|
|
620
619
|
case '.png':
|
|
621
620
|
case '.jpg':
|
|
622
621
|
case '.jpeg':
|
|
@@ -626,16 +625,16 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
626
625
|
case '.ico':
|
|
627
626
|
case '.gif':
|
|
628
627
|
case '.webp':
|
|
629
|
-
return IconImage
|
|
628
|
+
return IconImage
|
|
630
629
|
case '.zip':
|
|
631
630
|
case '.rar':
|
|
632
631
|
case '.7z':
|
|
633
|
-
return IconZip
|
|
632
|
+
return IconZip
|
|
634
633
|
default:
|
|
635
|
-
return IconTxt
|
|
634
|
+
return IconTxt
|
|
636
635
|
}
|
|
637
636
|
}
|
|
638
|
-
}, []);
|
|
637
|
+
}, []); */
|
|
639
638
|
const onSelectedFileOpened = async (e) => {
|
|
640
639
|
if (props.isPathChooser)
|
|
641
640
|
props.areaChoose();
|
|
@@ -667,7 +666,9 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
667
666
|
alert(`"${e.name}" ${SDKUI_Localizator.FolderExist}`, SDKUI_Localizator.Attention);
|
|
668
667
|
}
|
|
669
668
|
};
|
|
670
|
-
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("div", { 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,
|
|
669
|
+
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("div", { 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,
|
|
670
|
+
// customizeThumbnail={customizeIcon}
|
|
671
|
+
rootFolderName: SDK_Localizator.Areas, onSelectionChanged: onSelectionChanged, onDirectoryCreating: onDirectoryCreating, onFocusedItemChanged: onFocusedItemChanged, onSelectedFileOpened: onSelectedFileOpened, onContextMenuItemClick: onContextMenuItemClick,
|
|
671
672
|
/* onItemMoved={() => setCounter(counter => counter + 1)}
|
|
672
673
|
onItemCopied={() => setCounter(counter => counter + 1)}
|
|
673
674
|
onItemDeleted={() => setCounter(counter => counter - 1)}
|