@sumaris-net/ngx-components 18.26.13 → 18.26.14-alpha1
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/doc/changelog.md +4 -1
- package/esm2022/src/app/shared/upload-file/upload-file-popover.component.mjs +10 -4
- package/esm2022/src/app/shared/upload-file/upload-file.component.mjs +41 -4
- package/esm2022/src/app/shared/upload-file/upload-file.model.mjs +1 -1
- package/fesm2022/sumaris-net.ngx-components.mjs +48 -5
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/upload-file/upload-file-popover.component.d.ts +5 -1
- package/src/app/shared/upload-file/upload-file.component.d.ts +6 -2
- package/src/app/shared/upload-file/upload-file.model.d.ts +7 -0
- package/src/assets/i18n/en-US.json +2 -0
- package/src/assets/i18n/en.json +2 -0
- package/src/assets/i18n/fr.json +2 -0
- package/src/assets/manifest.json +1 -1
package/package.json
CHANGED
|
@@ -11,7 +11,9 @@ export interface UploadFilePopoverOptions<T> {
|
|
|
11
11
|
instantUpload?: boolean;
|
|
12
12
|
uniqueFile?: boolean;
|
|
13
13
|
fileExtension?: string;
|
|
14
|
+
fileExtensionsExcluded?: string[];
|
|
14
15
|
maxParallelUpload?: number;
|
|
16
|
+
maxFileSizeMb?: number;
|
|
15
17
|
autoHideDropArea?: boolean;
|
|
16
18
|
okButtonText?: string;
|
|
17
19
|
cancelButtonText?: string;
|
|
@@ -26,12 +28,14 @@ export declare class UploadFilePopover implements UploadFilePopoverOptions<any>
|
|
|
26
28
|
protected cd: ChangeDetectorRef;
|
|
27
29
|
uploader: UploadFileComponent;
|
|
28
30
|
fileExtension: string;
|
|
31
|
+
fileExtensionsExcluded: string[];
|
|
29
32
|
title: string;
|
|
30
33
|
uniqueFile: boolean;
|
|
31
34
|
instantUpload: boolean;
|
|
32
35
|
uploadFn: FileUploadFn<any>;
|
|
33
36
|
deleteFn: FileDeleteFn<any>;
|
|
34
37
|
maxParallelUpload: number;
|
|
38
|
+
maxFileSizeMb: number;
|
|
35
39
|
autoHideDropArea: boolean;
|
|
36
40
|
okButtonText: string;
|
|
37
41
|
cancelButtonText: string;
|
|
@@ -45,5 +49,5 @@ export declare class UploadFilePopover implements UploadFilePopoverOptions<any>
|
|
|
45
49
|
cancel(): Promise<boolean>;
|
|
46
50
|
protected resetError(): void;
|
|
47
51
|
static ɵfac: i0.ɵɵFactoryDeclaration<UploadFilePopover, never>;
|
|
48
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UploadFilePopover, "app-upload-file-popover", never, { "fileExtension": { "alias": "fileExtension"; "required": false; }; "title": { "alias": "title"; "required": false; }; "uniqueFile": { "alias": "uniqueFile"; "required": false; }; "instantUpload": { "alias": "instantUpload"; "required": false; }; "uploadFn": { "alias": "uploadFn"; "required": false; }; "deleteFn": { "alias": "deleteFn"; "required": false; }; "maxParallelUpload": { "alias": "maxParallelUpload"; "required": false; }; "autoHideDropArea": { "alias": "autoHideDropArea"; "required": false; }; "okButtonText": { "alias": "okButtonText"; "required": false; }; "cancelButtonText": { "alias": "cancelButtonText"; "required": false; }; }, {}, never, never, false, never>;
|
|
52
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UploadFilePopover, "app-upload-file-popover", never, { "fileExtension": { "alias": "fileExtension"; "required": false; }; "fileExtensionsExcluded": { "alias": "fileExtensionsExcluded"; "required": false; }; "title": { "alias": "title"; "required": false; }; "uniqueFile": { "alias": "uniqueFile"; "required": false; }; "instantUpload": { "alias": "instantUpload"; "required": false; }; "uploadFn": { "alias": "uploadFn"; "required": false; }; "deleteFn": { "alias": "deleteFn"; "required": false; }; "maxParallelUpload": { "alias": "maxParallelUpload"; "required": false; }; "maxFileSizeMb": { "alias": "maxFileSizeMb"; "required": false; }; "autoHideDropArea": { "alias": "autoHideDropArea"; "required": false; }; "okButtonText": { "alias": "okButtonText"; "required": false; }; "cancelButtonText": { "alias": "cancelButtonText"; "required": false; }; }, {}, never, never, false, never>;
|
|
49
53
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChangeDetectorRef, ElementRef } from '@angular/core';
|
|
2
2
|
import { TranslateService } from '@ngx-translate/core';
|
|
3
|
-
import { FileDeleteFn, FileUploadFn, UploadFile } from './upload-file.model';
|
|
3
|
+
import { FileCheck, FileDeleteFn, FileUploadFn, UploadFile } from './upload-file.model';
|
|
4
4
|
import { WaitForOptions } from '../observables';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class UploadFileComponent {
|
|
@@ -8,14 +8,17 @@ export declare class UploadFileComponent {
|
|
|
8
8
|
protected translate: TranslateService;
|
|
9
9
|
fileDropEl: ElementRef;
|
|
10
10
|
fileExtension: string;
|
|
11
|
+
fileExtensionsExcluded: string[];
|
|
11
12
|
uniqueFile: boolean;
|
|
12
13
|
instantUpload: boolean;
|
|
13
14
|
uploadFn: FileUploadFn<any>;
|
|
14
15
|
deleteFn: FileDeleteFn<any>;
|
|
15
16
|
maxParallelUpload: number;
|
|
17
|
+
maxFileSizeMb: number;
|
|
16
18
|
autoHideDropArea: boolean;
|
|
17
19
|
files: UploadFile<any>[];
|
|
18
20
|
uploading: boolean;
|
|
21
|
+
checks: FileCheck[];
|
|
19
22
|
get processingFiles(): UploadFile<any>[];
|
|
20
23
|
get processedFiles(): UploadFile<any>[];
|
|
21
24
|
get processingFilesCount(): number;
|
|
@@ -40,11 +43,12 @@ export declare class UploadFileComponent {
|
|
|
40
43
|
* @param files (Files List)
|
|
41
44
|
*/
|
|
42
45
|
prepareFilesList(files: FileList | File[]): void;
|
|
46
|
+
checkFiles(): void;
|
|
43
47
|
/**
|
|
44
48
|
* Execute upload
|
|
45
49
|
*/
|
|
46
50
|
uploadFiles(files?: File[]): Promise<UploadFile<any>[]>;
|
|
47
51
|
waitIdle(opts?: WaitForOptions): Promise<void>;
|
|
48
52
|
static ɵfac: i0.ɵɵFactoryDeclaration<UploadFileComponent, never>;
|
|
49
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UploadFileComponent, "app-upload-file", never, { "fileExtension": { "alias": "fileExtension"; "required": false; }; "uniqueFile": { "alias": "uniqueFile"; "required": false; }; "instantUpload": { "alias": "instantUpload"; "required": false; }; "uploadFn": { "alias": "uploadFn"; "required": false; }; "deleteFn": { "alias": "deleteFn"; "required": false; }; "maxParallelUpload": { "alias": "maxParallelUpload"; "required": false; }; "autoHideDropArea": { "alias": "autoHideDropArea"; "required": false; }; }, {}, never, never, false, never>;
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UploadFileComponent, "app-upload-file", never, { "fileExtension": { "alias": "fileExtension"; "required": false; }; "fileExtensionsExcluded": { "alias": "fileExtensionsExcluded"; "required": false; }; "uniqueFile": { "alias": "uniqueFile"; "required": false; }; "instantUpload": { "alias": "instantUpload"; "required": false; }; "uploadFn": { "alias": "uploadFn"; "required": false; }; "deleteFn": { "alias": "deleteFn"; "required": false; }; "maxParallelUpload": { "alias": "maxParallelUpload"; "required": false; }; "maxFileSizeMb": { "alias": "maxFileSizeMb"; "required": false; }; "autoHideDropArea": { "alias": "autoHideDropArea"; "required": false; }; }, {}, never, never, false, never>;
|
|
50
54
|
}
|
|
@@ -6,6 +6,13 @@ export declare class UploadFile<T> extends File {
|
|
|
6
6
|
error?: string;
|
|
7
7
|
response?: FileResponse<T> | HttpResponse<T>;
|
|
8
8
|
}
|
|
9
|
+
export type FileCheckEnabledFn = () => boolean;
|
|
10
|
+
export type FileHasErrorFn = (file: UploadFile<any>) => boolean;
|
|
11
|
+
export interface FileCheck {
|
|
12
|
+
isEnabled: FileCheckEnabledFn;
|
|
13
|
+
hasError: FileHasErrorFn;
|
|
14
|
+
error: string;
|
|
15
|
+
}
|
|
9
16
|
export type FileUploadFn<T> = (file: File) => Observable<FileEvent<T> | HttpEvent<T>>;
|
|
10
17
|
export type FileDeleteFn<T> = (file: UploadFile<T>) => Promise<boolean>;
|
|
11
18
|
export interface FileProgressEvent {
|
|
@@ -648,6 +648,8 @@
|
|
|
648
648
|
"IMPORTING": "Import in progress",
|
|
649
649
|
"BTN_IMPORT_POLICY_DOTS": "Import policy...",
|
|
650
650
|
"ERROR": "Error while uploading file",
|
|
651
|
+
"MAX_FILE_SIZE_ERROR": "The file size is too large to be uploaded ({{maxFileSizeMb}} MB max)",
|
|
652
|
+
"EXTENSION_NOT_ALLOWED_ERROR": "The file extension is not allowed ({{fileExtensionsExcluded}} excluded)",
|
|
651
653
|
"IMPORT_POLICY": {
|
|
652
654
|
"TITLE": "Import options",
|
|
653
655
|
"INSERT-ONLY": "Inserts only",
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -648,6 +648,8 @@
|
|
|
648
648
|
"IMPORTING": "Import in progress",
|
|
649
649
|
"BTN_IMPORT_POLICY_DOTS": "Import policy...",
|
|
650
650
|
"ERROR": "Error while uploading file",
|
|
651
|
+
"MAX_FILE_SIZE_ERROR": "The file size is too large to be uploaded ({{maxFileSizeMb}} MB max)",
|
|
652
|
+
"EXTENSION_NOT_ALLOWED_ERROR": "The file extension is not allowed ({{fileExtensionsExcluded}} excluded)",
|
|
651
653
|
"IMPORT_POLICY": {
|
|
652
654
|
"TITLE": "Import options",
|
|
653
655
|
"INSERT-ONLY": "Inserts only",
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -650,6 +650,8 @@
|
|
|
650
650
|
"IMPORTING": "Importation en cours",
|
|
651
651
|
"BTN_IMPORT_POLICY_DOTS": "Stratégie d'importation...",
|
|
652
652
|
"ERROR": "Erreur durant l'envoi de fichier",
|
|
653
|
+
"MAX_FILE_SIZE_ERROR": "La taille du fichier est trop importante pour être téléversé ({{maxFileSizeMb}} Mo max).",
|
|
654
|
+
"EXTENSION_NOT_ALLOWED_ERROR": "L'extension du fichier n'est pas autorisée ({{fileExtensionsExcluded}} exclus).",
|
|
653
655
|
"IMPORT_POLICY": {
|
|
654
656
|
"TITLE": "Stratégie d'importation",
|
|
655
657
|
"INSERT-ONLY": "Insertions uniquement",
|
package/src/assets/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "ngx-sumaris-components",
|
|
3
3
|
"short_name": "ngx-sumaris-components",
|
|
4
4
|
"manifest_version": 1,
|
|
5
|
-
"version": "18.26.
|
|
5
|
+
"version": "18.26.14-alpha1",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|