@sumaris-net/ngx-components 18.27.2 → 18.27.3
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 +11 -0
- package/esm2022/public_api.mjs +2 -1
- package/esm2022/src/app/core/about/about.modal.mjs +61 -17
- package/esm2022/src/app/core/table/async-table.class.mjs +7 -1
- package/esm2022/src/app/core/table/entities-async-table-datasource.class.mjs +1 -1
- package/esm2022/src/app/shared/alerts.mjs +42 -8
- package/esm2022/src/app/shared/gitlab/gitlab.utils.mjs +170 -0
- package/esm2022/src/app/shared/markdown/markdown.component.mjs +4 -3
- package/esm2022/src/app/shared/markdown/markdown.utils.mjs +3 -12
- 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 +316 -35
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/src/app/core/about/about.modal.d.ts +8 -3
- package/src/app/shared/alerts.d.ts +39 -4
- package/src/app/shared/gitlab/gitlab.utils.d.ts +109 -0
- package/src/app/shared/markdown/markdown.utils.d.ts +0 -2
- 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/testing/package.json +0 -3
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -167,6 +167,7 @@ export * from './src/app/shared/markdown/markdown.directive';
|
|
|
167
167
|
export * from './src/app/shared/markdown/markdown.component';
|
|
168
168
|
export * from './src/app/shared/markdown/markdown.modal';
|
|
169
169
|
export * from './src/app/shared/print/print.service';
|
|
170
|
+
export * from './src/app/shared/gitlab/gitlab.utils';
|
|
170
171
|
export * from './src/app/core/core.module';
|
|
171
172
|
export * from './src/app/core/services/model/account.model';
|
|
172
173
|
export * from './src/app/core/services/model/token.model';
|
|
@@ -7,6 +7,8 @@ import { Configuration } from '../services/model/config.model';
|
|
|
7
7
|
import { Observable } from 'rxjs';
|
|
8
8
|
import { NetworkService } from '../services/network.service';
|
|
9
9
|
import { NodeInfo } from '../services/network.utils';
|
|
10
|
+
import { HttpClient } from '@angular/common/http';
|
|
11
|
+
import { PlatformService } from '../services/platform.service';
|
|
10
12
|
import * as i0 from "@angular/core";
|
|
11
13
|
export declare const APP_ABOUT_DEVELOPERS: InjectionToken<Partial<Department>[]>;
|
|
12
14
|
export declare const APP_ABOUT_PARTNERS: InjectionToken<Partial<Department>[]>;
|
|
@@ -15,6 +17,8 @@ export declare class AboutModal implements OnInit, OnDestroy {
|
|
|
15
17
|
protected modalController: ModalController;
|
|
16
18
|
protected configService: ConfigService;
|
|
17
19
|
protected networkService: NetworkService;
|
|
20
|
+
protected platformService: PlatformService;
|
|
21
|
+
protected http: HttpClient;
|
|
18
22
|
protected cd: ChangeDetectorRef;
|
|
19
23
|
protected environment: any;
|
|
20
24
|
developers: Partial<Department>[];
|
|
@@ -33,14 +37,15 @@ export declare class AboutModal implements OnInit, OnDestroy {
|
|
|
33
37
|
protected nodeInfo: NodeInfo;
|
|
34
38
|
protected buildDate: string;
|
|
35
39
|
protected get allowVersionDetails(): boolean;
|
|
36
|
-
constructor(translate: TranslateService, modalController: ModalController, configService: ConfigService, networkService: NetworkService, cd: ChangeDetectorRef, environment: any, developers: Partial<Department>[], partners: Partial<Department>[]);
|
|
40
|
+
constructor(translate: TranslateService, modalController: ModalController, configService: ConfigService, networkService: NetworkService, platformService: PlatformService, http: HttpClient, cd: ChangeDetectorRef, environment: any, developers: Partial<Department>[], partners: Partial<Department>[]);
|
|
37
41
|
ngOnInit(): void;
|
|
38
42
|
ngOnDestroy(): void;
|
|
39
43
|
close(): Promise<void>;
|
|
40
44
|
protected setConfig(config?: Configuration): void;
|
|
41
|
-
protected
|
|
45
|
+
protected getChangelogUrl(config?: Configuration): any;
|
|
46
|
+
protected openChangelog(event: Event): Promise<void | import("@ionic/core").OverlayEventDetail<any>>;
|
|
42
47
|
protected loadNodeInfo(): Promise<void>;
|
|
43
48
|
protected getNodeInfo(): Promise<NodeInfo>;
|
|
44
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AboutModal, [null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AboutModal, [null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
45
50
|
static ɵcmp: i0.ɵɵComponentDeclaration<AboutModal, "app-about-modal", never, {}, {}, never, never, false, never>;
|
|
46
51
|
}
|
|
@@ -9,8 +9,14 @@ export declare class Alerts {
|
|
|
9
9
|
* @param alertCtrl
|
|
10
10
|
* @param translate
|
|
11
11
|
* @param event
|
|
12
|
+
* @param opts
|
|
13
|
+
* @param opts.backdropDismiss Whether the alert can be dismissed by clicking the backdrop (default: true)
|
|
14
|
+
* @param opts.keyboardClose Whether the alert can be dismissed by pressing the back button (default: true)
|
|
12
15
|
*/
|
|
13
|
-
static askSaveBeforeLeave(alertCtrl: AlertController, translate: TranslateService, event?: Event
|
|
16
|
+
static askSaveBeforeLeave(alertCtrl: AlertController, translate: TranslateService, event?: Event, opts?: {
|
|
17
|
+
backdropDismiss?: boolean;
|
|
18
|
+
keyboardClose?: boolean;
|
|
19
|
+
}): Promise<boolean | undefined>;
|
|
14
20
|
/**
|
|
15
21
|
* Ask the user to conform an action. If return undefined: user has cancelled
|
|
16
22
|
*
|
|
@@ -19,8 +25,15 @@ export declare class Alerts {
|
|
|
19
25
|
* @param immediate is action has an immediate effect ?
|
|
20
26
|
* @param event
|
|
21
27
|
* @param interpolateParams
|
|
28
|
+
* @param opts
|
|
29
|
+
* @param opts.backdropDismiss Whether the alert can be dismissed by clicking the backdrop (default: true)
|
|
30
|
+
* @param opts.keyboardClose Whether the alert can be dismissed by pressing the back button (default: true)
|
|
22
31
|
*/
|
|
23
|
-
static askActionConfirmation(alertCtrl: AlertController, translate: TranslateService, immediate?: boolean, event?: Event,
|
|
32
|
+
static askActionConfirmation(alertCtrl: AlertController, translate: TranslateService, immediate?: boolean, event?: Event, opts?: {
|
|
33
|
+
backdropDismiss?: boolean;
|
|
34
|
+
keyboardClose?: boolean;
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}, interpolateParams?: any): Promise<boolean | undefined>;
|
|
24
37
|
/**
|
|
25
38
|
* Ask the user to confirm. If return undefined: user has cancelled
|
|
26
39
|
*
|
|
@@ -30,8 +43,17 @@ export declare class Alerts {
|
|
|
30
43
|
* @param translate
|
|
31
44
|
* @param event
|
|
32
45
|
* @param interpolateParams
|
|
46
|
+
* @param opts
|
|
47
|
+
* @param opts.backdropDismiss Whether the alert can be dismissed by clicking the backdrop (default: true)
|
|
48
|
+
* @param opts.keyboardClose Whether the alert can be dismissed by pressing the back button (default: true)
|
|
49
|
+
*
|
|
50
|
+
* Note: interpolateParams and opts are merged for translation for compatibility
|
|
33
51
|
*/
|
|
34
|
-
static askConfirmation(messageKey: string, alertCtrl: AlertController, translate: TranslateService, event?: Event,
|
|
52
|
+
static askConfirmation(messageKey: string, alertCtrl: AlertController, translate: TranslateService, event?: Event, opts?: {
|
|
53
|
+
backdropDismiss?: boolean;
|
|
54
|
+
keyboardClose?: boolean;
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
}, interpolateParams?: any): Promise<boolean | undefined>;
|
|
35
57
|
/**
|
|
36
58
|
* Ask the user to save before leaving. If return undefined: user has cancelled
|
|
37
59
|
*
|
|
@@ -39,17 +61,30 @@ export declare class Alerts {
|
|
|
39
61
|
* @param translate
|
|
40
62
|
* @param event
|
|
41
63
|
* @param interpolateParams
|
|
64
|
+
* @param opts
|
|
65
|
+
* @param opts.backdropDismiss Whether the alert can be dismissed by clicking the backdrop (default: true)
|
|
66
|
+
* @param opts.keyboardClose Whether the alert can be dismissed by pressing the back button (default: true)
|
|
67
|
+
*
|
|
68
|
+
* Note: interpolateParams and opts are merged for translation for compatibility
|
|
42
69
|
*/
|
|
43
|
-
static askDeleteConfirmation(alertCtrl: AlertController, translate: TranslateService, event?: Event,
|
|
70
|
+
static askDeleteConfirmation(alertCtrl: AlertController, translate: TranslateService, event?: Event, opts?: {
|
|
71
|
+
backdropDismiss?: boolean;
|
|
72
|
+
keyboardClose?: boolean;
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
}, interpolateParams?: any): Promise<boolean | undefined>;
|
|
44
75
|
static askSaveBeforeAction(alertCtrl: AlertController, translate: TranslateService, opts?: {
|
|
45
76
|
valid?: boolean;
|
|
46
77
|
validMessageI18n?: string;
|
|
47
78
|
invalidMessageI18n?: string;
|
|
79
|
+
backdropDismiss?: boolean;
|
|
80
|
+
keyboardClose?: boolean;
|
|
48
81
|
}, interpolateParams?: any): Promise<{
|
|
49
82
|
confirmed: boolean;
|
|
50
83
|
save: boolean;
|
|
51
84
|
} | undefined>;
|
|
52
85
|
static showError(messageKey: string, alertCtrl: AlertController, translate: TranslateService, opts?: {
|
|
53
86
|
titleKey?: string;
|
|
87
|
+
backdropDismiss?: boolean;
|
|
88
|
+
keyboardClose?: boolean;
|
|
54
89
|
}, interpolateParams?: any): Promise<void>;
|
|
55
90
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
export interface IGitlabRelease {
|
|
3
|
+
name: string;
|
|
4
|
+
tag_name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class GitlabUtils {
|
|
8
|
+
static API_V4_PATH: string;
|
|
9
|
+
static API_V4_PROJECTS_PATH: string;
|
|
10
|
+
/**
|
|
11
|
+
* Checks whether a URL points to a Gitlab instance.
|
|
12
|
+
*
|
|
13
|
+
* A URL is considered a Gitlab URL either when its host starts with 'gitlab.'
|
|
14
|
+
* (e.g. 'https://gitlab.ifremer.fr/...'), or when it is a repository file URL
|
|
15
|
+
* (see {@link isRepoFileUrl}) - in which case the host is NOT checked, since
|
|
16
|
+
* a self-hosted Gitlab instance may use a custom domain name.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* GitlabUtils.isGitlabUrl('https://gitlab.ifremer.fr/sih-public/sumaris/sumaris-app'); // true
|
|
20
|
+
* GitlabUtils.isGitlabUrl('https://my-custom-domain.com/foo/-/raw/master/README.md'); // true (repo file URL)
|
|
21
|
+
* GitlabUtils.isGitlabUrl('https://github.com/foo/bar'); // false
|
|
22
|
+
*/
|
|
23
|
+
static isGitlabUrl(url: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Checks whether a URL is a Gitlab repository file URL, i.e. a URL used to
|
|
26
|
+
* view a single file in a repository ('/-/blob/') or to download its raw
|
|
27
|
+
* content ('/-/raw/').
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* GitlabUtils.isRepoFileUrl('https://gitlab.ifremer.fr/a/b/-/raw/master/README.md'); // true
|
|
31
|
+
* GitlabUtils.isRepoFileUrl('https://gitlab.ifremer.fr/a/b/-/blob/master/README.md'); // true
|
|
32
|
+
* GitlabUtils.isRepoFileUrl('https://gitlab.ifremer.fr/api/v4/projects/a%2Fb'); // false
|
|
33
|
+
*/
|
|
34
|
+
static isRepoFileUrl(url: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Converts a repository file URL into its 'raw content' equivalent, by
|
|
37
|
+
* replacing the '/-/blob/' (file viewer) or '/-/tree/' (directory viewer)
|
|
38
|
+
* segment with '/-/raw/'.
|
|
39
|
+
*
|
|
40
|
+
* If the URL is not a repository file URL (see {@link isRepoFileUrl}), it is
|
|
41
|
+
* returned unchanged.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* GitlabUtils.getRawRepoFileUrl('https://gitlab.ifremer.fr/a/b/-/blob/master/README.md');
|
|
45
|
+
* // 'https://gitlab.ifremer.fr/a/b/-/raw/master/README.md'
|
|
46
|
+
*/
|
|
47
|
+
static getRawRepoFileUrl(url: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Checks whether a URL targets the Gitlab REST API (any endpoint under
|
|
50
|
+
* '/api/v4/'). Repository file URLs (see {@link isRepoFileUrl}) are always
|
|
51
|
+
* excluded, even if they happen to contain '/api/v4/' somewhere in their path.
|
|
52
|
+
*/
|
|
53
|
+
static isApiUrl(url: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Checks whether a URL targets the Gitlab 'projects' REST API (any endpoint
|
|
56
|
+
* under '/api/v4/projects/'), e.g. project releases, branches, etc.
|
|
57
|
+
*/
|
|
58
|
+
static isApiProjectsUrl(url: string): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Checks whether a URL targets the Gitlab project releases REST API, e.g.
|
|
61
|
+
* 'https://gitlab.ifremer.fr/api/v4/projects/{id}/releases' (all releases)
|
|
62
|
+
* or 'https://gitlab.ifremer.fr/api/v4/projects/{id}/releases/{tag_name}'
|
|
63
|
+
* (a single release).
|
|
64
|
+
*/
|
|
65
|
+
static isProjectReleasesApiUrl(url: string): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Fetches releases from the Gitlab project releases REST API.
|
|
68
|
+
*
|
|
69
|
+
* The given URL can either target the collection endpoint
|
|
70
|
+
* ('.../releases', returning all releases), or a single release endpoint
|
|
71
|
+
* ('.../releases/{tag_name}', returning one release, wrapped into an array).
|
|
72
|
+
*
|
|
73
|
+
* @return the list of releases, an empty array if the API call failed for a
|
|
74
|
+
* single release, or `null` if the URL is not a project releases API URL.
|
|
75
|
+
*/
|
|
76
|
+
static getProjectReleases(http: HttpClient, url: string): Promise<IGitlabRelease[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Extracts the URL-encoded project path (e.g. 'group%2Fsubgroup%2Fproject')
|
|
79
|
+
* from a Gitlab 'projects' API URL. The returned value is NOT decoded, so it
|
|
80
|
+
* still contains '%2F' in place of '/'.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* GitlabUtils.getProjectNameFromApiUrl('https://gitlab.ifremer.fr/api/v4/projects/sih-public%2Fsumaris%2Fsumaris-app/releases');
|
|
84
|
+
* // 'sih-public%2Fsumaris%2Fsumaris-app'
|
|
85
|
+
*/
|
|
86
|
+
static getProjectNameFromApiUrl(url: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* Resolves the Gitlab web page associated to a URL:
|
|
89
|
+
* - for an API 'projects' URL (see {@link isApiUrl}), this is the project's
|
|
90
|
+
* home page, e.g. 'https://gitlab.ifremer.fr/sih-public/sumaris/sumaris-app';
|
|
91
|
+
* - for a repository file URL (see {@link isRepoFileUrl}), this is the
|
|
92
|
+
* project's raw content base path (e.g. '.../my-project/-/raw/'), since
|
|
93
|
+
* the project path cannot be reliably distinguished from the file path
|
|
94
|
+
* once slashes are un-encoded.
|
|
95
|
+
*
|
|
96
|
+
* @return `null` if the project page cannot be resolved from the given URL.
|
|
97
|
+
*/
|
|
98
|
+
static getProjectPage(url: string): string;
|
|
99
|
+
/**
|
|
100
|
+
* Builds the URL of the Gitlab web page listing a project's releases (e.g.
|
|
101
|
+
* 'https://gitlab.ifremer.fr/sih-public/sumaris/sumaris-app/-/releases'),
|
|
102
|
+
* optionally anchored on a specific version/tag.
|
|
103
|
+
*
|
|
104
|
+
* @param url any URL from which the project page can be resolved (see {@link getProjectPage})
|
|
105
|
+
* @param version optional tag name (e.g. '2.16.2') appended to the releases page
|
|
106
|
+
* @return `null` if the project page cannot be resolved from the given URL.
|
|
107
|
+
*/
|
|
108
|
+
static getProjectReleasePage(url: string, version?: string): string;
|
|
109
|
+
}
|
|
@@ -20,7 +20,5 @@ export declare class MarkdownUtils {
|
|
|
20
20
|
static resolveRelativeUrl(baseUrl: string, relativePath: string, opts?: {
|
|
21
21
|
absoluteByDefault: boolean;
|
|
22
22
|
}): string;
|
|
23
|
-
static isGitlabUrl(url: string): boolean;
|
|
24
|
-
static fixGitlabUrlToRaw(url: string): string;
|
|
25
23
|
static getRootUrl(url: string): string;
|
|
26
24
|
}
|
|
@@ -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 {
|
|
@@ -649,6 +649,8 @@
|
|
|
649
649
|
"IMPORTING": "Import in progress",
|
|
650
650
|
"BTN_IMPORT_POLICY_DOTS": "Import policy...",
|
|
651
651
|
"ERROR": "Error while uploading file",
|
|
652
|
+
"MAX_FILE_SIZE_ERROR": "The file size is too large to be uploaded ({{maxFileSizeMb}} MB max)",
|
|
653
|
+
"EXTENSION_NOT_ALLOWED_ERROR": "The file extension is not allowed ({{fileExtensionsExcluded}} excluded)",
|
|
652
654
|
"IMPORT_POLICY": {
|
|
653
655
|
"TITLE": "Import options",
|
|
654
656
|
"INSERT-ONLY": "Inserts only",
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -649,6 +649,8 @@
|
|
|
649
649
|
"IMPORTING": "Import in progress",
|
|
650
650
|
"BTN_IMPORT_POLICY_DOTS": "Import policy...",
|
|
651
651
|
"ERROR": "Error while uploading file",
|
|
652
|
+
"MAX_FILE_SIZE_ERROR": "The file size is too large to be uploaded ({{maxFileSizeMb}} MB max)",
|
|
653
|
+
"EXTENSION_NOT_ALLOWED_ERROR": "The file extension is not allowed ({{fileExtensionsExcluded}} excluded)",
|
|
652
654
|
"IMPORT_POLICY": {
|
|
653
655
|
"TITLE": "Import options",
|
|
654
656
|
"INSERT-ONLY": "Inserts only",
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -651,6 +651,8 @@
|
|
|
651
651
|
"IMPORTING": "Importation en cours",
|
|
652
652
|
"BTN_IMPORT_POLICY_DOTS": "Stratégie d'importation...",
|
|
653
653
|
"ERROR": "Erreur durant l'envoi de fichier",
|
|
654
|
+
"MAX_FILE_SIZE_ERROR": "La taille du fichier est trop importante pour être téléversé ({{maxFileSizeMb}} Mo max).",
|
|
655
|
+
"EXTENSION_NOT_ALLOWED_ERROR": "L'extension du fichier n'est pas autorisée ({{fileExtensionsExcluded}} exclus).",
|
|
654
656
|
"IMPORT_POLICY": {
|
|
655
657
|
"TITLE": "Stratégie d'importation",
|
|
656
658
|
"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.27.
|
|
5
|
+
"version": "18.27.3",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|
package/testing/package.json
DELETED