@epam/ai-dial-react-file-manager 0.3.0-dev.2 → 0.3.0-dev.20
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/dist/ai-dial-react-file-manager.es.js +3798 -3710
- package/dist/index.css +1 -1
- package/dist/src/components/FileManager/FileManager.d.ts +78 -15
- package/dist/src/components/FileManager/FileManagerContext.d.ts +4 -2
- package/dist/src/components/FileManager/components/DestinationFolderPopup/DestinationFolderPopup.d.ts +3 -3
- package/dist/src/components/FileManager/components/FileManagerBulkActionsToolbar/FileManagerBulkActionsToolbar.d.ts +20 -8
- package/dist/src/components/FileManager/components/FileManagerBulkActionsToolbar/constants.d.ts +5 -0
- package/dist/src/components/FileManager/components/FileManagerItemName/FileManagerItemName.d.ts +2 -3
- package/dist/src/components/FileManager/components/FileManagerItemNameInput/FileManagerItemNameInput.d.ts +0 -4
- package/dist/src/components/FileManager/components/FileManagerNavigationPanel/FileManagerNavigationPanel.d.ts +13 -32
- package/dist/src/components/FileManager/components/FileManagerNavigationPanel/constants.d.ts +2 -3
- package/dist/src/components/FileManager/components/FileManagerSearchBar/FileManagerSearchBar.d.ts +44 -0
- package/dist/src/components/FileManager/components/FileManagerSearchBar/constants.d.ts +2 -0
- package/dist/src/components/FileManager/components/FileManagerSortDropdown/FileManagerSortDropdown.d.ts +43 -0
- package/dist/src/components/FileManager/components/FileManagerToolbar/DialFileManagerToolbar.d.ts +10 -27
- package/dist/src/components/FileManager/components/FoldersTree/FoldersTree.d.ts +13 -0
- package/dist/src/components/FileManager/components/FoldersTree/constants.d.ts +1 -1
- package/dist/src/components/FileManager/constants.d.ts +14 -9
- package/dist/src/components/FileManager/hooks/use-file-manager-tabs.d.ts +2 -2
- package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +2 -1
- package/dist/src/components/FileManager/utils.d.ts +8 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/types/file-manager.d.ts +15 -0
- package/package.json +3 -4
- package/dist/src/components/FileManager/components/FileManagerItemIcon/FileManagerItemIcon.d.ts +0 -50
- package/dist/src/components/FileManager/hooks/use-tree-additional-buttons.d.ts +0 -22
package/dist/src/components/FileManager/components/FileManagerSearchBar/FileManagerSearchBar.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SearchProps } from '@epam/ai-dial-ui-kit';
|
|
3
|
+
export interface DialFileManagerSearchBarProps extends Omit<SearchProps, 'onChange' | 'id' | 'value' | 'className' | 'containerClassName'> {
|
|
4
|
+
/** Controlled value for the search input (parent-managed). */
|
|
5
|
+
value?: string | number | null;
|
|
6
|
+
/** DOM id for the internal Search input. */
|
|
7
|
+
elementId?: string;
|
|
8
|
+
/** Callback fired when the search value changes. */
|
|
9
|
+
onSearchChange?: (value: string) => void;
|
|
10
|
+
/** Additional classes for the bar container. */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Extra classes for the search input element. */
|
|
13
|
+
searchClassName?: string;
|
|
14
|
+
/** Extra classes for the search input's own container. */
|
|
15
|
+
searchContainerClassName?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* FileManagerSearchBar
|
|
19
|
+
*
|
|
20
|
+
* The full-width search row that heads the File Manager grid card. It used to
|
|
21
|
+
* be a 260px field pinned to the right of the breadcrumb trail; the breadcrumbs
|
|
22
|
+
* now live in the content header, and the search reads as part of the table it
|
|
23
|
+
* filters.
|
|
24
|
+
*
|
|
25
|
+
* The input is controlled by the parent: the component holds no query state of
|
|
26
|
+
* its own and only reports changes through `onSearchChange`.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <DialFileManagerSearchBar
|
|
31
|
+
* value={query}
|
|
32
|
+
* placeholder="Search in My files..."
|
|
33
|
+
* onSearchChange={setQuery}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @param [value] - Controlled value for the search input
|
|
38
|
+
* @param [elementId="file-manager-search"] - DOM id for the internal Search input
|
|
39
|
+
* @param [onSearchChange] - Callback fired when the search value changes
|
|
40
|
+
* @param [className] - Additional classes for the bar container
|
|
41
|
+
* @param [searchClassName] - Extra classes for the search input element
|
|
42
|
+
* @param [searchContainerClassName] - Extra classes for the search input's own container
|
|
43
|
+
*/
|
|
44
|
+
export declare const DialFileManagerSearchBar: FC<DialFileManagerSearchBarProps>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FileManagerSort, FileManagerSortDirection, FileManagerSortField } from '../../../../types/file-manager';
|
|
3
|
+
export interface DialFileManagerSortDropdownProps {
|
|
4
|
+
/** The sort currently applied to the grid. */
|
|
5
|
+
sort: FileManagerSort;
|
|
6
|
+
/** Fired with the next sort when a field or a direction is picked. */
|
|
7
|
+
onSortChange?: (sort: FileManagerSort) => void;
|
|
8
|
+
/** Label of the trigger button. */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Menu labels of the sort fields. */
|
|
11
|
+
fieldLabels?: Partial<Record<FileManagerSortField, string>>;
|
|
12
|
+
/** Menu labels of the sort directions. */
|
|
13
|
+
directionLabels?: Partial<Record<FileManagerSortDirection, string>>;
|
|
14
|
+
/** Whether the trigger is disabled. */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Additional classes for the trigger button. */
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* DialFileManagerSortDropdown
|
|
21
|
+
*
|
|
22
|
+
* The "Sort" menu at the trailing edge of the search row. It lists the sort
|
|
23
|
+
* fields, a divider, then the directions, and marks the chosen field and the
|
|
24
|
+
* chosen direction with a trailing check. The component holds no sort state of
|
|
25
|
+
* its own: it shows `sort` and reports picks through `onSortChange`.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <DialFileManagerSortDropdown
|
|
30
|
+
* sort={{ field: FileManagerSortField.Name, direction: FileManagerSortDirection.Asc }}
|
|
31
|
+
* onSortChange={setSort}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @param sort - The sort currently applied to the grid
|
|
36
|
+
* @param [onSortChange] - Fired with the next sort when a field or a direction is picked
|
|
37
|
+
* @param [label='Sort'] - Label of the trigger button
|
|
38
|
+
* @param [fieldLabels] - Menu labels of the sort fields
|
|
39
|
+
* @param [directionLabels] - Menu labels of the sort directions
|
|
40
|
+
* @param [disabled] - Whether the trigger is disabled
|
|
41
|
+
* @param [className] - Additional classes for the trigger button
|
|
42
|
+
*/
|
|
43
|
+
export declare const DialFileManagerSortDropdown: FC<DialFileManagerSortDropdownProps>;
|
package/dist/src/components/FileManager/components/FileManagerToolbar/DialFileManagerToolbar.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DropdownItem, TabItem, ButtonVariant } from '@epam/ai-dial-ui-kit';
|
|
1
|
+
import { DropdownItem, ButtonVariant } from '@epam/ai-dial-ui-kit';
|
|
3
2
|
import { FC } from 'react';
|
|
4
3
|
export interface DialFileManagerToolbarProps {
|
|
5
|
-
tabs?: TabItem[];
|
|
6
|
-
activeTab?: string;
|
|
7
4
|
areHiddenFilesVisible: boolean;
|
|
8
|
-
hiddenFilesSwitcherLabel?: string;
|
|
9
5
|
showHiddenFilesLabel?: string;
|
|
10
6
|
hideHiddenFilesLabel?: string;
|
|
11
7
|
isNewButtonVisible?: boolean;
|
|
@@ -14,33 +10,25 @@ export interface DialFileManagerToolbarProps {
|
|
|
14
10
|
newButtonDropdownItems?: DropdownItem[];
|
|
15
11
|
newButtonLabel?: string;
|
|
16
12
|
showHiddenFilesToggle?: boolean;
|
|
17
|
-
onTabChange?: (id: DialFileManagerTabs) => void;
|
|
18
13
|
onToggleHiddenFiles?: (value: boolean) => void;
|
|
19
14
|
disabledNewButtonTooltip?: string;
|
|
20
15
|
}
|
|
21
16
|
/**
|
|
22
17
|
* DialFileManagerToolbar — A configurable, responsive toolbar component for file management views.
|
|
23
18
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
19
|
+
* Renders the action cluster that sits at the trailing edge of the File Manager
|
|
20
|
+
* content header, next to the breadcrumb trail:
|
|
26
21
|
* - A toggle for showing or hiding hidden files
|
|
27
|
-
* -
|
|
28
|
-
*
|
|
22
|
+
* - An optional "Add" button or dropdown for creating new files or folders
|
|
23
|
+
*
|
|
24
|
+
* Tab navigation is no longer part of this toolbar — it lives in the folders
|
|
25
|
+
* panel, next to the tree it filters.
|
|
29
26
|
*
|
|
30
27
|
* @example
|
|
31
28
|
* ```tsx
|
|
32
|
-
* const tabs: TabModel[] = [
|
|
33
|
-
* { id: 'all', name: 'All Files' },
|
|
34
|
-
* { id: 'favorites', name: 'Favorites' },
|
|
35
|
-
* ];
|
|
36
|
-
*
|
|
37
29
|
* <DialFileManagerToolbar
|
|
38
|
-
* tabs={tabs}
|
|
39
|
-
* activeTab="all"
|
|
40
30
|
* areHiddenFilesVisible={false}
|
|
41
|
-
* onTabChange={(id) => console.log('Switched to tab:', id)}
|
|
42
31
|
* onToggleHiddenFiles={(visible) => console.log('Hidden files visible:', visible)}
|
|
43
|
-
* onRefresh={() => console.log('Refreshed')}
|
|
44
32
|
* isNewButtonVisible
|
|
45
33
|
* newButtonDropdownItems={[
|
|
46
34
|
* { key: 'folder', label: 'New Folder' },
|
|
@@ -49,13 +37,9 @@ export interface DialFileManagerToolbarProps {
|
|
|
49
37
|
* />
|
|
50
38
|
* ```
|
|
51
39
|
*
|
|
52
|
-
* @param [tabs] - List of tab definitions to display, each represented by a `TabModel` containing `id` and `name`.
|
|
53
|
-
* @param [activeTab] - The ID of the currently active tab.
|
|
54
40
|
* @param areHiddenFilesVisible - Whether hidden files are currently visible.
|
|
55
|
-
* @param [
|
|
56
|
-
* @param [
|
|
57
|
-
* @param [hideHiddenFilesLabel='Hide hidden'] - Label shown when hidden files are visible.
|
|
58
|
-
* @param [onTabChange] - Callback fired when the user switches between tabs. Receives the selected tab ID.
|
|
41
|
+
* @param [showHiddenFilesLabel='Show hidden files'] - Label of the toggle while hidden files are not visible.
|
|
42
|
+
* @param [hideHiddenFilesLabel='Hide hidden files'] - Label of the toggle while hidden files are visible.
|
|
59
43
|
* @param [onToggleHiddenFiles] - Callback fired when the hidden files visibility is toggled. Receives the new visibility state.
|
|
60
44
|
* @param [isNewButtonVisible] - Whether the "New" button or dropdown should be displayed.
|
|
61
45
|
* @param [isNewButtonDisabled] - Whether the "New" button is disabled.
|
|
@@ -65,9 +49,8 @@ export interface DialFileManagerToolbarProps {
|
|
|
65
49
|
* @param [disabledNewButtonTooltip] - Tooltip text to show when the new button is disabled.
|
|
66
50
|
*
|
|
67
51
|
* @remarks
|
|
68
|
-
* - Tabs are rendered via `Tabs`.
|
|
69
52
|
* - The hidden files toggle uses `Switch`.
|
|
70
|
-
* - The
|
|
53
|
+
* - The new actions use `GhostIconButton` or dropdown variants for consistency.
|
|
71
54
|
* - The toolbar automatically adapts its layout for different screen sizes.
|
|
72
55
|
* - When `newButtonDropdownItems` is provided, the new button becomes a dropdown menu.
|
|
73
56
|
*/
|
|
@@ -28,6 +28,12 @@ export interface DialFoldersTreeProps {
|
|
|
28
28
|
forbiddenSymbolsRegExp?: RegExp;
|
|
29
29
|
forbiddenSymbolsTooltip?: ReactNode;
|
|
30
30
|
newFolderDefaultName?: string;
|
|
31
|
+
/** Accessible name of the `role="tree"` root. Defaults to `'Folders'`. */
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
/** Moves focus to the selected row (or the first row) when the tree mounts. */
|
|
34
|
+
autoFocus?: boolean;
|
|
35
|
+
/** Called when Escape is pressed on a row, e.g. to close an overlay hosting the tree. */
|
|
36
|
+
onEscape?: () => void;
|
|
31
37
|
}
|
|
32
38
|
/**
|
|
33
39
|
* DialFoldersTree — A hierarchical folder tree component with nested expand/collapse support, selection highlighting,
|
|
@@ -122,11 +128,18 @@ export interface DialFoldersTreeProps {
|
|
|
122
128
|
* @param [onCreateFolderSave] - Optional Callback fired when create new folder is confirmed
|
|
123
129
|
* @param [onCreateFolderCancel] - Optional Callback fired when create new folder is cancelled
|
|
124
130
|
* @param [newFolderDefaultName] - Optional new folder default name.
|
|
131
|
+
* @param [ariaLabel='Folders'] - Accessible name of the `role="tree"` root.
|
|
132
|
+
* @param [autoFocus=false] - Moves focus to the selected row (or the first row) on mount.
|
|
133
|
+
* @param [onEscape] - Callback fired when Escape is pressed on a row.
|
|
125
134
|
* @remarks
|
|
126
135
|
* - Folder and file data must follow the `DialFile` model.
|
|
127
136
|
* - The `expandedPaths`, `loadingPaths`, `selectedPath`, and `renamedPath` props are externally controlled.
|
|
128
137
|
* - Inline renaming is fully customizable using `onRenameSave`, `onRenameCancel`, and `onRenameValidate`.
|
|
129
138
|
* - Context menus can be attached to both folders and files using `getContextMenuItems`.
|
|
130
139
|
* - Use `showFiles={false}` to render only folders for a simplified tree.
|
|
140
|
+
* - Rows are `role="treeitem"` with a roving tabIndex: Arrow Up/Down and
|
|
141
|
+
* Home/End move focus, Arrow Right/Left expand, collapse or move to the
|
|
142
|
+
* parent (mirrored under `dir="rtl"`), Enter/Space activate the row as a
|
|
143
|
+
* click does, and Escape calls `onEscape`.
|
|
131
144
|
*/
|
|
132
145
|
export declare const DialFoldersTree: FC<DialFoldersTreeProps>;
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { FileManagerColumnKey } from '../../types/file-manager.ts';
|
|
2
|
-
export declare const containerBaseClassName = "w-full h-full grid grid-rows-[
|
|
3
|
-
export declare const toolbarBaseClassName = "
|
|
2
|
+
export declare const containerBaseClassName = "w-full h-full grid grid-rows-[minmax(0,1fr)] overflow-hidden min-w-0";
|
|
3
|
+
export declare const toolbarBaseClassName = "text-secondary flex items-center gap-2";
|
|
4
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
|
|
8
|
-
export declare const
|
|
5
|
+
export declare const contentGridClassName = "flex flex-col flex-1 min-h-0 min-w-0 h-full px-5 gap-5 pb-4";
|
|
6
|
+
export declare const contentHeaderClassName = "flex w-full shrink-0 items-center justify-between gap-4 h-[64px]";
|
|
7
|
+
export declare const sidebarPanelClassName = "min-h-0 min-w-[360px] h-full bg-layer-raised shadow-sm";
|
|
8
|
+
export declare const sidebarContentClassName = "flex h-full min-h-0 flex-col gap-3";
|
|
9
|
+
export declare const sidebarHeadingClassName = "dial-h1-text text-primary";
|
|
10
|
+
export declare const sidebarHeadingRowClassName = "px-4 h-[64px] flex items-center justify-between gap-2";
|
|
11
|
+
export declare const sidebarTreeContainerClassName = "min-h-0 flex-1 px-3";
|
|
12
|
+
export declare const sidebarTabsAriaLabelDefault = "File storage sections";
|
|
13
|
+
export declare const gridPanelClassName = "flex flex-1 flex-col w-full min-h-0 min-w-0 gap-5";
|
|
14
|
+
export declare const gridBaseClassName = "flex-1 w-full text-secondary overflow-auto min-h-0 min-w-0";
|
|
15
|
+
export declare const bulkActionsToolbarWrapperClassName = "absolute bottom-4 left-4 right-4 z-10";
|
|
9
16
|
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
17
|
export declare const sidebarTitleDefault = "Files";
|
|
12
18
|
export declare const BASE_FILE_MANAGER_ICON_SIZE = 20;
|
|
13
19
|
export declare const FILES_DATA_TRANSFER_TYPE = "Files";
|
|
14
20
|
export declare const FOLDER_PLACEHOLDER_FILE_NAME = ".dial_folder";
|
|
15
21
|
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
22
|
export declare const AG_GRID_SELECTION_COLUMN_ID = "ag-Grid-SelectionColumn";
|
|
19
23
|
export declare const COMPACT_VIEW_HEADER_HEIGHT = 44;
|
|
20
24
|
export declare const COMPACT_VIEW_FILE_ROW_HEIGHT = 56;
|
|
21
25
|
export declare const DEFAULT_COMPACT_VIEW_WIDTH_BREAKPOINT = 800;
|
|
22
26
|
export declare const DEFAULT_VISIBLE_COLUMN: FileManagerColumnKey[];
|
|
27
|
+
export declare const searchRowClassName = "flex w-full shrink-0 items-center gap-3";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FilterChipItem } from '@epam/ai-dial-ui-kit';
|
|
2
2
|
import { DialFileManagerTabs } from '../../../types/file-manager';
|
|
3
3
|
export declare const useDialFileManagerTabs: (tabLabels?: Record<DialFileManagerTabs, string>, initialTab?: DialFileManagerTabs) => {
|
|
4
4
|
activeTab: DialFileManagerTabs;
|
|
5
5
|
handleTabChange: (tab: DialFileManagerTabs) => void;
|
|
6
|
-
tabs:
|
|
6
|
+
tabs: FilterChipItem<DialFileManagerTabs>[] | undefined;
|
|
7
7
|
};
|
|
@@ -37,7 +37,8 @@ export interface UseGridContextMenuProps {
|
|
|
37
37
|
isRenameFileAvailable?: boolean;
|
|
38
38
|
isDuplicateFolderAvailable?: boolean;
|
|
39
39
|
forbiddenSymbolsRegExp?: RegExp;
|
|
40
|
+
skipForbiddenSymbolsCheckForActions?: boolean;
|
|
40
41
|
onGridCreateSiblingFolder: (files: DialFile[]) => void;
|
|
41
42
|
onGridCreateChildFolder: (files: DialFile[]) => void;
|
|
42
43
|
}
|
|
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[];
|
|
44
|
+
export declare const useGridContextMenu: ({ actionLabels, onDuplicate, onCopy, onMove, onDownload, onRename, onDelete, onInfo, onUnshare, onRemoveAccess, sharedWithMeIds, sharedByMePaths, onManagePermissions, onPreview, onOpenInNewTab, previewExtensions, isRenameFileAvailable, isDuplicateFolderAvailable, forbiddenSymbolsRegExp, skipForbiddenSymbolsCheckForActions, onGridCreateSiblingFolder, onGridCreateChildFolder, }: UseGridContextMenuProps) => (file: DialFile) => DropdownItem[];
|
|
@@ -2,6 +2,7 @@ import { DialFile } from '../../models/file';
|
|
|
2
2
|
import { DialFileAcceptType } from '../../models/file-manager';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import { FileManagerGridRow } from './FileManagerContext';
|
|
5
|
+
import { FileManagerSort } from '../../types/file-manager';
|
|
5
6
|
export declare const findNodeByPath: (nodes: DialFile[] | undefined, path: string) => DialFile | undefined;
|
|
6
7
|
export declare const findFolderForPath: (root: DialFile[] | undefined, path?: string) => DialFile | undefined;
|
|
7
8
|
export declare const normalizeToLowerCase: (input?: string) => string;
|
|
@@ -65,6 +66,12 @@ export declare const splitPathAndName: (fullPath: string) => {
|
|
|
65
66
|
};
|
|
66
67
|
export declare const isFileSelectable: (file: Pick<DialFile, "contentLength" | "contentType" | "name">, allowedFileTypes?: DialFileAcceptType[], maxSelectableFileSize?: number) => boolean;
|
|
67
68
|
export declare const getRowTooltip: (file: FileManagerGridRow, allowedFileTypes?: DialFileAcceptType[], maxSelectableFileSize?: number, unsupportedFileTypeTooltip?: string, fileTooLargeTooltip?: string) => string | undefined;
|
|
68
|
-
export declare const baseColumnComparator: (a: string | number | undefined, b: string | number | undefined, _nodeA?: unknown, _nodeB?: unknown, isInverted?: boolean) => number;
|
|
69
69
|
export declare const getFolderNestingDepth: (folderPath: string) => number;
|
|
70
70
|
export declare const getNextFolderName: (existingFolders: DialFile[]) => string;
|
|
71
|
+
/**
|
|
72
|
+
* Orders grid rows for the sort menu. A row still being created stays on top
|
|
73
|
+
* so its name input never jumps away, and folders lead files the way every
|
|
74
|
+
* file browser lists them; the chosen field and direction order each group.
|
|
75
|
+
* Ties fall back to the name so equal dates or sizes keep a stable order.
|
|
76
|
+
*/
|
|
77
|
+
export declare const sortGridRows: (rows: FileManagerGridRow[], sort: FileManagerSort) => FileManagerGridRow[];
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export { DialFileManager } from './components/FileManager/FileManager';
|
|
2
|
-
export type { BulkActionsToolbarOptions, CreateFolderValidationMessages, DeleteConfirmationOptions, DialFileManagerConflictResolutionPopupOptions, DialFileManagerDestinationFolderPopupOptions, DialFileManagerProps, FileMetadataPopupOptions, FileTreeOptions, GridOptions, NavigationPanelOptions, NewAction, ToolbarOptions, } from './components/FileManager/FileManager';
|
|
2
|
+
export type { BulkActionsToolbarOptions, CreateFolderValidationMessages, DeleteConfirmationOptions, DialFileManagerConflictResolutionPopupOptions, DialFileManagerDestinationFolderPopupOptions, DialFileManagerProps, FileMetadataPopupOptions, FileTreeOptions, GridOptions, NavigationPanelOptions, NewAction, SortOptions, ToolbarOptions, } from './components/FileManager/FileManager';
|
|
3
3
|
export { DialDestinationFolderPopup } from './components/FileManager/components/DestinationFolderPopup/DestinationFolderPopup';
|
|
4
4
|
export type { DestinationFolderPopupProps } from './components/FileManager/components/DestinationFolderPopup/DestinationFolderPopup';
|
|
5
5
|
export { DialFoldersTree } from './components/FileManager/components/FoldersTree/FoldersTree';
|
|
6
6
|
export type { DialFoldersTreeProps } from './components/FileManager/components/FoldersTree/FoldersTree';
|
|
7
|
+
export { DialFileManagerSortDropdown } from './components/FileManager/components/FileManagerSortDropdown/FileManagerSortDropdown';
|
|
8
|
+
export type { DialFileManagerSortDropdownProps } from './components/FileManager/components/FileManagerSortDropdown/FileManagerSortDropdown';
|
|
7
9
|
export type { FileManagerContextValue, FileManagerGridRow, } from './components/FileManager/FileManagerContext';
|
|
8
10
|
export { FileManagerProvider } from './components/FileManager/FileManagerProvider';
|
|
9
11
|
export type { FileManagerProviderProps } from './components/FileManager/FileManagerProvider';
|
|
@@ -14,6 +16,6 @@ export { DialFileNodeType, DialFilePermission, DialFileResourceType, } from './m
|
|
|
14
16
|
export type { DialRootFolder } from './models/file';
|
|
15
17
|
export { type DialCopiedItem, type DialDeletedItem, type DialFileAcceptType, type DialFileManagerActionsRef, type DialUploadFileItem, } from './models/file-manager';
|
|
16
18
|
export { GridSelectionMode } from './models/selection-mode';
|
|
17
|
-
export { DestinationFolderMode, DialFileManagerActions, DialFileManagerConflictActions, DialFileManagerConflictStrategies, DialFileManagerTabs, FileManagerColumnKey, FileManagerCreateFolderTriggerView, FileManagerCreateFolderType, FileManagerRenameTriggerView, } from './types/file-manager';
|
|
19
|
+
export { DestinationFolderMode, DialFileManagerActions, DialFileManagerConflictActions, DialFileManagerConflictStrategies, DialFileManagerTabs, FileManagerColumnKey, FileManagerCreateFolderTriggerView, FileManagerCreateFolderType, FileManagerRenameTriggerView, FileManagerSortDirection, FileManagerSortField, type FileManagerSort, } from './types/file-manager';
|
|
18
20
|
export { NAME_COLUMN, SIZE_COLUMN, UPDATED_AT_COLUMN, } from './constants/file-grid-columns';
|
|
19
21
|
export { FILE_MANAGER_ICON_PROPS, FILE_MANAGER_ICON_STROKE, } from './constants/icon';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare enum DialFileManagerTabs {
|
|
2
|
+
/** Combined view with one top-level folder per source tab. */
|
|
3
|
+
All = "all",
|
|
2
4
|
MyFiles = "my_files",
|
|
3
5
|
Shared = "shared",
|
|
4
6
|
Organization = "organization",
|
|
@@ -57,3 +59,16 @@ export declare enum FileManagerColumnKey {
|
|
|
57
59
|
Actions = "__actions",
|
|
58
60
|
Version = "version"
|
|
59
61
|
}
|
|
62
|
+
export declare enum FileManagerSortField {
|
|
63
|
+
Name = "name",
|
|
64
|
+
UpdatedAt = "updatedAt",
|
|
65
|
+
Size = "size"
|
|
66
|
+
}
|
|
67
|
+
export declare enum FileManagerSortDirection {
|
|
68
|
+
Asc = "asc",
|
|
69
|
+
Desc = "desc"
|
|
70
|
+
}
|
|
71
|
+
export interface FileManagerSort {
|
|
72
|
+
field: FileManagerSortField;
|
|
73
|
+
direction: FileManagerSortDirection;
|
|
74
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-react-file-manager",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "React file manager package for AI DIAL interfaces",
|
|
@@ -78,11 +78,10 @@
|
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@tabler/icons-react": "^3.41.1",
|
|
81
|
-
"classnames": "^2.5.1",
|
|
82
81
|
"mime-types": "^3.0.2"
|
|
83
82
|
},
|
|
84
83
|
"peerDependencies": {
|
|
85
|
-
"@epam/ai-dial-ui-kit": "^0.15.0-dev.
|
|
84
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.23",
|
|
86
85
|
"ag-grid-community": "^35.2.1",
|
|
87
86
|
"ag-grid-react": "^35.2.1",
|
|
88
87
|
"react": "^19.2.5",
|
|
@@ -90,7 +89,7 @@
|
|
|
90
89
|
},
|
|
91
90
|
"devDependencies": {
|
|
92
91
|
"@chromatic-com/storybook": "^5.1.2",
|
|
93
|
-
"@epam/ai-dial-ui-kit": "^0.15.0-dev.
|
|
92
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.23",
|
|
94
93
|
"@eslint/js": "^9.39.2",
|
|
95
94
|
"@floating-ui/react": "^0.27.19",
|
|
96
95
|
"@storybook/addon-a11y": "^10.3.6",
|
package/dist/src/components/FileManager/components/FileManagerItemIcon/FileManagerItemIcon.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { DialItemType, DialFileIconProps } from '@epam/ai-dial-ui-kit';
|
|
3
|
-
export interface DialFileManagerItemIconProps extends Omit<DialFileIconProps, 'extension'> {
|
|
4
|
-
type: DialItemType;
|
|
5
|
-
name: string;
|
|
6
|
-
shared?: boolean;
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
sharedIndicatorClassName?: string;
|
|
9
|
-
sharedIndicatorTooltip?: ReactNode;
|
|
10
|
-
fileExtension?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Renders an icon representing either a file or folder entity in the Dial system.
|
|
14
|
-
*
|
|
15
|
-
* Displays:
|
|
16
|
-
* - A file icon based on its extension (via `DialFileIcon`)
|
|
17
|
-
* - A folder icon (via `IconFolder`)
|
|
18
|
-
* - A loading spinner if `loading` is true
|
|
19
|
-
* - A shared indicator if the entity is marked as shared
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```tsx
|
|
23
|
-
* <DialFileManagerItemIcon
|
|
24
|
-
* name="document.pdf"
|
|
25
|
-
* type={DialItemType.File}
|
|
26
|
-
* shared
|
|
27
|
-
* />
|
|
28
|
-
*
|
|
29
|
-
* <DialFileManagerItemIcon
|
|
30
|
-
* name="My Folder"
|
|
31
|
-
* type={DialItemType.Folder}
|
|
32
|
-
* loading
|
|
33
|
-
* />
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* @param {Object} props
|
|
37
|
-
* @param {string} props.name - The name of the file or folder (used to determine extension for files).
|
|
38
|
-
* @param {DialItemType} props.type - The type of the item (`file` or `folder`).
|
|
39
|
-
* @param {boolean} [props.shared=false] - Whether the item is shared.
|
|
40
|
-
* @param {boolean} [props.loading=false] - Whether to display the loading state.
|
|
41
|
-
* @param {number} [props.size] - Optional icon size override.
|
|
42
|
-
* @param {number} [props.stroke] - Optional icon stroke width override.
|
|
43
|
-
* @param {string} [props.className] - Optional CSS class for styling.
|
|
44
|
-
* @param {boolean} [props.decorative] - Whether the icon is decorative (for accessibility).
|
|
45
|
-
* @param {string} [props.label] - Accessible label for screen readers.
|
|
46
|
-
* @param {ReactNode} [props.indicator] - Optional indicator to display over the icon.
|
|
47
|
-
* @param {string} [props.sharedIndicatorClassName] - Optional CSS class for the shared indicator.
|
|
48
|
-
* @param [sharedIndicatorTooltip] - Custom tooltip content for the shared indicator; defaults to "Shared"
|
|
49
|
-
*/
|
|
50
|
-
export declare const DialFileManagerItemIcon: FC<DialFileManagerItemIconProps>;
|
|
@@ -1,22 +0,0 @@
|
|
|
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 {};
|