@topconsultnpm/sdkui-react-beta 6.11.49 → 6.11.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/base/TMFileManager.d.ts +2 -0
- package/lib/components/base/TMFileManager.js +39 -23
- package/lib/components/editors/TMFormulaEditor.d.ts +12 -0
- package/lib/components/editors/TMFormulaEditor.js +3 -3
- package/lib/helper/SDKUI_Localizator.d.ts +1 -0
- package/lib/helper/SDKUI_Localizator.js +10 -0
- package/lib/stories/TMFileManager.stories.js +56 -49
- package/lib/stories/TMSDKUI_Localizator.stories.d.ts +4 -0
- package/lib/stories/TMSDKUI_Localizator.stories.js +123 -0
- package/package.json +1 -1
|
@@ -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
|
|
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: {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -9,6 +9,17 @@ export declare enum FormulaTargets {
|
|
|
9
9
|
PDFCommandAddText = 4,
|
|
10
10
|
BatchUpdate = 5
|
|
11
11
|
}
|
|
12
|
+
export declare enum FormulaIconTypes {
|
|
13
|
+
"Instructions" = 0,
|
|
14
|
+
"Function" = 1,
|
|
15
|
+
"Variable" = 2,
|
|
16
|
+
"SystemVariables" = 3,
|
|
17
|
+
"Metadata" = 4,
|
|
18
|
+
"MetadataNumber" = 5,
|
|
19
|
+
"MetadataVarchar" = 6,
|
|
20
|
+
"MetadataSystem" = 7,
|
|
21
|
+
"MetadataGeneric" = 8
|
|
22
|
+
}
|
|
12
23
|
export declare class FormulaDescriptor {
|
|
13
24
|
expression?: string;
|
|
14
25
|
formulaTarget?: FormulaTargets;
|
|
@@ -17,6 +28,7 @@ export declare class FormulaDescriptor {
|
|
|
17
28
|
metadataDataTypeDest?: MetadataDataTypes;
|
|
18
29
|
tid?: number;
|
|
19
30
|
}
|
|
31
|
+
export declare const renderFormulaIcon: (iconType: FormulaIconTypes, tid?: number, md?: MetadataDescriptor) => import("react/jsx-runtime").JSX.Element;
|
|
20
32
|
declare const TMFormulaEditor: React.FunctionComponent<ITMApplyFormProps<FormulaDescriptor>>;
|
|
21
33
|
export default TMFormulaEditor;
|
|
22
34
|
export declare class FormulaHelper {
|
|
@@ -25,7 +25,7 @@ export var FormulaTargets;
|
|
|
25
25
|
FormulaTargets[FormulaTargets["PDFCommandAddText"] = 4] = "PDFCommandAddText";
|
|
26
26
|
FormulaTargets[FormulaTargets["BatchUpdate"] = 5] = "BatchUpdate";
|
|
27
27
|
})(FormulaTargets || (FormulaTargets = {}));
|
|
28
|
-
var FormulaIconTypes;
|
|
28
|
+
export var FormulaIconTypes;
|
|
29
29
|
(function (FormulaIconTypes) {
|
|
30
30
|
FormulaIconTypes[FormulaIconTypes["Instructions"] = 0] = "Instructions";
|
|
31
31
|
FormulaIconTypes[FormulaIconTypes["Function"] = 1] = "Function";
|
|
@@ -42,7 +42,7 @@ export class FormulaDescriptor {
|
|
|
42
42
|
this.items = [];
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
export const renderFormulaIcon = (iconType, tid, md) => {
|
|
46
46
|
switch (iconType) {
|
|
47
47
|
case FormulaIconTypes.Instructions: return _jsx(IconActivityLog, { fontSize: 14 });
|
|
48
48
|
case FormulaIconTypes.Function: return _jsx(IconFunction, { fontSize: 20 });
|
|
@@ -120,7 +120,7 @@ const TMFormulaEditor = (props) => {
|
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
122
|
const renderTreeViewItem = useCallback((item) => {
|
|
123
|
-
return (_jsxs(StyledDivHorizontal, { style: { display: 'flex', gap: '5px' }, children: [
|
|
123
|
+
return (_jsxs(StyledDivHorizontal, { style: { display: 'flex', gap: '5px' }, children: [renderFormulaIcon(item.icon, item.tid, item.md), _jsx("span", { style: { verticalAlign: 'middle' }, children: item.text }), !item.hasItems && _jsx("span", { style: { verticalAlign: 'middle', color: TMColors.primary }, children: _jsx(IconPencil, { onClick: () => { insertText(item.text); } }) })] }));
|
|
124
124
|
}, []);
|
|
125
125
|
return (_jsx(TMApplyForm, { isModal: props.isModal, formMode: props.formMode, isModified: formData.expression !== formDataOrig.expression, exception: exception, validationItems: validationItems, title: SDKUI_Localizator.Formula, hasNavigation: false, height: '600px', width: '800px', onApply: () => applyData(), onClose: props.onClose, onUndo: () => {
|
|
126
126
|
setFormData(formDataOrig);
|
|
@@ -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?";
|
|
@@ -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";
|
|
@@ -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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { CultureIDs } from "@topconsultnpm/sdk-ts-beta";
|
|
4
|
+
import { SDKUI_Localizator } from "../helper";
|
|
5
|
+
// Default export for Storybook configuration
|
|
6
|
+
export default {
|
|
7
|
+
title: "Localizator/SDKUI_Localizator",
|
|
8
|
+
component: () => _jsx("div", {}),
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
};
|
|
11
|
+
// Story component
|
|
12
|
+
const Template = () => {
|
|
13
|
+
const [language, setLanguage] = useState(CultureIDs.En_US);
|
|
14
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
15
|
+
const localizedStrings = [
|
|
16
|
+
{ key: "Abort", value: SDKUI_Localizator.Abort },
|
|
17
|
+
{ key: "Abort_Confirm", value: SDKUI_Localizator.Abort_Confirm },
|
|
18
|
+
{ key: "About", value: SDKUI_Localizator.About },
|
|
19
|
+
{ key: "Add", value: SDKUI_Localizator.Add },
|
|
20
|
+
{ key: "AddAbove", value: SDKUI_Localizator.AddAbove },
|
|
21
|
+
{ key: "AddBelow", value: SDKUI_Localizator.AddBelow },
|
|
22
|
+
{ key: "AddAlls", value: SDKUI_Localizator.AddAlls },
|
|
23
|
+
{ key: "AddDefinition", value: SDKUI_Localizator.AddDefinition },
|
|
24
|
+
{ key: "AddOrSubstFile", value: SDKUI_Localizator.AddOrSubstFile },
|
|
25
|
+
{ key: "All", value: SDKUI_Localizator.All },
|
|
26
|
+
{ key: "AllFilesAndFoldersInSupportArea", value: SDKUI_Localizator.AllFilesAndFoldersInSupportArea },
|
|
27
|
+
{ key: "AllItems", value: SDKUI_Localizator.AllItems },
|
|
28
|
+
{ key: "Alls2", value: SDKUI_Localizator.Alls2 },
|
|
29
|
+
{ key: "Alphabetic", value: SDKUI_Localizator.Alphabetic },
|
|
30
|
+
{ key: "Applied", value: SDKUI_Localizator.Applied },
|
|
31
|
+
{ key: "Apply", value: SDKUI_Localizator.Apply },
|
|
32
|
+
{ key: "ApplyAndClose", value: SDKUI_Localizator.ApplyAndClose },
|
|
33
|
+
{ key: "Approve", value: SDKUI_Localizator.Approve },
|
|
34
|
+
{ key: "Archive", value: SDKUI_Localizator.Archive },
|
|
35
|
+
{ key: "ArchiveConstraint", value: SDKUI_Localizator.ArchiveConstraint },
|
|
36
|
+
{ key: "ArchiveConstraints_ContentCompulsory", value: SDKUI_Localizator.ArchiveConstraints_ContentCompulsory },
|
|
37
|
+
{ key: "ArchiveConstraints_None", value: SDKUI_Localizator.ArchiveConstraints_None },
|
|
38
|
+
{ key: "ArchiveConstraints_OnlyMetadata", value: SDKUI_Localizator.ArchiveConstraints_OnlyMetadata },
|
|
39
|
+
{ key: "ArchiveID", value: SDKUI_Localizator.ArchiveID },
|
|
40
|
+
{ key: "Attention", value: SDKUI_Localizator.Attention },
|
|
41
|
+
{ key: "AuthMode", value: SDKUI_Localizator.AuthMode },
|
|
42
|
+
{ key: "AuthMode_OnBehalfOf", value: SDKUI_Localizator.AuthMode_OnBehalfOf },
|
|
43
|
+
{ key: "AuthMode_WindowsViaTopMedia", value: SDKUI_Localizator.AuthMode_WindowsViaTopMedia },
|
|
44
|
+
{ key: "Author", value: SDKUI_Localizator.Author },
|
|
45
|
+
{ key: "Back", value: SDKUI_Localizator.Back },
|
|
46
|
+
{ key: "BatchUpdate", value: SDKUI_Localizator.BatchUpdate },
|
|
47
|
+
{ key: "BlogCase", value: SDKUI_Localizator.BlogCase },
|
|
48
|
+
{ key: "Blog_Read", value: SDKUI_Localizator.Blog_Read },
|
|
49
|
+
{ key: "Blog_Write", value: SDKUI_Localizator.Blog_Write },
|
|
50
|
+
{ key: "Browser", value: SDKUI_Localizator.Browser },
|
|
51
|
+
{ key: "BrowseAreaFile", value: SDKUI_Localizator.BrowseAreaFile },
|
|
52
|
+
{ key: "BrowseAreaFolder", value: SDKUI_Localizator.BrowseAreaFolder },
|
|
53
|
+
{ key: "CassettoDoganaleExportMRN", value: SDKUI_Localizator.CassettoDoganaleExportMRN },
|
|
54
|
+
{ key: "CassettoDoganaleExportVU", value: SDKUI_Localizator.CassettoDoganaleExportVU },
|
|
55
|
+
{ key: "CassettoDoganaleImportMRN", value: SDKUI_Localizator.CassettoDoganaleImportMRN },
|
|
56
|
+
{ key: "CassettoDoganalePlus_UserName", value: SDKUI_Localizator.CassettoDoganalePlus_UserName },
|
|
57
|
+
{ key: "Cancel", value: SDKUI_Localizator.Cancel },
|
|
58
|
+
{ key: "ChangePassword", value: SDKUI_Localizator.ChangePassword },
|
|
59
|
+
{ key: "CheckIn", value: SDKUI_Localizator.CheckIn },
|
|
60
|
+
{ key: "CheckOut", value: SDKUI_Localizator.CheckOut },
|
|
61
|
+
{ key: "ChronologyDelete", value: SDKUI_Localizator.ChronologyDelete },
|
|
62
|
+
{ key: "Clear", value: SDKUI_Localizator.Clear },
|
|
63
|
+
{ key: "ClearOTP", value: SDKUI_Localizator.ClearOTP },
|
|
64
|
+
{ key: "Close", value: SDKUI_Localizator.Close },
|
|
65
|
+
{ key: "Columns_All_Hide", value: SDKUI_Localizator.Columns_All_Hide },
|
|
66
|
+
{ key: "Columns_All_Show", value: SDKUI_Localizator.Columns_All_Show },
|
|
67
|
+
{ key: "CompleteError", value: SDKUI_Localizator.CompleteError },
|
|
68
|
+
{ key: "Configure", value: SDKUI_Localizator.Configure },
|
|
69
|
+
{ key: "ConfirmPassword", value: SDKUI_Localizator.ConfirmPassword },
|
|
70
|
+
{ key: "ConfirmOnCancel", value: SDKUI_Localizator.ConfirmOnCancel },
|
|
71
|
+
{ key: "ContinueOperation", value: SDKUI_Localizator.ContinueOperation },
|
|
72
|
+
{ key: "CopiedSuccessfully", value: SDKUI_Localizator.CopiedSuccessfully },
|
|
73
|
+
{ key: "CopyToClipboard", value: SDKUI_Localizator.CopyToClipboard },
|
|
74
|
+
{ key: "Count", value: SDKUI_Localizator.Count },
|
|
75
|
+
{ key: "Create", value: SDKUI_Localizator.Create },
|
|
76
|
+
{ key: "CreationTime", value: SDKUI_Localizator.CreationTime },
|
|
77
|
+
{ key: "CultureID", value: SDKUI_Localizator.CultureID },
|
|
78
|
+
{ key: "Date", value: SDKUI_Localizator.Date },
|
|
79
|
+
{ key: "Date_Modified", value: SDKUI_Localizator.Date_Modified },
|
|
80
|
+
{ key: "DcmtCount", value: SDKUI_Localizator.DcmtCount },
|
|
81
|
+
{ key: "DcmtsDetail", value: SDKUI_Localizator.DcmtsDetail },
|
|
82
|
+
{ key: "DcmtsMaster", value: SDKUI_Localizator.DcmtsMaster },
|
|
83
|
+
{ key: "DcmtType", value: SDKUI_Localizator.DcmtType },
|
|
84
|
+
{ key: "DcmtTypesSelected", value: SDKUI_Localizator.DcmtTypesSelected },
|
|
85
|
+
{ key: "DcmtTypeSelect", value: SDKUI_Localizator.DcmtTypeSelect },
|
|
86
|
+
{ key: "Default", value: SDKUI_Localizator.Default },
|
|
87
|
+
{ key: "Details", value: SDKUI_Localizator.Details },
|
|
88
|
+
{ key: "Delete", value: SDKUI_Localizator.Delete },
|
|
89
|
+
{ key: "Delete_ConfirmFor1", value: SDKUI_Localizator.Delete_ConfirmFor1 },
|
|
90
|
+
{ key: "Delete_ConfirmForN", value: SDKUI_Localizator.Delete_ConfirmForN },
|
|
91
|
+
{ key: "DeletionCompletedSuccessfully", value: SDKUI_Localizator.DeletionCompletedSuccessfully },
|
|
92
|
+
{ key: "DeletionOperationInterrupted", value: SDKUI_Localizator.DeletionOperationInterrupted },
|
|
93
|
+
{ key: "Description", value: SDKUI_Localizator.Description },
|
|
94
|
+
{ key: "Destination", value: SDKUI_Localizator.Destination },
|
|
95
|
+
{ key: "DetailsView", value: SDKUI_Localizator.DetailsView },
|
|
96
|
+
{ key: "Disabled", value: SDKUI_Localizator.Disabled },
|
|
97
|
+
{ key: "Domain", value: SDKUI_Localizator.Domain },
|
|
98
|
+
{ key: "Download_in_Process", value: SDKUI_Localizator.Download_in_Process },
|
|
99
|
+
{ key: "Drafts", value: SDKUI_Localizator.Drafts },
|
|
100
|
+
{ key: "Duplicate", value: SDKUI_Localizator.Duplicate },
|
|
101
|
+
{ key: "Duplicate_ConfirmFor1", value: SDKUI_Localizator.Duplicate_ConfirmFor1 },
|
|
102
|
+
{ key: "Duplicate_ConfirmForN", value: SDKUI_Localizator.Duplicate_ConfirmForN },
|
|
103
|
+
{ key: "Duplicate_Download", value: SDKUI_Localizator.Duplicate_Download },
|
|
104
|
+
{ key: "DuplicationCompletedSuccessfully", value: SDKUI_Localizator.DuplicationCompletedSuccessfully },
|
|
105
|
+
{ key: "DuplicateNameError", value: SDKUI_Localizator.DuplicateNameError },
|
|
106
|
+
{ key: "DuplicationOperationInterrupted", value: SDKUI_Localizator.DuplicationOperationInterrupted }
|
|
107
|
+
];
|
|
108
|
+
// Filter localized strings based on the search term (including digits)
|
|
109
|
+
const filteredStrings = localizedStrings.filter((entry) => entry.key.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
110
|
+
entry.value.toString().toLowerCase().includes(searchTerm.toLowerCase()));
|
|
111
|
+
SDKUI_Localizator.setLanguage(language);
|
|
112
|
+
return (_jsxs("div", { style: { padding: "16px", border: "1px solid #ccc", borderRadius: "8px" }, children: [_jsx("input", { type: "text", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), placeholder: "Search for a language...", style: {
|
|
113
|
+
marginBottom: "16px",
|
|
114
|
+
padding: "8px",
|
|
115
|
+
border: "1px solid #ccc",
|
|
116
|
+
borderRadius: "4px",
|
|
117
|
+
width: "100%",
|
|
118
|
+
} }), _jsx("select", { value: language, onChange: (e) => {
|
|
119
|
+
setLanguage(e.target.value);
|
|
120
|
+
SDKUI_Localizator.setLanguage(e.target.value);
|
|
121
|
+
}, style: { marginBottom: "16px", padding: "8px", border: "1px solid #ccc", borderRadius: "4px" }, children: Object.values(CultureIDs).map((lang) => (_jsx("option", { value: lang, children: lang }, lang))) }), _jsx("div", { children: filteredStrings.length > 0 ? (filteredStrings.map((entry) => (_jsxs("p", { children: [_jsxs("strong", { children: [entry.key, ":"] }), " ", entry.value] }, entry.key)))) : (_jsx("p", { children: "No matching results" })) })] }));
|
|
122
|
+
};
|
|
123
|
+
export const DefaultLocalizator = Template.bind({});
|