@dignite-ng/expand.file-explorer 0.0.3 → 0.0.5
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/config/{src/enums/index.ts → enums/index.d.ts} +1 -1
- package/config/enums/route-names.d.ts +3 -0
- package/config/file-config.module.d.ts +8 -0
- package/config/index.d.ts +5 -0
- package/config/{src/providers/index.ts → providers/index.d.ts} +1 -1
- package/config/providers/route.provider.d.ts +8 -0
- package/config/{src/public-api.ts → public-api.d.ts} +3 -3
- package/esm2022/config/dignite-ng-expand.file-explorer-config.mjs +5 -0
- package/esm2022/config/enums/index.mjs +2 -0
- package/esm2022/config/enums/route-names.mjs +2 -0
- package/esm2022/config/file-config.module.mjs +19 -0
- package/esm2022/config/providers/index.mjs +2 -0
- package/esm2022/config/providers/route.provider.mjs +24 -0
- package/esm2022/config/public-api.mjs +4 -0
- package/esm2022/dignite-ng-expand.file-explorer.mjs +5 -0
- package/esm2022/lib/components/dome/file-dome.component.mjs +32 -0
- package/esm2022/lib/components/file-edit/file-edit.component.mjs +104 -0
- package/esm2022/lib/components/file-modal/file-modal.component.mjs +272 -0
- package/esm2022/lib/components/file-modal-tree/file-modal-tree.component.mjs +195 -0
- package/esm2022/lib/components/file-picker/file-picker.component.mjs +65 -0
- package/esm2022/lib/components/index.mjs +6 -0
- package/esm2022/lib/file-explorer-routing.module.mjs +25 -0
- package/esm2022/lib/file-explorer.module.mjs +88 -0
- package/esm2022/lib/previews/file-preview.component.mjs +100 -0
- package/esm2022/lib/previews/index.mjs +3 -0
- package/esm2022/lib/previews/models.mjs +92 -0
- package/esm2022/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.mjs +48 -0
- package/esm2022/lib/proxy/dignite/file-explorer/directories/index.mjs +3 -0
- package/esm2022/lib/proxy/dignite/file-explorer/directories/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/file-explorer/files/file-descriptor.service.mjs +60 -0
- package/esm2022/lib/proxy/dignite/file-explorer/files/index.mjs +3 -0
- package/esm2022/lib/proxy/dignite/file-explorer/files/models.mjs +2 -0
- package/esm2022/lib/proxy/dignite/file-explorer/index.mjs +4 -0
- package/esm2022/lib/proxy/dignite/index.mjs +3 -0
- package/esm2022/lib/proxy/index.mjs +5 -0
- package/esm2022/lib/proxy/microsoft/asp-net-core/index.mjs +3 -0
- package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/index.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/models.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/extensions/index.mjs +3 -0
- package/esm2022/lib/proxy/microsoft/extensions/primitives/index.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/extensions/primitives/models.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/index.mjs +5 -0
- package/esm2022/lib/proxy/microsoft/net/http/headers/index.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/net/http/headers/models.mjs +2 -0
- package/esm2022/lib/proxy/microsoft/net/http/index.mjs +3 -0
- package/esm2022/lib/proxy/microsoft/net/index.mjs +3 -0
- package/esm2022/lib/proxy/volo/abp/content/index.mjs +2 -0
- package/esm2022/lib/proxy/volo/abp/content/models.mjs +2 -0
- package/esm2022/lib/proxy/volo/abp/index.mjs +3 -0
- package/esm2022/lib/proxy/volo/index.mjs +3 -0
- package/esm2022/lib/services/file-api.service.mjs +66 -0
- package/esm2022/lib/services/index.mjs +2 -0
- package/esm2022/public-api.mjs +9 -0
- package/fesm2022/dignite-ng-expand.file-explorer-config.mjs +47 -0
- package/fesm2022/dignite-ng-expand.file-explorer-config.mjs.map +1 -0
- package/fesm2022/dignite-ng-expand.file-explorer.mjs +1169 -0
- package/fesm2022/dignite-ng-expand.file-explorer.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/dome/file-dome.component.d.ts +19 -0
- package/lib/components/file-edit/file-edit.component.d.ts +38 -0
- package/lib/components/file-modal/file-modal.component.d.ts +93 -0
- package/lib/components/file-modal-tree/file-modal-tree.component.d.ts +66 -0
- package/lib/components/file-picker/file-picker.component.d.ts +26 -0
- package/lib/components/index.d.ts +5 -0
- package/lib/file-explorer-routing.module.d.ts +7 -0
- package/lib/file-explorer.module.d.ts +19 -0
- package/lib/previews/file-preview.component.d.ts +47 -0
- package/lib/previews/index.d.ts +2 -0
- package/lib/previews/models.d.ts +5 -0
- package/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.d.ts +17 -0
- package/{src/lib/proxy/dignite/file-explorer/directories/models.ts → lib/proxy/dignite/file-explorer/directories/models.d.ts} +29 -35
- package/lib/proxy/dignite/file-explorer/files/file-descriptor.service.d.ts +20 -0
- package/lib/proxy/dignite/file-explorer/files/models.d.ts +50 -0
- package/{src/lib/proxy/microsoft/asp-net-core/mvc/models.ts → lib/proxy/microsoft/asp-net-core/mvc/models.d.ts} +10 -12
- package/lib/proxy/microsoft/extensions/primitives/models.d.ts +8 -0
- package/{src/lib/proxy/microsoft/net/http/headers/models.ts → lib/proxy/microsoft/net/http/headers/models.d.ts} +6 -7
- package/lib/proxy/volo/abp/content/models.d.ts +5 -0
- package/lib/services/file-api.service.d.ts +14 -0
- package/lib/services/index.d.ts +1 -0
- package/package.json +21 -2
- package/{src/public-api.ts → public-api.d.ts} +1 -5
- package/config/ng-package.json +0 -7
- package/config/src/enums/route-names.ts +0 -15
- package/config/src/file-config.module.ts +0 -12
- package/config/src/providers/route.provider.ts +0 -26
- package/ng-package.json +0 -7
- package/src/lib/components/dome/file-dome.component.html +0 -18
- package/src/lib/components/dome/file-dome.component.scss +0 -0
- package/src/lib/components/dome/file-dome.component.spec.ts +0 -21
- package/src/lib/components/dome/file-dome.component.ts +0 -33
- package/src/lib/components/file-edit/file-edit.component.html +0 -29
- package/src/lib/components/file-edit/file-edit.component.scss +0 -0
- package/src/lib/components/file-edit/file-edit.component.spec.ts +0 -21
- package/src/lib/components/file-edit/file-edit.component.ts +0 -98
- package/src/lib/components/file-modal/file-modal.component.html +0 -112
- package/src/lib/components/file-modal/file-modal.component.scss +0 -56
- package/src/lib/components/file-modal/file-modal.component.spec.ts +0 -21
- package/src/lib/components/file-modal/file-modal.component.ts +0 -284
- package/src/lib/components/file-modal-tree/file-modal-tree.component.html +0 -63
- package/src/lib/components/file-modal-tree/file-modal-tree.component.scss +0 -0
- package/src/lib/components/file-modal-tree/file-modal-tree.component.spec.ts +0 -21
- package/src/lib/components/file-modal-tree/file-modal-tree.component.ts +0 -207
- package/src/lib/components/file-picker/file-picker.component.html +0 -28
- package/src/lib/components/file-picker/file-picker.component.scss +0 -0
- package/src/lib/components/file-picker/file-picker.component.spec.ts +0 -21
- package/src/lib/components/file-picker/file-picker.component.ts +0 -58
- package/src/lib/components/index.ts +0 -5
- package/src/lib/file-explorer-routing.module.ts +0 -18
- package/src/lib/file-explorer.module.ts +0 -46
- package/src/lib/proxy/README.md +0 -17
- package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +0 -65
- package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +0 -86
- package/src/lib/proxy/dignite/file-explorer/files/models.ts +0 -58
- package/src/lib/proxy/generate-proxy.json +0 -11810
- package/src/lib/proxy/microsoft/extensions/primitives/models.ts +0 -9
- package/src/lib/proxy/volo/abp/content/models.ts +0 -6
- package/src/lib/services/file-api.service.ts +0 -59
- package/src/lib/services/index.ts +0 -1
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
- /package/{src/lib/proxy/dignite/file-explorer/directories/index.ts → lib/proxy/dignite/file-explorer/directories/index.d.ts} +0 -0
- /package/{src/lib/proxy/dignite/file-explorer/files/index.ts → lib/proxy/dignite/file-explorer/files/index.d.ts} +0 -0
- /package/{src/lib/proxy/dignite/file-explorer/index.ts → lib/proxy/dignite/file-explorer/index.d.ts} +0 -0
- /package/{src/lib/proxy/dignite/index.ts → lib/proxy/dignite/index.d.ts} +0 -0
- /package/{src/lib/proxy/index.ts → lib/proxy/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/asp-net-core/index.ts → lib/proxy/microsoft/asp-net-core/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/asp-net-core/mvc/index.ts → lib/proxy/microsoft/asp-net-core/mvc/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/extensions/index.ts → lib/proxy/microsoft/extensions/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/extensions/primitives/index.ts → lib/proxy/microsoft/extensions/primitives/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/index.ts → lib/proxy/microsoft/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/net/http/headers/index.ts → lib/proxy/microsoft/net/http/headers/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/net/http/index.ts → lib/proxy/microsoft/net/http/index.d.ts} +0 -0
- /package/{src/lib/proxy/microsoft/net/index.ts → lib/proxy/microsoft/net/index.d.ts} +0 -0
- /package/{src/lib/proxy/volo/abp/content/index.ts → lib/proxy/volo/abp/content/index.d.ts} +0 -0
- /package/{src/lib/proxy/volo/abp/index.ts → lib/proxy/volo/abp/index.d.ts} +0 -0
- /package/{src/lib/proxy/volo/index.ts → lib/proxy/volo/index.d.ts} +0 -0
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
import type { ExtensibleAuditedEntityDto, ExtensibleEntityDto } from '@abp/ng.core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
order: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface UpdateDirectoryInput {
|
|
34
|
-
name: string;
|
|
35
|
-
}
|
|
1
|
+
import type { ExtensibleAuditedEntityDto, ExtensibleEntityDto } from '@abp/ng.core';
|
|
2
|
+
export interface CreateDirectoryInput {
|
|
3
|
+
containerName: string;
|
|
4
|
+
name: string;
|
|
5
|
+
parentId?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DirectoryDescriptorDto extends ExtensibleAuditedEntityDto<string> {
|
|
8
|
+
containerName?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
parentId?: string;
|
|
11
|
+
order: number;
|
|
12
|
+
}
|
|
13
|
+
export interface DirectoryDescriptorInfoDto extends ExtensibleEntityDto<string> {
|
|
14
|
+
containerName?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
parentId?: string;
|
|
17
|
+
order: number;
|
|
18
|
+
children: DirectoryDescriptorInfoDto[];
|
|
19
|
+
}
|
|
20
|
+
export interface GetDirectoriesInput {
|
|
21
|
+
containerName: string;
|
|
22
|
+
}
|
|
23
|
+
export interface MoveDirectoryInput {
|
|
24
|
+
parentId?: string;
|
|
25
|
+
order: number;
|
|
26
|
+
}
|
|
27
|
+
export interface UpdateDirectoryInput {
|
|
28
|
+
name: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CreateFileInput, FileContainerConfigurationDto, FileDescriptorDto, GetFilesInput, ImageResizeInput, UpdateFileInput } from './models';
|
|
2
|
+
import { RestService, Rest } from '@abp/ng.core';
|
|
3
|
+
import type { PagedResultDto } from '@abp/ng.core';
|
|
4
|
+
import type { FileResult } from '../../../microsoft/asp-net-core/mvc/models';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class FileDescriptorService {
|
|
7
|
+
private restService;
|
|
8
|
+
apiName: string;
|
|
9
|
+
create: (input: CreateFileInput, config?: Partial<Rest.Config>) => import("rxjs").Observable<FileDescriptorDto>;
|
|
10
|
+
delete: (id: string, config?: Partial<Rest.Config>) => import("rxjs").Observable<void>;
|
|
11
|
+
download: (containerName: string, blobName: string, fileName: string, config?: Partial<Rest.Config>) => import("rxjs").Observable<FileResult>;
|
|
12
|
+
get: (id: string, config?: Partial<Rest.Config>) => import("rxjs").Observable<FileDescriptorDto>;
|
|
13
|
+
getFileContainerConfiguration: (containerName: string, config?: Partial<Rest.Config>) => import("rxjs").Observable<FileContainerConfigurationDto>;
|
|
14
|
+
getList: (input: GetFilesInput, config?: Partial<Rest.Config>) => import("rxjs").Observable<PagedResultDto<FileDescriptorDto>>;
|
|
15
|
+
getStream: (containerName: string, blobName: string, imageResize?: ImageResizeInput, config?: Partial<Rest.Config>) => import("rxjs").Observable<Blob>;
|
|
16
|
+
update: (id: string, input: UpdateFileInput, config?: Partial<Rest.Config>) => import("rxjs").Observable<FileDescriptorDto>;
|
|
17
|
+
constructor(restService: RestService);
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileDescriptorService, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FileDescriptorService>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { IRemoteStreamContent } from '../../../volo/abp/content/models';
|
|
2
|
+
import type { CreationAuditedEntityDto, PagedAndSortedResultRequestDto } from '@abp/ng.core';
|
|
3
|
+
export interface CreateFileInput {
|
|
4
|
+
containerName: string;
|
|
5
|
+
cellName?: string;
|
|
6
|
+
directoryId?: string;
|
|
7
|
+
entityId?: string;
|
|
8
|
+
file: IRemoteStreamContent;
|
|
9
|
+
}
|
|
10
|
+
export interface FileCellDto {
|
|
11
|
+
name?: string;
|
|
12
|
+
displayName?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface FileContainerConfigurationDto {
|
|
15
|
+
maxBlobSize: number;
|
|
16
|
+
allowedFileTypeNames: string[];
|
|
17
|
+
fileCells: FileCellDto[];
|
|
18
|
+
createDirectoryPermissionName?: string;
|
|
19
|
+
createFilePermissionName?: string;
|
|
20
|
+
updateFilePermissionName?: string;
|
|
21
|
+
deleteFilePermissionName?: string;
|
|
22
|
+
getFilePermissionName?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface FileDescriptorDto extends CreationAuditedEntityDto<string> {
|
|
25
|
+
entityId?: string;
|
|
26
|
+
containerName?: string;
|
|
27
|
+
blobName?: string;
|
|
28
|
+
cellName?: string;
|
|
29
|
+
directoryId?: string;
|
|
30
|
+
size: number;
|
|
31
|
+
name?: string;
|
|
32
|
+
mimeType?: string;
|
|
33
|
+
url?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface GetFilesInput extends PagedAndSortedResultRequestDto {
|
|
36
|
+
containerName: string;
|
|
37
|
+
directoryId?: string;
|
|
38
|
+
creatorId?: string;
|
|
39
|
+
filter?: string;
|
|
40
|
+
entityId?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ImageResizeInput {
|
|
43
|
+
width?: number;
|
|
44
|
+
height?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface UpdateFileInput {
|
|
47
|
+
cellName?: string;
|
|
48
|
+
directoryId?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { EntityTagHeaderValue } from '../../net/http/headers/models';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
enableRangeProcessing: boolean;
|
|
12
|
-
}
|
|
1
|
+
import type { EntityTagHeaderValue } from '../../net/http/headers/models';
|
|
2
|
+
export interface ActionResult {
|
|
3
|
+
}
|
|
4
|
+
export interface FileResult extends ActionResult {
|
|
5
|
+
contentType?: string;
|
|
6
|
+
fileDownloadName?: string;
|
|
7
|
+
lastModified?: string;
|
|
8
|
+
entityTag: EntityTagHeaderValue;
|
|
9
|
+
enableRangeProcessing: boolean;
|
|
10
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { StringSegment } from '../../../extensions/primitives/models';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
import type { StringSegment } from '../../../extensions/primitives/models';
|
|
2
|
+
export interface EntityTagHeaderValue {
|
|
3
|
+
any: EntityTagHeaderValue;
|
|
4
|
+
tag: StringSegment;
|
|
5
|
+
isWeak: boolean;
|
|
6
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class FileApiService {
|
|
3
|
+
constructor();
|
|
4
|
+
/**转换文件大小单位 输入k */
|
|
5
|
+
formatFileSize(bytes: any): string;
|
|
6
|
+
/**获取图片的本地连接 */
|
|
7
|
+
getImageLacolBase64Url(file: File): Promise<unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* 深拷贝--方法
|
|
10
|
+
* $api.deepClone() */
|
|
11
|
+
deepClone(obj: any): any;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileApiService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FileApiService>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './file-api.service';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dignite-ng/expand.file-explorer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^16.2.0",
|
|
6
6
|
"@angular/core": "^16.2.0"
|
|
@@ -12,5 +12,24 @@
|
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public",
|
|
14
14
|
"registry": "https://registry.npmjs.org/"
|
|
15
|
+
},
|
|
16
|
+
"module": "fesm2022/dignite-ng-expand.file-explorer.mjs",
|
|
17
|
+
"typings": "index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
"./package.json": {
|
|
20
|
+
"default": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./index.d.ts",
|
|
24
|
+
"esm2022": "./esm2022/dignite-ng-expand.file-explorer.mjs",
|
|
25
|
+
"esm": "./esm2022/dignite-ng-expand.file-explorer.mjs",
|
|
26
|
+
"default": "./fesm2022/dignite-ng-expand.file-explorer.mjs"
|
|
27
|
+
},
|
|
28
|
+
"./config": {
|
|
29
|
+
"types": "./config/index.d.ts",
|
|
30
|
+
"esm2022": "./esm2022/config/dignite-ng-expand.file-explorer-config.mjs",
|
|
31
|
+
"esm": "./esm2022/config/dignite-ng-expand.file-explorer-config.mjs",
|
|
32
|
+
"default": "./fesm2022/dignite-ng-expand.file-explorer-config.mjs"
|
|
33
|
+
}
|
|
15
34
|
}
|
|
16
|
-
}
|
|
35
|
+
}
|
package/config/ng-package.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export const enum eFileRouteNames {
|
|
2
|
-
// Cms = 'Cms',
|
|
3
|
-
// Entries = 'Entries',
|
|
4
|
-
// Settings = "Settings",
|
|
5
|
-
// Fields = "Fields",
|
|
6
|
-
// Sites = "Sites",
|
|
7
|
-
// Sections = "Sections",
|
|
8
|
-
// Cms = '内容管理',
|
|
9
|
-
// Entries = '条目',
|
|
10
|
-
// Settings = "设置",
|
|
11
|
-
// Fields = "字段",
|
|
12
|
-
// Sites = "站点",
|
|
13
|
-
FileUploadDemo = "File Upload Demo",
|
|
14
|
-
|
|
15
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ModuleWithProviders, NgModule } from '@angular/core';
|
|
2
|
-
import { FILE_ROUTE_PROVIDERS } from './providers/route.provider';
|
|
3
|
-
|
|
4
|
-
@NgModule()
|
|
5
|
-
export class FileConfigModule {
|
|
6
|
-
static forRoot(): ModuleWithProviders<FileConfigModule> {
|
|
7
|
-
return {
|
|
8
|
-
ngModule: FileConfigModule,
|
|
9
|
-
providers: [FILE_ROUTE_PROVIDERS],
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { eLayoutType, RoutesService } from '@abp/ng.core';
|
|
2
|
-
import { APP_INITIALIZER } from '@angular/core';
|
|
3
|
-
import { eFileRouteNames } from '../enums';
|
|
4
|
-
|
|
5
|
-
export const FILE_ROUTE_PROVIDERS = [
|
|
6
|
-
{
|
|
7
|
-
provide: APP_INITIALIZER,
|
|
8
|
-
useFactory: configureRoutes,
|
|
9
|
-
deps: [RoutesService],
|
|
10
|
-
multi: true,
|
|
11
|
-
},
|
|
12
|
-
];
|
|
13
|
-
|
|
14
|
-
export function configureRoutes(routesService: RoutesService) {
|
|
15
|
-
return () => {
|
|
16
|
-
routesService.add([
|
|
17
|
-
{
|
|
18
|
-
path: '/file/file-dome',
|
|
19
|
-
name:eFileRouteNames.FileUploadDemo,
|
|
20
|
-
iconClass: 'fas fa fa-file-archive-o',
|
|
21
|
-
layout: eLayoutType.application,
|
|
22
|
-
order: 9,
|
|
23
|
-
},
|
|
24
|
-
]);
|
|
25
|
-
};
|
|
26
|
-
}
|
package/ng-package.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<div class="row">
|
|
2
|
-
<div class="col">
|
|
3
|
-
<div class="card">
|
|
4
|
-
<div class="card-header py-2 border-bottom">Send file stream with form</div>
|
|
5
|
-
<div class="card-body">
|
|
6
|
-
<fe-file-edit [(fileData)]="fileSubmittedData" (fileDataChange)="fileDataChange($event)"></fe-file-edit>
|
|
7
|
-
</div>
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
<div class="col">
|
|
11
|
-
<div class="card">
|
|
12
|
-
<div class="card-header py-2 border-bottom">Send file stream with form</div>
|
|
13
|
-
<div class="card-body">
|
|
14
|
-
<fe-file-picker [selectFormFile]="selectedFileGroup" (selectedFileChange)="_selectedFileChange($event)" ></fe-file-picker>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
File without changes
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { FileDomeComponent } from './file-dome.component';
|
|
4
|
-
|
|
5
|
-
describe('FileDomeComponent', () => {
|
|
6
|
-
let component: FileDomeComponent;
|
|
7
|
-
let fixture: ComponentFixture<FileDomeComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [FileDomeComponent]
|
|
12
|
-
});
|
|
13
|
-
fixture = TestBed.createComponent(FileDomeComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'fe-file-dome',
|
|
5
|
-
templateUrl: './file-dome.component.html',
|
|
6
|
-
styleUrls: ['./file-dome.component.scss']
|
|
7
|
-
})
|
|
8
|
-
export class FileDomeComponent {
|
|
9
|
-
|
|
10
|
-
/**跟随表单提交--已提交的数据,或选择的数据源 */
|
|
11
|
-
fileSubmittedData: any[] = []
|
|
12
|
-
|
|
13
|
-
/**跟随表单提交--待提交的数据
|
|
14
|
-
*
|
|
15
|
-
* @param 待上传的文件们
|
|
16
|
-
* @param 待删除已上传的文件们
|
|
17
|
-
*/
|
|
18
|
-
fileDataToBeSubmitted: any
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**跟随表单提交--数据发生改变回调 */
|
|
22
|
-
fileDataChange(event) {
|
|
23
|
-
this.fileDataToBeSubmitted = event
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**选择文件-弹窗的-已选定的文件 */
|
|
27
|
-
selectedFileGroup:any[]=[]
|
|
28
|
-
|
|
29
|
-
/**_selectedFile改变回调 */
|
|
30
|
-
_selectedFileChange(event) {
|
|
31
|
-
this.selectedFileGroup = event
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<div class="input-group mb-2">
|
|
2
|
-
<input type="file" class="form-control" #fileEdit [multiple]="_multiple" accept=".jpg,.jpeg,.png,.gif,.webp"(change)="getFileChange($event)">
|
|
3
|
-
</div>
|
|
4
|
-
|
|
5
|
-
<table class="table" *ngIf="filesTableData.length>0">
|
|
6
|
-
<thead>
|
|
7
|
-
<tr>
|
|
8
|
-
<th scope="col">{{'FileExplorer::FileName' | abpLocalization}}</th>
|
|
9
|
-
<th scope="col">{{'FileExplorer::FileSize' | abpLocalization}}</th>
|
|
10
|
-
<th scope="col"></th>
|
|
11
|
-
</tr>
|
|
12
|
-
</thead>
|
|
13
|
-
<tbody>
|
|
14
|
-
<ng-container *ngFor="let item of filesTableData;let i =index">
|
|
15
|
-
<tr>
|
|
16
|
-
<th scope="row">
|
|
17
|
-
<div>{{item.name}}</div>
|
|
18
|
-
<div class="form-text text-danger" *ngIf="item.size > sizeLimit">{{'FileExplorer::ExceedsMaximumSize' | abpLocalization:_FileApiService.formatFileSize(sizeLimit)}}</div>
|
|
19
|
-
</th>
|
|
20
|
-
<td>{{item.fileSize}}</td>
|
|
21
|
-
<td>
|
|
22
|
-
<button class="btn btn-sm p-0 btn-light " (click.stop)="deleteFileTableItem(i,item)">
|
|
23
|
-
<i class="fas fa-trash p-2"></i>
|
|
24
|
-
</button>
|
|
25
|
-
</td>
|
|
26
|
-
</tr>
|
|
27
|
-
</ng-container>
|
|
28
|
-
</tbody>
|
|
29
|
-
</table>
|
|
File without changes
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { FileEditComponent } from './file-edit.component';
|
|
4
|
-
|
|
5
|
-
describe('FileEditComponent', () => {
|
|
6
|
-
let component: FileEditComponent;
|
|
7
|
-
let fixture: ComponentFixture<FileEditComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [FileEditComponent]
|
|
12
|
-
});
|
|
13
|
-
fixture = TestBed.createComponent(FileEditComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core';
|
|
2
|
-
import { FileApiService } from '../../services/file-api.service';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'fe-file-edit',
|
|
6
|
-
templateUrl: './file-edit.component.html',
|
|
7
|
-
styleUrls: ['./file-edit.component.scss']
|
|
8
|
-
})
|
|
9
|
-
export class FileEditComponent {
|
|
10
|
-
constructor(
|
|
11
|
-
public _FileApiService: FileApiService,
|
|
12
|
-
) { }
|
|
13
|
-
|
|
14
|
-
/**是否多选 */
|
|
15
|
-
_multiple: boolean = true
|
|
16
|
-
@Input()
|
|
17
|
-
public set multiple(v: boolean) {
|
|
18
|
-
this._multiple = v;
|
|
19
|
-
if (v) { }
|
|
20
|
-
}
|
|
21
|
-
/**文件数据--已上传的数据 */
|
|
22
|
-
_fileData: any[] = []
|
|
23
|
-
@Input()
|
|
24
|
-
public set fileData(v: any[]) {
|
|
25
|
-
this._fileData = v;
|
|
26
|
-
if (v.length > 0) {
|
|
27
|
-
this.getFileChange({ target: { files: v } })
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/** 跟随表单提交--已提交的数据,或选择的数据源--回调*/
|
|
31
|
-
@Output() fileDataChange = new EventEmitter()
|
|
32
|
-
|
|
33
|
-
/**文件大小限制
|
|
34
|
-
* @param 1mb
|
|
35
|
-
*/
|
|
36
|
-
sizeLimit: number = 1048576
|
|
37
|
-
@Input()
|
|
38
|
-
public set limit(v: number) {
|
|
39
|
-
this.sizeLimit = v;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**文件表格数据 */
|
|
43
|
-
filesTableData: any[] = []
|
|
44
|
-
/** 待删除已上传的文件们*/
|
|
45
|
-
deleteTheUploadedFiles: any[] = []
|
|
46
|
-
|
|
47
|
-
/**获取文件选择框的元素 */
|
|
48
|
-
@ViewChild('fileEdit', { static: true }) fileEdit: ElementRef;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/**获取文件信息改变 */
|
|
52
|
-
async getFileChange(event) {
|
|
53
|
-
let files = new Array(...event.target.files)
|
|
54
|
-
/**需要等待setfileSizeUnits执行完后在执行其他方法--需要完善 */
|
|
55
|
-
await this.waitFileToAddTable(files)
|
|
56
|
-
this.fileHandling()
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**等待将文件数据加入到文件表格数据中 */
|
|
60
|
-
waitFileToAddTable(files) {
|
|
61
|
-
return new Promise(async (resolve, rejects) => {
|
|
62
|
-
this.filesTableData.push(...await this.setfileSizeUnits(files))
|
|
63
|
-
resolve(true)
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**删除文件表格的项 */
|
|
68
|
-
deleteFileTableItem(index, item) {
|
|
69
|
-
this.filesTableData.splice(index, 1)
|
|
70
|
-
if (item.id) {
|
|
71
|
-
this.deleteTheUploadedFiles.push(item)
|
|
72
|
-
}
|
|
73
|
-
this.fileHandling()
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**文件处理-调用回调函数 */
|
|
77
|
-
fileHandling() {
|
|
78
|
-
let theFilesToBeUploaded = this.filesTableData.filter(el => !el.id)
|
|
79
|
-
//判断图片大小是否超过限制-用于判断表单是否允许提交
|
|
80
|
-
let isSubmit = !this.filesTableData.some(el => el.size > this.sizeLimit);
|
|
81
|
-
this.fileDataChange.emit({ theFilesToBeUploaded, deleteTheUploadedFiles: this.deleteTheUploadedFiles, isSubmit })
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**设置值文件大小单位/ */
|
|
85
|
-
async setfileSizeUnits(files: File[] | any[]): Promise<any> {
|
|
86
|
-
return new Promise((resolve, rejects) => {
|
|
87
|
-
let formattedFiles = []
|
|
88
|
-
files.forEach(async (file) => {
|
|
89
|
-
file.fileSize = this._FileApiService.formatFileSize(file.size)
|
|
90
|
-
formattedFiles.push(file)
|
|
91
|
-
//设置选择图片的本地url
|
|
92
|
-
if (!file.src) file.src = await this._FileApiService.getImageLacolBase64Url(file);
|
|
93
|
-
});
|
|
94
|
-
resolve(files)
|
|
95
|
-
})
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
}
|