@bnsights/bbsf-controls 1.2.26 → 1.2.28
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 +21 -5
- package/bnsights-bbsf-controls-1.2.27.tgz +0 -0
- package/bnsights-bbsf-controls-1.2.28.tgz +0 -0
- package/fesm2022/bnsights-bbsf-controls.mjs +243 -136
- package/fesm2022/bnsights-bbsf-controls.mjs.map +1 -1
- package/lib/Shared/Models/ControlOptionsBase.d.ts +46 -0
- package/lib/Shared/Models/FileUploadCropperOptions.d.ts +18 -0
- package/lib/Shared/Models/FileUploadOptions.d.ts +17 -0
- package/lib/Shared/Models/index.d.ts +1 -0
- package/lib/Shared/services/ControlUtility.d.ts +2 -1
- package/lib/Shared/services/validationErrorMassage.service.d.ts +2 -1
- package/lib/controls/FileUpload/FileUpload.component.d.ts +11 -2
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -43,5 +43,51 @@ export declare class ControlOptionsBase {
|
|
|
43
43
|
isReadonly: boolean;
|
|
44
44
|
/** Set output function for repeater */
|
|
45
45
|
outputFunction: Function;
|
|
46
|
+
/** Overrides the 'RequiredValidationKey' label (required error). */
|
|
47
|
+
requiredErrorMsg?: string;
|
|
48
|
+
/** Overrides the 'EmailValidationKey' label (email errors: 'email' / 'EmailValidationKey'). */
|
|
49
|
+
emailErrorMsg?: string;
|
|
50
|
+
/** Overrides the 'urlValidationError' label (URL error). */
|
|
51
|
+
urlErrorMsg?: string;
|
|
52
|
+
/** Overrides the 'NumberValidationKey' label (numbers-only 'pattern' error). */
|
|
53
|
+
numberErrorMsg?: string;
|
|
54
|
+
/** Overrides the 'MaxLenghtValidationKey' label (maxlength error). */
|
|
55
|
+
maxLengthErrorMsg?: string;
|
|
56
|
+
/** Overrides the 'MinLenghtValidationKey' label (minlength error). */
|
|
57
|
+
minLengthErrorMsg?: string;
|
|
58
|
+
/** Overrides the 'MinValueValidationKey' label (min value error). */
|
|
59
|
+
minValueErrorMsg?: string;
|
|
60
|
+
/** Overrides the 'MaxValueValidationKey' label (max value error). */
|
|
61
|
+
maxValueErrorMsg?: string;
|
|
62
|
+
/** Overrides the 'IntegerNumberValidationKey' label (integer-only error). */
|
|
63
|
+
integerNumberErrorMsg?: string;
|
|
64
|
+
/** Overrides the 'PositiveNumberValidationKey' label (positive-number error). */
|
|
65
|
+
positiveNumberErrorMsg?: string;
|
|
66
|
+
/** Overrides the 'PhoneNumberValidationKey' label (phone validity error). */
|
|
67
|
+
phoneNumberErrorMsg?: string;
|
|
68
|
+
/** Overrides the 'MaskValidationKey' label (mask error). */
|
|
69
|
+
maskErrorMsg?: string;
|
|
70
|
+
/** Overrides the 'PasswordComplexityHasNumber' label. */
|
|
71
|
+
passwordHasNumberErrorMsg?: string;
|
|
72
|
+
/** Overrides the 'PasswordComplexityHasCapitalLetter' label. */
|
|
73
|
+
passwordHasCapitalLetterErrorMsg?: string;
|
|
74
|
+
/** Overrides the 'PasswordComplexityHasSmallLetter' label. */
|
|
75
|
+
passwordHasSmallLetterErrorMsg?: string;
|
|
76
|
+
/** Overrides the 'PasswordComplexityHasSpecialLetter' label. */
|
|
77
|
+
passwordHasSpecialLetterErrorMsg?: string;
|
|
78
|
+
/** Overrides the 'ArabicLetterOnly' label. */
|
|
79
|
+
arabicLetterOnlyErrorMsg?: string;
|
|
80
|
+
/** Overrides the 'EnglishLetterOnly' label. */
|
|
81
|
+
englishLetterOnlyErrorMsg?: string;
|
|
82
|
+
/** Overrides the 'VAL_ArabicIsRequiredAndOnly50CharactersEnglish' label. */
|
|
83
|
+
arabicRequiredAndEnglishMax50ErrorMsg?: string;
|
|
84
|
+
/** Overrides the 'MaxWordCountValidationKey' label (max word count error). */
|
|
85
|
+
maxWordCountErrorMsg?: string;
|
|
86
|
+
/** Overrides the 'NewSelectionValidationKey' label (must-select-from-list error). */
|
|
87
|
+
newSelectionErrorMsg?: string;
|
|
88
|
+
/** Overrides the 'InvalidStartDate' label (date-range start error). */
|
|
89
|
+
invalidStartDateErrorMsg?: string;
|
|
90
|
+
/** Overrides the 'InvalidEndDate' label (date-range end error). */
|
|
91
|
+
invalidEndDateErrorMsg?: string;
|
|
46
92
|
get displayValue(): any;
|
|
47
93
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class FileUploadCropperPreset {
|
|
2
|
+
aspectRatio: number;
|
|
3
|
+
cropperStaticWidth: number;
|
|
4
|
+
cropperStaticHeight: number;
|
|
5
|
+
constructor(aspectRatio: number, cropperStaticWidth: number, cropperStaticHeight: number);
|
|
6
|
+
}
|
|
7
|
+
export declare class FileUploadCropperOptions {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
orientationControlName?: string;
|
|
10
|
+
defaultIsHorizontal: boolean;
|
|
11
|
+
modalSize: 'sm' | 'lg' | 'xl';
|
|
12
|
+
backdrop: boolean | 'static';
|
|
13
|
+
maintainAspectRatio: boolean;
|
|
14
|
+
onlyScaleDown: boolean;
|
|
15
|
+
cancelBehavior: 'clear' | 'keep';
|
|
16
|
+
horizontal: FileUploadCropperPreset;
|
|
17
|
+
vertical: FileUploadCropperPreset;
|
|
18
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FileType } from '../Enums/FileType';
|
|
2
2
|
import { ControlOptionsBase } from './ControlOptionsBase';
|
|
3
|
+
import { FileUploadCropperOptions } from './FileUploadCropperOptions';
|
|
3
4
|
export declare class FileUploadOptions extends ControlOptionsBase {
|
|
4
5
|
value: any;
|
|
5
6
|
/** Ability to set FileInput required */
|
|
@@ -32,4 +33,20 @@ export declare class FileUploadOptions extends ControlOptionsBase {
|
|
|
32
33
|
maxSumFilesSizeLbl?: string;
|
|
33
34
|
/** Label before the max file count; overrides "MaxFileCountValidationKey" text when set. */
|
|
34
35
|
maxFileCountLbl?: string;
|
|
36
|
+
/** Optional image cropper configuration for single-file, non-async uploads. */
|
|
37
|
+
cropperOptions?: FileUploadCropperOptions;
|
|
38
|
+
/** Overrides the 'MaxFileCountValidationKey' resource label in the max-file-count error message. */
|
|
39
|
+
maxFileCountErrorMsg?: string;
|
|
40
|
+
/** Overrides the 'MinFileCountValidationKey' resource label in the min-file-count error message. */
|
|
41
|
+
minFileCountErrorMsg?: string;
|
|
42
|
+
/** Overrides the 'MaxSizeForAllFilesInMB' resource label in the total-size error message. */
|
|
43
|
+
maxSizeTotalErrorMsg?: string;
|
|
44
|
+
/** Overrides the 'FileMaxSizeInMB' resource label in the per-file max-size error message. */
|
|
45
|
+
maxFileSizeErrorMsg?: string;
|
|
46
|
+
/** Overrides the 'ToolTipTypeError' resource label in the invalid-file-type error message. */
|
|
47
|
+
toolTipTypeErrorMsg?: string;
|
|
48
|
+
/** Overrides the hardcoded 'File(s) already exist' fallback in the duplicate-file error message. */
|
|
49
|
+
duplicateFileErrorMsg?: string;
|
|
50
|
+
/** Overrides the 'RequiredValidationKey' resource label in the required error message. */
|
|
51
|
+
requiredErrorMsg?: string;
|
|
35
52
|
}
|
|
@@ -19,6 +19,7 @@ export * from './EditPersonalImage';
|
|
|
19
19
|
export * from './EnglishArabicDTO';
|
|
20
20
|
export * from './FileDTO';
|
|
21
21
|
export * from './FileOptions';
|
|
22
|
+
export * from './FileUploadCropperOptions';
|
|
22
23
|
export * from './FileUploadModel';
|
|
23
24
|
export * from './FileUploadOptions';
|
|
24
25
|
export * from './filter-options';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CustomValidation } from '../Models/CustomValidation';
|
|
2
|
+
import { FileUploadOptions } from '../Models/FileUploadOptions';
|
|
2
3
|
import { ErrorMassageValidation } from './validationErrorMassage.service';
|
|
3
4
|
import { ValidationErrors, ValidatorFn, AbstractControl } from '@angular/forms';
|
|
4
5
|
import { ControlValidationService, UtilityService } from '@bnsights/bbsf-utilities/ui';
|
|
@@ -8,7 +9,7 @@ export declare class ControlUtility {
|
|
|
8
9
|
private controlValidationService;
|
|
9
10
|
private utilityService;
|
|
10
11
|
constructor(ErrorHandler: ErrorMassageValidation, controlValidationService: ControlValidationService, utilityService: UtilityService);
|
|
11
|
-
getErrorValidation(ErrorsItem: any[], customValidation?: CustomValidation): string;
|
|
12
|
+
getErrorValidation(ErrorsItem: any[], customValidation?: CustomValidation, options?: FileUploadOptions): string;
|
|
12
13
|
patternValidator(regex: RegExp, error: ValidationErrors): ValidatorFn;
|
|
13
14
|
patchControlValue(originalValue: any, PatchFunction: any, PatchPath: any): void;
|
|
14
15
|
arabicValidator(error: ValidationErrors): ValidatorFn;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ControlContainer } from '@angular/forms';
|
|
2
2
|
import { UtilityService } from '@bnsights/bbsf-utilities/ui';
|
|
3
|
+
import { FileUploadOptions } from '../Models/FileUploadOptions';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class ErrorMassageValidation {
|
|
5
6
|
private controlContainer;
|
|
@@ -8,7 +9,7 @@ export declare class ErrorMassageValidation {
|
|
|
8
9
|
constructor(controlContainer: ControlContainer, utilityService: UtilityService);
|
|
9
10
|
url: string;
|
|
10
11
|
static showerror(FormControlName: string): void;
|
|
11
|
-
getErrorMassageValidation(error: any): string;
|
|
12
|
+
getErrorMassageValidation(error: any, options?: FileUploadOptions): string;
|
|
12
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<ErrorMassageValidation, [{ optional: true; }, null]>;
|
|
13
14
|
static ɵprov: i0.ɵɵInjectableDeclaration<ErrorMassageValidation>;
|
|
14
15
|
}
|
|
@@ -2,6 +2,7 @@ import { OnInit, AfterViewInit, ElementRef, EventEmitter, OnDestroy } from '@ang
|
|
|
2
2
|
import { FormGroup, AbstractControl, ControlContainer, FormGroupDirective } from '@angular/forms';
|
|
3
3
|
import { FileUploader, FileLikeObject, FileItem } from 'ng2-file-upload';
|
|
4
4
|
import { ControlValidationService, UtilityService } from '@bnsights/bbsf-utilities/ui';
|
|
5
|
+
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
|
5
6
|
import { FileDTO, FileUploadModel, FileUploadOptions, MultipleFileUploadModel } from '../../Shared/Models';
|
|
6
7
|
import { ControlUtility, FileUploadService, GlobalSettings } from '../../Shared/services';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
@@ -13,6 +14,7 @@ export declare class FileUploadComponent implements OnInit, AfterViewInit, OnDes
|
|
|
13
14
|
private controlValidationService;
|
|
14
15
|
private globalSettings;
|
|
15
16
|
private fileUploadService;
|
|
17
|
+
private modalService;
|
|
16
18
|
static controlContainerStatic: any;
|
|
17
19
|
fileInput: ElementRef;
|
|
18
20
|
isSubmitted: boolean;
|
|
@@ -41,7 +43,7 @@ export declare class FileUploadComponent implements OnInit, AfterViewInit, OnDes
|
|
|
41
43
|
maxFilesValidationMsg: string;
|
|
42
44
|
headerLabel: string;
|
|
43
45
|
dropHeaderLabel: string;
|
|
44
|
-
constructor(controlContainer: ControlContainer, MultipleFileUploadControlHost: FormGroupDirective, controlUtility: ControlUtility, UtilityService: UtilityService, controlValidationService: ControlValidationService, globalSettings: GlobalSettings, fileUploadService: FileUploadService);
|
|
46
|
+
constructor(controlContainer: ControlContainer, MultipleFileUploadControlHost: FormGroupDirective, controlUtility: ControlUtility, UtilityService: UtilityService, controlValidationService: ControlValidationService, globalSettings: GlobalSettings, fileUploadService: FileUploadService, modalService: NgbModal);
|
|
45
47
|
ngOnInit(): void;
|
|
46
48
|
ngAfterViewInit(): void;
|
|
47
49
|
resetError: () => void;
|
|
@@ -50,6 +52,13 @@ export declare class FileUploadComponent implements OnInit, AfterViewInit, OnDes
|
|
|
50
52
|
fileOverAnother(event: any): void;
|
|
51
53
|
isHideInput(): boolean;
|
|
52
54
|
onFileChange(): void;
|
|
55
|
+
private applySingleFileUpload;
|
|
56
|
+
private shouldCropAddedFile;
|
|
57
|
+
private resolveCropperOptions;
|
|
58
|
+
private resolveCropperOrientation;
|
|
59
|
+
private readCroppedFile;
|
|
60
|
+
private commitSingleFileUpload;
|
|
61
|
+
private clearSingleFileUpload;
|
|
53
62
|
removeFromControlValue(item: FileItem): void;
|
|
54
63
|
removeRequiredValidation: () => void;
|
|
55
64
|
addRequiredValidation: () => void;
|
|
@@ -66,6 +75,6 @@ export declare class FileUploadComponent implements OnInit, AfterViewInit, OnDes
|
|
|
66
75
|
private isFileTypeAccepted;
|
|
67
76
|
private setValuePreservingErrors;
|
|
68
77
|
private emitPatchedChange;
|
|
69
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, [{ optional: true; }, null, null, null, null, null, null]>;
|
|
78
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, [{ optional: true; }, null, null, null, null, null, null, null]>;
|
|
70
79
|
static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "BBSF-FileUpload", never, { "group": { "alias": "group"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "OnChange": "OnChange"; "isUploadComplete": "isUploadComplete"; }, never, never, true, never>;
|
|
71
80
|
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from './lib/Shared/Models/CustomValidation';
|
|
|
58
58
|
export * from './lib/Shared/Models/DatePickerOptions';
|
|
59
59
|
export * from './lib/Shared/Models/TextBoxOptions';
|
|
60
60
|
export * from './lib/Shared/Models/FileUploadOptions';
|
|
61
|
+
export * from './lib/Shared/Models/FileUploadCropperOptions';
|
|
61
62
|
export * from './lib/Shared/Models/FileUploadModel';
|
|
62
63
|
export * from './lib/Shared/Models/MultipleFileUploadModel';
|
|
63
64
|
export * from './lib/Shared/Models/MultiLingualTextBoxOptions';
|