@epam/ai-dial-ui-kit 0.5.0-rc.11 → 0.5.0-rc.111
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/README.md +3 -3
- package/dist/dial-ui-kit.cjs.js +29 -29
- package/dist/dial-ui-kit.es.js +18998 -16265
- package/dist/index.css +2 -2
- package/dist/src/components/Alert/Alert.d.ts +15 -5
- package/dist/src/components/Alert/constants.d.ts +7 -4
- package/dist/src/components/AutocompleteInput/AutocompleteInput.d.ts +10 -10
- package/dist/src/components/AutocompleteInput/AutocompleteInputValue.d.ts +6 -6
- package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +8 -8
- package/dist/src/components/Breadcrumb/BreadcrumbItem.d.ts +2 -2
- package/dist/src/components/Breadcrumb/constants.d.ts +10 -10
- package/dist/src/components/Button/Button.d.ts +10 -18
- package/dist/src/components/Checkbox/Checkbox.d.ts +4 -5
- package/dist/src/components/CloseButton/CloseButton.d.ts +5 -3
- package/dist/src/components/CollapsibleSidebar/CollapsibleSidebar.d.ts +7 -7
- package/dist/src/components/ConfirmationPopup/ConfirmationPopup.d.ts +4 -4
- package/dist/src/components/ConfirmationPopup/constants.d.ts +3 -3
- package/dist/src/components/DraggableItem/DraggableItem.d.ts +8 -8
- package/dist/src/components/DraggableItem/constants.d.ts +2 -2
- package/dist/src/components/Dropdown/Dropdown.d.ts +4 -2
- package/dist/src/components/Dropdown/constants.d.ts +7 -7
- package/dist/src/components/EllipsisTooltip/EllipsisTooltip.d.ts +7 -5
- package/dist/src/components/EllipsisTooltip/constants.d.ts +1 -1
- package/dist/src/components/Field/Field.d.ts +5 -7
- package/dist/src/components/FileIcon/FileIcon.d.ts +3 -3
- package/dist/src/components/FileManager/FileManager.d.ts +75 -15
- package/dist/src/components/FileManager/FileManagerContext.d.ts +65 -4
- package/dist/src/components/FileManager/FileManagerProvider.d.ts +1 -0
- package/dist/src/components/FileManager/components/ConflictResolutionPopup/ConflictResolutionPopup.d.ts +92 -0
- package/dist/src/components/FileManager/components/DestinationFolderPopup/DestinationFolderPopup.d.ts +5 -2
- package/dist/src/components/FileManager/components/DialFileManagerItemSummaryCell/DialFileManagerItemSummaryCell.d.ts +56 -0
- package/dist/src/components/FileManager/components/DialFileManagerItemSummaryCell/DialFileManagerItemSummaryCell.test.d.ts +1 -0
- package/dist/src/components/FileManager/components/FileManagerBulkActionsToolbar/FileManagerBulkActionsToolbar.d.ts +5 -3
- package/dist/src/components/FileManager/components/FileManagerDeleteConfirmationPopup/FileManagerDeleteConfirmationPopup.d.ts +1 -1
- package/dist/src/components/FileManager/components/FileManagerItemIcon/FileManagerItemIcon.d.ts +1 -1
- package/dist/src/components/FileManager/components/FileManagerItemName/FileManagerItemName.d.ts +2 -1
- package/dist/src/components/FileManager/components/FileManagerItemNameInput/FileManagerItemNameInput.d.ts +4 -2
- package/dist/src/components/FileManager/components/FileManagerNavigationPanel/FileManagerNavigationPanel.d.ts +13 -11
- package/dist/src/components/FileManager/components/FileManagerNavigationPanel/constants.d.ts +3 -3
- package/dist/src/components/FileManager/components/FileManagerToolbar/DialFileManagerToolbar.d.ts +13 -13
- 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 +9 -1
- package/dist/src/components/FileManager/components/FoldersTree/hooks/use-expanded-paths.d.ts +13 -0
- package/dist/src/components/FileManager/constants.d.ts +14 -7
- package/dist/src/components/FileManager/hooks/__tests__/use-conflict-resolution.spec.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/__tests__/use-file-upload.spec.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/__tests__/use-trigger-view-rename.spec.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/use-conflict-resolution.d.ts +26 -0
- package/dist/src/components/FileManager/hooks/use-file-clipboard.d.ts +18 -4
- package/dist/src/components/FileManager/hooks/use-file-delete.d.ts +3 -2
- package/dist/src/components/FileManager/hooks/use-file-download.d.ts +2 -1
- package/dist/src/components/FileManager/hooks/use-file-metadata.d.ts +10 -0
- package/dist/src/components/FileManager/hooks/use-file-search.d.ts +22 -0
- package/dist/src/components/FileManager/hooks/use-file-upload.d.ts +45 -0
- package/dist/src/components/FileManager/hooks/use-folder-creation.d.ts +21 -0
- package/dist/src/components/FileManager/hooks/use-grid-actions-column.d.ts +13 -0
- package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +5 -1
- package/dist/src/components/FileManager/hooks/use-item-renaming.d.ts +9 -5
- package/dist/src/components/FileManager/hooks/use-new-actions.d.ts +16 -0
- package/dist/src/components/FileManager/hooks/use-tree-additional-buttons.d.ts +22 -0
- package/dist/src/components/FileManager/hooks/use-trigger-view-rename.d.ts +20 -0
- package/dist/src/components/FileManager/utils.d.ts +35 -1
- package/dist/src/components/FileName/FileName.d.ts +17 -5
- package/dist/src/components/FolderName/FolderName.d.ts +2 -2
- package/dist/src/components/FormItem/FormItem.d.ts +10 -10
- package/dist/src/components/FormItem/constants.d.ts +1 -1
- package/dist/src/components/FormPopup/FormPopup.d.ts +1 -1
- package/dist/src/components/FormPopup/constants.d.ts +1 -1
- package/dist/src/components/Grid/Grid.d.ts +12 -3
- package/dist/src/components/Grid/constants.d.ts +1 -1
- package/dist/src/components/Grid/hooks/use-grid-selection.d.ts +2 -1
- package/dist/src/components/Grid/renderers/DateCellRenderer.d.ts +3 -3
- package/dist/src/components/Grid/renderers/constants.d.ts +1 -1
- package/dist/src/components/Icon/Icon.d.ts +0 -1
- package/dist/src/components/Input/Input.d.ts +4 -4
- package/dist/src/components/InputField/InputField.d.ts +3 -3
- package/dist/src/components/InputPopup/InputPopup.d.ts +6 -6
- package/dist/src/components/LabelledText/LabelledText.d.ts +2 -0
- package/dist/src/components/Loader/Loader.d.ts +5 -5
- package/dist/src/components/Loader/constants.d.ts +2 -2
- package/dist/src/components/NoDataContent/NoDataContent.d.ts +6 -3
- package/dist/src/components/PasswordInput/PasswordInputField.d.ts +1 -1
- package/dist/src/components/Popup/Popup.d.ts +11 -7
- package/dist/src/components/Popup/constants.d.ts +3 -3
- package/dist/src/components/RadioButton/RadioButton.d.ts +7 -7
- package/dist/src/components/RadioGroup/RadioGroup.d.ts +20 -20
- package/dist/src/components/RadioGroup/constants.d.ts +3 -3
- package/dist/src/components/RadioGroupPopupField/RadioGroupPopupField.d.ts +2 -2
- package/dist/src/components/RemoveButton/RemoveButton.d.ts +6 -8
- package/dist/src/components/ResizableContainer/ConditionalResizableContainer.d.ts +33 -0
- package/dist/src/components/ResizableContainer/ResizableContainer.d.ts +69 -0
- package/dist/src/components/ResizableContainer/components/ResizeHandle.d.ts +10 -0
- package/dist/src/components/ResizableContainer/components/ResizeIcon.d.ts +8 -0
- package/dist/src/components/Search/Search.d.ts +7 -4
- package/dist/src/components/Search/constants.d.ts +4 -4
- package/dist/src/components/Select/Select.d.ts +9 -3
- package/dist/src/components/Select/constants.d.ts +7 -6
- package/dist/src/components/SelectField/SelectField.d.ts +6 -6
- package/dist/src/components/SharedEntityIndicator/SharedEntityIndicator.d.ts +4 -4
- package/dist/src/components/Skeleton/Skeleton.d.ts +77 -0
- package/dist/src/components/Skeleton/utils.d.ts +2 -0
- package/dist/src/components/Switch/Switch.d.ts +2 -2
- package/dist/src/components/Tab/Tab.d.ts +4 -4
- package/dist/src/components/Tabs/Tabs.d.ts +9 -9
- package/dist/src/components/Tag/Tag.d.ts +2 -2
- package/dist/src/components/TextAreaField/TextAreaField.d.ts +3 -3
- package/dist/src/components/Textarea/Textarea.d.ts +4 -4
- package/dist/src/hooks/use-width-breakpoint.d.ts +23 -0
- package/dist/src/index.d.ts +8 -2
- package/dist/src/models/breadcrumb.d.ts +1 -1
- package/dist/src/models/dropdown.d.ts +1 -0
- package/dist/src/models/file-manager.d.ts +19 -0
- package/dist/src/models/file.d.ts +2 -1
- package/dist/src/models/tab.d.ts +2 -1
- package/dist/src/types/dropdown.d.ts +2 -1
- package/dist/src/types/file-manager.d.ts +29 -11
- package/dist/src/types/form-item.d.ts +2 -2
- package/dist/src/types/resizable-container.d.ts +4 -0
- package/dist/src/types/skeleton.d.ts +15 -0
- package/dist/src/types/tab.d.ts +1 -1
- package/package.json +12 -11
|
@@ -8,11 +8,12 @@ export interface DialFileManagerItemNameInputProps {
|
|
|
8
8
|
elementId: string;
|
|
9
9
|
iconSize?: number;
|
|
10
10
|
iconStroke?: number;
|
|
11
|
-
|
|
11
|
+
iconClassName?: string;
|
|
12
12
|
iconLabel?: string;
|
|
13
13
|
iconIndicator?: ReactNode;
|
|
14
14
|
inputInvalid?: boolean;
|
|
15
15
|
inputInvalidMessage?: string;
|
|
16
|
+
inputContainerClassName?: string;
|
|
16
17
|
inputIconAfter?: ReactNode;
|
|
17
18
|
inputRef?: Ref<HTMLInputElement>;
|
|
18
19
|
onChange?: (value?: string) => void;
|
|
@@ -53,12 +54,13 @@ export interface DialFileManagerItemNameInputProps {
|
|
|
53
54
|
* @param {boolean} [props.loading=false] - Whether the icon is loading.
|
|
54
55
|
* @param {number} [props.iconSize] - Optional size override for the icon.
|
|
55
56
|
* @param {number} [props.iconStroke] - Optional stroke width override for the icon.
|
|
56
|
-
* @param {string} [props.
|
|
57
|
+
* @param {string} [props.iconClassName] - Optional CSS class for the icon.
|
|
57
58
|
* @param {string} [props.iconLabel] - Optional accessible label for the icon.
|
|
58
59
|
* @param {ReactNode} [props.iconIndicator] - Optional indicator to render over the icon.
|
|
59
60
|
* @param {boolean} [props.inputInvalid=false] - Marks the input as invalid.
|
|
60
61
|
* @param {string} [props.inputInvalidMessage] - Tooltip message shown when invalid.
|
|
61
62
|
* @param {ReactNode} [props.inputIconAfter] - Optional icon shown after the input (defaults to an error icon).
|
|
63
|
+
* @param {string} [props.inputContainerClassName] - Additional CSS classes applied to the input container.
|
|
62
64
|
* @param {Ref<HTMLInputElement>} [props.inputRef] - Ref to access the underlying input element.
|
|
63
65
|
* @param {(value: string) => void} [props.onChange] - Callback fired when input value changes.
|
|
64
66
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { DialBreadcrumbProps } from '../../../Breadcrumb/Breadcrumb';
|
|
3
3
|
import { DialSearchProps } from '../../../Search/Search';
|
|
4
|
-
export interface DialFileManagerNavigationPanelProps extends Omit<DialBreadcrumbProps, 'pathItems' | 'children' | '
|
|
4
|
+
export interface DialFileManagerNavigationPanelProps extends Omit<DialBreadcrumbProps, 'pathItems' | 'children' | 'className' | 'separator'>, Omit<DialSearchProps, 'onChange' | 'elementId' | 'value' | 'className' | 'containerClassName' | 'placeholder' | 'size'> {
|
|
5
5
|
path?: string;
|
|
6
6
|
makeHref?: (segments: string[], index: number) => string | undefined;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
className?: string;
|
|
8
|
+
breadcrumbClassName?: string;
|
|
9
9
|
onItemClick?: (href?: string) => void;
|
|
10
10
|
rootItemPath?: string;
|
|
11
11
|
rootItemLabel?: string;
|
|
@@ -13,8 +13,9 @@ export interface DialFileManagerNavigationPanelProps extends Omit<DialBreadcrumb
|
|
|
13
13
|
value?: string | number | null;
|
|
14
14
|
elementId?: string;
|
|
15
15
|
onSearchChange?: (value: string) => void;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
searchClassName?: string;
|
|
17
|
+
searchContainerClassName?: string;
|
|
18
|
+
isCompactView?: boolean;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* FileManagerNavigationPanel
|
|
@@ -38,23 +39,24 @@ export interface DialFileManagerNavigationPanelProps extends Omit<DialBreadcrumb
|
|
|
38
39
|
* // With clickable parents
|
|
39
40
|
* <FileManagerNavigationPanel
|
|
40
41
|
* path="Org/Design/Assets"
|
|
41
|
-
* makeHref={(segments, i) => '#' +
|
|
42
|
+
* makeHref={(segments, i) => '#' + segments.slice(0, i + 1).join('/')}
|
|
42
43
|
* />
|
|
43
44
|
* ```
|
|
44
45
|
*
|
|
45
46
|
* @param [ariaLabel="Breadcrumb"] - Aria label for the breadcrumb `<nav>`
|
|
46
|
-
* @param [
|
|
47
|
+
* @param [titleClassName] - Extra classes for breadcrumb titles
|
|
47
48
|
* @param [path] - A full path string that will be split into breadcrumb items
|
|
48
49
|
* @param [makeHref] - Factory to create hrefs for segments
|
|
49
50
|
* @param [onItemClick] - Callback fired when a breadcrumb item is clicked
|
|
50
|
-
* @param [
|
|
51
|
-
* @param [
|
|
51
|
+
* @param [className] - Additional classes for the panel container
|
|
52
|
+
* @param [breadcrumbClassName] - ClassName forwarded to inner `DialBreadcrumb`
|
|
52
53
|
* @param [searchable=true] - Whether to render the search control
|
|
53
54
|
* @param [value] - Controlled value for the search input (parent-managed)
|
|
54
55
|
* @param [elementId="fm-search"] - DOM id for the internal DialSearch input
|
|
55
56
|
* @param [size=SearchSize.Base] - Size of the search input (from DialSearchProps)
|
|
56
57
|
* @param [onSearchChange] - Callback fired when the search value changes
|
|
57
|
-
* @param [
|
|
58
|
-
* @param [
|
|
58
|
+
* @param [searchClassName] - Extra classes for the search input element
|
|
59
|
+
* @param [searchContainerClassName] - Extra classes for the search container
|
|
60
|
+
* @param [isCompactView=false] - Whether the component should render in compact mode
|
|
59
61
|
*/
|
|
60
62
|
export declare const DialFileManagerNavigationPanel: FC<DialFileManagerNavigationPanelProps>;
|
package/dist/src/components/FileManager/components/FileManagerNavigationPanel/constants.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
1
|
+
export declare const panelBaseClassName = "w-full flex items-center justify-between gap-4";
|
|
2
|
+
export declare const breadcrumbContainerClassName = "min-w-0 h-[38px] flex-1 overflow-hidden bg-layer-3 px-3 flex items-center rounded";
|
|
3
|
+
export declare const searchContainerWrapperClassName = "w-[260px]";
|
package/dist/src/components/FileManager/components/FileManagerToolbar/DialFileManagerToolbar.d.ts
CHANGED
|
@@ -10,10 +10,10 @@ export interface DialFileManagerToolbarProps {
|
|
|
10
10
|
hiddenFilesSwitcherLabel?: string;
|
|
11
11
|
showHiddenFilesLabel?: string;
|
|
12
12
|
hideHiddenFilesLabel?: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
isNewButtonVisible?: boolean;
|
|
14
|
+
newButtonVariant?: ButtonVariant;
|
|
15
|
+
newButtonDropdownItems?: DropdownItem[];
|
|
16
|
+
newButtonLabel?: string;
|
|
17
17
|
onTabChange?: (id: DialFileManagerTabs) => void;
|
|
18
18
|
onToggleHiddenFiles?: (value: boolean) => void;
|
|
19
19
|
}
|
|
@@ -24,7 +24,7 @@ export interface DialFileManagerToolbarProps {
|
|
|
24
24
|
* - Tab navigation for switching between file sections or views
|
|
25
25
|
* - A toggle for showing or hiding hidden files
|
|
26
26
|
* - A refresh button for reloading content
|
|
27
|
-
* - An optional "
|
|
27
|
+
* - An optional "New" button or dropdown for creating new files or folders
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```tsx
|
|
@@ -40,8 +40,8 @@ export interface DialFileManagerToolbarProps {
|
|
|
40
40
|
* onTabChange={(id) => console.log('Switched to tab:', id)}
|
|
41
41
|
* onToggleHiddenFiles={(visible) => console.log('Hidden files visible:', visible)}
|
|
42
42
|
* onRefresh={() => console.log('Refreshed')}
|
|
43
|
-
*
|
|
44
|
-
*
|
|
43
|
+
* isNewButtonVisible
|
|
44
|
+
* newButtonDropdownItems={[
|
|
45
45
|
* { key: 'folder', label: 'New Folder' },
|
|
46
46
|
* { key: 'file', label: 'Upload File' },
|
|
47
47
|
* ]}
|
|
@@ -56,16 +56,16 @@ export interface DialFileManagerToolbarProps {
|
|
|
56
56
|
* @param [hideHiddenFilesLabel='Hide hidden'] - Label shown when hidden files are visible.
|
|
57
57
|
* @param [onTabChange] - Callback fired when the user switches between tabs. Receives the selected tab ID.
|
|
58
58
|
* @param [onToggleHiddenFiles] - Callback fired when the hidden files visibility is toggled. Receives the new visibility state.
|
|
59
|
-
* @param [
|
|
60
|
-
* @param [
|
|
61
|
-
* @param [
|
|
62
|
-
* @param [
|
|
59
|
+
* @param [isNewButtonVisible] - Whether the "New" button or dropdown should be displayed.
|
|
60
|
+
* @param [newButtonVariant=ButtonVariant.Secondary] - Visual style variant for the new button.
|
|
61
|
+
* @param [newButtonDropdownItems=[]] - Dropdown items available under the new button. If empty, a single new button is shown instead.
|
|
62
|
+
* @param [newButtonLabel='New'] - Label text for the new button.
|
|
63
63
|
*
|
|
64
64
|
* @remarks
|
|
65
65
|
* - Tabs are rendered via `DialTabs`.
|
|
66
66
|
* - The hidden files toggle uses `DialSwitch`.
|
|
67
|
-
* - The refresh and
|
|
67
|
+
* - The refresh and new actions use `DialButton` or dropdown variants for consistency.
|
|
68
68
|
* - The toolbar automatically adapts its layout for different screen sizes.
|
|
69
|
-
* - When `
|
|
69
|
+
* - When `newButtonDropdownItems` is provided, the new button becomes a dropdown menu.
|
|
70
70
|
*/
|
|
71
71
|
export declare const DialFileManagerToolbar: FC<DialFileManagerToolbarProps>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { DialFile } from '../../../../models/file';
|
|
3
|
+
export interface FileMetadataPopupProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
fileMetadata?: DialFile;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
nameLabel?: string;
|
|
10
|
+
pathLabel?: string;
|
|
11
|
+
modifiedDateLabel?: string;
|
|
12
|
+
sizeLabel?: string;
|
|
13
|
+
authorLabel?: string;
|
|
14
|
+
dateLocale?: Intl.LocalesArgument;
|
|
15
|
+
dateOptions?: Intl.DateTimeFormatOptions;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* FileMetadataPopup
|
|
19
|
+
*
|
|
20
|
+
* A popup dialog for displaying file metadata information.
|
|
21
|
+
* Shows file details like name, path, modified date, size, and author.
|
|
22
|
+
* Displays a loading skeleton while metadata is being fetched.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <FileMetadataPopup
|
|
27
|
+
* open={isOpen}
|
|
28
|
+
* onClose={handleClose}
|
|
29
|
+
* fileMetadata={file}
|
|
30
|
+
* loading={isLoading}
|
|
31
|
+
* title="Information"
|
|
32
|
+
* dateLocale="en-US"
|
|
33
|
+
* dateOptions={{ year: 'numeric', month: 'short', day: '2-digit' }}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @param open - Whether the popup is visible
|
|
38
|
+
* @param onClose - Callback fired when the popup is closed
|
|
39
|
+
* @param [fileMetadata] - File metadata to display
|
|
40
|
+
* @param [loading] - Whether metadata is being loaded
|
|
41
|
+
* @param [title="Information"] - Title of the popup
|
|
42
|
+
* @param [nameLabel="Name:"] - Label for the name field
|
|
43
|
+
* @param [pathLabel="Path:"] - Label for the path field
|
|
44
|
+
* @param [modifiedDateLabel="Modified Date:"] - Label for the modified date field
|
|
45
|
+
* @param [sizeLabel="Size:"] - Label for the size field
|
|
46
|
+
* @param [authorLabel="Author:"] - Label for the author field
|
|
47
|
+
* @param [dateLocale="en-US"] - Locale for date formatting
|
|
48
|
+
* @param [dateOptions] - Options for date formatting
|
|
49
|
+
*/
|
|
50
|
+
export declare const FileMetadataPopup: FC<FileMetadataPopupProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const LABEL_COLUMN_WIDTH = 100;
|
|
2
|
+
export declare const SKELETON_HEIGHT = 16;
|
|
3
|
+
export declare const LABEL_CLASS = "text-secondary";
|
|
4
|
+
export declare const VALUE_CLASS = "text-primary min-w-0";
|
|
5
|
+
export declare const PATH_CLASS = "text-primary break-words min-w-0";
|
|
6
|
+
export declare const SKELETON_CLASS = "bg-layer-2";
|
|
@@ -5,9 +5,13 @@ export interface DialFoldersTreeProps {
|
|
|
5
5
|
items: DialFile[];
|
|
6
6
|
expandedPaths?: Set<string>;
|
|
7
7
|
loadingPaths?: Set<string>;
|
|
8
|
+
loadedPaths?: Set<string>;
|
|
9
|
+
sharedByMePaths?: Set<string>;
|
|
8
10
|
selectedPath?: string;
|
|
9
11
|
renamedPath?: string;
|
|
10
12
|
showFiles?: boolean;
|
|
13
|
+
rootItemPath?: string;
|
|
14
|
+
rootItemLabel?: string;
|
|
11
15
|
emptyStateTitle?: string;
|
|
12
16
|
emptyStateDescription?: string;
|
|
13
17
|
emptyStateIcon?: ReactNode;
|
|
@@ -17,6 +21,7 @@ export interface DialFoldersTreeProps {
|
|
|
17
21
|
onRenameValidate?: (value: string, item: DialFile) => string | null;
|
|
18
22
|
getContextMenuItems?: (item: DialFile) => DropdownItem[];
|
|
19
23
|
areHiddenFilesVisible?: boolean;
|
|
24
|
+
onExpandedPathsChange?: (expandedPaths: Set<string>) => void;
|
|
20
25
|
}
|
|
21
26
|
/**
|
|
22
27
|
* DialFoldersTree — A hierarchical folder tree component with nested expand/collapse support, selection highlighting,
|
|
@@ -89,6 +94,8 @@ export interface DialFoldersTreeProps {
|
|
|
89
94
|
* @param [items] - Array of folder and file nodes to display in the tree.
|
|
90
95
|
* @param [expandedPaths] - Set of folder paths that should be expanded.
|
|
91
96
|
* @param [loadingPaths] - Set of folder paths currently loading (shows spinner or placeholder).
|
|
97
|
+
* @param [loadedPaths] - Set of folder paths that have loaded.
|
|
98
|
+
* @param [sharedByMePaths] - Set of items paths that the user has shared with others. Enables UI indicators (icons/badges).
|
|
92
99
|
* @param [selectedPath] - Path representing the currently selected folder or file.
|
|
93
100
|
* @param [renamedPath] - Path of the folder or file currently being edited.
|
|
94
101
|
* @param [showFiles=false] - Whether to show files in addition to folders.
|
|
@@ -101,7 +108,8 @@ export interface DialFoldersTreeProps {
|
|
|
101
108
|
* @param [onRenameValidate] - Function to validate the new name during editing. Should return an error string or `null` if valid.
|
|
102
109
|
* @param [getContextMenuItems] - Function returning context menu items for a given node.
|
|
103
110
|
* @param [areHiddenFilesVisible=false] - Whether hidden files (dotfiles) should be visible in the tree.
|
|
104
|
-
*
|
|
111
|
+
* @param [rootItemPath] - Path of the folder to treat as the custom root node (no context menu, special label).
|
|
112
|
+
* @param [rootItemLabel] - Label to display for the root node instead of its actual name.
|
|
105
113
|
* @remarks
|
|
106
114
|
* - Folder and file data must follow the `DialFile` model.
|
|
107
115
|
* - The `expandedPaths`, `loadingPaths`, `selectedPath`, and `renamedPath` props are externally controlled.
|
|
@@ -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
|
+
};
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
1
|
+
export declare const containerBaseClassName = "w-full h-full grid grid-rows-[auto_1fr] gap-5 p-6 overflow-hidden min-w-0 bg-layer-2";
|
|
2
|
+
export declare const toolbarBaseClassName = "w-full text-secondary flex items-center gap-2";
|
|
3
|
+
export declare const mainGridClassName = "flex min-h-0 min-w-0 h-full gap-4 overflow-hidden";
|
|
4
|
+
export declare const contentGridClassName = "flex flex-col flex-1 min-h-0 min-w-0 h-full gap-4";
|
|
5
|
+
export declare const contentHeaderClassName = "items-center";
|
|
6
|
+
export declare const treeBaseClassName = "w-full h-full rounded bg-layer-3 text-secondary overflow-auto min-w-0";
|
|
7
|
+
export declare const gridBaseClassName = "flex-1 w-full rounded text-secondary overflow-auto min-h-0 min-w-0";
|
|
8
8
|
export declare const sidebarWidth = 280;
|
|
9
9
|
export declare const sidebarTitleDefault = "Files";
|
|
10
10
|
export declare const BASE_FILE_MANAGER_ICON_SIZE = 20;
|
|
11
|
+
export declare const FILES_DATA_TRANSFER_TYPE = "Files";
|
|
12
|
+
export declare const FOLDER_PLACEHOLDER_FILE_NAME = ".dial_folder";
|
|
13
|
+
export declare const FOLDERS_TREE_PANEL_MIN_WIDTH = 280;
|
|
14
|
+
export declare const FOLDERS_TREE_PANEL_MAX_WIDTH = 460;
|
|
15
|
+
export declare const COMPACT_VIEW_HEADER_HEIGHT = 44;
|
|
16
|
+
export declare const COMPACT_VIEW_FILE_ROW_HEIGHT = 56;
|
|
17
|
+
export declare const DEFAULT_COMPACT_VIEW_WIDTH_BREAKPOINT = 800;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
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('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
|
+
handleDecideForEach: (decisions: FileConflictDecision[]) => void;
|
|
26
|
+
};
|
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
import { DialFile } from '../../../models/file';
|
|
2
|
-
import { DialCopiedItem } from '../../../
|
|
2
|
+
import { DialCopiedItem } from '../../../models/file-manager';
|
|
3
|
+
import { FileConflictDecision } from '../components/ConflictResolutionPopup/ConflictResolutionPopup';
|
|
4
|
+
import { DestinationFolderMode } from '../../../types/file-manager';
|
|
3
5
|
export interface UseFileClipboardOptions {
|
|
4
6
|
getDestinationFiles: (path: string) => DialFile[];
|
|
5
7
|
getSourceFiles: () => DialFile[];
|
|
6
8
|
onCopyFiles?: (items: DialCopiedItem[], destinationFolder: string) => void;
|
|
7
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;
|
|
8
15
|
}
|
|
9
|
-
export
|
|
10
|
-
export declare const useFileClipboard: ({ getDestinationFiles, onCopyFiles, onMoveToFiles, }: UseFileClipboardOptions) => {
|
|
16
|
+
export declare const useFileClipboard: ({ getDestinationFiles, onCopyFiles, onMoveToFiles, onCopySuccess, onMoveSuccess, onDuplicateSuccess, getCopyHeader, getMoveHeader, }: UseFileClipboardOptions) => {
|
|
11
17
|
handleDuplicate: (files: DialFile[]) => void;
|
|
12
18
|
handleCloseDestinationFolderPopup: () => void;
|
|
13
19
|
handleOpenDestinationFolderPopup: (mode: DestinationFolderMode) => void;
|
|
14
20
|
handleCopyTo: (destinationFolder: string) => void;
|
|
15
|
-
handleMoveTo: (destinationFolder: string, sourceFolder
|
|
21
|
+
handleMoveTo: (destinationFolder: string, sourceFolder?: string) => void;
|
|
16
22
|
openDestinationFolderPopup: boolean;
|
|
17
23
|
destinationFolderMode: DestinationFolderMode;
|
|
24
|
+
destinationFolderTitle: string | undefined;
|
|
18
25
|
handleSetCopiedFiles: (files: DialFile[]) => void;
|
|
19
26
|
handleSetMovedFiles: (files: DialFile[]) => void;
|
|
20
27
|
clearState: () => void;
|
|
28
|
+
conflictingFiles: DialFile[];
|
|
29
|
+
conflictResolutionOpen: boolean;
|
|
30
|
+
openConflictResolution: (files: DialFile[]) => void;
|
|
31
|
+
closeConflictResolution: () => void;
|
|
32
|
+
handleConflictReplace: () => void;
|
|
33
|
+
handleConflictDuplicate: () => void;
|
|
34
|
+
handleConflictDecideForEach: (decisions: FileConflictDecision[]) => void;
|
|
21
35
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { DialFile } from '../../../models/file';
|
|
2
|
-
import { DialDeletedItem } from '../../../
|
|
2
|
+
import { DialDeletedItem } from '../../../models/file-manager';
|
|
3
3
|
export interface UseFileDeleteOptions {
|
|
4
4
|
onDeleteFiles?: (items: DialDeletedItem[], sourceFolder: string) => void;
|
|
5
|
+
onDeleteSuccess?: () => void;
|
|
5
6
|
}
|
|
6
|
-
export declare const useFileDelete: ({ onDeleteFiles }: UseFileDeleteOptions) => {
|
|
7
|
+
export declare const useFileDelete: ({ onDeleteFiles, onDeleteSuccess, }: UseFileDeleteOptions) => {
|
|
7
8
|
deleteConfirmationOpen: boolean;
|
|
8
9
|
itemsToDelete: DialFile[];
|
|
9
10
|
openDeleteConfirmation: (items: DialFile[], parentFolderPath: string) => void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { DialFile } from '../../../models/file';
|
|
2
2
|
export interface UseFileDownloadOptions {
|
|
3
3
|
onDownloadFiles?: (items: DialFile[]) => void;
|
|
4
|
+
onDownloadSuccess?: () => void;
|
|
4
5
|
}
|
|
5
|
-
export declare const useFileDownload: ({ onDownloadFiles, }: UseFileDownloadOptions) => {
|
|
6
|
+
export declare const useFileDownload: ({ onDownloadFiles, onDownloadSuccess, }: UseFileDownloadOptions) => {
|
|
6
7
|
handleDownloadFiles: (items: DialFile[]) => void;
|
|
7
8
|
};
|
|
@@ -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,22 @@
|
|
|
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
|
+
}
|
|
12
|
+
export interface UseFileSearchReturn {
|
|
13
|
+
isSearchMode: boolean;
|
|
14
|
+
searchValue: string;
|
|
15
|
+
effectiveSearchValue: string;
|
|
16
|
+
setSearchValue: (value: string) => void;
|
|
17
|
+
handleSearchChange: (value?: string) => void;
|
|
18
|
+
handleSearchActivate: (query: string) => void;
|
|
19
|
+
handleSearchClear: () => void;
|
|
20
|
+
searchResultsRows: DialFile[];
|
|
21
|
+
}
|
|
22
|
+
export declare function useFileSearch({ onSearchFiles, clearSearchResults, currentPath, searchResults, searchInProgress, navigationPanelValue, onNavigationPanelSearchChange, allItems, }: UseFileSearchOptions): UseFileSearchReturn;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DragEvent } from '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
|
+
duplicateFiles?: string;
|
|
11
|
+
oversizedFiles?: string;
|
|
12
|
+
unsupportedFiles?: string;
|
|
13
|
+
validationFailed?: string;
|
|
14
|
+
validationError?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface UseFileUploadOptions {
|
|
17
|
+
onUploadFiles?: (files: DialUploadFileItem[], destinationFolder: string) => void;
|
|
18
|
+
onValidateUpload?: (files: DialUploadFileItem[], existingFiles: DialFile[], destinationFolder: string) => FileUploadValidationResult | Promise<FileUploadValidationResult>;
|
|
19
|
+
maxFileSize?: number;
|
|
20
|
+
allowedFileTypes?: DialFileAcceptType[];
|
|
21
|
+
validationMessages?: FileUploadValidationMessages;
|
|
22
|
+
onUploadArchive?: (file: File, name: string, destinationFolder: string) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare const useFileUpload: ({ onUploadFiles, onValidateUpload, maxFileSize, allowedFileTypes, validationMessages, onUploadArchive, }?: UseFileUploadOptions) => {
|
|
25
|
+
isDragging: boolean;
|
|
26
|
+
isDraggingOverWindow: boolean;
|
|
27
|
+
uploadError: string | undefined;
|
|
28
|
+
handleDragEnter: (e: DragEvent) => void;
|
|
29
|
+
handleDragLeave: (e: DragEvent) => void;
|
|
30
|
+
handleDragOver: (e: DragEvent) => void;
|
|
31
|
+
handleDrop: (e: DragEvent, destinationFolder: string, existingFiles: DialFile[]) => Promise<void>;
|
|
32
|
+
clearError: () => void;
|
|
33
|
+
handleUpload: (files: DialUploadFileItem[], destinationFolder: string, existingFiles: DialFile[]) => Promise<boolean>;
|
|
34
|
+
openFileDialog: (destinationFolder: string, existingFiles: DialFile[]) => void;
|
|
35
|
+
openArchiveDialog: (destinationFolder: string, existingFiles: DialFile[]) => void;
|
|
36
|
+
fileInputRef: import('react').RefObject<HTMLInputElement | null>;
|
|
37
|
+
uploadConflictingFiles: DialFile[];
|
|
38
|
+
uploadConflictResolutionOpen: boolean;
|
|
39
|
+
hasActiveUploadConflictRef: import('react').RefObject<boolean>;
|
|
40
|
+
openUploadConflictResolution: (files: DialFile[]) => void;
|
|
41
|
+
closeUploadConflictResolution: () => void;
|
|
42
|
+
handleUploadConflictReplace: () => void;
|
|
43
|
+
handleUploadConflictDuplicate: () => void;
|
|
44
|
+
handleUploadConflictDecideForEach: (decisions: FileConflictDecision[]) => void;
|
|
45
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
import { DialUploadFileItem } from '../../../models/file-manager';
|
|
3
|
+
export interface FolderCreationValidationMessages {
|
|
4
|
+
emptyName?: string;
|
|
5
|
+
duplicateName?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface UseFolderCreationProps {
|
|
8
|
+
currentFolder?: DialFile;
|
|
9
|
+
onCreateFolder?: (file: DialUploadFileItem, folderPath: string, fileId: string) => void | Promise<void>;
|
|
10
|
+
onValidateFolderName?: (name: string, parentFolder: DialFile) => string | null;
|
|
11
|
+
validationMessages?: FolderCreationValidationMessages;
|
|
12
|
+
}
|
|
13
|
+
export interface UseFolderCreationResult {
|
|
14
|
+
isCreatingFolder: boolean;
|
|
15
|
+
newFolderTempId: string | null;
|
|
16
|
+
startFolderCreation: () => void;
|
|
17
|
+
cancelFolderCreation: () => void;
|
|
18
|
+
saveFolderCreation: (name: string) => Promise<void>;
|
|
19
|
+
validateFolderName: (name: string) => string | null;
|
|
20
|
+
}
|
|
21
|
+
export declare const useFolderCreation: ({ currentFolder, onCreateFolder, onValidateFolderName, validationMessages, }: UseFolderCreationProps) => UseFolderCreationResult;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ColDef } from 'ag-grid-community';
|
|
2
|
+
import { FileManagerGridRow } from '../FileManagerContext';
|
|
3
|
+
import { DropdownItem } from '../../../models/dropdown';
|
|
4
|
+
import { DialFileAcceptType } from '../../../models/file-manager';
|
|
5
|
+
interface UseGridActionsColumnProps {
|
|
6
|
+
getContextMenuItems: (row: FileManagerGridRow) => DropdownItem[];
|
|
7
|
+
isRowDisabled: (row: FileManagerGridRow, allowedFileTypes?: DialFileAcceptType[]) => boolean;
|
|
8
|
+
allowedFileTypes?: DialFileAcceptType[];
|
|
9
|
+
}
|
|
10
|
+
export declare const useGridActionsColumn: ({ getContextMenuItems, isRowDisabled, allowedFileTypes, }: UseGridActionsColumnProps) => {
|
|
11
|
+
actionsColumnDef: ColDef<FileManagerGridRow, any>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -9,6 +9,8 @@ export interface UseGridContextMenuProps {
|
|
|
9
9
|
[DialFileManagerActions.Download]?: string;
|
|
10
10
|
[DialFileManagerActions.Delete]?: string;
|
|
11
11
|
[DialFileManagerActions.Move]?: string;
|
|
12
|
+
[DialFileManagerActions.Info]?: string;
|
|
13
|
+
[DialFileManagerActions.Unshare]?: string;
|
|
12
14
|
};
|
|
13
15
|
onDuplicate: (file: DialFile) => void;
|
|
14
16
|
onCopy: (file: DialFile) => void;
|
|
@@ -16,5 +18,7 @@ export interface UseGridContextMenuProps {
|
|
|
16
18
|
onDownload: (file: DialFile) => void;
|
|
17
19
|
onRename: (filePath: string) => void;
|
|
18
20
|
onDelete: (file: DialFile, parentFolderPath: string) => void;
|
|
21
|
+
onInfo: (file: DialFile) => void;
|
|
22
|
+
onUnshare: (file: DialFile) => void;
|
|
19
23
|
}
|
|
20
|
-
export declare const useGridContextMenu: ({ actionLabels, onDuplicate, onCopy, onMove, onDownload, onRename, onDelete, }: UseGridContextMenuProps) => (file: DialFile) => DropdownItem[];
|
|
24
|
+
export declare const useGridContextMenu: ({ actionLabels, onDuplicate, onCopy, onMove, onDownload, onRename, onDelete, onInfo, onUnshare, }: UseGridContextMenuProps) => (file: DialFile) => DropdownItem[];
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { DialFile } from '../../../models/file';
|
|
2
|
-
import { DialCopiedItem } from '../../../
|
|
3
|
-
export
|
|
2
|
+
import { DialCopiedItem } from '../../../models/file-manager';
|
|
3
|
+
export interface RenameValidationMessages {
|
|
4
|
+
emptyName?: string;
|
|
5
|
+
duplicateName?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const useItemRenaming: ({ items, onRenameValidate, validationMessages, onMoveToFiles, }: {
|
|
4
8
|
items?: DialFile[];
|
|
5
|
-
onRename?: (path: string) => void;
|
|
6
|
-
onRenameSave?: (value: string) => void;
|
|
7
|
-
onRenameCancel?: () => void;
|
|
8
9
|
onRenameValidate?: (value: string, item: DialFile) => string | null;
|
|
10
|
+
validationMessages?: RenameValidationMessages;
|
|
9
11
|
onMoveToFiles?: (items: DialCopiedItem[], sourceFolder: string, destinationFolder: string) => void;
|
|
10
12
|
}) => {
|
|
11
13
|
renamedPath: string | undefined;
|
|
14
|
+
renamedItem: DialFile | undefined;
|
|
12
15
|
renameHandler: (path: string) => void;
|
|
13
16
|
renameSaveHandler: (value: string) => void;
|
|
14
17
|
renameCancelHandler: () => void;
|
|
15
18
|
renameValidateHandler: (value: string, item: DialFile) => string | null;
|
|
19
|
+
getDisplayName: (item: DialFile) => string;
|
|
16
20
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DropdownItem } from '../../../models/dropdown';
|
|
2
|
+
export interface UseNewActionsProps {
|
|
3
|
+
newActionLabels?: {
|
|
4
|
+
uploadFiles?: string;
|
|
5
|
+
newFolder?: string;
|
|
6
|
+
uploadArchive?: string;
|
|
7
|
+
};
|
|
8
|
+
onUploadFiles?: () => void;
|
|
9
|
+
onCreateFolder?: () => void;
|
|
10
|
+
onUploadArchive?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface UseNewActionsResult {
|
|
13
|
+
newActions: DropdownItem[];
|
|
14
|
+
isNewButtonVisible: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const useNewActions: ({ newActionLabels, onUploadFiles, onCreateFolder, onUploadArchive, }: UseNewActionsProps) => UseNewActionsResult;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface useTreeAdditionalButtonsOptions {
|
|
3
|
+
additionalButtons?: ReactNode;
|
|
4
|
+
expandedPathsLength: number;
|
|
5
|
+
collapseAll: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Provides additional action buttons for the tree component, including a
|
|
9
|
+
* built-in "Collapse All" button. The hook memoizes the returned JSX to avoid
|
|
10
|
+
* unnecessary re-renders and applies disabled state automatically based on
|
|
11
|
+
* the number of expanded paths.
|
|
12
|
+
*
|
|
13
|
+
* @param {ReactNode} [additionalButtons] - Optional custom buttons rendered before the Collapse All button.
|
|
14
|
+
* @param {number} expandedPathsLength - Number of currently expanded paths in the tree.
|
|
15
|
+
* @param {() => void} collapseAll - Callback fired when the Collapse All button is clicked.
|
|
16
|
+
*
|
|
17
|
+
* @returns {{ additionalButtons: ReactNode }} - The rendered buttons fragment.
|
|
18
|
+
*/
|
|
19
|
+
export declare const useTreeAdditionalButtons: ({ additionalButtons, expandedPathsLength, collapseAll, }: useTreeAdditionalButtonsOptions) => {
|
|
20
|
+
additionalButtons: import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FileManagerRenameTriggerView } from '../../../types/file-manager';
|
|
2
|
+
interface UseTriggerViewRenameOptions {
|
|
3
|
+
onRename: (path: string) => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Manages which view ("tree" or "grid") triggered a rename action.
|
|
7
|
+
*
|
|
8
|
+
* Useful when both TreeView and GridView can initiate renaming,
|
|
9
|
+
* and the parent needs to know which source triggered it
|
|
10
|
+
* to apply view-specific logic or UI updates.
|
|
11
|
+
*
|
|
12
|
+
* Returns the last rename trigger source and two handlers
|
|
13
|
+
* (`onGridRename`, `onTreeRename`) that wrap the provided `onRename` callback.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useTriggerViewRename: ({ onRename, }: UseTriggerViewRenameOptions) => {
|
|
16
|
+
renameTriggerView: FileManagerRenameTriggerView;
|
|
17
|
+
onGridRename: (path: string) => void;
|
|
18
|
+
onTreeRename: (path: string) => void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|