@rlucan/ui 17.1.1 → 17.1.2
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/esm2022/lib/file/file.component.mjs +55 -34
- package/esm2022/lib/file-uploader/ui-file-uploader.component.mjs +31 -13
- package/esm2022/lib/services/ui-file.service.mjs +4 -3
- package/fesm2022/rlucan-ui.mjs +87 -47
- package/fesm2022/rlucan-ui.mjs.map +1 -1
- package/lib/file/file.component.d.ts +7 -6
- package/lib/file-uploader/ui-file-uploader.component.d.ts +8 -4
- package/lib/services/ui-file.service.d.ts +12 -8
- package/package.json +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { OnChanges,
|
|
2
|
-
import { IUiFileService, UiFileService } from '../services/ui-file.service';
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { IUiFileService, UiFileService, IUiFileSize } from '../services/ui-file.service';
|
|
3
3
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class FileComponent implements
|
|
5
|
+
export declare class FileComponent implements OnChanges {
|
|
6
6
|
private fileServiceConfig;
|
|
7
7
|
private domSanitizer;
|
|
8
8
|
private fileService;
|
|
9
|
-
|
|
9
|
+
private uiFileSize;
|
|
10
|
+
set fileSize(fs: string | IUiFileSize);
|
|
10
11
|
srcOptions: any;
|
|
11
12
|
srcData: any;
|
|
12
13
|
srcUrl: {
|
|
@@ -24,12 +25,12 @@ export declare class FileComponent implements OnInit, OnChanges {
|
|
|
24
25
|
get maxWidth(): string;
|
|
25
26
|
get height(): string;
|
|
26
27
|
get maxHeight(): string;
|
|
28
|
+
get imgStyle(): {};
|
|
27
29
|
get isVideo(): any;
|
|
28
30
|
get mime(): any;
|
|
29
31
|
get useRetinaSrc(): boolean;
|
|
30
32
|
constructor(fileServiceConfig: IUiFileService, domSanitizer: DomSanitizer, fileService: UiFileService);
|
|
31
|
-
ngOnInit(): void;
|
|
32
33
|
ngOnChanges(changes: SimpleChanges): void;
|
|
33
34
|
static ɵfac: i0.ɵɵFactoryDeclaration<FileComponent, [{ optional: true; }, null, null]>;
|
|
34
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FileComponent, "ui-file", never, { "fileSize": { "alias": "fileSize"; "required":
|
|
35
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FileComponent, "ui-file", never, { "fileSize": { "alias": "fileSize"; "required": true; }; "srcOptions": { "alias": "srcOptions"; "required": false; }; "srcData": { "alias": "srcData"; "required": false; }; "srcUrl": { "alias": "srcUrl"; "required": false; }; }, {}, never, never, false, never>;
|
|
35
36
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { ControlContainer } from '@angular/forms';
|
|
3
3
|
import { UploaderOptions, UploadFile, UploadInput, UploadOutput } from 'ngx-uploader';
|
|
4
|
-
import { IUiFileService, IUiFileServiceMessages, UiFileService } from '../services/ui-file.service';
|
|
4
|
+
import { IUiFileService, IUiFileServiceMessages, UiFileService, IUiFileSize } from '../services/ui-file.service';
|
|
5
5
|
import { Dimensions, ImageCroppedEvent, ImageTransform } from 'ngx-image-cropper';
|
|
6
6
|
import { UiSimpleComponent } from '../layouts/simple/ui-simple.component';
|
|
7
7
|
import { IUiTranslateService } from '../services/ui-translate.service';
|
|
@@ -22,12 +22,14 @@ export declare class UiFileUploaderComponent extends UiSimpleComponent implement
|
|
|
22
22
|
translateService: IUiTranslateService;
|
|
23
23
|
protected controlContainer: ControlContainer;
|
|
24
24
|
private fileService;
|
|
25
|
+
private uiFileSize;
|
|
26
|
+
_fileSize: string | IUiFileSize;
|
|
27
|
+
set fileSize(fs: string | IUiFileSize);
|
|
25
28
|
maxFiles: number;
|
|
26
29
|
multiple: boolean;
|
|
27
30
|
crop: boolean;
|
|
28
31
|
cropRounded: boolean;
|
|
29
32
|
cropMaxWidth: any;
|
|
30
|
-
fileSize: string;
|
|
31
33
|
customFileMenu: boolean;
|
|
32
34
|
addHint: any;
|
|
33
35
|
newFilePosition: 'first' | 'last';
|
|
@@ -35,9 +37,11 @@ export declare class UiFileUploaderComponent extends UiSimpleComponent implement
|
|
|
35
37
|
menuTemplate?: any;
|
|
36
38
|
addFileTemplate?: any;
|
|
37
39
|
fileTemplate?: any;
|
|
40
|
+
customContentTemplate?: any;
|
|
38
41
|
};
|
|
39
42
|
get menuTemplate(): any;
|
|
40
43
|
get addFileTemplate(): any;
|
|
44
|
+
get customContentTemplate(): any;
|
|
41
45
|
get fileTemplate(): any;
|
|
42
46
|
previewPosition: 'left' | 'bottom' | 'above';
|
|
43
47
|
imageCropped: EventEmitter<any>;
|
|
@@ -74,7 +78,7 @@ export declare class UiFileUploaderComponent extends UiSimpleComponent implement
|
|
|
74
78
|
height: string;
|
|
75
79
|
};
|
|
76
80
|
get aspectRatio(): number;
|
|
77
|
-
get addFileImgSrc(): string;
|
|
81
|
+
get addFileImgSrc(): (size: IUiFileSize) => string;
|
|
78
82
|
cropDone(f: any): any;
|
|
79
83
|
ngOnDestroy(): void;
|
|
80
84
|
remove(f: any): void;
|
|
@@ -98,5 +102,5 @@ export declare class UiFileUploaderComponent extends UiSimpleComponent implement
|
|
|
98
102
|
writeValue(obj: any): void;
|
|
99
103
|
cropperDone(id: any): void;
|
|
100
104
|
static ɵfac: i0.ɵɵFactoryDeclaration<UiFileUploaderComponent, [{ optional: true; }, null, { optional: true; host: true; skipSelf: true; }, null]>;
|
|
101
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UiFileUploaderComponent, "ui-file-uploader", never, { "
|
|
105
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UiFileUploaderComponent, "ui-file-uploader", never, { "fileSize": { "alias": "fileSize"; "required": true; }; "maxFiles": { "alias": "maxFiles"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "crop": { "alias": "crop"; "required": false; }; "cropRounded": { "alias": "cropRounded"; "required": false; }; "cropMaxWidth": { "alias": "cropMaxWidth"; "required": false; }; "customFileMenu": { "alias": "customFileMenu"; "required": false; }; "addHint": { "alias": "addHint"; "required": false; }; "newFilePosition": { "alias": "newFilePosition"; "required": false; }; "templates": { "alias": "templates"; "required": false; }; "previewPosition": { "alias": "previewPosition"; "required": false; }; }, { "imageCropped": "imageCropped"; "fileEvent": "fileEvent"; }, never, never, false, never>;
|
|
102
106
|
}
|
|
@@ -2,22 +2,26 @@ import { EventEmitter, InjectionToken } from '@angular/core';
|
|
|
2
2
|
import { UploadFile, UploadInput } from 'ngx-uploader';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
+
export interface IUiFileSize {
|
|
6
|
+
name: string;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
limit?: 'fit' | 'maxWidth' | 'maxHeight';
|
|
10
|
+
}
|
|
5
11
|
export type IUiFileServiceMessages = 'cropInvalidFileType' | 'extensionNotAllowed' | 'fileAdded' | 'fileRemoved';
|
|
6
12
|
export interface IUiFileService {
|
|
7
13
|
getAuthHeader: () => {
|
|
8
14
|
[key: string]: string;
|
|
9
15
|
};
|
|
10
|
-
uploadUrl: string;
|
|
11
|
-
getMediaSrc: (size:
|
|
12
|
-
getPreviewUrl: (size:
|
|
13
|
-
addFileImgSrc: string;
|
|
16
|
+
uploadUrl: (size?: IUiFileSize) => string;
|
|
17
|
+
getMediaSrc: (size: IUiFileSize, data: any, options: any) => string;
|
|
18
|
+
getPreviewUrl: (size: IUiFileSize, data: any) => string;
|
|
19
|
+
addFileImgSrc: (size: IUiFileSize) => string;
|
|
14
20
|
getMimeType: (data: any) => string;
|
|
15
|
-
imageSizes:
|
|
16
|
-
[key: string]: [number, number];
|
|
17
|
-
};
|
|
21
|
+
imageSizes: IUiFileSize[];
|
|
18
22
|
concurrentUploads: number;
|
|
19
23
|
useRetinaSrc: boolean;
|
|
20
|
-
fileValidation?: (size:
|
|
24
|
+
fileValidation?: (size: IUiFileSize, file: UploadFile) => Promise<boolean>;
|
|
21
25
|
}
|
|
22
26
|
export declare const UI_FILESERVICE: InjectionToken<IUiFileService>;
|
|
23
27
|
export declare class UiFileService {
|