@epam/ai-dial-ui-kit 0.5.0-rc.7 → 0.5.0-rc.9
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/dial-ui-kit.cjs.js +28 -28
- package/dist/dial-ui-kit.es.js +7516 -7352
- package/dist/src/components/FileManager/FileManager.d.ts +17 -1
- package/dist/src/components/FileManager/FileManagerContext.d.ts +2 -1
- package/dist/src/components/FileManager/constants.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/use-bulk-actions.d.ts +22 -0
- package/dist/src/components/FileName/FileName.d.ts +2 -0
- package/dist/src/components/FolderName/FolderName.d.ts +4 -1
- package/dist/src/components/Grid/Grid.d.ts +3 -1
- package/dist/src/components/Grid/hooks/use-grid-selection.d.ts +7 -4
- package/package.json +1 -1
|
@@ -41,7 +41,20 @@ export interface GridOptions extends Omit<DialGridProps<GridRow>, 'rowData' | 'c
|
|
|
41
41
|
dateOptions?: Intl.DateTimeFormatOptions;
|
|
42
42
|
}
|
|
43
43
|
export type ToolbarOptions = Omit<DialFileManagerToolbarProps, 'areHiddenFilesVisible' | 'onToggleHiddenFiles'>;
|
|
44
|
-
export type BulkActionsToolbarOptions = Omit<DialFileManagerBulkActionsToolbarProps, 'onClearSelection'
|
|
44
|
+
export type BulkActionsToolbarOptions = Omit<DialFileManagerBulkActionsToolbarProps, 'onClearSelection' | 'actions'> & {
|
|
45
|
+
actionLabels?: {
|
|
46
|
+
[DialFileManagerActions.Duplicate]?: string;
|
|
47
|
+
[DialFileManagerActions.Copy]?: string;
|
|
48
|
+
[DialFileManagerActions.Download]?: string;
|
|
49
|
+
[DialFileManagerActions.Delete]?: string;
|
|
50
|
+
[DialFileManagerActions.Move]?: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export interface CreateFolderValidationMessages {
|
|
54
|
+
emptyName?: string;
|
|
55
|
+
duplicateName?: string;
|
|
56
|
+
forbiddenChars?: string;
|
|
57
|
+
}
|
|
45
58
|
export interface DialFileManagerProps {
|
|
46
59
|
path?: string;
|
|
47
60
|
cssClass?: string;
|
|
@@ -67,6 +80,9 @@ export interface DialFileManagerProps {
|
|
|
67
80
|
onRenameSave?: (value: string) => void;
|
|
68
81
|
onRenameCancel?: () => void;
|
|
69
82
|
onRenameValidate?: (value: string, item: DialFile) => string | null;
|
|
83
|
+
onCreateFolder?: (folderPath: string, file: File, name: string, bucket?: string) => void;
|
|
84
|
+
onCreateFolderValidate?: (name: string, parentFolder: DialFile) => string | null;
|
|
85
|
+
createFolderValidationMessages?: CreateFolderValidationMessages;
|
|
70
86
|
}
|
|
71
87
|
/**
|
|
72
88
|
* File Manager layout with a collapsible folders tree, breadcrumb/search header, and a data grid.
|
|
@@ -34,7 +34,8 @@ export interface FileManagerContextValue {
|
|
|
34
34
|
toggleTreeCollapse: () => void;
|
|
35
35
|
setIsTreeCollapsed: (value: boolean) => void;
|
|
36
36
|
selectedIds: Set<string>;
|
|
37
|
-
|
|
37
|
+
selectedFiles: Map<string, DialFile>;
|
|
38
|
+
setSelectedFiles: (next: Map<string, DialFile>) => void;
|
|
38
39
|
clearSelection: () => void;
|
|
39
40
|
currentFolder?: DialFile;
|
|
40
41
|
gridRows: FileManagerGridRow[];
|
|
@@ -7,3 +7,4 @@ export declare const treeBaseClasses = "w-full h-full rounded bg-layer-3 text-se
|
|
|
7
7
|
export declare const gridBaseClasses = "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
|
+
export declare const BASE_FILE_MANAGER_ICON_SIZE = 20;
|
|
@@ -0,0 +1,22 @@
|
|
|
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.Delete]?: string;
|
|
12
|
+
[DialFileManagerActions.Move]?: string;
|
|
13
|
+
};
|
|
14
|
+
onDuplicate: (files: DialFile[]) => void;
|
|
15
|
+
onCopy: (files: DialFile[]) => void;
|
|
16
|
+
onMove: (files: DialFile[]) => void;
|
|
17
|
+
onDownload: (files: DialFile[]) => void;
|
|
18
|
+
onRename: (filePath: string) => void;
|
|
19
|
+
onDelete: (files: DialFile[], parentFolderPath: string) => void;
|
|
20
|
+
getCurrentFolderPath: () => string;
|
|
21
|
+
}
|
|
22
|
+
export declare const useBulkActions: ({ selectedFiles, actionLabels, onDuplicate, onCopy, onMove, onDownload, onDelete, getCurrentFolderPath, }: UseBulkActionsProps) => DialActionDropdownItem[];
|
|
@@ -3,6 +3,7 @@ export interface DialFileNameProps {
|
|
|
3
3
|
name: string;
|
|
4
4
|
cssClass?: string;
|
|
5
5
|
shared?: boolean;
|
|
6
|
+
iconSize?: number;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* Component to display a file name with a file icon and shared indicator.
|
|
@@ -16,5 +17,6 @@ export interface DialFileNameProps {
|
|
|
16
17
|
* @param name - Full file name with or without extension
|
|
17
18
|
* @param cssClass - Additional CSS classes for the root container
|
|
18
19
|
* @param shared - Whether the file is shared
|
|
20
|
+
* @param iconSize - Icon size in px. Default: BASE_ICON_SIZE.
|
|
19
21
|
*/
|
|
20
22
|
export declare const DialFileName: FC<DialFileNameProps>;
|
|
@@ -4,6 +4,7 @@ export interface DialFolderNameProps {
|
|
|
4
4
|
cssClass?: string;
|
|
5
5
|
shared?: boolean;
|
|
6
6
|
loading?: boolean;
|
|
7
|
+
iconSize?: number;
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
10
|
* Component to display a folder name with a folder icon and shared indicator.
|
|
@@ -16,6 +17,8 @@ export interface DialFolderNameProps {
|
|
|
16
17
|
*
|
|
17
18
|
* @param name - Folder name
|
|
18
19
|
* @param cssClass - Additional CSS classes for the root container
|
|
19
|
-
* @param shared -
|
|
20
|
+
* @param shared - If true, shows shared indicator. Default: false.
|
|
21
|
+
* @param loading - If true, shows loading state. Default: false.
|
|
22
|
+
* @param iconSize - Icon size in px. Default: BASE_ICON_SIZE.
|
|
20
23
|
*/
|
|
21
24
|
export declare const DialFolderName: FC<DialFolderNameProps>;
|
|
@@ -11,7 +11,9 @@ export interface DialGridProps<T extends object = Record<string, unknown>> {
|
|
|
11
11
|
withSelectionColumn?: boolean;
|
|
12
12
|
wrapCustomCellRenderers?: boolean | ((col: ColDef<T>) => boolean);
|
|
13
13
|
selectedRowIds?: Set<string>;
|
|
14
|
+
selectedRows?: Map<string, T>;
|
|
14
15
|
onSelectionChange?: (selectedRowIds: Set<string>, selectedRows: T[]) => void;
|
|
16
|
+
onSelectionChangeWithMap?: (selectedRows: Map<string, T>) => void;
|
|
15
17
|
getRowId?: (row: T) => string;
|
|
16
18
|
alternateOddRowColors?: boolean;
|
|
17
19
|
filterPlaceholder?: string;
|
|
@@ -104,4 +106,4 @@ export interface DialGridProps<T extends object = Record<string, unknown>> {
|
|
|
104
106
|
* providing additional context or instructions (e.g., "No data found" or "Try adjusting your filters").
|
|
105
107
|
* @param [loading=false] - When true, shows AG-Grid's native loading overlay
|
|
106
108
|
*/
|
|
107
|
-
export declare const DialGrid: <T extends object>({ columnDefs, rowData, additionalGridOptions, getContextMenuItems, cssClass, ariaLabel, withSelectionColumn, wrapCustomCellRenderers, selectedRowIds, onSelectionChange, getRowId, alternateOddRowColors, filterPlaceholder, emptyStateIcon, emptyStateTitle, emptyStateDescription, loading, }: DialGridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
export declare const DialGrid: <T extends object>({ columnDefs, rowData, additionalGridOptions, getContextMenuItems, cssClass, ariaLabel, withSelectionColumn, wrapCustomCellRenderers, selectedRowIds, selectedRows, onSelectionChange, onSelectionChangeWithMap, getRowId, alternateOddRowColors, filterPlaceholder, emptyStateIcon, emptyStateTitle, emptyStateDescription, loading, }: DialGridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
export interface UseGridSelectionProps<T> {
|
|
1
|
+
export interface UseGridSelectionProps<T extends object> {
|
|
2
2
|
selectedRowIds?: Set<string>;
|
|
3
|
+
selectedRows?: Map<string, T>;
|
|
3
4
|
onSelectionChange?: (selectedRowIds: Set<string>, selectedRows: T[]) => void;
|
|
5
|
+
onSelectionChangeWithMap?: (selectedRows: Map<string, T>) => void;
|
|
4
6
|
rowData?: T[];
|
|
5
7
|
getRowId: (row: T) => string;
|
|
6
8
|
}
|
|
7
|
-
export declare const useGridSelection: <T extends object>({ selectedRowIds, onSelectionChange, rowData, getRowId, }: UseGridSelectionProps<T>) => {
|
|
9
|
+
export declare const useGridSelection: <T extends object>({ selectedRowIds, selectedRows, onSelectionChange, onSelectionChangeWithMap, rowData, getRowId, }: UseGridSelectionProps<T>) => {
|
|
8
10
|
currentSelectedIds: Set<string>;
|
|
9
|
-
|
|
11
|
+
currentSelectedRows: Map<string, T>;
|
|
12
|
+
handleSelectionToggle: (row: T, checked: boolean) => void;
|
|
10
13
|
headerCheckboxState: string;
|
|
11
|
-
handleHeaderCheckboxChange: () => void;
|
|
14
|
+
handleHeaderCheckboxChange: (checked?: boolean) => void;
|
|
12
15
|
};
|