@topconsultnpm/sdkui-react-beta 6.11.48 → 6.11.50

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.
@@ -78,6 +78,8 @@ export interface TMFileManagerProps {
78
78
  handleDropFileCallback?: (files: Array<File>) => void;
79
79
  /** JSX element representing the thumbnail view item for a file or folder */
80
80
  thumbnailsViewItemComponent?: (props: TMWGsDraftThumbViewItemProps) => JSX.Element;
81
+ /** Number of total founded */
82
+ dcmtsFound?: number;
81
83
  }
82
84
  declare const TMFileManager: (props: TMFileManagerProps) => import("react/jsx-runtime").JSX.Element;
83
85
  export default TMFileManager;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useState } from 'react';
2
+ import { useCallback, useEffect, useMemo, useState } from 'react';
3
3
  import Toolbar, { Item as ToolbarItem } from 'devextreme-react/cjs/toolbar';
4
4
  import TreeView from 'devextreme-react/cjs/tree-view';
5
5
  import ScrollView from 'devextreme-react/cjs/scroll-view';
@@ -9,6 +9,8 @@ import { TMSearchBar } from '../sidebar/TMHeader';
9
9
  import TMButton from './TMButton';
10
10
  import TMDataGrid from './TMDataGrid';
11
11
  import { TMSplitterLayout } from './TMLayout';
12
+ import { DeviceType, useDeviceType } from './TMDeviceProvider';
13
+ import TMToolbarCard from './TMToolbarCard';
12
14
  export var TMFileManagerPageSize;
13
15
  (function (TMFileManagerPageSize) {
14
16
  TMFileManagerPageSize[TMFileManagerPageSize["Small"] = 30] = "Small";
@@ -17,7 +19,7 @@ export var TMFileManagerPageSize;
17
19
  })(TMFileManagerPageSize || (TMFileManagerPageSize = {}));
18
20
  const TMFileManager = (props) => {
19
21
  // Destructure the treeFs prop to get the root file system
20
- const { treeFs, selectedFolder, selectedFiles, focusedFile, handleSelectedFiles, handleFocusedFile, handleSelectedFolder, viewMode: initialViewMode, contextMenuItems, onDoubleClickHandler, thumbnailsViewItemComponent, handleDropFileCallback } = props;
22
+ const { treeFs, selectedFolder, selectedFiles, focusedFile, handleSelectedFiles, handleFocusedFile, handleSelectedFolder, viewMode: initialViewMode, contextMenuItems, onDoubleClickHandler, thumbnailsViewItemComponent, handleDropFileCallback, dcmtsFound } = props;
21
23
  // State to manage the current view mode ('thumbnails' or 'details')
22
24
  const [viewMode, setViewMode] = useState(initialViewMode ?? 'thumbnails');
23
25
  // State to store the search text entered by the user
@@ -34,9 +36,15 @@ const TMFileManager = (props) => {
34
36
  const [isDragging, setIsDragging] = useState(false);
35
37
  // State to store context menu items for file manager actions
36
38
  const [menuItems, setMenuItems] = useState({ folder: [], file: [] });
37
- // State to manage the anchor element for context menu positioning
39
+ // State to store the anchor element for the tree view context menu.
38
40
  const [treeViewAnchor, setTreeViewAnchor] = useState(null);
41
+ // State to store the anchor element for another view-related menu
39
42
  const [viewAnchor, setViewAnchor] = useState(null);
43
+ // Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
44
+ const deviceType = useDeviceType();
45
+ // This avoids unnecessary re-renders by only recalculating when deviceType changes.
46
+ let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
47
+ const [openDraftList, setOpenDraftList] = useState(false);
40
48
  useEffect(() => {
41
49
  setMenuItems(contextMenuItems ?? { folder: [], file: [] });
42
50
  }, [contextMenuItems]);
@@ -158,6 +166,8 @@ const TMFileManager = (props) => {
158
166
  return;
159
167
  const clickedItemId = e.itemData.id;
160
168
  const item = clickedItemId === treeFs.id ? treeFs : findFileItems(treeFs.items, clickedItemId);
169
+ if (isMobile)
170
+ setOpenDraftList(true);
161
171
  handleSelectedFolder?.(item);
162
172
  handleFocusedFile?.(undefined);
163
173
  handleSelectedFiles?.([]);
@@ -186,12 +196,15 @@ const TMFileManager = (props) => {
186
196
  e.preventDefault();
187
197
  setIsDragging(false);
188
198
  };
199
+ const onBackCallback = () => {
200
+ setOpenDraftList(false);
201
+ };
189
202
  // Main render of the file manager component with a split layout
190
- return _jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%", width: "100%" }, children: [_jsx(Toolbar, { style: { backgroundColor: '#f4f4f4', border: '2px solid #ccc', borderRadius: '8px', boxShadow: '0 4px 8px rgba(0,0,0,0.1)', height: "40px" }, children: _jsx(ToolbarItem, { location: "before", children: _jsx("div", { style: { paddingLeft: "5px", paddingRight: "5px" }, children: _jsx(TMButton, { caption: isLeftPanelCollapsed ? SDKUI_Localizator.ShowLeftPanel : SDKUI_Localizator.HideLeftPanel, btnStyle: 'toolbar', color: 'primaryOutline', icon: isLeftPanelCollapsed ? _jsx(IconHide, {}) : _jsx(IconShow, {}), onClick: () => setIsLeftPanelCollapsed(prev => !prev) }) }) }) }), _jsx("div", { style: {
191
- display: "flex",
192
- flexGrow: 1,
193
- height: "calc(100% - 40px)"
194
- }, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', showSeparator: true, separatorColor: 'transparent', separatorActiveColor: 'transparent', min: ['0', '0'], start: [isLeftPanelCollapsed ? '0%' : "50%", isLeftPanelCollapsed ? '100%' : "50%"], children: [_jsxs("div", { style: { height: "100%", width: "100%" }, onContextMenu: onTreeViewContextMenu, children: [_jsx(TreeView, { style: { marginTop: "10px" }, dataSource: treeViewData, displayExpr: "text", itemRender: renderTreeViewItem, onItemClick: handleTreeViewItemClick }), treeViewAnchor && _jsx(ContextMenu, { dataSource: menuItems.folder, target: treeViewAnchor, onHiding: closeTreeViewContextMenu })] }), _jsxs("div", { style: { backgroundColor: "#fff", width: "100%", height: "100%" }, children: [_jsxs(Toolbar, { style: { backgroundColor: '#f4f4f4', height: "40px", paddingLeft: "5px", paddingRight: '5px' }, children: [_jsx(ToolbarItem, { location: "before", children: _jsx(TMButton, { caption: viewMode === 'details' ? SDKUI_Localizator.PreviewView : SDKUI_Localizator.DetailsView, btnStyle: 'toolbar', color: 'primaryOutline', icon: viewMode === 'details' ? _jsx(IconDashboard, {}) : _jsx(IconList, {}), onClick: toggleViewMode }) }), _jsx(ToolbarItem, { location: "before", children: _jsx(TMSearchBar, { marginLeft: '0px', maxWidth: '160px', searchValue: searchText, onSearchValueChanged: (e) => handleSearchChange(e) }) })] }), _jsxs("div", { onDrop: handleDrop, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onContextMenu: onViewContextMenu, style: { width: "100%", height: "calc(100% - 40px)", border: isDragging ? '2px solid red' : '2px solid transparent' }, children: [viewMode === 'thumbnails' && _jsx(ThumbnailsView, { items: filteredFileItems, selectedFiles: selectedFiles, contextMenuItems: contextMenuItems?.file, handleSelectedFiles: handleSelectedFiles, handleFocusedFile: handleFocusedFile, onDoubleClickHandler: onDoubleClickHandler, thumbnailsViewItemComponent: thumbnailsViewItemComponent }), viewMode === 'details' && _jsx(DetailsView, { items: filteredFileItems, contextMenuItems: contextMenuItems?.file, selectedFiles: selectedFiles, focusedFile: focusedFile, handleSelectedFiles: handleSelectedFiles, handleFocusedFile: handleFocusedFile, onDoubleClickHandler: onDoubleClickHandler }), viewAnchor && _jsx(ContextMenu, { dataSource: menuItems.file, target: viewAnchor, onHiding: closeViewContextMenu })] })] })] }, "TMWGs-panels-treeView") })] });
203
+ return _jsxs("div", { style: { height: "100%", width: "100%" }, children: [!isMobile && _jsxs("div", { style: { flexDirection: "column", height: "100%", width: "100%", }, children: [_jsx(Toolbar, { style: { backgroundColor: '#f4f4f4', border: '2px solid #ccc', borderRadius: '8px', boxShadow: '0 4px 8px rgba(0,0,0,0.1)', height: "40px" }, children: _jsx(ToolbarItem, { location: "before", children: _jsx("div", { style: { paddingLeft: "5px", paddingRight: "5px" }, children: _jsx(TMButton, { caption: isLeftPanelCollapsed ? SDKUI_Localizator.ShowLeftPanel : SDKUI_Localizator.HideLeftPanel, btnStyle: 'toolbar', color: 'primaryOutline', icon: isLeftPanelCollapsed ? _jsx(IconHide, {}) : _jsx(IconShow, {}), onClick: () => setIsLeftPanelCollapsed(prev => !prev) }) }) }) }), _jsx("div", { style: {
204
+ display: "flex",
205
+ flexGrow: 1,
206
+ height: "calc(100% - 40px)"
207
+ }, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', showSeparator: true, separatorColor: 'transparent', separatorActiveColor: 'transparent', min: ['0', '0'], start: [isLeftPanelCollapsed ? '0%' : "50%", isLeftPanelCollapsed ? '100%' : "50%"], children: [_jsxs("div", { style: { height: "100%", width: "100%" }, onContextMenu: onTreeViewContextMenu, children: [_jsx(TreeView, { style: { marginTop: "10px" }, dataSource: treeViewData, displayExpr: "text", itemRender: renderTreeViewItem, onItemClick: handleTreeViewItemClick }), treeViewAnchor && _jsx(ContextMenu, { id: 'treeViewContextMenuDesktop', dataSource: menuItems.folder, target: treeViewAnchor, onHiding: closeTreeViewContextMenu })] }), _jsxs("div", { style: { backgroundColor: "#fff", width: "100%", height: "100%" }, children: [_jsxs(Toolbar, { style: { backgroundColor: '#f4f4f4', height: "40px", paddingLeft: "5px", paddingRight: '5px' }, children: [_jsx(ToolbarItem, { location: "before", children: _jsx(TMButton, { caption: viewMode === 'details' ? SDKUI_Localizator.PreviewView : SDKUI_Localizator.DetailsView, btnStyle: 'toolbar', color: 'primaryOutline', icon: viewMode === 'details' ? _jsx(IconDashboard, {}) : _jsx(IconList, {}), onClick: toggleViewMode }) }), _jsx(ToolbarItem, { location: "before", children: _jsx(TMSearchBar, { marginLeft: '0px', maxWidth: '160px', searchValue: searchText, onSearchValueChanged: (e) => handleSearchChange(e) }) })] }), _jsxs("div", { onDrop: handleDrop, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onContextMenu: onViewContextMenu, style: { width: "100%", height: "calc(100% - 40px)", border: isDragging ? '2px solid red' : '2px solid transparent' }, children: [viewMode === 'thumbnails' && _jsx(ThumbnailsView, { items: filteredFileItems, selectedFiles: selectedFiles, contextMenuItems: menuItems.file, handleSelectedFiles: handleSelectedFiles, handleFocusedFile: handleFocusedFile, onDoubleClickHandler: onDoubleClickHandler, thumbnailsViewItemComponent: thumbnailsViewItemComponent }), viewMode === 'details' && _jsx(DetailsView, { items: filteredFileItems, contextMenuItems: menuItems.file, selectedFiles: selectedFiles, focusedFile: focusedFile, handleSelectedFiles: handleSelectedFiles, handleFocusedFile: handleFocusedFile, onDoubleClickHandler: onDoubleClickHandler }), viewAnchor && _jsx(ContextMenu, { id: 'fileContextMenuDesktop', dataSource: menuItems.file, target: viewAnchor, onHiding: closeViewContextMenu })] })] })] }, "TMWGs-panels-treeView") })] }), isMobile && _jsx("div", { style: { height: "100%", width: "100%" }, children: _jsxs(TMToolbarCard, { onBack: openDraftList ? onBackCallback : undefined, title: SDKUI_Localizator.Drafts, totalItems: dcmtsFound ?? 0, children: [_jsxs("div", { style: { display: openDraftList ? 'none' : 'block', transition: 'opacity 0.3s ease-in-out' }, children: [_jsx(TreeView, { style: { marginTop: "10px", }, dataSource: treeViewData, displayExpr: "text", itemRender: renderTreeViewItem, onItemClick: handleTreeViewItemClick }), treeViewAnchor && _jsx(ContextMenu, { id: 'treeViewContextMenuMobile', dataSource: menuItems.folder, target: treeViewAnchor, onHiding: closeTreeViewContextMenu })] }), _jsxs("div", { style: { backgroundColor: "#fff", width: "100%", height: "100%", display: openDraftList ? 'block' : 'none', transition: 'opacity 0.3s ease-in-out' }, children: [_jsxs(Toolbar, { style: { backgroundColor: '#f4f4f4', height: "40px", paddingLeft: "5px", paddingRight: '5px' }, children: [_jsx(ToolbarItem, { location: "before", children: _jsx(TMButton, { caption: viewMode === 'details' ? SDKUI_Localizator.PreviewView : SDKUI_Localizator.DetailsView, btnStyle: 'toolbar', color: 'primaryOutline', icon: viewMode === 'details' ? _jsx(IconDashboard, {}) : _jsx(IconList, {}), onClick: toggleViewMode }) }), _jsx(ToolbarItem, { location: "before", children: _jsx(TMSearchBar, { marginLeft: '0px', maxWidth: '160px', searchValue: searchText, onSearchValueChanged: (e) => handleSearchChange(e) }) })] }), _jsxs("div", { onDrop: handleDrop, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onContextMenu: onViewContextMenu, style: { width: "100%", height: "calc(100% - 40px)", border: isDragging ? '2px solid red' : '2px solid transparent' }, children: [viewMode === 'thumbnails' && _jsx(ThumbnailsView, { items: filteredFileItems, selectedFiles: selectedFiles, contextMenuItems: contextMenuItems?.file, handleSelectedFiles: handleSelectedFiles, handleFocusedFile: handleFocusedFile, onDoubleClickHandler: onDoubleClickHandler, thumbnailsViewItemComponent: thumbnailsViewItemComponent }), viewMode === 'details' && _jsx(DetailsView, { items: filteredFileItems, contextMenuItems: contextMenuItems?.file, selectedFiles: selectedFiles, focusedFile: focusedFile, handleSelectedFiles: handleSelectedFiles, handleFocusedFile: handleFocusedFile, onDoubleClickHandler: onDoubleClickHandler }), viewAnchor && _jsx(ContextMenu, { id: 'fileViewContextMenuMobile', dataSource: menuItems.file, target: viewAnchor, onHiding: closeViewContextMenu })] })] })] }) })] });
195
208
  };
196
209
  export default TMFileManager;
197
210
  const DetailsView = (props) => {
@@ -200,6 +213,23 @@ const DetailsView = (props) => {
200
213
  const data = cellData.data;
201
214
  return _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center' }, children: getFileIcon(data.ext, data.version) });
202
215
  };
216
+ const cellDatetimeRender = useCallback((cellData) => {
217
+ const { value } = cellData;
218
+ const formattedDate = value ? new Date(value).toLocaleString('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' }) : '';
219
+ return _jsx("div", { children: formattedDate });
220
+ }, []);
221
+ const dataColumns = useMemo(() => {
222
+ return [
223
+ { dataField: "id", caption: "ID", dataType: 'string', visible: false },
224
+ { dataField: "ext", caption: SDKUI_Localizator.Extension, cellRender: cellExtRender },
225
+ { dataField: "name", caption: SDKUI_Localizator.Name },
226
+ { dataField: "version", caption: SDKUI_Localizator.Version },
227
+ { dataField: "size", caption: SDKUI_Localizator.Size, cellRender: (cellData) => formatBytes(cellData.data.size ?? 0) },
228
+ { dataField: "updaterName", caption: SDKUI_Localizator.Author },
229
+ { dataField: "lastUpdateTime", caption: SDKUI_Localizator.LastUpdateTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
230
+ { dataField: "creationTime", caption: SDKUI_Localizator.CreationTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
231
+ ];
232
+ }, []);
203
233
  // Handles selection change in the data grid
204
234
  const onSelectionChanged = useCallback((e) => {
205
235
  if (handleSelectedFiles) {
@@ -225,21 +255,7 @@ const DetailsView = (props) => {
225
255
  e.items = contextMenuItems ? [...contextMenuItems] : [];
226
256
  }
227
257
  };
228
- const cellDatetimeRender = useCallback((cellData) => {
229
- const { value } = cellData;
230
- const formattedDate = value ? new Date(value).toLocaleString('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' }) : '';
231
- return _jsx("div", { children: formattedDate });
232
- }, []);
233
- return (items && items.length > 0) ? (_jsx(TMDataGrid, { dataSource: items ?? [], dataColumns: [
234
- { dataField: "id", caption: "ID", dataType: 'string', visible: false },
235
- { dataField: "ext", caption: SDKUI_Localizator.Extension, cellRender: cellExtRender },
236
- { dataField: "name", caption: SDKUI_Localizator.Name },
237
- { dataField: "version", caption: SDKUI_Localizator.Version },
238
- { dataField: "size", caption: SDKUI_Localizator.Size, cellRender: (cellData) => formatBytes(cellData.data.size ?? 0) },
239
- { dataField: "updaterName", caption: SDKUI_Localizator.Author },
240
- { dataField: "lastUpdateTime", caption: SDKUI_Localizator.LastUpdateTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
241
- { dataField: "creationTime", caption: SDKUI_Localizator.CreationTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
242
- ], focusedRowKey: focusedFile?.id, selectedRowKeys: selectedFiles?.map(file => file.id), onFocusedRowChanged: onFocusedRowChanged, onSelectionChanged: onSelectionChanged, onRowDblClick: onRowDblClick, onContextMenuPreparing: onContextMenuPreparing, showSearchPanel: false, showRowLines: SDKUI_Globals.dataGridShowRowLines, showColumnLines: SDKUI_Globals.dataGridShowColumnLines })) : _jsx("div", { style: { width: "100%", height: "100%", display: 'flex', justifyContent: 'center', alignItems: 'center', marginTop: '10px' }, children: SDKUI_Localizator.FolderIsEmpty });
258
+ return (items && items.length > 0) ? (_jsx(TMDataGrid, { dataSource: items, dataColumns: dataColumns, focusedRowKey: focusedFile?.id, selectedRowKeys: selectedFiles?.map(file => file.id), onFocusedRowChanged: onFocusedRowChanged, onSelectionChanged: onSelectionChanged, onRowDblClick: onRowDblClick, onContextMenuPreparing: onContextMenuPreparing, showSearchPanel: false, showRowLines: SDKUI_Globals.dataGridShowRowLines, showColumnLines: SDKUI_Globals.dataGridShowColumnLines })) : _jsx("div", { style: { width: "100%", height: "100%", display: 'flex', justifyContent: 'center', alignItems: 'center', marginTop: '10px' }, children: SDKUI_Localizator.FolderIsEmpty });
243
259
  };
244
260
  const ThumbnailsView = (props) => {
245
261
  const { items, selectedFiles, handleSelectedFiles, handleFocusedFile, onDoubleClickHandler, thumbnailsViewItemComponent } = props;
@@ -89,6 +89,7 @@ export declare class SDKUI_Localizator {
89
89
  static get Disabled(): "Deaktiviert" | "Disabled" | "Deshabilitado" | "Désactivé" | "Desabilitado" | "Disabilitato";
90
90
  static get Domain(): "Domäne" | "Domain" | "Dominio" | "Domaine";
91
91
  static get Download_in_Process(): "Download läuft" | "Download in progress" | "Descarga en curso" | "Téléchargement en cours" | "Download em progresso" | "Download in corso";
92
+ static get Drafts(): string;
92
93
  static get Duplicate(): "Duplikat" | "Duplicate" | "Duplicar" | "Dupliquer" | "Duplicado" | "Duplica";
93
94
  static get Duplicate_ConfirmFor1(): "Möchten Sie '{{0}}' duplizieren?" | "Are you sure you want to duplicate '{{0}}'?" | "¿Estás seguro de que deseas duplicar '{{0}}'?" | "Êtes-vous sûr de vouloir dupliquer '{{0}}'?" | "Você tem certeza que deseja duplicar '{{0}}'?" | "Sei sicuro di voler duplicare '{{0}}'?";
94
95
  static get Duplicate_ConfirmForN(): "{{0}} ausgewählte Objekte. Alle duplizieren?" | "{{0}} selected objects. Duplicate them all?" | "{{0}} objetos seleccionados. ¿Duplicar todos?" | "{{0}} objets sélectionnés. Voulez-vous tous les dupliquer?" | "{{0}} objetos selecionados. Duplicá-los todos?" | "{{0}} oggetti selezionati. Duplicare tutti?";
@@ -137,7 +138,7 @@ export declare class SDKUI_Localizator {
137
138
  static get FormulaEditor_Functions(): "Funktionen" | "Functions" | "Funciones" | "Fonctions" | "Funções" | "Funzioni";
138
139
  static get FormulaEditor_FunctionString(): "Funktionen für Zeichenkettenwerte" | "String values functions" | "Funciones para los valores de cadena" | "Fonctions pour les valeurs de chaîne" | "Funções para valores de cadeia" | "Funzioni per i valori stringa";
139
140
  static get FormulaEditor_Instructions(): "Anweisungen" | "Instructions" | "Instrucciones" | "Instruções" | "Istruzioni";
140
- static get FormulaEditor_Variables(): "Variablen @" | "Variables @" | "Variáveis @" | "Variabili @";
141
+ static get FormulaEditor_Variables(): "Variablen" | "Variables" | "Variáveis" | "Variabili";
141
142
  static get FormulaEditor_ValidateOK(): "Erfolgreich validierte Formel" | "Formula successfully validated" | "Fórmula validada correctamente" | "La formule est valide" | "Fórmula utilizada com sucesso" | "Formula validata con successo";
142
143
  static get File_Downloading(): "Datei wird heruntergeladen" | "File is downloading..." | "El archivo se está descargando" | "Le fichier est en cours de téléchargement" | "O arquivo está sendo baixado" | "Il file è in fase di download";
143
144
  static get File_Size(): "Dateigröße" | "File size" | "Tamaño del archivo" | "Taille du fichier" | "Tamanho do arquivo" | "Dimensione del file";
@@ -839,6 +839,16 @@ export class SDKUI_Localizator {
839
839
  default: return "Download in corso";
840
840
  }
841
841
  }
842
+ static get Drafts() {
843
+ switch (this._cultureID) {
844
+ case CultureIDs.De_DE: return "Entwürfe";
845
+ case CultureIDs.En_US: return "Drafts";
846
+ case CultureIDs.Es_ES: return "Borradores";
847
+ case CultureIDs.Fr_FR: return "Brouillons";
848
+ case CultureIDs.Pt_PT: return "Rascunhos";
849
+ default: return "Bozze";
850
+ }
851
+ }
842
852
  static get Duplicate() {
843
853
  switch (this._cultureID) {
844
854
  case CultureIDs.De_DE: return "Duplikat";
@@ -1333,12 +1343,12 @@ export class SDKUI_Localizator {
1333
1343
  }
1334
1344
  static get FormulaEditor_Variables() {
1335
1345
  switch (this._cultureID) {
1336
- case CultureIDs.De_DE: return "Variablen @";
1337
- case CultureIDs.En_US: return "Variables @";
1338
- case CultureIDs.Es_ES: return "Variables @";
1339
- case CultureIDs.Fr_FR: return "Variables @";
1340
- case CultureIDs.Pt_PT: return "Variáveis @";
1341
- default: return "Variabili @";
1346
+ case CultureIDs.De_DE: return "Variablen";
1347
+ case CultureIDs.En_US: return "Variables";
1348
+ case CultureIDs.Es_ES: return "Variables";
1349
+ case CultureIDs.Fr_FR: return "Variables";
1350
+ case CultureIDs.Pt_PT: return "Variáveis";
1351
+ default: return "Variabili";
1342
1352
  }
1343
1353
  }
1344
1354
  static get FormulaEditor_ValidateOK() {
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useState } from 'react';
2
3
  import { action } from '@storybook/addon-actions';
3
4
  import TMFileManager from '../components/base/TMFileManager';
4
5
  import { TMDeviceProvider } from '../components/base/TMDeviceProvider';
@@ -11,54 +12,60 @@ export default {
11
12
  // Default Story
12
13
  export const DefaultTMFileManager = (args) => {
13
14
  // Sample file items to mock the data structure
14
- const sampleFiles = [
15
- {
16
- id: 1,
17
- name: 'Folder 1',
18
- isDirectory: true,
19
- items: [
20
- {
21
- id: 3,
22
- name: 'File 1',
23
- isDirectory: false,
24
- items: [],
25
- size: 2048,
26
- ext: 'txt',
27
- creationTime: new Date(),
28
- lastUpdateTime: new Date(),
29
- version: 1
30
- }
31
- ],
32
- size: 1024,
33
- ext: 'txt',
34
- creationTime: new Date(),
35
- lastUpdateTime: new Date(),
36
- version: 1
37
- },
38
- {
39
- id: 2,
40
- name: 'Folder 2',
41
- isDirectory: true,
42
- items: [
43
- {
44
- id: 3,
45
- name: 'File 2',
46
- isDirectory: false,
47
- items: [],
48
- size: 2048,
49
- ext: 'pdf',
50
- creationTime: new Date(),
51
- lastUpdateTime: new Date(),
52
- version: 1
53
- }
54
- ],
55
- size: 0,
56
- ext: 'folder',
57
- creationTime: new Date(),
58
- lastUpdateTime: new Date(),
59
- version: 1
60
- }
61
- ];
15
+ const sampleFiles = useMemo(() => {
16
+ return [{
17
+ id: 1,
18
+ name: 'Folder 1',
19
+ isDirectory: true,
20
+ items: [
21
+ {
22
+ id: 3,
23
+ name: 'File 1',
24
+ isDirectory: false,
25
+ items: [],
26
+ size: 2048,
27
+ ext: 'txt',
28
+ creationTime: new Date(),
29
+ lastUpdateTime: new Date(),
30
+ version: 1
31
+ }
32
+ ],
33
+ size: 1024,
34
+ ext: 'txt',
35
+ creationTime: new Date(),
36
+ lastUpdateTime: new Date(),
37
+ version: 1
38
+ },
39
+ {
40
+ id: 2,
41
+ name: 'Folder 2',
42
+ isDirectory: true,
43
+ items: [
44
+ {
45
+ id: 3,
46
+ name: 'File 2',
47
+ isDirectory: false,
48
+ items: [],
49
+ size: 2048,
50
+ ext: 'pdf',
51
+ creationTime: new Date(),
52
+ lastUpdateTime: new Date(),
53
+ version: 1
54
+ }
55
+ ],
56
+ size: 0,
57
+ ext: 'folder',
58
+ creationTime: new Date(),
59
+ lastUpdateTime: new Date(),
60
+ version: 1
61
+ }
62
+ ];
63
+ }, []);
64
+ const [selectedFolder, setSelectedFolder] = useState(undefined);
65
+ // Handle selected folder
66
+ const handleSelectedFolder = (folderItem) => {
67
+ setSelectedFolder(folderItem);
68
+ };
62
69
  // Example context menu items
63
70
  const contextMenuItems = {
64
71
  folder: [
@@ -86,5 +93,5 @@ export const DefaultTMFileManager = (args) => {
86
93
  name: 'Root Directory',
87
94
  isDirectory: true,
88
95
  items: sampleFiles,
89
- }, contextMenuItems: contextMenuItems });
96
+ }, contextMenuItems: contextMenuItems, selectedFolder: selectedFolder, handleSelectedFolder: handleSelectedFolder });
90
97
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.11.48",
3
+ "version": "6.11.50",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",