@topconsultnpm/sdkui-react-beta 6.14.53 → 6.14.55

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.
@@ -7,12 +7,15 @@ 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, IconSelected, SDKUI_Localizator } from '../../helper';
10
+ import { 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
- import { IconFolder, IconPdf, IconTxt, IconXls, IconDocx, IconImage, IconZip, IconXml, IconMp4, IconEmail, IconPpt, IconSigned, IconExe, IconHtml, IconDwg, IconDicom, IconSlddrw } from '../../assets/thumbnails';
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
+ import styled from 'styled-components';
18
+ import { renderToStaticMarkup } from 'react-dom/server';
16
19
  export class TMFileSystemItem {
17
20
  constructor() {
18
21
  this.name = "";
@@ -22,6 +25,32 @@ export class TMFileSystemItem {
22
25
  }
23
26
  }
24
27
  let abortController = new AbortController();
28
+ const svgString = encodeURIComponent(renderToStaticMarkup(_jsx(IconFolderForCSS, { fill: "#9fc6e7" })));
29
+ const svgDataUrl = `data:image/svg+xml,${svgString}`;
30
+ const StyledFileManagerWrapper = styled.div `
31
+ .dx-filemanager .dx-treeview-item .dx-icon-folder {
32
+ display: none !important;
33
+ }
34
+ .dx-filemanager .dx-treeview-item .dx-treeview-item-content {
35
+ position: relative !important;
36
+ padding-left: 26px !important;
37
+ min-height: 22px !important;
38
+ }
39
+ .dx-filemanager .dx-treeview-item .dx-treeview-item-content::before {
40
+ content: '';
41
+ position: absolute;
42
+ left: 0;
43
+ top: 60%;
44
+ width: 20px;
45
+ height: 20px;
46
+ transform: translateY(-50%);
47
+ background-image: url("${svgDataUrl}");
48
+ background-size: contain;
49
+ background-repeat: no-repeat;
50
+ display: inline-block;
51
+ z-index: 1;
52
+ }
53
+ `;
25
54
  const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false }) => {
26
55
  // State to store the instance of CustomFileSystemProvider. It is initialized once and used for managing file system operations.
27
56
  const [areaProvider, setAreaProvider] = useState();
@@ -603,7 +632,7 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
603
632
  };
604
633
  const customizeIcon = useCallback((fileSystemItem) => {
605
634
  if (fileSystemItem.isDirectory) {
606
- return IconFolder;
635
+ return svgToString(_jsx(IconFolder, { fontSize: 20, color: TMColors.iconLight }));
607
636
  }
608
637
  else {
609
638
  const fileExtension = fileSystemItem.getFileExtension();
@@ -694,7 +723,7 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
694
723
  alert(`"${e.name}" ${SDKUI_Localizator.FolderExist}`, SDKUI_Localizator.Attention);
695
724
  }
696
725
  };
697
- 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, customizeThumbnail: customizeIcon, rootFolderName: SDK_Localizator.Areas, onSelectionChanged: onSelectionChanged, onDirectoryCreating: onDirectoryCreating, onFocusedItemChanged: onFocusedItemChanged, onSelectedFileOpened: onSelectedFileOpened, onContextMenuItemClick: onContextMenuItemClick,
726
+ 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, { 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,
698
727
  /* onItemMoved={() => setCounter(counter => counter + 1)}
699
728
  onItemCopied={() => setCounter(counter => counter + 1)}
700
729
  onItemDeleted={() => setCounter(counter => counter - 1)}
@@ -188,6 +188,10 @@ declare function IconLock(props: Readonly<React.SVGProps<SVGSVGElement>>): impor
188
188
  declare function IconLockClosed(props?: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
189
189
  declare function IconBxLock(props?: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
190
190
  declare function IconFolder(props?: Readonly<React.SVGProps<SVGSVGElement>>): import("react/jsx-runtime").JSX.Element;
191
+ export declare function IconFolderForCSS({ fill, ...props }: {
192
+ [x: string]: any;
193
+ fill?: string | undefined;
194
+ }): import("react/jsx-runtime").JSX.Element;
191
195
  declare function IconFolderOpen(props: Readonly<React.SVGProps<SVGSVGElement>>): import("react/jsx-runtime").JSX.Element;
192
196
  declare function IconTag(props?: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
193
197
  declare function IconFolderZip(props?: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -477,6 +477,9 @@ function IconFolder(props) {
477
477
  // <svg fontSize={props?.fontSize ? props?.fontSize : FONTSIZE} viewBox="0 0 1024 1024" fill="currentColor" height="1em" width="1em" {...props} > <path d="M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32z" /> </svg>
478
478
  _jsx("svg", { focusable: "false", viewBox: "0 0 24 24", height: "1em", width: "1em", ...props, fill: "currentColor", children: _jsxs("g", { children: [_jsx("path", { d: "M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z" }), _jsx("path", { d: "M0 0h24v24H0z", fill: "none" })] }) }));
479
479
  }
480
+ export function IconFolderForCSS({ fill = "#9fc6e7", ...props }) {
481
+ return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "20", height: "20", ...props, children: _jsxs("g", { children: [_jsx("path", { d: "M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z", fill: fill }), _jsx("path", { d: "M0 0h24v24H0z", fill: "none" })] }) }));
482
+ }
480
483
  function IconFolderOpen(props) { return (_jsxs("svg", { fontSize: props.fontSize ? props.fontSize : FONTSIZE, viewBox: "0 0 1024 1024", fill: "currentColor", height: "1em", width: "1em", ...props, children: [" ", _jsx("path", { d: "M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zm-180 0H238c-13 0-24.8 7.9-29.7 20L136 643.2V256h188.5l119.6 114.4H748V444z" }), " "] })); }
481
484
  function IconTag(props) { return (_jsxs("svg", { fontSize: props?.fontSize ? props.fontSize : FONTSIZE, viewBox: "0 0 448 512", fill: "currentColor", height: "1em", width: "1em", ...props, children: [" ", _jsx("path", { d: "M0 80v149.5c0 17 6.7 33.3 18.7 45.3l176 176c25 25 65.5 25 90.5 0l133.5-133.5c25-25 25-65.5 0-90.5l-176-176c-12-12-28.3-18.7-45.3-18.7H48C21.5 32 0 53.5 0 80zm112 96c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z" }), " "] })); }
482
485
  function IconFolderZip(props) { return (_jsxs("svg", { fontSize: props?.fontSize ? props.fontSize : FONTSIZE, viewBox: "0 0 24 24", fill: "currentColor", height: "1em", width: "1em", ...props, children: [" ", _jsx("path", { d: "M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m-2 6h-2v2h2v2h-2v2h-2v-2h2v-2h-2v-2h2v-2h-2V8h2v2h2v2z" }), " "] })); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.14.53",
3
+ "version": "6.14.55",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",