@emailmaker/filemanager 0.10.2 → 0.10.4
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/components/EmIcons/EmIcons.d.ts +10 -0
- package/components/FileContent/FileContent.d.ts +7 -1
- package/components/FileManagerApp/ActionsHeader.d.ts +1 -9
- package/components/FileModals/FileModals.d.ts +1 -0
- package/file-manager.css +356 -256
- package/file-manager.esm.js +10 -10
- package/file-manager.esm.js.map +1 -1
- package/file-manager.js +1 -1
- package/file-manager.js.LICENSE.txt +1 -3
- package/hooks/core/context.d.ts +1 -1
- package/hooks/core/types.d.ts +1 -1
- package/hooks/useCustomIcons.d.ts +2 -0
- package/package.json +1 -1
- package/types.d.ts +10 -4
- package/utils/jsonDataProvider.d.ts +2 -1
|
@@ -173,8 +173,6 @@ and limitations under the License.
|
|
|
173
173
|
|
|
174
174
|
/** */
|
|
175
175
|
|
|
176
|
-
/** */
|
|
177
|
-
|
|
178
176
|
/** */
|
|
179
177
|
|
|
180
178
|
/** */
|
|
@@ -203,7 +201,7 @@ and limitations under the License.
|
|
|
203
201
|
|
|
204
202
|
/** */
|
|
205
203
|
|
|
206
|
-
/** */
|
|
207
205
|
|
|
208
206
|
/** */
|
|
209
207
|
|
package/hooks/core/context.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { FileManagerOptions } from '../../types';
|
|
3
|
-
import {
|
|
3
|
+
import { FileManagerActions, FileManagerState } from './types';
|
|
4
4
|
export interface FileManagerContextValue {
|
|
5
5
|
state: FileManagerState;
|
|
6
6
|
actions: Partial<FileManagerActions>;
|
package/hooks/core/types.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export interface FileManagerActions {
|
|
|
46
46
|
setSortBy: (sortBy: SortByType) => void;
|
|
47
47
|
setSortOrder: (sortOrder: SortOrderType) => void;
|
|
48
48
|
setPathHistory: (history: PathItem[]) => void;
|
|
49
|
-
setSelectedFiles: (files
|
|
49
|
+
setSelectedFiles: (files?: Set<string>) => void;
|
|
50
50
|
setLoading: (isLoading: boolean) => void;
|
|
51
51
|
setPagination: (pagination: Partial<PaginationState>) => void;
|
|
52
52
|
setIsModalVisible: (visible: boolean) => void;
|
|
@@ -10,6 +10,8 @@ export declare const useCustomIcons: () => {
|
|
|
10
10
|
UploadByUrlIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
11
11
|
ExpandArrowIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
12
12
|
CollapseArrowIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
13
|
+
ExpandFolderIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
14
|
+
CollapseFolderIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
13
15
|
FolderPreviewIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
14
16
|
GridViewIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
15
17
|
ListViewIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface Folder {
|
|
|
7
7
|
id: string;
|
|
8
8
|
name: string;
|
|
9
9
|
parentId?: string | null;
|
|
10
|
+
childCount?: number;
|
|
10
11
|
}
|
|
11
12
|
export interface ThumbnailFile {
|
|
12
13
|
thumbnail: string;
|
|
@@ -16,8 +17,8 @@ export interface ThumbnailFile {
|
|
|
16
17
|
export interface File {
|
|
17
18
|
id: string;
|
|
18
19
|
name: string;
|
|
19
|
-
size
|
|
20
|
-
date
|
|
20
|
+
size?: number;
|
|
21
|
+
date?: string;
|
|
21
22
|
folderId: string;
|
|
22
23
|
type?: string;
|
|
23
24
|
url?: string;
|
|
@@ -29,6 +30,7 @@ export interface File {
|
|
|
29
30
|
selected?: boolean;
|
|
30
31
|
isFolder?: boolean;
|
|
31
32
|
lastEdited?: string;
|
|
33
|
+
childCount?: number;
|
|
32
34
|
}
|
|
33
35
|
export interface PathItem {
|
|
34
36
|
id: string;
|
|
@@ -46,6 +48,7 @@ export interface FilesQueryParams {
|
|
|
46
48
|
limit?: number;
|
|
47
49
|
sortBy?: 'name' | 'size' | 'date' | 'type';
|
|
48
50
|
sortOrder?: 'asc' | 'desc';
|
|
51
|
+
itemType?: 'file' | 'folder' | 'all';
|
|
49
52
|
}
|
|
50
53
|
export interface ApiPaginationResponse {
|
|
51
54
|
page: number;
|
|
@@ -125,10 +128,11 @@ export interface FileManagerOptions {
|
|
|
125
128
|
}
|
|
126
129
|
export interface FileManagerDataProviders {
|
|
127
130
|
getFileData: (file: File) => Promise<Blob>;
|
|
128
|
-
getFolders
|
|
131
|
+
getFolders?: (options?: {
|
|
129
132
|
parentId?: string | null;
|
|
130
133
|
deep?: boolean;
|
|
131
134
|
}) => Promise<Folder[]>;
|
|
135
|
+
getChildrenCount?: (folderId?: string) => Promise<number>;
|
|
132
136
|
getFiles: (options: {
|
|
133
137
|
folderId?: string;
|
|
134
138
|
search?: string;
|
|
@@ -136,6 +140,7 @@ export interface FileManagerDataProviders {
|
|
|
136
140
|
sortOrder?: SortState['sortOrder'];
|
|
137
141
|
page?: number;
|
|
138
142
|
limit?: number;
|
|
143
|
+
itemType?: 'file' | 'folder' | 'all';
|
|
139
144
|
}) => Promise<{
|
|
140
145
|
files: File[];
|
|
141
146
|
pagination?: Partial<ApiPaginationResponse>;
|
|
@@ -148,7 +153,7 @@ export interface FileManagerDataProviders {
|
|
|
148
153
|
deleteFolder?: (folderId: string) => Promise<boolean>;
|
|
149
154
|
uploadFile: (file: {
|
|
150
155
|
name: string;
|
|
151
|
-
size:
|
|
156
|
+
size: number;
|
|
152
157
|
type: string;
|
|
153
158
|
folderId?: string | null;
|
|
154
159
|
data: Blob | string;
|
|
@@ -266,6 +271,7 @@ export interface Config {
|
|
|
266
271
|
};
|
|
267
272
|
dataProcessingMode?: 'server' | 'client' | 'auto';
|
|
268
273
|
enableClientSideProcessing?: boolean;
|
|
274
|
+
disablePagination?: boolean;
|
|
269
275
|
staticData?: {
|
|
270
276
|
files?: File[];
|
|
271
277
|
folders?: Folder[];
|
|
@@ -20,6 +20,7 @@ export declare class JSONDataProvider implements FileManagerDataProviders {
|
|
|
20
20
|
search?: string;
|
|
21
21
|
sortBy?: "name" | "size" | "date" | "type";
|
|
22
22
|
sortOrder?: "asc" | "desc";
|
|
23
|
+
itemType?: "file" | "folder" | "all";
|
|
23
24
|
}) => Promise<{
|
|
24
25
|
files: File[];
|
|
25
26
|
total: number;
|
|
@@ -32,7 +33,7 @@ export declare class JSONDataProvider implements FileManagerDataProviders {
|
|
|
32
33
|
deleteFolder: (folderId: string) => Promise<boolean>;
|
|
33
34
|
uploadFile: (file: {
|
|
34
35
|
name: string;
|
|
35
|
-
size:
|
|
36
|
+
size: number;
|
|
36
37
|
type: string;
|
|
37
38
|
folderId?: string | null;
|
|
38
39
|
data: Blob | string;
|