@epam/ai-dial-ui-kit 0.5.0-rc.8 → 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 +7480 -7343
- 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/hooks/use-bulk-actions.d.ts +22 -0
- 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[];
|
|
@@ -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[];
|
|
@@ -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
|
};
|