@epam/ai-dial-react-file-manager 0.1.0-dev.13
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/LICENSE +201 -0
- package/README.md +144 -0
- package/dist/ai-dial-react-file-manager.es.js +5188 -0
- package/dist/index.css +1 -0
- package/dist/src/components/FileManager/FileManager.d.ts +319 -0
- package/dist/src/components/FileManager/FileManagerContext.d.ts +180 -0
- package/dist/src/components/FileManager/FileManagerProvider.d.ts +20 -0
- package/dist/src/components/FileManager/FileManagerTooltip.d.ts +12 -0
- package/dist/src/components/FileManager/components/ConflictResolutionPopup/ConflictResolutionPopup.d.ts +90 -0
- package/dist/src/components/FileManager/components/DestinationFolderPopup/DestinationFolderPopup.d.ts +68 -0
- package/dist/src/components/FileManager/components/DialFileManagerItemSummaryCell/DialFileManagerItemSummaryCell.d.ts +63 -0
- package/dist/src/components/FileManager/components/FileManagerBulkActionsToolbar/FileManagerBulkActionsToolbar.d.ts +56 -0
- package/dist/src/components/FileManager/components/FileManagerBulkActionsToolbar/constants.d.ts +3 -0
- package/dist/src/components/FileManager/components/FileManagerDeleteConfirmationPopup/FileManagerDeleteConfirmationPopup.d.ts +26 -0
- package/dist/src/components/FileManager/components/FileManagerItemIcon/FileManagerItemIcon.d.ts +50 -0
- package/dist/src/components/FileManager/components/FileManagerItemName/FileManagerItemName.d.ts +57 -0
- package/dist/src/components/FileManager/components/FileManagerItemNameInput/FileManagerItemNameInput.d.ts +71 -0
- package/dist/src/components/FileManager/components/FileManagerNavigationPanel/FileManagerNavigationPanel.d.ts +63 -0
- package/dist/src/components/FileManager/components/FileManagerNavigationPanel/constants.d.ts +3 -0
- package/dist/src/components/FileManager/components/FileManagerToolbar/DialFileManagerToolbar.d.ts +74 -0
- package/dist/src/components/FileManager/components/FileMetadataPopup/FileMetadataPopup.d.ts +50 -0
- package/dist/src/components/FileManager/components/FileMetadataPopup/constants.d.ts +6 -0
- package/dist/src/components/FileManager/components/FoldersTree/FoldersTree.d.ts +132 -0
- package/dist/src/components/FileManager/components/FoldersTree/constants.d.ts +6 -0
- package/dist/src/components/FileManager/components/FoldersTree/hooks/use-expanded-paths.d.ts +13 -0
- package/dist/src/components/FileManager/constants.d.ts +21 -0
- package/dist/src/components/FileManager/errors.d.ts +6 -0
- package/dist/src/components/FileManager/hooks/use-bulk-actions.d.ts +30 -0
- package/dist/src/components/FileManager/hooks/use-collapse-tree.d.ts +9 -0
- package/dist/src/components/FileManager/hooks/use-conflict-resolution.d.ts +27 -0
- package/dist/src/components/FileManager/hooks/use-current-path.d.ts +13 -0
- package/dist/src/components/FileManager/hooks/use-file-clipboard.d.ts +37 -0
- package/dist/src/components/FileManager/hooks/use-file-delete.d.ts +13 -0
- package/dist/src/components/FileManager/hooks/use-file-download.d.ts +9 -0
- package/dist/src/components/FileManager/hooks/use-file-manager-columns.d.ts +43 -0
- package/dist/src/components/FileManager/hooks/use-file-manager-context.d.ts +5 -0
- package/dist/src/components/FileManager/hooks/use-file-manager-tabs.d.ts +7 -0
- package/dist/src/components/FileManager/hooks/use-file-metadata.d.ts +10 -0
- package/dist/src/components/FileManager/hooks/use-file-search.d.ts +23 -0
- package/dist/src/components/FileManager/hooks/use-file-upload.d.ts +62 -0
- package/dist/src/components/FileManager/hooks/use-folder-creation.d.ts +30 -0
- package/dist/src/components/FileManager/hooks/use-grid-actions-column.d.ts +15 -0
- package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +43 -0
- package/dist/src/components/FileManager/hooks/use-item-renaming.d.ts +22 -0
- package/dist/src/components/FileManager/hooks/use-new-actions.d.ts +23 -0
- package/dist/src/components/FileManager/hooks/use-paths-selection.d.ts +13 -0
- package/dist/src/components/FileManager/hooks/use-show-hidden-files.d.ts +9 -0
- package/dist/src/components/FileManager/hooks/use-tree-additional-buttons.d.ts +22 -0
- package/dist/src/components/FileManager/hooks/use-trigger-view-create-folder.d.ts +26 -0
- package/dist/src/components/FileManager/hooks/use-trigger-view-rename.d.ts +20 -0
- package/dist/src/components/FileManager/utils.d.ts +58 -0
- package/dist/src/constants/file-grid-columns.d.ts +4 -0
- package/dist/src/hooks/use-flexible-actions.d.ts +88 -0
- package/dist/src/hooks/use-is-mobile-screen.d.ts +15 -0
- package/dist/src/hooks/use-width-breakpoint.d.ts +25 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/models/base-entity.d.ts +4 -0
- package/dist/src/models/file-manager.d.ts +19 -0
- package/dist/src/models/file.d.ts +39 -0
- package/dist/src/models/selection-mode.d.ts +4 -0
- package/dist/src/types/file-manager.d.ts +59 -0
- package/dist/src/types/screen.d.ts +6 -0
- package/dist/src/utils/mobile.d.ts +49 -0
- package/dist/src/utils/path.d.ts +10 -0
- package/package.json +141 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { FC, ReactNode } from '../../../../../node_modules/react';
|
|
2
|
+
import { DialFile } from '../../../../models/file';
|
|
3
|
+
import { DropdownItem } from '@epam/ai-dial-ui-kit';
|
|
4
|
+
export interface DialFoldersTreeProps {
|
|
5
|
+
items: DialFile[];
|
|
6
|
+
expandedPaths?: Set<string>;
|
|
7
|
+
loadingPaths?: Set<string>;
|
|
8
|
+
loadedPaths?: Set<string>;
|
|
9
|
+
sharedByMePaths?: Set<string>;
|
|
10
|
+
selectedPath?: string;
|
|
11
|
+
renamedPath?: string;
|
|
12
|
+
createdFolderPath?: string | null;
|
|
13
|
+
showFiles?: boolean;
|
|
14
|
+
rootItemPath?: string;
|
|
15
|
+
rootItemLabel?: string;
|
|
16
|
+
emptyStateTitle?: string;
|
|
17
|
+
emptyStateDescription?: string;
|
|
18
|
+
emptyStateIcon?: ReactNode;
|
|
19
|
+
onItemClick?: (item: DialFile) => void;
|
|
20
|
+
onRenameSave?: (value: string) => void;
|
|
21
|
+
onRenameCancel?: () => void;
|
|
22
|
+
onRenameValidate?: (value: string, item: DialFile) => string | null;
|
|
23
|
+
onCreateFolderSave?: (value: string) => void;
|
|
24
|
+
onCreateFolderCancel?: () => void;
|
|
25
|
+
getContextMenuItems?: (item: DialFile) => DropdownItem[];
|
|
26
|
+
areHiddenFilesVisible?: boolean;
|
|
27
|
+
onExpandedPathsChange?: (expandedPaths: Set<string>) => void;
|
|
28
|
+
forbiddenSymbolsRegExp?: RegExp;
|
|
29
|
+
forbiddenSymbolsTooltip?: ReactNode;
|
|
30
|
+
newFolderDefaultName?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* DialFoldersTree — A hierarchical folder tree component with nested expand/collapse support, selection highlighting,
|
|
34
|
+
* and optional file display.
|
|
35
|
+
*
|
|
36
|
+
* Provides a fully interactive, recursive folder structure with:
|
|
37
|
+
* - Expandable and collapsible items
|
|
38
|
+
* - Optional file visibility
|
|
39
|
+
* - Loading state indicators for specific paths
|
|
40
|
+
* - Inline renaming support for folders or files
|
|
41
|
+
* - Multi-item selection highlighting
|
|
42
|
+
* - Context menu integration via `DialDropdown`
|
|
43
|
+
* - Recursive rendering with indentation and icons
|
|
44
|
+
* - Customizable empty state (title, description, and icon)
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* // Basic usage with folders and files
|
|
49
|
+
* const items: DialFile[] = [
|
|
50
|
+
* {
|
|
51
|
+
* path: '/documents',
|
|
52
|
+
* name: 'Documents',
|
|
53
|
+
* nodeType: DialFileNodeType.FOLDER,
|
|
54
|
+
* items: [
|
|
55
|
+
* {
|
|
56
|
+
* path: '/documents/file.txt',
|
|
57
|
+
* name: 'file.txt',
|
|
58
|
+
* nodeType: DialFileNodeType.FILE,
|
|
59
|
+
* },
|
|
60
|
+
* ],
|
|
61
|
+
* },
|
|
62
|
+
* ];
|
|
63
|
+
*
|
|
64
|
+
* <DialFoldersTree items={items} showFiles />
|
|
65
|
+
*
|
|
66
|
+
* // With expanded and selected items
|
|
67
|
+
* const expandedPaths = new Set(['/documents']);
|
|
68
|
+
*
|
|
69
|
+
* <DialFoldersTree
|
|
70
|
+
* items={items}
|
|
71
|
+
* expandedPaths={expandedPaths}
|
|
72
|
+
* selectedPath="/documents/file.txt"
|
|
73
|
+
* onItemClick={(item) => console.log('Clicked:', item.path)}
|
|
74
|
+
* />
|
|
75
|
+
*
|
|
76
|
+
* // With inline renaming and validation
|
|
77
|
+
* <DialFoldersTree
|
|
78
|
+
* items={items}
|
|
79
|
+
* renamedPath="/documents"
|
|
80
|
+
* onRenameValidate={(value) => (value.trim() ? null : 'Name cannot be empty')}
|
|
81
|
+
* onRenameSave={(newValue) => console.log('Saved new name:', newValue)}
|
|
82
|
+
* onRenameCancel={() => console.log('Edit cancelled')}
|
|
83
|
+
* />
|
|
84
|
+
*
|
|
85
|
+
* // With custom empty state and context menu
|
|
86
|
+
* const getContextMenuItems = (item: DialFile): DropdownItem[] => [
|
|
87
|
+
* { key: 'rename', label: 'Rename' },
|
|
88
|
+
* { key: 'delete', label: 'Delete', danger: true },
|
|
89
|
+
* ];
|
|
90
|
+
*
|
|
91
|
+
* <DialFoldersTree
|
|
92
|
+
* items={[]}
|
|
93
|
+
* emptyStateTitle="No Content"
|
|
94
|
+
* emptyStateDescription="Upload files or create a new folder to get started."
|
|
95
|
+
* emptyStateIcon={<IconFolderPlus />}
|
|
96
|
+
* getContextMenuItems={getContextMenuItems}
|
|
97
|
+
* />
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* @param [items] - Array of folder and file nodes to display in the tree.
|
|
101
|
+
* @param [expandedPaths] - Set of folder paths that should be expanded.
|
|
102
|
+
* @param [loadingPaths] - Set of folder paths currently loading (shows spinner or placeholder).
|
|
103
|
+
* @param [loadedPaths] - Set of folder paths that have loaded.
|
|
104
|
+
* @param [sharedByMePaths] - Set of items paths that the user has shared with others. Enables UI indicators (icons/badges).
|
|
105
|
+
* @param [selectedPath] - Path representing the currently selected folder or file.
|
|
106
|
+
* @param [renamedPath] - Path of the folder or file currently being edited.
|
|
107
|
+
* @param [showFiles=false] - Whether to show files in addition to folders.
|
|
108
|
+
* @param [emptyStateTitle='No Folders'] - Title text displayed when there are no items.
|
|
109
|
+
* @param [emptyStateDescription] - Optional description text for the empty state.
|
|
110
|
+
* @param [emptyStateIcon] - Optional icon to display in the empty state.
|
|
111
|
+
* @param [onItemClick] - Callback fired when a folder or file is clicked (receives the corresponding `DialFile` node).
|
|
112
|
+
* @param [onRenameSave] - Callback fired when editing is confirmed with a valid name (receives the new name).
|
|
113
|
+
* @param [onRenameCancel] - Callback fired when editing is cancelled.
|
|
114
|
+
* @param [onRenameValidate] - Function to validate the new name during editing. Should return an error string or `null` if valid.
|
|
115
|
+
* @param [getContextMenuItems] - Function returning context menu items for a given node.
|
|
116
|
+
* @param [areHiddenFilesVisible=false] - Whether hidden files (dotfiles) should be visible in the tree.
|
|
117
|
+
* @param [rootItemPath] - Path of the folder to treat as the custom root node (no context menu, special label).
|
|
118
|
+
* @param [rootItemLabel] - Label to display for the root node instead of its actual name.
|
|
119
|
+
* @param [forbiddenSymbolsRegExp] - Optional RegExp used to validate folder and file names for forbidden characters.
|
|
120
|
+
* @param [forbiddenSymbolsTooltip] - Optional tooltip content displayed when a name contains forbidden characters.
|
|
121
|
+
* @param [createdFolderPath] - Optional Path of the new created folder.
|
|
122
|
+
* @param [onCreateFolderSave] - Optional Callback fired when create new folder is confirmed
|
|
123
|
+
* @param [onCreateFolderCancel] - Optional Callback fired when create new folder is cancelled
|
|
124
|
+
* @param [newFolderDefaultName] - Optional new folder default name.
|
|
125
|
+
* @remarks
|
|
126
|
+
* - Folder and file data must follow the `DialFile` model.
|
|
127
|
+
* - The `expandedPaths`, `loadingPaths`, `selectedPath`, and `renamedPath` props are externally controlled.
|
|
128
|
+
* - Inline renaming is fully customizable using `onRenameSave`, `onRenameCancel`, and `onRenameValidate`.
|
|
129
|
+
* - Context menus can be attached to both folders and files using `getContextMenuItems`.
|
|
130
|
+
* - Use `showFiles={false}` to render only folders for a simplified tree.
|
|
131
|
+
*/
|
|
132
|
+
export declare const DialFoldersTree: FC<DialFoldersTreeProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UseExpandedPathsOptions {
|
|
2
|
+
expandedPaths?: Set<string>;
|
|
3
|
+
onExpandedPathsChange?: (expandedPaths: Set<string>) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const useExpandedPaths: (options?: UseExpandedPathsOptions) => {
|
|
6
|
+
expandedPaths: Set<string>;
|
|
7
|
+
setExpandedPaths: (newSet: Set<string>) => void;
|
|
8
|
+
togglePath: (path: string) => void;
|
|
9
|
+
collapseAll: () => void;
|
|
10
|
+
expandPath: (path: string) => void;
|
|
11
|
+
collapsePath: (path: string) => void;
|
|
12
|
+
isControlled: boolean;
|
|
13
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FileManagerColumnKey } from '../../types/file-manager.ts';
|
|
2
|
+
export declare const containerBaseClassName = "w-full h-full grid grid-rows-[auto_1fr] gap-5 p-6 overflow-hidden min-w-0 bg-layer-1";
|
|
3
|
+
export declare const toolbarBaseClassName = "w-full text-secondary flex items-center gap-2";
|
|
4
|
+
export declare const mainGridClassName = "flex min-h-0 min-w-0 h-full gap-4 overflow-hidden";
|
|
5
|
+
export declare const contentGridClassName = "flex flex-col flex-1 min-h-0 min-w-0 h-full gap-4";
|
|
6
|
+
export declare const contentHeaderClassName = "items-center";
|
|
7
|
+
export declare const treeBaseClassName = "h-full rounded bg-layer-3 text-secondary min-w-0";
|
|
8
|
+
export declare const gridBaseClassName = "flex-1 w-full rounded text-secondary overflow-auto min-h-0 min-w-0";
|
|
9
|
+
export declare const actionsColumnButtonClassName = "opacity-0 pointer-events-none group-hover/grid-row:opacity-100 group-hover/grid-row:pointer-events-auto";
|
|
10
|
+
export declare const sidebarWidth = 280;
|
|
11
|
+
export declare const sidebarTitleDefault = "Files";
|
|
12
|
+
export declare const BASE_FILE_MANAGER_ICON_SIZE = 20;
|
|
13
|
+
export declare const FILES_DATA_TRANSFER_TYPE = "Files";
|
|
14
|
+
export declare const FOLDER_PLACEHOLDER_FILE_NAME = ".dial_folder";
|
|
15
|
+
export declare const DEFAULT_FOLDER_BASE_NAME = "New folder";
|
|
16
|
+
export declare const FOLDERS_TREE_PANEL_MIN_WIDTH = 280;
|
|
17
|
+
export declare const FOLDERS_TREE_PANEL_MAX_WIDTH = 460;
|
|
18
|
+
export declare const COMPACT_VIEW_HEADER_HEIGHT = 44;
|
|
19
|
+
export declare const COMPACT_VIEW_FILE_ROW_HEIGHT = 56;
|
|
20
|
+
export declare const DEFAULT_COMPACT_VIEW_WIDTH_BREAKPOINT = 800;
|
|
21
|
+
export declare const DEFAULT_VISIBLE_COLUMN: FileManagerColumnKey[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
import { DialFileManagerActions } from '../../../types/file-manager';
|
|
3
|
+
import { DialActionDropdownItem } from '../components/FileManagerBulkActionsToolbar/FileManagerBulkActionsToolbar';
|
|
4
|
+
export interface UseBulkActionsProps {
|
|
5
|
+
selectedFiles: Map<string, DialFile>;
|
|
6
|
+
actionLabels?: {
|
|
7
|
+
[DialFileManagerActions.Duplicate]?: string;
|
|
8
|
+
[DialFileManagerActions.Copy]?: string;
|
|
9
|
+
[DialFileManagerActions.Rename]?: string;
|
|
10
|
+
[DialFileManagerActions.Download]?: string;
|
|
11
|
+
[DialFileManagerActions.Unshare]?: string;
|
|
12
|
+
[DialFileManagerActions.Delete]?: string;
|
|
13
|
+
[DialFileManagerActions.Move]?: string;
|
|
14
|
+
[DialFileManagerActions.RemoveAccess]?: string;
|
|
15
|
+
};
|
|
16
|
+
onDuplicate: (files: DialFile[]) => void;
|
|
17
|
+
onCopy: (files: DialFile[]) => void;
|
|
18
|
+
onMove: (files: DialFile[]) => void;
|
|
19
|
+
onDownload: (files: DialFile[]) => void;
|
|
20
|
+
onUnshare?: (files: DialFile[]) => void;
|
|
21
|
+
onRemoveAccess?: (files: DialFile[]) => void;
|
|
22
|
+
onRename: (filePath: string) => void;
|
|
23
|
+
onDelete: (files: DialFile[], parentFolderPath: string) => void;
|
|
24
|
+
getCurrentFolderPath: () => string;
|
|
25
|
+
sharedWithMeIds?: string[];
|
|
26
|
+
sharedByMePaths?: Set<string>;
|
|
27
|
+
onClearSelection: () => void;
|
|
28
|
+
forbiddenSymbolsRegExp?: RegExp;
|
|
29
|
+
}
|
|
30
|
+
export declare const useBulkActions: ({ selectedFiles, actionLabels, onDuplicate, onCopy, onMove, onDownload, onUnshare, onRemoveAccess, onDelete, getCurrentFolderPath, sharedWithMeIds, sharedByMePaths, onClearSelection, forbiddenSymbolsRegExp, }: UseBulkActionsProps) => DialActionDropdownItem[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface UseCollapseTreeOptions {
|
|
2
|
+
collapsed?: boolean;
|
|
3
|
+
onCollapseChange?: (collapsed: boolean) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const useCollapseTree: (options?: UseCollapseTreeOptions) => {
|
|
6
|
+
isTreeCollapsed: boolean;
|
|
7
|
+
toggleTreeCollapse: () => void;
|
|
8
|
+
setIsTreeCollapsed: (value: boolean) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
import { DialCopiedItem } from '../../../models/file-manager';
|
|
3
|
+
import { FileConflictDecision } from '../components/ConflictResolutionPopup/ConflictResolutionPopup';
|
|
4
|
+
import { DialFileManagerConflictActions } from '../../../types/file-manager';
|
|
5
|
+
export interface UseConflictResolutionOptions {
|
|
6
|
+
getDestinationFiles: (path: string) => DialFile[];
|
|
7
|
+
onResolve?: (items: DialCopiedItem[], destinationFolder: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface ConflictResolutionResult {
|
|
10
|
+
hasConflicts: boolean;
|
|
11
|
+
conflicts: DialFile[];
|
|
12
|
+
}
|
|
13
|
+
export declare const useConflictResolution: ({ getDestinationFiles, onResolve, }: UseConflictResolutionOptions) => {
|
|
14
|
+
conflictingFiles: DialFile[];
|
|
15
|
+
conflictResolutionOpen: boolean;
|
|
16
|
+
hasActiveConflictRef: import('../../../../node_modules/react').RefObject<boolean>;
|
|
17
|
+
checkForConflicts: (destinationFolder: string, files: DialFile[]) => ConflictResolutionResult;
|
|
18
|
+
startConflictResolution: (destinationFolder: string, files: DialFile[], metadata?: Record<string, unknown>) => ConflictResolutionResult;
|
|
19
|
+
resolveConflictsWithStrategy: (destinationFolder: string, files: DialFile[], overwrite: boolean, metadata?: Record<string, unknown>) => DialCopiedItem[];
|
|
20
|
+
resolveConflictsWithDecisions: (destinationFolder: string, files: DialFile[], decisions: Map<string, DialFileManagerConflictActions>, metadata?: Record<string, unknown>) => DialCopiedItem[];
|
|
21
|
+
openConflictResolution: (files: DialFile[]) => void;
|
|
22
|
+
closeConflictResolution: () => void;
|
|
23
|
+
handleReplaceAll: () => void;
|
|
24
|
+
handleDuplicateAll: () => void;
|
|
25
|
+
handleCancelAll: () => void;
|
|
26
|
+
handleDecideForEach: (decisions: FileConflictDecision[]) => void;
|
|
27
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UseCurrentPathOptions {
|
|
2
|
+
path?: string;
|
|
3
|
+
defaultPath?: string;
|
|
4
|
+
onPathChange?: (nextPath?: string) => void;
|
|
5
|
+
onSelectionClear?: () => void;
|
|
6
|
+
}
|
|
7
|
+
interface UseCurrentPathResult {
|
|
8
|
+
currentPath?: string;
|
|
9
|
+
setCurrentPath: (nextPath?: string) => void;
|
|
10
|
+
handlePathChange: (nextPath?: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const useCurrentPath: ({ path, defaultPath, onPathChange, onSelectionClear, }: UseCurrentPathOptions) => UseCurrentPathResult;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
import { DialCopiedItem } from '../../../models/file-manager';
|
|
3
|
+
import { FileConflictDecision } from '../components/ConflictResolutionPopup/ConflictResolutionPopup';
|
|
4
|
+
import { DestinationFolderMode } from '../../../types/file-manager';
|
|
5
|
+
export interface UseFileClipboardOptions {
|
|
6
|
+
getDestinationFiles: (path: string) => DialFile[];
|
|
7
|
+
getSourceFiles: () => DialFile[];
|
|
8
|
+
onCopyFiles?: (items: DialCopiedItem[], destinationFolder: string) => void;
|
|
9
|
+
onMoveToFiles?: (items: DialCopiedItem[], sourceFolder: string, destinationFolder: string) => void;
|
|
10
|
+
onCopySuccess?: () => void;
|
|
11
|
+
onMoveSuccess?: () => void;
|
|
12
|
+
onDuplicateSuccess?: () => void;
|
|
13
|
+
getCopyHeader?: (itemsCount: number, itemName?: string) => string;
|
|
14
|
+
getMoveHeader?: (itemsCount: number, itemName?: string) => string;
|
|
15
|
+
}
|
|
16
|
+
export declare const useFileClipboard: ({ getDestinationFiles, onCopyFiles, onMoveToFiles, onCopySuccess, onMoveSuccess, onDuplicateSuccess, getCopyHeader, getMoveHeader, }: UseFileClipboardOptions) => {
|
|
17
|
+
handleDuplicate: (files: DialFile[]) => void;
|
|
18
|
+
handleCloseDestinationFolderPopup: () => void;
|
|
19
|
+
handleOpenDestinationFolderPopup: (mode: DestinationFolderMode) => void;
|
|
20
|
+
handleCopyTo: (destinationFolder: string) => void;
|
|
21
|
+
handleMoveTo: (destinationFolder: string, sourceFolder?: string) => void;
|
|
22
|
+
openDestinationFolderPopup: boolean;
|
|
23
|
+
destinationFolderMode: DestinationFolderMode;
|
|
24
|
+
destinationFolderTitle: string | undefined;
|
|
25
|
+
handleSetCopiedFiles: (files: DialFile[]) => void;
|
|
26
|
+
handleSetMovedFiles: (files: DialFile[]) => void;
|
|
27
|
+
clearState: () => void;
|
|
28
|
+
conflictingFiles: DialFile[];
|
|
29
|
+
conflictResolutionOpen: boolean;
|
|
30
|
+
openConflictResolution: (files: DialFile[]) => void;
|
|
31
|
+
closeConflictResolution: () => void;
|
|
32
|
+
handleConflictReplace: () => void;
|
|
33
|
+
handleConflictCancel: () => void;
|
|
34
|
+
handleConflictDuplicate: () => void;
|
|
35
|
+
handleConflictDecideForEach: (decisions: FileConflictDecision[]) => void;
|
|
36
|
+
sourceFolder: string | undefined;
|
|
37
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
import { DialDeletedItem } from '../../../models/file-manager';
|
|
3
|
+
export interface UseFileDeleteOptions {
|
|
4
|
+
onDeleteFiles?: (items: DialDeletedItem[], sourceFolder: string) => void;
|
|
5
|
+
onDeleteSuccess?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useFileDelete: ({ onDeleteFiles, onDeleteSuccess, }: UseFileDeleteOptions) => {
|
|
8
|
+
deleteConfirmationOpen: boolean;
|
|
9
|
+
itemsToDelete: DialFile[];
|
|
10
|
+
openDeleteConfirmation: (items: DialFile[], parentFolderPath: string) => void;
|
|
11
|
+
closeDeleteConfirmation: () => void;
|
|
12
|
+
confirmDelete: () => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
export interface UseFileDownloadOptions {
|
|
3
|
+
onDownloadFiles?: (items: DialFile[]) => void;
|
|
4
|
+
customDownloadItemsAction?: (items: DialFile[]) => void;
|
|
5
|
+
onDownloadSuccess?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useFileDownload: ({ onDownloadFiles, customDownloadItemsAction, onDownloadSuccess, }: UseFileDownloadOptions) => {
|
|
8
|
+
handleDownloadFiles: (items: DialFile[]) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ReactNode } from '../../../../node_modules/react';
|
|
2
|
+
import { ColDef } from '../../../../node_modules/ag-grid-community';
|
|
3
|
+
import { DialFile } from '../../../models/file';
|
|
4
|
+
import { FileManagerRenameTriggerView, FileManagerColumnKey } from '../../../types/file-manager';
|
|
5
|
+
import { FileManagerGridRow } from '../FileManagerContext';
|
|
6
|
+
type GridRow = FileManagerGridRow;
|
|
7
|
+
export interface FileManagerGridContext {
|
|
8
|
+
newFolderTempId?: string;
|
|
9
|
+
renamedPath?: string;
|
|
10
|
+
renamedItem?: DialFile;
|
|
11
|
+
renameTriggerView: FileManagerRenameTriggerView;
|
|
12
|
+
sharedByMePaths?: Set<string>;
|
|
13
|
+
selectedPaths?: Set<string>;
|
|
14
|
+
disabledRowIds?: Set<string>;
|
|
15
|
+
forbiddenSymbolsRegExp?: RegExp;
|
|
16
|
+
forbiddenSymbolsTooltip?: ReactNode;
|
|
17
|
+
cancelFolderCreation: () => void;
|
|
18
|
+
saveFolderCreation: (name: string) => Promise<void>;
|
|
19
|
+
validateFolderName: (name: string) => string | null;
|
|
20
|
+
onRenameValidate: (value: string, item: DialFile) => string | null;
|
|
21
|
+
onRenameSave: (value: string) => void;
|
|
22
|
+
onRenameCancel: () => void;
|
|
23
|
+
getDisplayName: (item: DialFile) => string;
|
|
24
|
+
hideSearchPathItemName?: boolean;
|
|
25
|
+
filesLoading?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface UseFileManagerColumnsArgs {
|
|
28
|
+
userColumnDefs?: (ColDef<GridRow> | ((dateLocale: Intl.LocalesArgument, dateOptions: Intl.DateTimeFormatOptions | undefined, isCompactView: boolean) => ColDef<GridRow, unknown>))[];
|
|
29
|
+
filterable: boolean;
|
|
30
|
+
dateLocale?: Intl.LocalesArgument;
|
|
31
|
+
dateOptions?: Intl.DateTimeFormatOptions;
|
|
32
|
+
effectiveVisibleColumns: FileManagerColumnKey[];
|
|
33
|
+
isCompactView: boolean;
|
|
34
|
+
hasActions: boolean;
|
|
35
|
+
actionsColumnDef: ColDef<GridRow>;
|
|
36
|
+
rootItemPath?: string;
|
|
37
|
+
rootItemLabel?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface UseFileManagerColumnsResult {
|
|
40
|
+
columnDefs: ColDef<GridRow>[];
|
|
41
|
+
}
|
|
42
|
+
export declare function useFileManagerColumns({ userColumnDefs, filterable, dateLocale, dateOptions, effectiveVisibleColumns, isCompactView, hasActions, actionsColumnDef, rootItemLabel, rootItemPath, }: UseFileManagerColumnsArgs): UseFileManagerColumnsResult;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TabModel } from '@epam/ai-dial-ui-kit';
|
|
2
|
+
import { DialFileManagerTabs } from '../../../types/file-manager';
|
|
3
|
+
export declare const useDialFileManagerTabs: (tabLabels?: Record<DialFileManagerTabs, string>, initialTab?: DialFileManagerTabs) => {
|
|
4
|
+
activeTab: DialFileManagerTabs;
|
|
5
|
+
handleTabChange: (tab: DialFileManagerTabs) => void;
|
|
6
|
+
tabs: TabModel[] | undefined;
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
export interface UseFileMetadataProps {
|
|
3
|
+
onGetInfo?: (file: DialFile) => void | Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
export declare const useFileMetadata: ({ onGetInfo }: UseFileMetadataProps) => {
|
|
6
|
+
isMetadataPopupOpen: boolean;
|
|
7
|
+
selectedFileForMetadata: DialFile | undefined;
|
|
8
|
+
openMetadataPopup: (file: DialFile) => Promise<void>;
|
|
9
|
+
closeMetadataPopup: () => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
export interface UseFileSearchOptions {
|
|
3
|
+
onSearchFiles?: (folder: string, query: string) => void;
|
|
4
|
+
clearSearchResults?: () => void;
|
|
5
|
+
currentPath?: string;
|
|
6
|
+
searchResults?: DialFile[];
|
|
7
|
+
searchInProgress?: boolean;
|
|
8
|
+
navigationPanelValue?: string | number | null;
|
|
9
|
+
onNavigationPanelSearchChange?: (value: string) => void;
|
|
10
|
+
allItems?: DialFile[];
|
|
11
|
+
activeTab?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface UseFileSearchReturn {
|
|
14
|
+
isSearchMode: boolean;
|
|
15
|
+
searchValue: string;
|
|
16
|
+
effectiveSearchValue: string;
|
|
17
|
+
setSearchValue: (value: string) => void;
|
|
18
|
+
handleSearchChange: (value?: string) => void;
|
|
19
|
+
handleSearchActivate: (query: string) => void;
|
|
20
|
+
handleSearchClear: () => void;
|
|
21
|
+
searchResultsRows: DialFile[];
|
|
22
|
+
}
|
|
23
|
+
export declare function useFileSearch({ onSearchFiles, clearSearchResults, currentPath, searchResults, searchInProgress, navigationPanelValue, onNavigationPanelSearchChange, allItems, activeTab, }: UseFileSearchOptions): UseFileSearchReturn;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { DragEvent } from '../../../../node_modules/react';
|
|
2
|
+
import { DialFile } from '../../../models/file';
|
|
3
|
+
import { DialFileAcceptType, DialUploadFileItem } from '../../../models/file-manager';
|
|
4
|
+
import { FileConflictDecision } from '../components/ConflictResolutionPopup/ConflictResolutionPopup';
|
|
5
|
+
export interface FileUploadValidationResult {
|
|
6
|
+
valid: boolean;
|
|
7
|
+
message?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FileUploadValidationMessages {
|
|
10
|
+
/**
|
|
11
|
+
* Message displayed when duplicate files are selected. Customize for accessibility or copy consistency.
|
|
12
|
+
*/
|
|
13
|
+
duplicateFiles?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Message displayed when files exceed the maximum allowed size. Customize for accessibility or copy consistency.
|
|
16
|
+
*/
|
|
17
|
+
oversizedFiles?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Message displayed when selected files are of unsupported types. Customize for accessibility or copy consistency.
|
|
20
|
+
*/
|
|
21
|
+
unsupportedFiles?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Message displayed when folder uploads are attempted but not supported. Customize for accessibility or copy consistency.
|
|
24
|
+
*/
|
|
25
|
+
foldersNotSupported?: string;
|
|
26
|
+
validationFailed?: string;
|
|
27
|
+
validationError?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface UseFileUploadOptions {
|
|
30
|
+
uploadEnabled?: boolean;
|
|
31
|
+
onUploadFiles?: (files: DialUploadFileItem[], destinationFolder: string) => void;
|
|
32
|
+
onValidateUpload?: (files: DialUploadFileItem[], existingFiles: DialFile[], destinationFolder: string) => FileUploadValidationResult | Promise<FileUploadValidationResult>;
|
|
33
|
+
maxFileSize?: number;
|
|
34
|
+
allowedFileTypes?: DialFileAcceptType[];
|
|
35
|
+
validationMessages?: FileUploadValidationMessages;
|
|
36
|
+
onUploadArchive?: (file: File, name: string, destinationFolder: string) => void;
|
|
37
|
+
prepareUploadFileName?: (name: string) => string;
|
|
38
|
+
currentFolder?: DialFile;
|
|
39
|
+
}
|
|
40
|
+
export declare const useFileUpload: ({ onUploadFiles, onValidateUpload, maxFileSize, allowedFileTypes, validationMessages, onUploadArchive, prepareUploadFileName, uploadEnabled, currentFolder, }?: UseFileUploadOptions) => {
|
|
41
|
+
isDragging: boolean;
|
|
42
|
+
isDraggingOverWindow: boolean;
|
|
43
|
+
uploadError: string | undefined;
|
|
44
|
+
handleDragEnter: (e: DragEvent) => void;
|
|
45
|
+
handleDragLeave: (e: DragEvent) => void;
|
|
46
|
+
handleDragOver: (e: DragEvent) => void;
|
|
47
|
+
handleDrop: (e: DragEvent, destinationFolder: string, existingFiles: DialFile[]) => Promise<void>;
|
|
48
|
+
clearError: () => void;
|
|
49
|
+
handleUpload: (files: DialUploadFileItem[], destinationFolder: string, existingFiles: DialFile[]) => Promise<boolean>;
|
|
50
|
+
openFileDialog: (destinationFolder: string, existingFiles: DialFile[]) => void;
|
|
51
|
+
openArchiveDialog: (destinationFolder: string, existingFiles: DialFile[]) => void;
|
|
52
|
+
fileInputRef: import('../../../../node_modules/react').RefObject<HTMLInputElement | null>;
|
|
53
|
+
uploadConflictingFiles: DialFile[];
|
|
54
|
+
uploadConflictResolutionOpen: boolean;
|
|
55
|
+
hasActiveUploadConflictRef: import('../../../../node_modules/react').RefObject<boolean>;
|
|
56
|
+
openUploadConflictResolution: (files: DialFile[]) => void;
|
|
57
|
+
closeUploadConflictResolution: () => void;
|
|
58
|
+
handleUploadConflictReplace: () => void;
|
|
59
|
+
handleUploadConflictDuplicate: () => void;
|
|
60
|
+
handleUploadConflictCancel: () => void;
|
|
61
|
+
handleUploadConflictDecideForEach: (decisions: FileConflictDecision[]) => void;
|
|
62
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
import { DialUploadFileItem } from '../../../models/file-manager';
|
|
3
|
+
export interface FolderCreationValidationMessages {
|
|
4
|
+
emptyName?: string;
|
|
5
|
+
duplicateName?: string;
|
|
6
|
+
hiddenItemWarning?: string;
|
|
7
|
+
consecutiveDotsError?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface UseFolderCreationProps {
|
|
10
|
+
currentFolder?: DialFile;
|
|
11
|
+
onCreateFolder?: (file: DialUploadFileItem, folderPath: string, fileId: string) => void | Promise<void>;
|
|
12
|
+
onValidateFolderName?: (name: string, parentFolder: DialFile) => string | null;
|
|
13
|
+
validationMessages?: FolderCreationValidationMessages;
|
|
14
|
+
items?: DialFile[];
|
|
15
|
+
}
|
|
16
|
+
export interface UseFolderCreationResult {
|
|
17
|
+
isCreatingFolder: boolean;
|
|
18
|
+
newFolderTempId: string | null;
|
|
19
|
+
newFolderDefaultName: string;
|
|
20
|
+
createdFolderPath: string | null;
|
|
21
|
+
startFolderCreation: () => void;
|
|
22
|
+
startGridSiblingFolderCreation: (targetFile: DialFile) => void;
|
|
23
|
+
startTreeSiblingFolderCreation: (targetFile: DialFile) => void;
|
|
24
|
+
startGridChildFolderCreation: (targetFile: DialFile) => void;
|
|
25
|
+
startTreeChildFolderCreation: (targetFile: DialFile) => void;
|
|
26
|
+
cancelFolderCreation: () => void;
|
|
27
|
+
saveFolderCreation: (name: string) => Promise<void>;
|
|
28
|
+
validateFolderName: (name: string) => string | null;
|
|
29
|
+
}
|
|
30
|
+
export declare const useFolderCreation: ({ currentFolder, onCreateFolder, onValidateFolderName, validationMessages, items, }: UseFolderCreationProps) => UseFolderCreationResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ColDef } from '../../../../node_modules/ag-grid-community';
|
|
2
|
+
import { FileManagerGridRow } from '../FileManagerContext';
|
|
3
|
+
import { DropdownItem } from '@epam/ai-dial-ui-kit';
|
|
4
|
+
import { DialFileAcceptType } from '../../../models/file-manager';
|
|
5
|
+
interface UseGridActionsColumnProps {
|
|
6
|
+
getContextMenuItems: (row: FileManagerGridRow) => DropdownItem[];
|
|
7
|
+
isRowDisabled: (row: FileManagerGridRow, allowedFileTypes?: DialFileAcceptType[], maxSelectableFileSize?: number) => boolean;
|
|
8
|
+
allowedFileTypes?: DialFileAcceptType[];
|
|
9
|
+
maxSelectableFileSize?: number;
|
|
10
|
+
buttonClassName?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const useGridActionsColumn: ({ getContextMenuItems, isRowDisabled, allowedFileTypes, maxSelectableFileSize, buttonClassName, }: UseGridActionsColumnProps) => {
|
|
13
|
+
actionsColumnDef: ColDef<FileManagerGridRow, any>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
import { DialFileManagerActions } from '../../../types/file-manager';
|
|
3
|
+
import { DropdownItem } from '@epam/ai-dial-ui-kit';
|
|
4
|
+
export interface UseGridContextMenuProps {
|
|
5
|
+
actionLabels?: {
|
|
6
|
+
[DialFileManagerActions.AddSibling]?: string;
|
|
7
|
+
[DialFileManagerActions.AddChild]?: string;
|
|
8
|
+
[DialFileManagerActions.Copy]?: string;
|
|
9
|
+
[DialFileManagerActions.Duplicate]?: string;
|
|
10
|
+
[DialFileManagerActions.Copy]?: string;
|
|
11
|
+
[DialFileManagerActions.Rename]?: string;
|
|
12
|
+
[DialFileManagerActions.Download]?: string;
|
|
13
|
+
[DialFileManagerActions.ManagePermissions]?: string;
|
|
14
|
+
[DialFileManagerActions.Preview]?: string;
|
|
15
|
+
[DialFileManagerActions.Delete]?: string;
|
|
16
|
+
[DialFileManagerActions.Move]?: string;
|
|
17
|
+
[DialFileManagerActions.Info]?: string;
|
|
18
|
+
[DialFileManagerActions.Unshare]?: string;
|
|
19
|
+
[DialFileManagerActions.RemoveAccess]?: string;
|
|
20
|
+
[DialFileManagerActions.OpenInNewTab]?: string;
|
|
21
|
+
};
|
|
22
|
+
onDuplicate: (file: DialFile) => void;
|
|
23
|
+
onCopy: (file: DialFile) => void;
|
|
24
|
+
onMove: (file: DialFile) => void;
|
|
25
|
+
onDownload: (file: DialFile) => void;
|
|
26
|
+
onRename: (filePath: string) => void;
|
|
27
|
+
onDelete: (file: DialFile, parentFolderPath: string) => void;
|
|
28
|
+
onInfo: (file: DialFile) => void;
|
|
29
|
+
onUnshare: (file: DialFile) => void;
|
|
30
|
+
onRemoveAccess?: (file: DialFile) => void;
|
|
31
|
+
sharedWithMeIds?: string[];
|
|
32
|
+
sharedByMePaths?: Set<string>;
|
|
33
|
+
onManagePermissions?: (path?: string) => void;
|
|
34
|
+
onPreview?: (path?: string) => void;
|
|
35
|
+
onOpenInNewTab?: (file: DialFile) => void;
|
|
36
|
+
previewExtensions?: string[];
|
|
37
|
+
isRenameFileAvailable?: boolean;
|
|
38
|
+
isDuplicateFolderAvailable?: boolean;
|
|
39
|
+
forbiddenSymbolsRegExp?: RegExp;
|
|
40
|
+
onGridCreateSiblingFolder: (files: DialFile[]) => void;
|
|
41
|
+
onGridCreateChildFolder: (files: DialFile[]) => void;
|
|
42
|
+
}
|
|
43
|
+
export declare const useGridContextMenu: ({ actionLabels, onDuplicate, onCopy, onMove, onDownload, onRename, onDelete, onInfo, onUnshare, onRemoveAccess, sharedWithMeIds, sharedByMePaths, onManagePermissions, onPreview, onOpenInNewTab, previewExtensions, isRenameFileAvailable, isDuplicateFolderAvailable, forbiddenSymbolsRegExp, onGridCreateSiblingFolder, onGridCreateChildFolder, }: UseGridContextMenuProps) => (file: DialFile) => DropdownItem[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
import { DialCopiedItem } from '../../../models/file-manager';
|
|
3
|
+
export interface RenameValidationMessages {
|
|
4
|
+
emptyName?: string;
|
|
5
|
+
duplicateName?: string;
|
|
6
|
+
hiddenItemWarning?: string;
|
|
7
|
+
consecutiveDotsError?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const useItemRenaming: ({ items, onRenameValidate, validationMessages, onMoveToFiles, }: {
|
|
10
|
+
items?: DialFile[];
|
|
11
|
+
onRenameValidate?: (value: string, item: DialFile) => string | null;
|
|
12
|
+
validationMessages?: RenameValidationMessages;
|
|
13
|
+
onMoveToFiles?: (items: DialCopiedItem[], sourceFolder: string, destinationFolder: string) => void;
|
|
14
|
+
}) => {
|
|
15
|
+
renamedPath: string | undefined;
|
|
16
|
+
renamedItem: DialFile | undefined;
|
|
17
|
+
renameHandler: (path: string) => void;
|
|
18
|
+
renameSaveHandler: (value: string) => void;
|
|
19
|
+
renameCancelHandler: () => void;
|
|
20
|
+
renameValidateHandler: (value: string, item: DialFile) => string | null;
|
|
21
|
+
getDisplayName: (item: DialFile) => string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DropdownItem } from '@epam/ai-dial-ui-kit';
|
|
2
|
+
import { NewAction } from '../FileManager';
|
|
3
|
+
import { DialFile } from '../../../models/file';
|
|
4
|
+
export interface UseNewActionsProps {
|
|
5
|
+
newActions?: {
|
|
6
|
+
uploadFiles?: NewAction;
|
|
7
|
+
newFolder?: NewAction;
|
|
8
|
+
uploadArchive?: NewAction;
|
|
9
|
+
newItem?: NewAction;
|
|
10
|
+
};
|
|
11
|
+
currentFolder?: DialFile;
|
|
12
|
+
onUploadFiles?: () => void;
|
|
13
|
+
onCreateFolder?: () => void;
|
|
14
|
+
onUploadArchive?: () => void;
|
|
15
|
+
onCreateNewItem: () => void;
|
|
16
|
+
isNewButtonDisabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface UseNewActionsResult {
|
|
19
|
+
newActions: DropdownItem[];
|
|
20
|
+
isNewButtonVisible: boolean;
|
|
21
|
+
isNewButtonDisabled: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const useNewActions: ({ newActions, currentFolder, onUploadFiles, onCreateFolder, onUploadArchive, onCreateNewItem, isNewButtonDisabled: isNewButtonDisabledExternal, }: UseNewActionsProps) => UseNewActionsResult;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface UsePathsSelectionParams {
|
|
2
|
+
selectedPaths?: Set<string>;
|
|
3
|
+
defaultSelectedPaths?: Set<string>;
|
|
4
|
+
onSelectedPathsChange?: (paths: Set<string>) => void;
|
|
5
|
+
}
|
|
6
|
+
interface UsePathsSelectionResult {
|
|
7
|
+
selectedPaths: Set<string>;
|
|
8
|
+
setSelectedPaths: (paths: Set<string>) => void;
|
|
9
|
+
clearSelection: () => void;
|
|
10
|
+
isControlled: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function usePathsSelection({ selectedPaths, defaultSelectedPaths, onSelectedPathsChange, }: UsePathsSelectionParams): UsePathsSelectionResult;
|
|
13
|
+
export {};
|