@topconsultnpm/sdkui-react-beta 6.10.89 → 6.10.90

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.
@@ -67,6 +67,8 @@ export interface TMFileManagerProps {
67
67
  handleFocusedFile?: (fileItem: FileItem | undefined) => void;
68
68
  /** Callback for handling double-click events on a file */
69
69
  onDoubleClickHandler?: (fileItem: FileItem | undefined) => void;
70
+ /** Callback for handling drop file */
71
+ handleDropFileCallback?: (files: Array<File>) => void;
70
72
  /** JSX element representing the thumbnail view item for a file or folder */
71
73
  thumbnailsViewItemComponent?: (props: TMThumbnailsViewItemProps) => JSX.Element;
72
74
  }
@@ -17,7 +17,7 @@ export var TMFileManagerPageSize;
17
17
  })(TMFileManagerPageSize || (TMFileManagerPageSize = {}));
18
18
  const TMFileManager = (props) => {
19
19
  // Destructure the treeFs prop to get the root file system
20
- const { treeFs, selectedFiles, focusedFile, handleSelectedFiles, handleFocusedFile, handleSelectedFolder, viewMode: initialViewMode, contextMenuItems, onDoubleClickHandler, thumbnailsViewItemComponent } = props;
20
+ const { treeFs, selectedFiles, focusedFile, handleSelectedFiles, handleFocusedFile, handleSelectedFolder, viewMode: initialViewMode, contextMenuItems, onDoubleClickHandler, handleDropFileCallback, thumbnailsViewItemComponent } = props;
21
21
  // State to manage the current view mode ('thumbnails' or 'details')
22
22
  const [viewMode, setViewMode] = useState(initialViewMode ?? 'thumbnails');
23
23
  // State to store the search text entered by the user
@@ -169,28 +169,24 @@ const TMFileManager = (props) => {
169
169
  const files = Array.from(e.dataTransfer?.files || []);
170
170
  setDroppedFiles(files);
171
171
  setIsDragging(false);
172
- // Build a single alert string
173
- let alertMessage = 'Dropped Files Information:\n';
174
- files.forEach((file) => {
175
- const fileName = file.name; // Full file name
176
- const fileParts = fileName.split('.');
177
- const extension = fileParts.pop(); // Extract the last part as extension
178
- const baseName = fileParts.join('.'); // Combine the remaining parts
179
- alertMessage += `File: ${fileName}\nBase Name: ${baseName}\nExtension: ${extension}\n\n`;
180
- });
181
- alert(alertMessage); // Show a single alert with all file info
172
+ if (handleDropFileCallback)
173
+ handleDropFileCallback(files);
182
174
  };
183
175
  // Prevent default behavior (i.e., preventing the page from navigating)
184
176
  const handleDragOver = (e) => {
185
177
  e.preventDefault();
186
178
  setIsDragging(true);
187
179
  };
180
+ const handleDragLeave = (e) => {
181
+ e.preventDefault();
182
+ setIsDragging(false);
183
+ };
188
184
  // Main render of the file manager component with a split layout
189
185
  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: {
190
186
  display: "flex",
191
187
  flexGrow: 1,
192
188
  height: "calc(100% - 40px)"
193
- }, 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 }), anchorEl && _jsx(ContextMenu, { dataSource: menuItems, target: anchorEl, onHiding: closeContextMenu })] }), _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, 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 }), anchorEl && _jsx(ContextMenu, { dataSource: menuItems, target: anchorEl, onHiding: closeContextMenu })] })] })] }, "TMWGs-panels-treeView") })] });
189
+ }, 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 }), anchorEl && _jsx(ContextMenu, { dataSource: menuItems, target: anchorEl, onHiding: closeContextMenu })] }), _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 }), anchorEl && _jsx(ContextMenu, { dataSource: menuItems, target: anchorEl, onHiding: closeContextMenu })] })] })] }, "TMWGs-panels-treeView") })] });
194
190
  };
195
191
  export default TMFileManager;
196
192
  const DetailsView = (props) => {
@@ -305,6 +305,9 @@ export declare class SDKUI_Localizator {
305
305
  static get UpdateInProgress(): "Aktualisierung läuft" | "Update in progress" | "Mise à jour en cours" | "Atualização em andamento" | "Aggiornamento in corso";
306
306
  static get UpdateOperationWasInterrupted(): "Der Updatevorgang wurde abgebrochen" | "The update operation was interrupted" | "La operación de actualización fue interrumpida" | "L'opération de mise à jour a été interrompue" | "A operação de atualização foi interrompida" | "L'operazione di aggiornamento è stata interrotta";
307
307
  static get Updating(): "Aktualisieren" | "Actualizar" | "updating" | "Mise à jour" | "Atualizar" | "aggiornamento";
308
+ static get Upload_ConfirmFor1(): "Möchten Sie '{{0}}' hochladen?" | "Are you sure you want to upload '{{0}}'?" | "¿Estás seguro de que deseas subir '{{0}}'?" | "Êtes-vous sûr de vouloir télécharger '{{0}}'?" | "Você tem certeza que deseja enviar '{{0}}'?" | "Sei sicuro di voler caricare '{{0}}'?";
309
+ static get Upload_ConfirmForN(): "{{0}} ausgewählte Objekte. Alle hochladen?" | "{{0}} selected objects. Upload them all?" | "{{0}} objetos seleccionados. ¿Subir todos?" | "{{0}} objets sélectionnés. Voulez-vous tous les télécharger?" | "{{0}} objetos selecionados. Enviar todos?" | "{{0}} oggetti selezionati. Caricare tutti?";
310
+ static get UploadFile(): "Datei hochladen" | "Upload file" | "Subir archivo" | "Télécharger le fichier" | "Carregar arquivo" | "Carica file";
308
311
  static get User_FirstName(): "Name" | "Nombre" | "Nome" | "First name" | "Prénom";
309
312
  static get User_LastName(): "Nom" | "Nachname" | "Last name" | "Apellido(s)" | "Apelido" | "Cognome";
310
313
  static get UserName(): "Nutzer-Name" | "Username" | "Nombre usuario" | "Nom d'utilisateur" | "Nomeção de utentão" | "Nome utente";
@@ -3008,6 +3008,36 @@ export class SDKUI_Localizator {
3008
3008
  default: return "aggiornamento";
3009
3009
  }
3010
3010
  }
3011
+ static get Upload_ConfirmFor1() {
3012
+ switch (this._cultureID) {
3013
+ case CultureIDs.De_DE: return "Möchten Sie '{{0}}' hochladen?";
3014
+ case CultureIDs.En_US: return "Are you sure you want to upload '{{0}}'?";
3015
+ case CultureIDs.Es_ES: return "¿Estás seguro de que deseas subir '{{0}}'?";
3016
+ case CultureIDs.Fr_FR: return "Êtes-vous sûr de vouloir télécharger '{{0}}'?";
3017
+ case CultureIDs.Pt_PT: return "Você tem certeza que deseja enviar '{{0}}'?";
3018
+ default: return "Sei sicuro di voler caricare '{{0}}'?";
3019
+ }
3020
+ }
3021
+ static get Upload_ConfirmForN() {
3022
+ switch (this._cultureID) {
3023
+ case CultureIDs.De_DE: return "{{0}} ausgewählte Objekte. Alle hochladen?";
3024
+ case CultureIDs.En_US: return "{{0}} selected objects. Upload them all?";
3025
+ case CultureIDs.Es_ES: return "{{0}} objetos seleccionados. ¿Subir todos?";
3026
+ case CultureIDs.Fr_FR: return "{{0}} objets sélectionnés. Voulez-vous tous les télécharger?";
3027
+ case CultureIDs.Pt_PT: return "{{0}} objetos selecionados. Enviar todos?";
3028
+ default: return "{{0}} oggetti selezionati. Caricare tutti?";
3029
+ }
3030
+ }
3031
+ static get UploadFile() {
3032
+ switch (this._cultureID) {
3033
+ case CultureIDs.De_DE: return "Datei hochladen";
3034
+ case CultureIDs.En_US: return "Upload file";
3035
+ case CultureIDs.Es_ES: return "Subir archivo";
3036
+ case CultureIDs.Fr_FR: return "Télécharger le fichier";
3037
+ case CultureIDs.Pt_PT: return "Carregar arquivo";
3038
+ default: return "Carica file";
3039
+ }
3040
+ }
3011
3041
  static get User_FirstName() {
3012
3042
  switch (this._cultureID) {
3013
3043
  case CultureIDs.De_DE: return "Name";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.10.89",
3
+ "version": "6.10.90",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",