@bnsights/bbsf-controls 1.2.27 → 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 +13 -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 +35 -35
- package/fesm2022/bnsights-bbsf-controls.mjs.map +1 -1
- package/lib/Shared/Models/ControlOptionsBase.d.ts +46 -0
- package/lib/Shared/Models/FileUploadOptions.d.ts +14 -0
- package/lib/Shared/services/ControlUtility.d.ts +2 -1
- package/lib/Shared/services/validationErrorMassage.service.d.ts +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
BBSF Controls package is part of BBSF 3 packages. It has all the form controls that we use to build our application forms.
|
|
4
4
|
|
|
5
|
-
For more info please visit [BBSF Controls documenation](https://bbsfadmin.bnsights.com/controls) or [BBSF documentation](https://bnsightsprojects.visualstudio.com/BBSF%203/_wiki/wikis/BBSF-3.wiki/65/BBSF-Documentation)
|
|
6
|
-
|
|
7
|
-
## 🚀 NEW! Tree-Shakable Granular Modules (v2.0+)
|
|
8
|
-
|
|
9
|
-
The package now supports **true tree-shaking** through granular modules for optimal bundle size!
|
|
5
|
+
For more info please visit [BBSF Controls documenation](https://bbsfadmin.bnsights.com/controls) or [BBSF documentation](https://bnsightsprojects.visualstudio.com/BBSF%203/_wiki/wikis/BBSF-3.wiki/65/BBSF-Documentation)
|
|
6
|
+
|
|
7
|
+
## 🚀 NEW! Tree-Shakable Granular Modules (v2.0+)
|
|
8
|
+
|
|
9
|
+
The package now supports **true tree-shaking** through granular modules for optimal bundle size!
|
|
10
10
|
|
|
11
11
|
### 📦 Available Modules
|
|
12
12
|
|
|
@@ -400,6 +400,14 @@ If the issue persists, consider using a different HTML editor component that's c
|
|
|
400
400
|
|
|
401
401
|
## Change Log
|
|
402
402
|
|
|
403
|
+
## 1.2.28 / 23-06-2026
|
|
404
|
+
|
|
405
|
+
=====================
|
|
406
|
+
|
|
407
|
+
- Added optional `FileUploadOptions` overrides for validation error message labels.
|
|
408
|
+
- Supported host-provided localized labels for max file count, min file count, total size, file size, type tooltip, duplicate file, and required validation messages.
|
|
409
|
+
- Threaded file upload options through validation helpers and applied the duplicate-file override message.
|
|
410
|
+
|
|
403
411
|
## 1.2.27 / 22-06-2026
|
|
404
412
|
|
|
405
413
|
=====================
|
|
Binary file
|
|
Binary file
|
|
@@ -106,95 +106,95 @@ class ErrorMassageValidation {
|
|
|
106
106
|
control.setErrors({ minlength: true });
|
|
107
107
|
control.markAsTouched();
|
|
108
108
|
}
|
|
109
|
-
getErrorMassageValidation(error) {
|
|
109
|
+
getErrorMassageValidation(error, options) {
|
|
110
110
|
let result = '';
|
|
111
111
|
switch (error.key) {
|
|
112
112
|
case 'required':
|
|
113
|
-
result = this.utilityService.getResourceValue('RequiredValidationKey');
|
|
113
|
+
result = options?.requiredErrorMsg || this.utilityService.getResourceValue('RequiredValidationKey');
|
|
114
114
|
break;
|
|
115
115
|
case 'email':
|
|
116
|
-
result = this.utilityService.getResourceValue('EmailValidationKey');
|
|
116
|
+
result = options?.emailErrorMsg || this.utilityService.getResourceValue('EmailValidationKey');
|
|
117
117
|
break;
|
|
118
118
|
case 'EmailValidationKey':
|
|
119
|
-
result = this.utilityService.getResourceValue('EmailValidationKey');
|
|
119
|
+
result = options?.emailErrorMsg || this.utilityService.getResourceValue('EmailValidationKey');
|
|
120
120
|
break;
|
|
121
121
|
case 'URLValidationKey':
|
|
122
|
-
result = this.utilityService.getResourceValue('urlValidationError');
|
|
122
|
+
result = options?.urlErrorMsg || this.utilityService.getResourceValue('urlValidationError');
|
|
123
123
|
break;
|
|
124
124
|
case 'pattern':
|
|
125
|
-
result = this.utilityService.getResourceValue('NumberValidationKey');
|
|
125
|
+
result = options?.numberErrorMsg || this.utilityService.getResourceValue('NumberValidationKey');
|
|
126
126
|
break;
|
|
127
127
|
case 'maxlength':
|
|
128
|
-
result = `${this.utilityService.getResourceValue('MaxLenghtValidationKey')} ${error.value.requiredLength}`;
|
|
128
|
+
result = `${options?.maxLengthErrorMsg || this.utilityService.getResourceValue('MaxLenghtValidationKey')} ${error.value.requiredLength}`;
|
|
129
129
|
break;
|
|
130
130
|
case 'minlength':
|
|
131
|
-
result = `${this.utilityService.getResourceValue('MinLenghtValidationKey')} ${error.value.requiredLength}`;
|
|
131
|
+
result = `${options?.minLengthErrorMsg || this.utilityService.getResourceValue('MinLenghtValidationKey')} ${error.value.requiredLength}`;
|
|
132
132
|
break;
|
|
133
133
|
case 'min':
|
|
134
|
-
result = `${this.utilityService.getResourceValue('MinValueValidationKey')} ${error.value.min}`;
|
|
134
|
+
result = `${options?.minValueErrorMsg || this.utilityService.getResourceValue('MinValueValidationKey')} ${error.value.min}`;
|
|
135
135
|
break;
|
|
136
136
|
case 'max':
|
|
137
|
-
result = `${this.utilityService.getResourceValue('MaxValueValidationKey')} ${error.value.max}`;
|
|
137
|
+
result = `${options?.maxValueErrorMsg || this.utilityService.getResourceValue('MaxValueValidationKey')} ${error.value.max}`;
|
|
138
138
|
break;
|
|
139
139
|
case 'IntegerNumberValidationKey':
|
|
140
|
-
result = this.utilityService.getResourceValue('IntegerNumberValidationKey');
|
|
140
|
+
result = options?.integerNumberErrorMsg || this.utilityService.getResourceValue('IntegerNumberValidationKey');
|
|
141
141
|
break;
|
|
142
142
|
case 'PositiveNumberValidationKey':
|
|
143
|
-
result = this.utilityService.getResourceValue('PositiveNumberValidationKey');
|
|
143
|
+
result = options?.positiveNumberErrorMsg || this.utilityService.getResourceValue('PositiveNumberValidationKey');
|
|
144
144
|
break;
|
|
145
145
|
case 'validatePhoneNumber':
|
|
146
|
-
result = this.utilityService.getResourceValue('PhoneNumberValidationKey');
|
|
146
|
+
result = options?.phoneNumberErrorMsg || this.utilityService.getResourceValue('PhoneNumberValidationKey');
|
|
147
147
|
break;
|
|
148
148
|
case 'mask':
|
|
149
|
-
result = `${this.utilityService.getResourceValue('MaskValidationKey')} ${error.value.requiredMask}`;
|
|
149
|
+
result = `${options?.maskErrorMsg || this.utilityService.getResourceValue('MaskValidationKey')} ${error.value.requiredMask}`;
|
|
150
150
|
break;
|
|
151
151
|
case 'passwordComplexityHasNumber':
|
|
152
|
-
result = this.utilityService.getResourceValue('PasswordComplexityHasNumber');
|
|
152
|
+
result = options?.passwordHasNumberErrorMsg || this.utilityService.getResourceValue('PasswordComplexityHasNumber');
|
|
153
153
|
break;
|
|
154
154
|
case 'ArabicLetterOnly':
|
|
155
|
-
result = this.utilityService.getResourceValue('ArabicLetterOnly');
|
|
155
|
+
result = options?.arabicLetterOnlyErrorMsg || this.utilityService.getResourceValue('ArabicLetterOnly');
|
|
156
156
|
break;
|
|
157
157
|
case 'EnglishLetterOnly':
|
|
158
|
-
result = this.utilityService.getResourceValue('EnglishLetterOnly');
|
|
158
|
+
result = options?.englishLetterOnlyErrorMsg || this.utilityService.getResourceValue('EnglishLetterOnly');
|
|
159
159
|
break;
|
|
160
160
|
case 'ArabicIsRequiredAndOnly50CharactersEnglish':
|
|
161
|
-
result = this.utilityService.getResourceValue('VAL_ArabicIsRequiredAndOnly50CharactersEnglish');
|
|
161
|
+
result = options?.arabicRequiredAndEnglishMax50ErrorMsg || this.utilityService.getResourceValue('VAL_ArabicIsRequiredAndOnly50CharactersEnglish');
|
|
162
162
|
break;
|
|
163
163
|
case 'passwordComplexityHasCapitalLetter':
|
|
164
|
-
result = this.utilityService.getResourceValue('PasswordComplexityHasCapitalLetter');
|
|
164
|
+
result = options?.passwordHasCapitalLetterErrorMsg || this.utilityService.getResourceValue('PasswordComplexityHasCapitalLetter');
|
|
165
165
|
break;
|
|
166
166
|
case 'passwordComplexityHasSmallLetter':
|
|
167
|
-
result = this.utilityService.getResourceValue('PasswordComplexityHasSmallLetter');
|
|
167
|
+
result = options?.passwordHasSmallLetterErrorMsg || this.utilityService.getResourceValue('PasswordComplexityHasSmallLetter');
|
|
168
168
|
break;
|
|
169
169
|
case 'passwordComplexityHasSpecialLetter':
|
|
170
|
-
result = this.utilityService.getResourceValue('PasswordComplexityHasSpecialLetter');
|
|
170
|
+
result = options?.passwordHasSpecialLetterErrorMsg || this.utilityService.getResourceValue('PasswordComplexityHasSpecialLetter');
|
|
171
171
|
break;
|
|
172
172
|
case 'MaxWordCountValidationKey':
|
|
173
|
-
result = `${this.utilityService.getResourceValue('MaxWordCountValidationKey')} ${error.value}`;
|
|
173
|
+
result = `${options?.maxWordCountErrorMsg || this.utilityService.getResourceValue('MaxWordCountValidationKey')} ${error.value}`;
|
|
174
174
|
break;
|
|
175
175
|
case 'NewSelectionValidationKey':
|
|
176
|
-
result = this.utilityService.getResourceValue('NewSelectionValidationKey');
|
|
176
|
+
result = options?.newSelectionErrorMsg || this.utilityService.getResourceValue('NewSelectionValidationKey');
|
|
177
177
|
break;
|
|
178
178
|
case 'MaxFileCountValidationKey':
|
|
179
|
-
result = `${this.utilityService.getResourceValue('MaxFileCountValidationKey')} ${error.value}`;
|
|
179
|
+
result = `${options?.maxFileCountErrorMsg || this.utilityService.getResourceValue('MaxFileCountValidationKey')} ${error.value}`;
|
|
180
180
|
break;
|
|
181
181
|
case 'MinFileCountValidationKey':
|
|
182
|
-
result = `${this.utilityService.getResourceValue('MinFileCountValidationKey')} ${error.value}`;
|
|
182
|
+
result = `${options?.minFileCountErrorMsg || this.utilityService.getResourceValue('MinFileCountValidationKey')} ${error.value}`;
|
|
183
183
|
break;
|
|
184
184
|
case 'MaxSizeForAllFilesInMB':
|
|
185
|
-
result = `${this.utilityService.getResourceValue('MaxSizeForAllFilesInMB')} ${error.value}`;
|
|
185
|
+
result = `${options?.maxSizeTotalErrorMsg || this.utilityService.getResourceValue('MaxSizeForAllFilesInMB')} ${error.value}`;
|
|
186
186
|
break;
|
|
187
187
|
case 'FileMaxSizeInMB':
|
|
188
|
-
result = `${this.utilityService.getResourceValue('FileMaxSizeInMB')} ${error.value}`;
|
|
188
|
+
result = `${options?.maxFileSizeErrorMsg || this.utilityService.getResourceValue('FileMaxSizeInMB')} ${error.value}`;
|
|
189
189
|
break;
|
|
190
190
|
case 'ToolTipTypeError':
|
|
191
|
-
result = `${this.utilityService.getResourceValue('ToolTipTypeError')} ${error.value}`;
|
|
191
|
+
result = `${options?.toolTipTypeErrorMsg || this.utilityService.getResourceValue('ToolTipTypeError')} ${error.value}`;
|
|
192
192
|
break;
|
|
193
193
|
case 'InvalidEndDate':
|
|
194
|
-
result = this.utilityService.getResourceValue('InvalidEndDate');
|
|
194
|
+
result = options?.invalidEndDateErrorMsg || this.utilityService.getResourceValue('InvalidEndDate');
|
|
195
195
|
break;
|
|
196
196
|
case 'InvalidStartDate':
|
|
197
|
-
result = this.utilityService.getResourceValue('InvalidStartDate');
|
|
197
|
+
result = options?.invalidStartDateErrorMsg || this.utilityService.getResourceValue('InvalidStartDate');
|
|
198
198
|
break;
|
|
199
199
|
case 'DuplicateFileError':
|
|
200
200
|
result = error.value;
|
|
@@ -219,7 +219,7 @@ class ControlUtility {
|
|
|
219
219
|
this.controlValidationService = controlValidationService;
|
|
220
220
|
this.utilityService = utilityService;
|
|
221
221
|
}
|
|
222
|
-
getErrorValidation(ErrorsItem, customValidation) {
|
|
222
|
+
getErrorValidation(ErrorsItem, customValidation, options) {
|
|
223
223
|
let result = '';
|
|
224
224
|
ErrorsItem.forEach(element => {
|
|
225
225
|
if (element.key === 'customerError' && ErrorsItem.length === 1) {
|
|
@@ -235,7 +235,7 @@ class ControlUtility {
|
|
|
235
235
|
result = element.value;
|
|
236
236
|
}
|
|
237
237
|
else {
|
|
238
|
-
result = this.ErrorHandler.getErrorMassageValidation(element);
|
|
238
|
+
result = this.ErrorHandler.getErrorMassageValidation(element, options);
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
241
|
return result;
|
|
@@ -305,7 +305,7 @@ class ControlUtility {
|
|
|
305
305
|
// UtilityService.showGlobalError();
|
|
306
306
|
// this.scrollToGlobalErrorMassage()
|
|
307
307
|
// }
|
|
308
|
-
return this.getErrorValidation(ErrorList, options.customValidation);
|
|
308
|
+
return this.getErrorValidation(ErrorList, options.customValidation, options);
|
|
309
309
|
}
|
|
310
310
|
scrollToGlobalErrorMassage() {
|
|
311
311
|
let element = document.getElementById('errorId');
|
|
@@ -7755,7 +7755,7 @@ class FileUploadComponent {
|
|
|
7755
7755
|
const formControl = this.fileUploadFormControl;
|
|
7756
7756
|
const resourceValue = this.UtilityService.getResourceValue('DuplicateFileError');
|
|
7757
7757
|
// If resource value is the same as the key, it means the resource wasn't found
|
|
7758
|
-
const errorMessage = (resourceValue && resourceValue !== 'DuplicateFileError') ? resourceValue : 'File(s) already exist';
|
|
7758
|
+
const errorMessage = this.options?.duplicateFileErrorMsg || ((resourceValue && resourceValue !== 'DuplicateFileError') ? resourceValue : 'File(s) already exist');
|
|
7759
7759
|
const errorObj = {
|
|
7760
7760
|
DuplicateFileError: `${errorMessage}: ${duplicateFileNames}`
|
|
7761
7761
|
};
|
|
@@ -7794,7 +7794,7 @@ class FileUploadComponent {
|
|
|
7794
7794
|
//keep existing valid files, remove only extra ones
|
|
7795
7795
|
this.uploader.queue = this.uploader.queue.slice(0, max);
|
|
7796
7796
|
this.maxFilesReached = true;
|
|
7797
|
-
this.maxFilesValidationMsg = this.UtilityService.getResourceValue('MaxFileCountValidationKey') + max;
|
|
7797
|
+
this.maxFilesValidationMsg = (this.options.maxFileCountErrorMsg || this.UtilityService.getResourceValue('MaxFileCountValidationKey')) + max;
|
|
7798
7798
|
}
|
|
7799
7799
|
else {
|
|
7800
7800
|
this.maxFilesReached = false;
|