@tft/crispr-forms 13.0.0 → 13.0.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/README.md +9 -69
- package/esm2020/lib/material/image-upload-field/image-upload-field.component.mjs +60 -23
- package/esm2020/lib/models/file-upload-field.config.mjs +1 -1
- package/esm2020/lib/models/image-upload-field.config.mjs +1 -1
- package/fesm2015/tft-crispr-forms.mjs +63 -24
- package/fesm2015/tft-crispr-forms.mjs.map +1 -1
- package/fesm2020/tft-crispr-forms.mjs +61 -23
- package/fesm2020/tft-crispr-forms.mjs.map +1 -1
- package/lib/material/image-upload-field/image-upload-field.component.d.ts +9 -2
- package/lib/models/file-upload-field.config.d.ts +1 -1
- package/lib/models/image-upload-field.config.d.ts +7 -1
- package/package.json +3 -4
- package/tft-crispr-forms-13.0.4.tgz +0 -0
- package/tft-crispr-forms-13.0.0.tgz +0 -0
|
@@ -33,9 +33,15 @@ export declare class ImageUploadFieldComponent extends ImageUploadFieldMixin imp
|
|
|
33
33
|
private cdr;
|
|
34
34
|
onChange: () => void;
|
|
35
35
|
defaultConfig: Partial<ImageUploadFieldConfig>;
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* The url mapped from initial input value, consumers can us mapInputValueToUrl in config to transform their input value into a src url for the image element
|
|
38
|
+
*/
|
|
37
39
|
private inputImageFileSubject;
|
|
38
|
-
inputImageFile$: Observable<
|
|
40
|
+
inputImageFile$: Observable<File>;
|
|
41
|
+
/**
|
|
42
|
+
* the compression progress
|
|
43
|
+
*/
|
|
44
|
+
progress: number | undefined;
|
|
39
45
|
compressedFile$: Observable<File>;
|
|
40
46
|
compressedImageUrlString$: Observable<string | null>;
|
|
41
47
|
imageSrcUrl$: Observable<string | null>;
|
|
@@ -60,4 +66,5 @@ export declare class ImageUploadFieldModule {
|
|
|
60
66
|
static ɵinj: i0.ɵɵInjectorDeclaration<ImageUploadFieldModule>;
|
|
61
67
|
}
|
|
62
68
|
export declare function maxFileSizeValidator(maxFileSize: number): ValidatorFn;
|
|
69
|
+
export declare function allowedFileExtValidator(allowedFileExtensions: string[], onlyAllowFiles?: boolean): ValidatorFn;
|
|
63
70
|
export {};
|
|
@@ -4,7 +4,7 @@ import type { ImageUploadFieldComponent } from '../material/image-upload-field';
|
|
|
4
4
|
import { CrisprControlConfig, ControlType, ButtonType, MatFieldProperties } from '../models';
|
|
5
5
|
export declare type FileUploadFieldConfig = CrisprControlConfig & MatFieldProperties & {
|
|
6
6
|
controlType: ControlType.FILE_UPLOAD;
|
|
7
|
-
label
|
|
7
|
+
label: string;
|
|
8
8
|
filesChanged?: (parentGroup: FormGroup, files: FileList) => void;
|
|
9
9
|
allowMultipleFiles?: boolean;
|
|
10
10
|
showClearFilesButton?: boolean;
|
|
@@ -2,7 +2,7 @@ import { FormGroup } from '@angular/forms';
|
|
|
2
2
|
import { CrisprControlConfig, ControlType, ButtonType, MatFieldProperties } from '../models';
|
|
3
3
|
export declare type ImageUploadFieldConfig = CrisprControlConfig & MatFieldProperties & {
|
|
4
4
|
controlType: ControlType.IMAGE_UPLOAD;
|
|
5
|
-
label
|
|
5
|
+
label: string;
|
|
6
6
|
filesChanged?: (parentGroup: FormGroup, file: File) => void;
|
|
7
7
|
/**
|
|
8
8
|
* The file types to accept. The onus is on the consuming developer to limit these to file types compatible with usage.
|
|
@@ -16,6 +16,12 @@ export declare type ImageUploadFieldConfig = CrisprControlConfig & MatFieldPrope
|
|
|
16
16
|
clearFilesButtonText?: string;
|
|
17
17
|
resetFilesButtonText?: string;
|
|
18
18
|
dropZoneText?: string;
|
|
19
|
+
/**
|
|
20
|
+
* If the input value of the control is not a string of the src
|
|
21
|
+
* url to the image, this function allows consumers to map their
|
|
22
|
+
* input value into one
|
|
23
|
+
*/
|
|
24
|
+
mapInputValueToUrl?: (inputValue: unknown) => string;
|
|
19
25
|
/**
|
|
20
26
|
* Should the field compress the image after loading it
|
|
21
27
|
* @default false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tft/crispr-forms",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.4",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^13.0.0",
|
|
6
6
|
"@angular/forms": "^13.0.0",
|
|
@@ -9,12 +9,11 @@
|
|
|
9
9
|
"@angular/cdk": "^13.0.0",
|
|
10
10
|
"@tft/form-validation-handler": "^13.0.0",
|
|
11
11
|
"@angular/material-moment-adapter": "^13.0.0",
|
|
12
|
-
"
|
|
12
|
+
"browser-image-compression": "^1.0.0",
|
|
13
13
|
"moment": "^2.24.0",
|
|
14
14
|
"rxjs": "^7.0.0",
|
|
15
15
|
"@angular/platform-browser-dynamic": "13.2.1",
|
|
16
|
-
"@angular/platform-browser": "13.2.1"
|
|
17
|
-
"browser-image-compression": "~1.0.0"
|
|
16
|
+
"@angular/platform-browser": "13.2.1"
|
|
18
17
|
},
|
|
19
18
|
"dependencies": {
|
|
20
19
|
"tslib": "^2.0.0"
|
|
Binary file
|
|
Binary file
|