@epam/ai-dial-ui-kit 0.5.0 → 0.6.0-rc.1

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.
@@ -98,12 +98,16 @@ export interface CreateFolderValidationMessages {
98
98
  }
99
99
  export interface DialFileManagerProps {
100
100
  path?: string;
101
+ defaultPath?: string;
101
102
  className?: string;
102
103
  allowedFileTypes?: DialFileAcceptType[];
103
104
  items?: DialFile[];
104
105
  rootItem?: DialRootFolder;
105
106
  filesLoading?: boolean;
106
107
  sharedByMePaths?: Set<string>;
108
+ selectedPaths?: Set<string>;
109
+ defaultSelectedPaths?: Set<string>;
110
+ onSelectedPathsChange?: (paths: Set<string>) => void;
107
111
  showHiddenFiles?: boolean;
108
112
  onShowHiddenFilesChange?: (value: boolean) => void;
109
113
  treeOptions?: FileTreeOptions;
@@ -186,10 +190,13 @@ export interface DialFileManagerProps {
186
190
  * ```
187
191
  *
188
192
  * @param [path] - Absolute path of the current location (e.g. "/All files/Design/Icons")
193
+ * @param [defaultPath] - Initial path used in uncontrolled mode (applied only on first render)
189
194
  * @param [className] - Additional classes for the root container
190
195
  * @param [items] - Full hierarchical list of files and folders used by both tree and grid
191
196
  * @param [rootItem] - Optional root folder item to represent the top-level container in the tree
192
197
  * @param [filesLoading=false] - When true, shows skeleton loading state in the grid
198
+ * @param [selectedPaths] - Controlled set of selected item paths
199
+ * @param [defaultSelectedPaths] - Initial selected paths used in uncontrolled mode
193
200
  *
194
201
  * @param [treeOptions] - Options that configure the collapsible sidebar and folders tree
195
202
  * @param [navigationPanelOptions] - Options for the breadcrumb and search panel (value/onSearchChange for controlled search)
@@ -201,6 +208,7 @@ export interface DialFileManagerProps {
201
208
  * @param [compactViewWidthBreakpoint=DEFAULT_COMPACT_VIEW_WIDTH_BREAKPOINT] - Width (px) below which the component switches to compact view.
202
209
  *
203
210
  * @param [onPathChange] - Callback fired when user navigates via tree or breadcrumb
211
+ * @param [onSelectedPathsChange] - Callback fired when the selected paths change
204
212
  * @param [onTableFileClick] - Callback fired when a file row is clicked in the grid
205
213
  *
206
214
  * @param [onCopyFiles] - Callback fired when files copy-paste
@@ -45,9 +45,9 @@ export interface FileManagerContextValue {
45
45
  isTreeCollapsed: boolean;
46
46
  toggleTreeCollapse: () => void;
47
47
  setIsTreeCollapsed: (value: boolean) => void;
48
- selectedIds: Set<string>;
48
+ selectedPaths: Set<string>;
49
49
  selectedFiles: Map<string, DialFile>;
50
- setSelectedFiles: (next: Map<string, DialFile>) => void;
50
+ setSelectedPaths: (paths: Set<string>) => void;
51
51
  clearSelection: () => void;
52
52
  currentFolder?: DialFile;
53
53
  gridRows: FileManagerGridRow[];
@@ -1,10 +1,13 @@
1
1
  export interface UseCurrentPathOptions {
2
2
  path?: string;
3
+ defaultPath?: string;
3
4
  onPathChange?: (nextPath?: string) => void;
4
5
  onSelectionClear?: () => void;
5
6
  }
6
- export declare const useCurrentPath: ({ path, onPathChange, onSelectionClear, }: UseCurrentPathOptions) => {
7
- currentPath: string | undefined;
8
- setCurrentPath: import('react').Dispatch<import('react').SetStateAction<string | undefined>>;
7
+ interface UseCurrentPathResult {
8
+ currentPath?: string;
9
+ setCurrentPath: (nextPath?: string) => void;
9
10
  handlePathChange: (nextPath?: string) => void;
10
- };
11
+ }
12
+ export declare const useCurrentPath: ({ path, defaultPath, onPathChange, onSelectionClear, }: UseCurrentPathOptions) => UseCurrentPathResult;
13
+ export {};
@@ -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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.5.0",
3
+ "version": "0.6.0-rc.1",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",