@bnsights/bbsf-controls 1.0.32 → 1.0.33
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 +4 -4
- package/bnsights-bbsf-controls-1.0.33.tgz +0 -0
- package/bnsights-bbsf-controls.metadata.json +1 -1
- package/bundles/bnsights-bbsf-controls.umd.js +356 -78
- package/bundles/bnsights-bbsf-controls.umd.js.map +1 -1
- package/esm2015/lib/Shared/Models/MultiLingualTextAreaOptions.js +1 -1
- package/esm2015/lib/Shared/Models/MultilingualTextBoxOptions.js +1 -1
- package/esm2015/lib/Shared/Models/RepeaterOptions.js +1 -2
- package/esm2015/lib/Shared/Models/TextAreaOptions.js +1 -1
- package/esm2015/lib/Shared/Models/TextBoxOptions.js +1 -1
- package/esm2015/lib/Shared/Models/datePickerOptions.js +3 -1
- package/esm2015/lib/Shared/config/environment.js +2 -2
- package/esm2015/lib/Shared/services/ControlUtility.js +24 -1
- package/esm2015/lib/Shared/services/GlobalSettings.service.js +9 -1
- package/esm2015/lib/Shared/services/validationErrorMassage.service.js +16 -1
- package/esm2015/lib/controls/AutocompleteTextBox/AutocompleteTextBox.component.js +1 -2
- package/esm2015/lib/controls/DateTimePicker/DateTimePicker.component.js +49 -3
- package/esm2015/lib/controls/FileUplaod/FileUplaod.component.js +1 -3
- package/esm2015/lib/controls/Form/Form.component.js +2 -18
- package/esm2015/lib/controls/ImageUpload/ImageUpload.component.js +7 -4
- package/esm2015/lib/controls/MultiLingualTextArea/MultiLingualTextArea.component.js +79 -8
- package/esm2015/lib/controls/MultiLingualTextBox/MultiLingualTextBox.component.js +79 -16
- package/esm2015/lib/controls/Paging/Paging.component.js +1 -3
- package/esm2015/lib/controls/TextArea/TextArea.component.js +43 -4
- package/esm2015/lib/controls/TextBox/TextBox.component.js +49 -19
- package/esm2015/lib/controls/bbsf-controls.module.js +1 -3
- package/fesm2015/bnsights-bbsf-controls.js +350 -74
- package/fesm2015/bnsights-bbsf-controls.js.map +1 -1
- package/lib/Shared/Models/MultiLingualTextAreaOptions.d.ts +1 -0
- package/lib/Shared/Models/MultilingualTextBoxOptions.d.ts +1 -0
- package/lib/Shared/Models/TextAreaOptions.d.ts +1 -0
- package/lib/Shared/Models/TextBoxOptions.d.ts +1 -0
- package/lib/Shared/Models/datePickerOptions.d.ts +2 -0
- package/lib/Shared/services/ControlUtility.d.ts +1 -0
- package/lib/Shared/services/GlobalSettings.service.d.ts +4 -0
- package/lib/controls/DateTimePicker/DateTimePicker.component.d.ts +9 -0
- package/lib/controls/MultiLingualTextArea/MultiLingualTextArea.component.d.ts +13 -2
- package/lib/controls/MultiLingualTextBox/MultiLingualTextBox.component.d.ts +13 -2
- package/lib/controls/TextArea/TextArea.component.d.ts +7 -1
- package/lib/controls/TextBox/TextBox.component.d.ts +8 -3
- package/package.json +1 -2
- package/bnsights-bbsf-controls-1.0.32.tgz +0 -0
|
@@ -45,7 +45,6 @@ import ArLocale from '@fullcalendar/core/locales/ar';
|
|
|
45
45
|
import { TypeaheadModule } from 'ngx-bootstrap/typeahead';
|
|
46
46
|
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
47
47
|
import { AngularEditorModule } from '@kolkov/angular-editor';
|
|
48
|
-
import { AutocompleteLibModule } from 'angular-ng-autocomplete';
|
|
49
48
|
import { InlineSVGModule } from 'ng-inline-svg';
|
|
50
49
|
import Swal from 'sweetalert2';
|
|
51
50
|
import { SweetAlert2Module } from '@sweetalert2/ngx-sweetalert2';
|
|
@@ -107,6 +106,12 @@ class ErrorMassageValidation {
|
|
|
107
106
|
case "max":
|
|
108
107
|
result = this.utilityService.getResourceValue("MaxValueValidationKey") + " " + error.value.max;
|
|
109
108
|
break;
|
|
109
|
+
case "IntegerNumberValidationKey":
|
|
110
|
+
result = this.utilityService.getResourceValue("IntegerNumberValidationKey");
|
|
111
|
+
break;
|
|
112
|
+
case "PositiveNumberValidationKey":
|
|
113
|
+
result = this.utilityService.getResourceValue("PositiveNumberValidationKey");
|
|
114
|
+
break;
|
|
110
115
|
case "validatePhoneNumber":
|
|
111
116
|
result = this.utilityService.getResourceValue("PhoneNumberValidationKey");
|
|
112
117
|
break;
|
|
@@ -122,6 +127,9 @@ class ErrorMassageValidation {
|
|
|
122
127
|
case "EnglishLetterOnly":
|
|
123
128
|
result = this.utilityService.getResourceValue("EnglishLetterOnly");
|
|
124
129
|
break;
|
|
130
|
+
case "ArabicIsRequiredAndOnly50CharactersEnglish":
|
|
131
|
+
result = this.utilityService.getResourceValue("ArabicIsRequiredAndOnly50CharactersEnglish");
|
|
132
|
+
break;
|
|
125
133
|
case "PasswordComplexityHasCapitalLetter":
|
|
126
134
|
result = this.utilityService.getResourceValue("PasswordComplexityHasCapitalLetter");
|
|
127
135
|
break;
|
|
@@ -152,6 +160,12 @@ class ErrorMassageValidation {
|
|
|
152
160
|
case "ToolTipTypeError":
|
|
153
161
|
result = this.utilityService.getResourceValue("ToolTipTypeError") + " " + error.value;
|
|
154
162
|
break;
|
|
163
|
+
case "InvalidEndDate":
|
|
164
|
+
result = this.utilityService.getResourceValue("InvalidEndDate");
|
|
165
|
+
break;
|
|
166
|
+
case "InvalidStartDate":
|
|
167
|
+
result = this.utilityService.getResourceValue("InvalidStartDate");
|
|
168
|
+
break;
|
|
155
169
|
default:
|
|
156
170
|
break;
|
|
157
171
|
}
|
|
@@ -212,6 +226,29 @@ class ControlUtility {
|
|
|
212
226
|
return valid ? null : error;
|
|
213
227
|
};
|
|
214
228
|
}
|
|
229
|
+
arabicValidator(error) {
|
|
230
|
+
return (control) => {
|
|
231
|
+
if (control.value.match('[\u0600-\u06FF]')) {
|
|
232
|
+
if (control.value.match('[A-Za-z]') != null) {
|
|
233
|
+
//FOUND ENGLISH CHARS
|
|
234
|
+
var length = control.value.replace(/\W/g, '').replace(/[0-9]/g, '').length;
|
|
235
|
+
if (length > 50) {
|
|
236
|
+
return error;
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
//NO ENGLISH CHARACTERS AT ALL
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
return error;
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
}
|
|
215
252
|
getInputType(type) {
|
|
216
253
|
return InputType[type];
|
|
217
254
|
}
|
|
@@ -356,9 +393,37 @@ class DateInputComponent {
|
|
|
356
393
|
this.markAllAsTouched = false;
|
|
357
394
|
this.validationRules = [];
|
|
358
395
|
this.validationRulesasync = [];
|
|
396
|
+
this.comparedControl = null;
|
|
397
|
+
this.dateError = false;
|
|
359
398
|
this.resetError = () => {
|
|
360
399
|
this.controlValidationService.RemoveGlobalError();
|
|
361
400
|
};
|
|
401
|
+
this.checkIfEndDateAfterStartDate = () => {
|
|
402
|
+
if (!this.comparedControl.value || !this.group.get(this.options.Name).value) {
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
if (new Date(this.comparedControl.value) < new Date(this.group.get(this.options.Name).value)) {
|
|
406
|
+
this.comparedControl.setErrors(null);
|
|
407
|
+
return null;
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
this.comparedControl.setErrors(null);
|
|
411
|
+
return { InvalidEndDate: true };
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
this.checkIfStartDateBeForEndDate = () => {
|
|
415
|
+
if (!this.comparedControl.value || !this.group.get(this.options.Name).value) {
|
|
416
|
+
return null;
|
|
417
|
+
}
|
|
418
|
+
if (new Date(this.comparedControl.value) < new Date(this.group.get(this.options.Name).value)) {
|
|
419
|
+
this.group.get(this.options.Name).setErrors(null);
|
|
420
|
+
return null;
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
this.group.get(this.options.Name).setErrors(null);
|
|
424
|
+
return { InvalidStartDate: true };
|
|
425
|
+
}
|
|
426
|
+
};
|
|
362
427
|
//External Method
|
|
363
428
|
this.RemoveRequiredValidation = () => {
|
|
364
429
|
this.controlUtility.RemoveRequiredValidation(this.DatePickerFormControl, this.validationRules, this.options);
|
|
@@ -400,11 +465,17 @@ class DateInputComponent {
|
|
|
400
465
|
}
|
|
401
466
|
if (this.options.LabelKey != null && this.options.LabelKey != "")
|
|
402
467
|
this.options.LabelValue = this.UtilityService.getResourceValue(this.options.LabelKey);
|
|
403
|
-
this.DatePickerFormControl.setValidators(this.validationRules);
|
|
404
|
-
this.DatePickerFormControl.setAsyncValidators(this.validationRulesasync);
|
|
405
468
|
if (this.options.IsDisabled) {
|
|
406
469
|
this.DatePickerFormControl.disable();
|
|
407
470
|
}
|
|
471
|
+
if (this.options.StartControlToCompareWith) {
|
|
472
|
+
if (this.group.get(this.options.StartControlToCompareWith)) {
|
|
473
|
+
this.comparedControl = this.group.get(this.options.StartControlToCompareWith);
|
|
474
|
+
this.subscribeDateChanges();
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
this.DatePickerFormControl.setValidators(this.validationRules);
|
|
478
|
+
this.DatePickerFormControl.setAsyncValidators(this.validationRulesasync);
|
|
408
479
|
this.DateInputControlHost.ngSubmit.subscribe((value) => {
|
|
409
480
|
this.group.markAllAsTouched();
|
|
410
481
|
this.markAllAsTouched = true;
|
|
@@ -458,6 +529,18 @@ class DateInputComponent {
|
|
|
458
529
|
this.onChangeService.ChangeValue(this.options.Name);
|
|
459
530
|
this.OnChange.emit(DateValue);
|
|
460
531
|
}
|
|
532
|
+
subscribeDateChanges() {
|
|
533
|
+
const startDateChanges = this.comparedControl.valueChanges;
|
|
534
|
+
const endDateChanges = this.group.get(this.options.Name).valueChanges;
|
|
535
|
+
startDateChanges.subscribe(start => {
|
|
536
|
+
this.comparedControl.addValidators(this.checkIfStartDateBeForEndDate);
|
|
537
|
+
this.comparedControl.updateValueAndValidity();
|
|
538
|
+
});
|
|
539
|
+
endDateChanges.subscribe(end => {
|
|
540
|
+
this.DatePickerFormControl.addValidators(this.checkIfEndDateAfterStartDate);
|
|
541
|
+
this.DatePickerFormControl.updateValueAndValidity();
|
|
542
|
+
});
|
|
543
|
+
}
|
|
461
544
|
}
|
|
462
545
|
DateInputComponent.controlContainerstatic = null;
|
|
463
546
|
DateInputComponent.decorators = [
|
|
@@ -523,6 +606,14 @@ class GlobalSettings {
|
|
|
523
606
|
/**To Set LanguageMode To MultipleLanguageText */
|
|
524
607
|
this.LanguageMode = LanguageMode.Both_Languages_are_visible;
|
|
525
608
|
this.HideAstericsWhenRequired = false;
|
|
609
|
+
//**To set maxlength warning message when equals limit
|
|
610
|
+
this.MaxLengthWarningLimit = 10;
|
|
611
|
+
//**Set any texbox maxlength default value
|
|
612
|
+
this.MaxLengthTextBox = 255;
|
|
613
|
+
//**Set any textArea maxlength default value
|
|
614
|
+
this.MaxLengthTextArea = 1000;
|
|
615
|
+
//**Set default image source
|
|
616
|
+
this.DefaultImageSrc = "./src/assets/images/uploadimg.png";
|
|
526
617
|
}
|
|
527
618
|
}
|
|
528
619
|
GlobalSettings.ɵprov = i0.ɵɵdefineInjectable({ factory: function GlobalSettings_Factory() { return new GlobalSettings(); }, token: GlobalSettings, providedIn: "root" });
|
|
@@ -740,7 +831,6 @@ class FileUploadComponent {
|
|
|
740
831
|
this.uploader.queue = [];
|
|
741
832
|
return;
|
|
742
833
|
}
|
|
743
|
-
debugger;
|
|
744
834
|
let reader = new FileReader();
|
|
745
835
|
let fileObject = file.rawFile;
|
|
746
836
|
reader.readAsDataURL(fileObject);
|
|
@@ -775,7 +865,6 @@ class FileUploadComponent {
|
|
|
775
865
|
}
|
|
776
866
|
}
|
|
777
867
|
removeFromControlValue(item) {
|
|
778
|
-
debugger;
|
|
779
868
|
if (this.options.IsMultipleFile == false) {
|
|
780
869
|
this.fileUploadModel = null;
|
|
781
870
|
if (this.options.IsRequired == true) {
|
|
@@ -878,6 +967,16 @@ class MultiLingualTextBoxComponent {
|
|
|
878
967
|
this.markAllAsTouched = false;
|
|
879
968
|
this.ArabicLetterOnly = "";
|
|
880
969
|
this.EnglishLetterOnly = "";
|
|
970
|
+
//For Show warning message of max length limit
|
|
971
|
+
this.minCharsLimit = -1; //To disable chars limit feature by default
|
|
972
|
+
this.englishCurrentCharsCount = 0;
|
|
973
|
+
this.arabicCurrentCharsCount = 0;
|
|
974
|
+
this.showEnglishCharsLimitMsg = false;
|
|
975
|
+
this.showArabicCharsLimitMsg = false;
|
|
976
|
+
this.hasEnglishCharsLimitValidationError = false;
|
|
977
|
+
this.hasArabicCharsLimitValidationError = false;
|
|
978
|
+
this.englishMaxLimitWarningMsg = "";
|
|
979
|
+
this.arabicMaxLimitWarningMsg = "";
|
|
881
980
|
//External Method
|
|
882
981
|
this.RemoveRequiredValidation = () => {
|
|
883
982
|
this.controlUtility.RemoveRequiredValidation(this.ArabicFormControl, this.EnglishValidationRules, this.options);
|
|
@@ -907,7 +1006,7 @@ class MultiLingualTextBoxComponent {
|
|
|
907
1006
|
this.CurrentLanguage = translate.currentLang != undefined ? translate.currentLang : translate.defaultLang;
|
|
908
1007
|
}
|
|
909
1008
|
getCustomErrorsMassages() {
|
|
910
|
-
this.ArabicLetterOnly = this.UtilityService.getResourceValue("
|
|
1009
|
+
this.ArabicLetterOnly = this.UtilityService.getResourceValue("ArabicIsRequiredAndOnly50CharactersEnglish");
|
|
911
1010
|
this.EnglishLetterOnly = this.UtilityService.getResourceValue("EnglishLetterOnly");
|
|
912
1011
|
}
|
|
913
1012
|
ngOnInit() {
|
|
@@ -932,6 +1031,8 @@ class MultiLingualTextBoxComponent {
|
|
|
932
1031
|
this.options.LanguageMode = this.globalSettings.LanguageMode;
|
|
933
1032
|
if (!this.options.MultiControlPlacementType)
|
|
934
1033
|
this.options.MultiControlPlacementType = this.globalSettings.MultiControlPlacementType;
|
|
1034
|
+
if (!this.options.MaxLength)
|
|
1035
|
+
this.options.MaxLength = this.globalSettings.MaxLengthTextBox;
|
|
935
1036
|
if (this.options.ArabicLabelKey != null && this.options.ArabicLabelKey != "")
|
|
936
1037
|
this.options.ArabicLabelValue = this.UtilityService.getResourceValue(this.options.ArabicLabelKey);
|
|
937
1038
|
if (this.options.EnglishLabelKey != null && this.options.EnglishLabelKey != "")
|
|
@@ -944,14 +1045,6 @@ class MultiLingualTextBoxComponent {
|
|
|
944
1045
|
this.ArabicValidationRules.push(Validation.functionBody);
|
|
945
1046
|
}
|
|
946
1047
|
}
|
|
947
|
-
if (this.options.CustomValidation.length > 0) {
|
|
948
|
-
let Validations = this.options.CustomValidation;
|
|
949
|
-
for (let index = 0; index < Validations.length; index++) {
|
|
950
|
-
const Validation = Validations[index];
|
|
951
|
-
this.EnglishValidationRules.push(Validation.functionBody);
|
|
952
|
-
this.ArabicValidationRules.push(Validation.functionBody);
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
1048
|
if (this.options.MinLength > 0) {
|
|
956
1049
|
this.ArabicValidationRules.push(Validators.minLength(this.options.MinLength));
|
|
957
1050
|
this.EnglishValidationRules.push(Validators.minLength(this.options.MinLength));
|
|
@@ -959,10 +1052,13 @@ class MultiLingualTextBoxComponent {
|
|
|
959
1052
|
if (this.options.MaxLength > 0) {
|
|
960
1053
|
this.EnglishValidationRules.push(Validators.maxLength(this.options.MaxLength));
|
|
961
1054
|
this.ArabicValidationRules.push(Validators.maxLength(this.options.MaxLength));
|
|
1055
|
+
if (!this.options.MaxLengthWarningLimit)
|
|
1056
|
+
this.options.MaxLengthWarningLimit = this.globalSettings.MaxLengthWarningLimit;
|
|
1057
|
+
this.minCharsLimit = this.options.MaxLength - this.options.MaxLengthWarningLimit;
|
|
962
1058
|
}
|
|
963
1059
|
this.showInputUsingLanguageMode();
|
|
964
1060
|
this.ArabicValidationRules.push(Validators.compose([
|
|
965
|
-
this.controlUtility.
|
|
1061
|
+
this.controlUtility.arabicValidator({ ArabicIsRequiredAndOnly50CharactersEnglish: this.ArabicLetterOnly }),
|
|
966
1062
|
]));
|
|
967
1063
|
this.EnglishValidationRules.push(Validators.compose([
|
|
968
1064
|
this.controlUtility.patternValidator(/^[\x00-\x7F]*$/, { EnglishLetterOnly: this.EnglishLetterOnly }),
|
|
@@ -1007,6 +1103,27 @@ class MultiLingualTextBoxComponent {
|
|
|
1007
1103
|
englishValue = this.EnglishFormControl.value;
|
|
1008
1104
|
}
|
|
1009
1105
|
}
|
|
1106
|
+
//Check for maxlength limit count
|
|
1107
|
+
//MaxLength should be gretaer than or equals chars limit so that minCharsLimit would be >= 0
|
|
1108
|
+
if (this.options.MaxLength && this.minCharsLimit >= 0) {
|
|
1109
|
+
this.englishCurrentCharsCount = this.EnglishFormControl.value.length;
|
|
1110
|
+
if (this.englishCurrentCharsCount >= this.minCharsLimit) {
|
|
1111
|
+
this.showEnglishCharsLimitMsg = true;
|
|
1112
|
+
this.hasEnglishCharsLimitValidationError = true;
|
|
1113
|
+
if (this.englishCurrentCharsCount == this.options.MaxLength)
|
|
1114
|
+
this.englishCharsLimitMsgClass = "danger";
|
|
1115
|
+
else
|
|
1116
|
+
this.englishCharsLimitMsgClass = "warning";
|
|
1117
|
+
}
|
|
1118
|
+
else {
|
|
1119
|
+
this.showEnglishCharsLimitMsg = false;
|
|
1120
|
+
this.hasEnglishCharsLimitValidationError = false;
|
|
1121
|
+
}
|
|
1122
|
+
var max = this.options.MaxLength;
|
|
1123
|
+
var current = this.englishCurrentCharsCount;
|
|
1124
|
+
var resource = this.UtilityService.getResourceValue("MaxLengthLimitWarning");
|
|
1125
|
+
this.englishMaxLimitWarningMsg = eval('`' + resource + '`');
|
|
1126
|
+
}
|
|
1010
1127
|
}
|
|
1011
1128
|
if (this.ArabicFormControl.value == "") {
|
|
1012
1129
|
this.ArabicWordCountArray = 0;
|
|
@@ -1028,6 +1145,27 @@ class MultiLingualTextBoxComponent {
|
|
|
1028
1145
|
arabicValue = this.ArabicFormControl.value;
|
|
1029
1146
|
}
|
|
1030
1147
|
}
|
|
1148
|
+
//Check for maxlength limit count
|
|
1149
|
+
//MaxLength should be gretaer than or equals chars limit so that minCharsLimit would be >= 0
|
|
1150
|
+
if (this.options.MaxLength && this.minCharsLimit >= 0) {
|
|
1151
|
+
this.arabicCurrentCharsCount = this.ArabicFormControl.value.length;
|
|
1152
|
+
if (this.arabicCurrentCharsCount >= this.minCharsLimit) {
|
|
1153
|
+
this.showArabicCharsLimitMsg = true;
|
|
1154
|
+
this.hasArabicCharsLimitValidationError = true;
|
|
1155
|
+
if (this.arabicCurrentCharsCount == this.options.MaxLength)
|
|
1156
|
+
this.arabicCharsLimitMsgClass = "danger";
|
|
1157
|
+
else
|
|
1158
|
+
this.arabicCharsLimitMsgClass = "warning";
|
|
1159
|
+
}
|
|
1160
|
+
else {
|
|
1161
|
+
this.showArabicCharsLimitMsg = false;
|
|
1162
|
+
this.hasArabicCharsLimitValidationError = false;
|
|
1163
|
+
}
|
|
1164
|
+
var max = this.options.MaxLength;
|
|
1165
|
+
var current = this.arabicCurrentCharsCount;
|
|
1166
|
+
var resource = this.UtilityService.getResourceValue("MaxLengthLimitWarning");
|
|
1167
|
+
this.arabicMaxLimitWarningMsg = eval('`' + resource + '`');
|
|
1168
|
+
}
|
|
1031
1169
|
}
|
|
1032
1170
|
let mulitLangModel = new EnglishArabicDTO();
|
|
1033
1171
|
mulitLangModel.Arabic = arabicValue;
|
|
@@ -1147,18 +1285,32 @@ class MultiLingualTextBoxComponent {
|
|
|
1147
1285
|
this.ArabicFormControl.updateValueAndValidity();
|
|
1148
1286
|
this.EnglishFormControl.updateValueAndValidity();
|
|
1149
1287
|
}
|
|
1150
|
-
|
|
1151
|
-
this.IsShowArabicWordCount =
|
|
1288
|
+
onArabicFocus(isFocus) {
|
|
1289
|
+
this.IsShowArabicWordCount = isFocus;
|
|
1290
|
+
//onFocus
|
|
1291
|
+
if (isFocus) {
|
|
1292
|
+
if (this.hasArabicCharsLimitValidationError) //check if there was previous validation error
|
|
1293
|
+
this.showArabicCharsLimitMsg = true;
|
|
1294
|
+
}
|
|
1295
|
+
else //onFocusOut
|
|
1296
|
+
this.showArabicCharsLimitMsg = false;
|
|
1152
1297
|
}
|
|
1153
|
-
|
|
1154
|
-
this.IsShowEnglishWordCount =
|
|
1298
|
+
onEnglishFocus(isFocus) {
|
|
1299
|
+
this.IsShowEnglishWordCount = isFocus;
|
|
1300
|
+
//onFocus
|
|
1301
|
+
if (isFocus) {
|
|
1302
|
+
if (this.hasEnglishCharsLimitValidationError) //check if there was previous validation error
|
|
1303
|
+
this.showEnglishCharsLimitMsg = true;
|
|
1304
|
+
}
|
|
1305
|
+
else //onFocusOut
|
|
1306
|
+
this.showEnglishCharsLimitMsg = false;
|
|
1155
1307
|
}
|
|
1156
1308
|
}
|
|
1157
1309
|
MultiLingualTextBoxComponent.controlContainerstatic = null;
|
|
1158
1310
|
MultiLingualTextBoxComponent.decorators = [
|
|
1159
1311
|
{ type: Component, args: [{
|
|
1160
1312
|
selector: 'BBSF-MultiLingualTextBox',
|
|
1161
|
-
template: "<div class=\"b-control b-multilangual-textbox\">\r\n <div class=\"form-group validate is-invalid\" [formGroup]=\"group\">\r\n\r\n <div class=\"form-group row\" [formGroup]=\"MultiLanguagegroup\">\r\n <div [ngClass]=\"(options.MultiControlPlacementType==1)?'col-md-12':'col-md-6'\">\r\n <div class=\"row\" *ngIf=\"ShowEnglishTextBox\">\r\n <label class=\"b-label col-form-label col-sm-12\"\r\n [ngClass]=\"(options.ViewType==1)?'col-md-9':'col-md-3'\" [hidden]=\"options.IsHideEnglishLabel\">\r\n {{(options.EnglishLabelValue!=null&&options.EnglishLabelValue!=\"\")?options.EnglishLabelValue:options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group align-items-center\">\r\n <div class=\"svg svg-icon-grey\" [ngClass]=\"(options.IconPositionEN==1)?'left-icon':'right-icon'\" *ngIf=\"options.Icon!=null\">\r\n <span [inlineSVG]=\"options.Icon\"></span>\r\n </div>\r\n <input class=\"form-control bnsights-control\"\r\n (focus)=\"
|
|
1313
|
+
template: "<div class=\"b-control b-multilangual-textbox\">\r\n <div class=\"form-group validate is-invalid\" [formGroup]=\"group\">\r\n\r\n <div class=\"form-group row\" [formGroup]=\"MultiLanguagegroup\">\r\n <div [ngClass]=\"(options.MultiControlPlacementType==1)?'col-md-12':'col-md-6'\">\r\n <div class=\"row\" *ngIf=\"ShowEnglishTextBox\">\r\n <label class=\"b-label col-form-label col-sm-12\"\r\n [ngClass]=\"(options.ViewType==1)?'col-md-9':'col-md-3'\" [hidden]=\"options.IsHideEnglishLabel\">\r\n {{(options.EnglishLabelValue!=null&&options.EnglishLabelValue!=\"\")?options.EnglishLabelValue:options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group align-items-center\">\r\n <div class=\"svg svg-icon-grey\" [ngClass]=\"(options.IconPositionEN==1)?'left-icon':'right-icon'\" *ngIf=\"options.Icon!=null\">\r\n <span [inlineSVG]=\"options.Icon\"></span>\r\n </div>\r\n <input class=\"form-control bnsights-control\"\r\n (focus)=\"onEnglishFocus(true)\" (focusout)=\"onEnglishFocus(false)\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"English\"\r\n [hidden]=\"options.IsHideEnglishFields\" maxlength=\"{{options.MaxLength}}\" minlength=\"{{options.MinLength}}\"\r\n [class.is-invalid]=\"EnglishFormControl.invalid && EnglishFormControl.touched\"\r\n placeholder=\"{{options.EnglishPlaceholder}}\" (change)=\"trimControlValue('En')\"\r\n (keyup)=\"onTextChange()\"\r\n (keydown)=\"EnglishWordCountArray>options.MaxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #userinputEnglish>\r\n <div class=\"input-group-append\" [hidden]=\"options.IsHideEnglishFields\" *ngIf=\"options.EnableCopyToClipboard\">\r\n <span class=\"input-group-text\" (click)=\"copyInputMessage(userinputEnglish)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"text-muted font-weight-500 word-count float-end\" *ngIf=\"options.MaxWordCount>0&&IsShowEnglishWordCount\">{{EnglishWordCount}}/{{options.MaxWordCount}}</div>\r\n <div class=\"text-danger Required-text\" *ngIf=\"(EnglishFormControl.invalid && EnglishFormControl.touched)\">\r\n {{getErrorValidation(EnglishFormControl.errors|keyvalue)}}\r\n </div>\r\n <div *ngIf=\"showEnglishCharsLimitMsg\">\r\n <span class=\"badge b-character-warning float-end\" [ngClass]=\"{'badge-light-warning': englishCharsLimitMsgClass === 'warning', 'badge-light-danger' : englishCharsLimitMsgClass === 'danger' }\">\r\n {{englishMaxLimitWarningMsg}}\r\n </span>\r\n </div>\r\n <div class=\"control-desc\" *ngIf=\"(options.LabelDescription!=null&&options.LabelDescription!='') ||(options.EnglishLabelDescription!=null&&options.EnglishLabelDescription!='')\">\r\n {{(options.EnglishLabelDescription!=null&&options.EnglishLabelDescription!=\"\")?options.EnglishLabelDescription:options.LabelDescription}}\r\n </div>\r\n <!-- <div *ngIf=\"EnglishFormControl.valid\">{{resetError()}}</div> -->\r\n <div *ngIf=\"group.valid\">{{resetError()}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div [ngClass]=\"(options.MultiControlPlacementType==1)?'col-md-12':'col-md-6'\">\r\n <div class=\"row\" *ngIf=\"ShowArabicTextBox\">\r\n <label class=\"b-label col-form-label col-sm-12\"\r\n [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\" [hidden]=\"options.IsHideArabicLabel\">\r\n {{(options.ArabicLabelValue!=null&&options.ArabicLabelValue!=\"\")?options.ArabicLabelValue:options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n <div class=\" col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group align-items-center\">\r\n <div class=\"svg svg-icon-grey\" [ngClass]=\"(options.IconPositionEN==1)?'right-icon':'left-icon'\" *ngIf=\"options.Icon!=null\">\r\n <span [inlineSVG]=\"options.Icon\"></span>\r\n </div>\r\n <input class=\"form-control bnsights-control\" dir=\"rtl\"\r\n (focus)=\"onArabicFocus(true)\" (focusout)=\"onArabicFocus(false)\"\r\n [hidden]=\"options.IsHideArabicFields\" aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n formControlName=\"Arabic\" maxlength=\"{{options.MaxLength}}\" minlength=\"{{options.MinLength}}\"\r\n [class.is-invalid]=\"ArabicFormControl.invalid && ArabicFormControl.touched\"\r\n placeholder=\"{{options.ArabicPlaceholder}}\" (keyup)=\"onTextChange()\"\r\n (keydown)=\"ArabicWordCountArray>options.MaxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n (change)=\"trimControlValue('Ar')\" #userinputArabic>\r\n\r\n <div class=\"input-group-append\" [hidden]=\"options.IsHideArabicFields\" *ngIf=\"options.EnableCopyToClipboard\">\r\n <span class=\"input-group-text\" (click)=\"copyInputMessage(userinputArabic)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"text-muted font-weight-500 float-end word-count\" *ngIf=\"options.MaxWordCount>0&&IsShowArabicWordCount\">{{ArabicWordCount}}/{{options.MaxWordCount}}</div>\r\n <div class=\"text-danger Required-text\" *ngIf=\"(ArabicFormControl.invalid && ArabicFormControl.touched)\">\r\n {{getErrorValidation(ArabicFormControl.errors|keyvalue)}}\r\n </div>\r\n <div *ngIf=\"showArabicCharsLimitMsg\">\r\n <span class=\"badge b-character-warning float-end\" [ngClass]=\"{'badge-light-warning': arabicCharsLimitMsgClass === 'warning', 'badge-light-danger' : arabicCharsLimitMsgClass === 'danger' }\">\r\n {{arabicMaxLimitWarningMsg}}\r\n </span>\r\n </div>\r\n <div class=\"control-desc\" *ngIf=\"(options.LabelDescription!=null&&options.LabelDescription!='')||(options.ArabicLabelDescription!=null&&options.ArabicLabelDescription!='')\">\r\n {{(options.ArabicLabelDescription!=null&&options.ArabicLabelDescription!=\"\")?options.ArabicLabelDescription:options.LabelDescription}}\r\n </div>\r\n <!-- <div *ngIf=\"ArabicFormControl.valid\">{{resetError()}}</div> -->\r\n <div *ngIf=\"group.valid\">{{resetError()}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n",
|
|
1162
1314
|
styles: [".example-form{min-width:150px;max-width:500px;width:100%}.example-full-width{width:100%}\n"]
|
|
1163
1315
|
},] }
|
|
1164
1316
|
];
|
|
@@ -1192,6 +1344,12 @@ class TextAreaComponent {
|
|
|
1192
1344
|
this.markAllAsTouched = false;
|
|
1193
1345
|
this.validationRules = [];
|
|
1194
1346
|
this.validationRulesasync = [];
|
|
1347
|
+
//For Show warning message of max length limit
|
|
1348
|
+
this.currentCharsCount = 0;
|
|
1349
|
+
this.showCharsLimitMsg = false;
|
|
1350
|
+
this.hasCharsLimitValidationError = false;
|
|
1351
|
+
this.minCharsLimit = -1; //To disable chars limit feature by default
|
|
1352
|
+
this.maxLimitWarningMsg = "";
|
|
1195
1353
|
this.resetError = () => {
|
|
1196
1354
|
this.controlValidationService.RemoveGlobalError();
|
|
1197
1355
|
};
|
|
@@ -1221,6 +1379,8 @@ class TextAreaComponent {
|
|
|
1221
1379
|
this.controlValidationService.isCreatedBefor = false;
|
|
1222
1380
|
this.group.addControl(this.options.Name, new FormControl(''));
|
|
1223
1381
|
this.TextAreaFormControl = this.group.controls[this.options.Name]; // new FormControl('',validationRules);
|
|
1382
|
+
if (!this.options.MaxLength)
|
|
1383
|
+
this.options.MaxLength = this.globalSettings.MaxLengthTextArea;
|
|
1224
1384
|
if (!this.options.ViewType)
|
|
1225
1385
|
this.options.ViewType = this.globalSettings.ViewType;
|
|
1226
1386
|
if (this.options.LabelKey != null && this.options.LabelKey != "")
|
|
@@ -1238,6 +1398,9 @@ class TextAreaComponent {
|
|
|
1238
1398
|
}
|
|
1239
1399
|
if (this.options.MaxLength > 0) {
|
|
1240
1400
|
this.validationRules.push(Validators.maxLength(this.options.MaxLength));
|
|
1401
|
+
if (!this.options.MaxLengthWarningLimit)
|
|
1402
|
+
this.options.MaxLengthWarningLimit = this.globalSettings.MaxLengthWarningLimit;
|
|
1403
|
+
this.minCharsLimit = this.options.MaxLength - this.options.MaxLengthWarningLimit;
|
|
1241
1404
|
}
|
|
1242
1405
|
if (this.options.IsRequired) {
|
|
1243
1406
|
this.validationRules.push(Validators.required);
|
|
@@ -1294,17 +1457,45 @@ class TextAreaComponent {
|
|
|
1294
1457
|
}
|
|
1295
1458
|
}
|
|
1296
1459
|
}
|
|
1460
|
+
//Check for maxlength limit count
|
|
1461
|
+
//MaxLength should be gretaer than or equals chars limit so that minCharsLimit would be >= 0
|
|
1462
|
+
if (this.options.MaxLength && this.minCharsLimit >= 0) {
|
|
1463
|
+
this.currentCharsCount = this.TextAreaFormControl.value.length;
|
|
1464
|
+
if (this.currentCharsCount >= this.minCharsLimit) {
|
|
1465
|
+
this.showCharsLimitMsg = true;
|
|
1466
|
+
this.hasCharsLimitValidationError = true;
|
|
1467
|
+
if (this.currentCharsCount == this.options.MaxLength)
|
|
1468
|
+
this.charsLimitMsgClass = "danger";
|
|
1469
|
+
else
|
|
1470
|
+
this.charsLimitMsgClass = "warning";
|
|
1471
|
+
}
|
|
1472
|
+
else {
|
|
1473
|
+
this.showCharsLimitMsg = false;
|
|
1474
|
+
this.hasCharsLimitValidationError = false;
|
|
1475
|
+
}
|
|
1476
|
+
var max = this.options.MaxLength;
|
|
1477
|
+
var current = this.currentCharsCount;
|
|
1478
|
+
var resource = this.UtilityService.getResourceValue("MaxLengthLimitWarning");
|
|
1479
|
+
this.maxLimitWarningMsg = eval('`' + resource + '`');
|
|
1480
|
+
}
|
|
1297
1481
|
this.OnChange.emit(this.TextAreaFormControl.value);
|
|
1298
1482
|
}
|
|
1299
|
-
|
|
1300
|
-
this.IsShowWordCount =
|
|
1483
|
+
onFocus(isFocus) {
|
|
1484
|
+
this.IsShowWordCount = isFocus;
|
|
1485
|
+
//onFocus
|
|
1486
|
+
if (isFocus) {
|
|
1487
|
+
if (this.hasCharsLimitValidationError) //check if there was previous validation error
|
|
1488
|
+
this.showCharsLimitMsg = true;
|
|
1489
|
+
}
|
|
1490
|
+
else //onFocusOut
|
|
1491
|
+
this.showCharsLimitMsg = false;
|
|
1301
1492
|
}
|
|
1302
1493
|
}
|
|
1303
1494
|
TextAreaComponent.controlContainerstatic = null;
|
|
1304
1495
|
TextAreaComponent.decorators = [
|
|
1305
1496
|
{ type: Component, args: [{
|
|
1306
1497
|
selector: 'BBSF-TextArea',
|
|
1307
|
-
template: "<div class=\"b-control b-textarea\">\r\n <div class=\"form-group row validate is-invalid\" [formGroup]=\"group\">\r\n <label class=\"b-label col-form-label col-sm-12 \" [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\"\r\n *ngIf=\"!options.HideLabel\">\r\n {{options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger Required-text\"\r\n aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'': ((options.HideLabel)?'col-md-12':'col-md-9')\">\r\n <div class=\"input-group\">\r\n <textarea class=\"form-control bnsights-control {{options.ExtraClasses}}\"\r\n (focus)=\"
|
|
1498
|
+
template: "<div class=\"b-control b-textarea\">\r\n <div class=\"form-group row validate is-invalid\" [formGroup]=\"group\">\r\n <label class=\"b-label col-form-label col-sm-12 \" [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\"\r\n *ngIf=\"!options.HideLabel\">\r\n {{options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger Required-text\"\r\n aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'': ((options.HideLabel)?'col-md-12':'col-md-9')\">\r\n <div class=\"input-group\">\r\n <textarea class=\"form-control bnsights-control {{options.ExtraClasses}}\"\r\n (focus)=\"onFocus(true)\" (focusout)=\"onFocus(false)\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\" aria-describedby=\"email-error\"\r\n aria-invalid=\"true\" formControlName=\"{{options.Name}}\"\r\n [class.is-invalid]=\"TextAreaFormControl.invalid && TextAreaFormControl.touched\"\r\n placeholder=\"{{options.Placeholder}}\" id=\"{{options.Name}}\" autocomplete=\"{{options.AutoComplete}}\"\r\n (change)=\"trimControlValue()\" rows=\"{{options.Rows}}\" (keyup)=\"onTextChange()\" cols=\"{{options.Cols}}\"\r\n maxlength=\"{{options.MaxLength}}\" minlength=\"{{options.MinLength}}\"\r\n (keydown)=\"WordCountArray>options.MaxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #TextAreainput></textarea>\r\n <div class=\"input-group-append\" *ngIf=\"options.EnableCopyToClipboard\">\r\n <span class=\"input-group-text\" (click)=\"copyInputMessage(TextAreainput)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>\r\n </div>\r\n <div class=\"text-muted font-weight-500 word-count float-end\" *ngIf=\"options.MaxWordCount>0&&IsShowWordCount\">{{WordCount}}/{{options.MaxWordCount}} words</div>\r\n </div>\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(TextAreaFormControl.invalid && TextAreaFormControl.touched)\">\r\n {{getErrorValidation(TextAreaFormControl.errors|keyvalue)}}\r\n </div>\r\n <div *ngIf=\"showCharsLimitMsg\">\r\n <span class=\"badge b-character-warning float-end\" [ngClass]=\"{'badge-light-warning': charsLimitMsgClass === 'warning', 'badge-light-danger' : charsLimitMsgClass === 'danger' }\">\r\n {{maxLimitWarningMsg}}\r\n </span>\r\n </div>\r\n <div class=\"control-desc text-dark\" *ngIf=\"options.LabelDescription!=null\">{{options.LabelDescription}}</div>\r\n <!-- <div *ngIf=\"TextAreaFormControl.valid\">{{resetError()}}</div> -->\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n\r\n </div>\r\n </div>\r\n</div>\r\n",
|
|
1308
1499
|
styles: [".example-form{min-width:150px;max-width:500px;width:100%}.example-full-width{width:100%}.flip_V{transform:scaleY(-1)}\n"]
|
|
1309
1500
|
},] }
|
|
1310
1501
|
];
|
|
@@ -1347,6 +1538,16 @@ class MultiLingualTextAreaComponent {
|
|
|
1347
1538
|
this.markAllAsTouched = false;
|
|
1348
1539
|
this.ArabicLetterOnly = "";
|
|
1349
1540
|
this.EnglishLetterOnly = "";
|
|
1541
|
+
//For Show warning message of max length limit
|
|
1542
|
+
this.minCharsLimit = -1; //To disable chars limit feature by default
|
|
1543
|
+
this.englishCurrentCharsCount = 0;
|
|
1544
|
+
this.arabicCurrentCharsCount = 0;
|
|
1545
|
+
this.showEnglishCharsLimitMsg = false;
|
|
1546
|
+
this.showArabicCharsLimitMsg = false;
|
|
1547
|
+
this.hasEnglishCharsLimitValidationError = false;
|
|
1548
|
+
this.hasArabicCharsLimitValidationError = false;
|
|
1549
|
+
this.englishMaxLimitWarningMsg = "";
|
|
1550
|
+
this.arabicMaxLimitWarningMsg = "";
|
|
1350
1551
|
this.resetError = () => {
|
|
1351
1552
|
this.controlValidationService.RemoveGlobalError();
|
|
1352
1553
|
};
|
|
@@ -1378,7 +1579,7 @@ class MultiLingualTextAreaComponent {
|
|
|
1378
1579
|
MultiLingualTextAreaComponent.controlContainerstatic = this.controlContainer;
|
|
1379
1580
|
}
|
|
1380
1581
|
getCustomErrorsMassages() {
|
|
1381
|
-
this.ArabicLetterOnly = this.UtilityService.getResourceValue("
|
|
1582
|
+
this.ArabicLetterOnly = this.UtilityService.getResourceValue("ArabicIsRequiredAndOnly50CharactersEnglish");
|
|
1382
1583
|
this.EnglishLetterOnly = this.UtilityService.getResourceValue("EnglishLetterOnly");
|
|
1383
1584
|
}
|
|
1384
1585
|
ngOnInit() {
|
|
@@ -1395,6 +1596,8 @@ class MultiLingualTextAreaComponent {
|
|
|
1395
1596
|
this.options.LanguageMode = this.globalSettings.LanguageMode;
|
|
1396
1597
|
if (!this.options.MultiControlPlacementType)
|
|
1397
1598
|
this.options.MultiControlPlacementType = this.globalSettings.MultiControlPlacementType;
|
|
1599
|
+
if (!this.options.MaxLength)
|
|
1600
|
+
this.options.MaxLength = this.globalSettings.MaxLengthTextArea;
|
|
1398
1601
|
if (this.options.ArabicLabelKey != null && this.options.ArabicLabelKey != "")
|
|
1399
1602
|
this.options.ArabicLabelValue = this.UtilityService.getResourceValue(this.options.ArabicLabelKey);
|
|
1400
1603
|
if (this.options.EnglishLabelKey != null && this.options.EnglishLabelKey != "")
|
|
@@ -1435,10 +1638,13 @@ class MultiLingualTextAreaComponent {
|
|
|
1435
1638
|
if (this.options.MaxLength > 0) {
|
|
1436
1639
|
this.EnglishValidationRules.push(Validators.maxLength(this.options.MaxLength));
|
|
1437
1640
|
this.ArabicValidationRules.push(Validators.maxLength(this.options.MaxLength));
|
|
1641
|
+
if (!this.options.MaxLengthWarningLimit)
|
|
1642
|
+
this.options.MaxLengthWarningLimit = this.globalSettings.MaxLengthWarningLimit;
|
|
1643
|
+
this.minCharsLimit = this.options.MaxLength - this.options.MaxLengthWarningLimit;
|
|
1438
1644
|
}
|
|
1439
1645
|
this.showInputUsingLanguageMode();
|
|
1440
1646
|
this.ArabicValidationRules.push(Validators.compose([
|
|
1441
|
-
this.controlUtility.
|
|
1647
|
+
this.controlUtility.arabicValidator({ ArabicIsRequiredAndOnly50CharactersEnglish: this.ArabicLetterOnly }),
|
|
1442
1648
|
]));
|
|
1443
1649
|
this.EnglishValidationRules.push(Validators.compose([
|
|
1444
1650
|
this.controlUtility.patternValidator(/^[\x00-\x7F]*$/, { EnglishLetterOnly: this.EnglishLetterOnly }),
|
|
@@ -1482,6 +1688,27 @@ class MultiLingualTextAreaComponent {
|
|
|
1482
1688
|
englishValue = this.EnglishTextAreaFormControl.value;
|
|
1483
1689
|
}
|
|
1484
1690
|
}
|
|
1691
|
+
//Check for maxlength limit count
|
|
1692
|
+
//MaxLength should be gretaer than or equals chars limit so that minCharsLimit would be >= 0
|
|
1693
|
+
if (this.options.MaxLength && this.minCharsLimit >= 0) {
|
|
1694
|
+
this.englishCurrentCharsCount = this.EnglishTextAreaFormControl.value.length;
|
|
1695
|
+
if (this.englishCurrentCharsCount >= this.minCharsLimit) {
|
|
1696
|
+
this.showEnglishCharsLimitMsg = true;
|
|
1697
|
+
this.hasEnglishCharsLimitValidationError = true;
|
|
1698
|
+
if (this.englishCurrentCharsCount == this.options.MaxLength)
|
|
1699
|
+
this.englishCharsLimitMsgClass = "danger";
|
|
1700
|
+
else
|
|
1701
|
+
this.englishCharsLimitMsgClass = "warning";
|
|
1702
|
+
}
|
|
1703
|
+
else {
|
|
1704
|
+
this.showEnglishCharsLimitMsg = false;
|
|
1705
|
+
this.hasEnglishCharsLimitValidationError = false;
|
|
1706
|
+
}
|
|
1707
|
+
var max = this.options.MaxLength;
|
|
1708
|
+
var current = this.englishCurrentCharsCount;
|
|
1709
|
+
var resource = this.UtilityService.getResourceValue("MaxLengthLimitWarning");
|
|
1710
|
+
this.englishMaxLimitWarningMsg = eval('`' + resource + '`');
|
|
1711
|
+
}
|
|
1485
1712
|
}
|
|
1486
1713
|
if (this.ArabicTextAreaFormControl.value == "") {
|
|
1487
1714
|
this.ArabicWordCountArray = 0;
|
|
@@ -1503,6 +1730,27 @@ class MultiLingualTextAreaComponent {
|
|
|
1503
1730
|
arabicValue = this.ArabicTextAreaFormControl.value;
|
|
1504
1731
|
}
|
|
1505
1732
|
}
|
|
1733
|
+
//Check for maxlength limit count
|
|
1734
|
+
//MaxLength should be gretaer than or equals chars limit so that minCharsLimit would be >= 0
|
|
1735
|
+
if (this.options.MaxLength && this.minCharsLimit >= 0) {
|
|
1736
|
+
this.arabicCurrentCharsCount = this.ArabicTextAreaFormControl.value.length;
|
|
1737
|
+
if (this.arabicCurrentCharsCount >= this.minCharsLimit) {
|
|
1738
|
+
this.showArabicCharsLimitMsg = true;
|
|
1739
|
+
this.hasArabicCharsLimitValidationError = true;
|
|
1740
|
+
if (this.arabicCurrentCharsCount == this.options.MaxLength)
|
|
1741
|
+
this.arabicCharsLimitMsgClass = "danger";
|
|
1742
|
+
else
|
|
1743
|
+
this.arabicCharsLimitMsgClass = "warning";
|
|
1744
|
+
}
|
|
1745
|
+
else {
|
|
1746
|
+
this.showArabicCharsLimitMsg = false;
|
|
1747
|
+
this.hasArabicCharsLimitValidationError = false;
|
|
1748
|
+
}
|
|
1749
|
+
var max = this.options.MaxLength;
|
|
1750
|
+
var current = this.arabicCurrentCharsCount;
|
|
1751
|
+
var resource = this.UtilityService.getResourceValue("MaxLengthLimitWarning");
|
|
1752
|
+
this.arabicMaxLimitWarningMsg = eval('`' + resource + '`');
|
|
1753
|
+
}
|
|
1506
1754
|
}
|
|
1507
1755
|
let mulitLangModel = new EnglishArabicDTO();
|
|
1508
1756
|
mulitLangModel.Arabic = arabicValue;
|
|
@@ -1613,18 +1861,32 @@ class MultiLingualTextAreaComponent {
|
|
|
1613
1861
|
this.ArabicTextAreaFormControl.updateValueAndValidity();
|
|
1614
1862
|
this.EnglishTextAreaFormControl.updateValueAndValidity();
|
|
1615
1863
|
}
|
|
1616
|
-
|
|
1617
|
-
this.IsShowArabicWordCount =
|
|
1864
|
+
onArabicFocus(isFocus) {
|
|
1865
|
+
this.IsShowArabicWordCount = isFocus;
|
|
1866
|
+
//onFocus
|
|
1867
|
+
if (isFocus) {
|
|
1868
|
+
if (this.hasArabicCharsLimitValidationError) //check if there was previous validation error
|
|
1869
|
+
this.showArabicCharsLimitMsg = true;
|
|
1870
|
+
}
|
|
1871
|
+
else //onFocusOut
|
|
1872
|
+
this.showArabicCharsLimitMsg = false;
|
|
1618
1873
|
}
|
|
1619
|
-
|
|
1620
|
-
this.IsShowEnglishWordCount =
|
|
1874
|
+
onEnglishFocus(isFocus) {
|
|
1875
|
+
this.IsShowEnglishWordCount = isFocus;
|
|
1876
|
+
//onFocus
|
|
1877
|
+
if (isFocus) {
|
|
1878
|
+
if (this.hasEnglishCharsLimitValidationError) //check if there was previous validation error
|
|
1879
|
+
this.showEnglishCharsLimitMsg = true;
|
|
1880
|
+
}
|
|
1881
|
+
else //onFocusOut
|
|
1882
|
+
this.showEnglishCharsLimitMsg = false;
|
|
1621
1883
|
}
|
|
1622
1884
|
}
|
|
1623
1885
|
MultiLingualTextAreaComponent.controlContainerstatic = null;
|
|
1624
1886
|
MultiLingualTextAreaComponent.decorators = [
|
|
1625
1887
|
{ type: Component, args: [{
|
|
1626
1888
|
selector: 'BBSF-MultiLingualTextArea',
|
|
1627
|
-
template: "<div class=\"b-control b-multilangual-textarea\">\r\n <div class=\"form-group validate is-invalid\" [formGroup]=\"group\">\r\n\r\n <div class=\"form-group row\" [formGroup]=\"MultiLanguageTextAreagroup\">\r\n <div [ngClass]=\"(options.MultiControlPlacementType==1)?'col-md-12':'col-md-6'\">\r\n <div class=\"row\" *ngIf=\"ShowEngishTextArea\">\r\n <label class=\"b-label col-form-label col-sm-12 \"\r\n [ngClass]=\"(options.ViewType==1)?'col-md-9':'col-md-3'\" [hidden]=\"options.IsHideEnglishLabel\">\r\n {{(options.EnglishLabelValue!=null&&options.EnglishLabelValue!=\"\")?options.EnglishLabelValue:options.LabelValue+\"in English\"}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group\">\r\n <textarea class=\"form-control bnsights-control\" rows=\"{{options.Rows}}\" cols=\"{{options.Cols}}\"\r\n (focus)=\"
|
|
1889
|
+
template: "<div class=\"b-control b-multilangual-textarea\">\r\n <div class=\"form-group validate is-invalid\" [formGroup]=\"group\">\r\n\r\n <div class=\"form-group row\" [formGroup]=\"MultiLanguageTextAreagroup\">\r\n <div [ngClass]=\"(options.MultiControlPlacementType==1)?'col-md-12':'col-md-6'\">\r\n <div class=\"row\" *ngIf=\"ShowEngishTextArea\">\r\n <label class=\"b-label col-form-label col-sm-12 \"\r\n [ngClass]=\"(options.ViewType==1)?'col-md-9':'col-md-3'\" [hidden]=\"options.IsHideEnglishLabel\">\r\n {{(options.EnglishLabelValue!=null&&options.EnglishLabelValue!=\"\")?options.EnglishLabelValue:options.LabelValue+\"in English\"}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group\">\r\n <textarea class=\"form-control bnsights-control\" rows=\"{{options.Rows}}\" cols=\"{{options.Cols}}\"\r\n (focus)=\"onEnglishFocus(true)\" (focusout)=\"onEnglishFocus(false)\"\r\n maxlength=\"{{options.MaxLength}}\" minlength=\"{{options.MinLength}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n formControlName=\"English\" [hidden]=\"options.IsHideEnglishFields\"\r\n [class.is-invalid]=\"EnglishTextAreaFormControl.invalid && EnglishTextAreaFormControl.touched\"\r\n placeholder=\"{{options.EnglishPlaceholder}}\" (change)=\"trimControlValue('En')\"\r\n (keyup)=\"onTextChange()\"\r\n (keydown)=\"EnglishWordCountArray>options.MaxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #userinputTextAreaEnglish>\r\n </textarea>\r\n <div class=\"input-group-append\" [hidden]=\"options.IsHideEnglishFields\" *ngIf=\"options.EnableCopyToClipboard\">\r\n <span class=\"input-group-text\" (click)=\"copyInputMessage(userinputTextAreaEnglish)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>\r\n </div>\r\n\r\n\r\n </div>\r\n <div class=\"text-muted font-weight-500 float-end word-count\" *ngIf=\"options.MaxWordCount>0&&IsShowEnglishWordCount\">{{EnglishWordCount}}/{{options.MaxWordCount}}</div>\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(EnglishTextAreaFormControl.invalid && EnglishTextAreaFormControl.touched)\">\r\n {{getErrorValidation(EnglishTextAreaFormControl.errors|keyvalue)}}\r\n </div>\r\n <div *ngIf=\"showEnglishCharsLimitMsg\">\r\n <span class=\"badge b-character-warning float-end\" [ngClass]=\"{'badge-light-warning': englishCharsLimitMsgClass === 'warning', 'badge-light-danger' : englishCharsLimitMsgClass === 'danger' }\">\r\n {{englishMaxLimitWarningMsg}}\r\n </span>\r\n </div>\r\n <div class=\"control-desc\" *ngIf=\"(options.LabelDescription!=null&&options.LabelDescription!='') ||(options.EnglishLabelDescription!=null&&options.EnglishLabelDescription!='')\">\r\n {{(options.EnglishLabelDescription!=null&&options.EnglishLabelDescription!=\"\")?options.EnglishLabelDescription:options.LabelDescription}}\r\n </div>\r\n\r\n <!-- <div *ngIf=\"EnglishTextAreaFormControl.valid\">{{resetError()}}</div> -->\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n\r\n\r\n </div>\r\n </div>\r\n </div>\r\n <div [ngClass]=\"(options.MultiControlPlacementType==1)?'col-md-12':'col-md-6'\">\r\n <div class=\"row\" *ngIf=\"ShowArabicTextArea\">\r\n\r\n <label class=\"b-label col-form-label col-sm-12 \"\r\n [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\" [hidden]=\"options.IsHideArabicLable\">\r\n {{(options.ArabicLabelValue!=null&&options.ArabicLabelValue!=\"\")?options.ArabicLabelValue:options.LabelValue+\"in Arabic\"}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n <div class=\" col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group\">\r\n <textarea class=\"form-control bnsights-control\" dir=\"rtl\" rows=\"{{options.Rows}}\" cols=\"{{options.Cols}}\"\r\n (focus)=\"onArabicFocus(true)\" (focusout)=\"onArabicFocus(false)\"\r\n [hidden]=\"options.IsHideArabicFields\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n formControlName=\"Arabic\" rows=\"{{options.Rows}}\"\r\n maxlength=\"{{options.MaxLength}}\" minlength=\"{{options.MinLength}}\"\r\n [class.is-invalid]=\"ArabicTextAreaFormControl.invalid && ArabicTextAreaFormControl.touched\"\r\n placeholder=\"{{options.ArabicPlaceholder}}\" (change)=\"trimControlValue('Ar')\"\r\n (keyup)=\"onTextChange()\"\r\n (keydown)=\"ArabicWordCountArray>options.MaxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #userinputTextAreaArabic>\r\n </textarea>\r\n <div class=\"input-group-append\" [hidden]=\"options.IsHideArabicFields\" *ngIf=\"options.EnableCopyToClipboard\">\r\n <span class=\"input-group-text\" (click)=\"copyInputMessage(userinputTextAreaArabic)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"text-muted font-weight-500 float-end word-count\" *ngIf=\"options.MaxWordCount>0&&IsShowArabicWordCount\">{{ArabicWordCount}}/{{options.MaxWordCount}}</div>\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(ArabicTextAreaFormControl.invalid && ArabicTextAreaFormControl.touched)\">\r\n {{getErrorValidation(ArabicTextAreaFormControl.errors|keyvalue)}}\r\n </div>\r\n <div *ngIf=\"showArabicCharsLimitMsg\">\r\n <span class=\"badge b-character-warning float-end\" [ngClass]=\"{'badge-light-warning': arabicCharsLimitMsgClass === 'warning', 'badge-light-danger' : arabicCharsLimitMsgClass === 'danger' }\">\r\n {{arabicMaxLimitWarningMsg}}\r\n </span>\r\n </div>\r\n <div class=\"control-desc\" *ngIf=\"(options.LabelDescription!=null&&options.LabelDescription!='')||(options.ArabicLabelDescription!=null&&options.ArabicLabelDescription!='')\">\r\n {{(options.ArabicLabelDescription!=null&&options.ArabicLabelDescription!=\"\")?options.ArabicLabelDescription:options.LabelDescription}}\r\n </div>\r\n <!-- <div *ngIf=\"ArabicTextAreaFormControl.valid\">{{resetError()}}</div> -->\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n",
|
|
1628
1890
|
styles: [".example-form{min-width:150px;max-width:500px;width:100%}.example-full-width{width:100%}\n"]
|
|
1629
1891
|
},] }
|
|
1630
1892
|
];
|
|
@@ -2708,7 +2970,6 @@ class ImageUploaderComponent {
|
|
|
2708
2970
|
this.controlValidationService = controlValidationService;
|
|
2709
2971
|
this.globalSettings = globalSettings;
|
|
2710
2972
|
this.files = [];
|
|
2711
|
-
this.ImageSource = "./src/assets/images/uploadimg.png";
|
|
2712
2973
|
this.OnChange = new EventEmitter();
|
|
2713
2974
|
this.ValidationMessage = "";
|
|
2714
2975
|
this.AcceptedType = "";
|
|
@@ -2755,8 +3016,10 @@ class ImageUploaderComponent {
|
|
|
2755
3016
|
this.controlValidationService.isCreatedBefor = false;
|
|
2756
3017
|
if (!this.options.ViewType)
|
|
2757
3018
|
this.options.ViewType = this.globalSettings.ViewType;
|
|
2758
|
-
if (this.options.DefaultImageSrc
|
|
2759
|
-
this.
|
|
3019
|
+
if (!this.options.DefaultImageSrc)
|
|
3020
|
+
this.options.DefaultImageSrc = this.globalSettings.DefaultImageSrc;
|
|
3021
|
+
//Set img src by default value
|
|
3022
|
+
this.ImageSource = this.options.DefaultImageSrc;
|
|
2760
3023
|
if (this.options.AllowImageCropper) {
|
|
2761
3024
|
this.config = {
|
|
2762
3025
|
aspectRatio: this.options.ImageCropperWidth / this.options.ImageCropperHeight,
|
|
@@ -2922,6 +3185,8 @@ class ImageUploaderComponent {
|
|
|
2922
3185
|
let ItemList = this.group.get(this.options.Name).value;
|
|
2923
3186
|
this.files = [];
|
|
2924
3187
|
ItemList = null;
|
|
3188
|
+
//Set Img src by default image (upload)
|
|
3189
|
+
this.ImageSource = this.options.DefaultImageSrc;
|
|
2925
3190
|
if ((this.files.length == 0) && this.options.IsRequired) {
|
|
2926
3191
|
this.ImageUploadFormControl.markAsTouched();
|
|
2927
3192
|
this.ImageUploadFormControl.setErrors(Validators.required);
|
|
@@ -3525,7 +3790,6 @@ class AutocompleteTextBoxComponent {
|
|
|
3525
3790
|
}
|
|
3526
3791
|
onChangeSearch(search) {
|
|
3527
3792
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3528
|
-
debugger;
|
|
3529
3793
|
this.Search = search;
|
|
3530
3794
|
this.SelectedValue = "";
|
|
3531
3795
|
yield this.suggestions$.subscribe((result) => {
|
|
@@ -3968,7 +4232,6 @@ class PagingComponent {
|
|
|
3968
4232
|
}
|
|
3969
4233
|
this.requestHandlerService.post(this.options.ActionPostURL, pagingDTO, null, params, null)
|
|
3970
4234
|
.subscribe((responseData) => {
|
|
3971
|
-
debugger;
|
|
3972
4235
|
this.result = responseData.items; //this.castItems(responseData.items);
|
|
3973
4236
|
let castedResult = plainToClass(this.options.TypeOfResponse, this.result, { excludeExtraneousValues: true });
|
|
3974
4237
|
this.Items.emit(castedResult);
|
|
@@ -3984,7 +4247,6 @@ class PagingComponent {
|
|
|
3984
4247
|
});
|
|
3985
4248
|
}
|
|
3986
4249
|
castItems(objectArr) {
|
|
3987
|
-
debugger;
|
|
3988
4250
|
let originalArray = [];
|
|
3989
4251
|
for (let index = 0; index < objectArr.length; index++) {
|
|
3990
4252
|
const element = objectArr[index];
|
|
@@ -4269,7 +4531,12 @@ class TextboxComponent {
|
|
|
4269
4531
|
this.markAllAsTouched = false;
|
|
4270
4532
|
this.validationRules = [];
|
|
4271
4533
|
this.validationRulesasync = [];
|
|
4272
|
-
|
|
4534
|
+
//For Show warning message of max length limit
|
|
4535
|
+
this.currentCharsCount = 0;
|
|
4536
|
+
this.showCharsLimitMsg = false;
|
|
4537
|
+
this.hasCharsLimitValidationError = false;
|
|
4538
|
+
this.minCharsLimit = -1; //To disable chars limit feature by default
|
|
4539
|
+
this.maxLimitWarningMsg = "";
|
|
4273
4540
|
this.resetError = () => {
|
|
4274
4541
|
this.controlValidationService.RemoveGlobalError();
|
|
4275
4542
|
};
|
|
@@ -4295,21 +4562,10 @@ class TextboxComponent {
|
|
|
4295
4562
|
};
|
|
4296
4563
|
TextboxComponent.controlContainerstatic = this.controlContainer;
|
|
4297
4564
|
}
|
|
4298
|
-
// static showErrorOfInputs(errors: any) {
|
|
4299
|
-
// const controlContainerstatic = TextboxComponent.controlContainerstatic;
|
|
4300
|
-
// const formGroup = controlContainerstatic.control as FormGroup;
|
|
4301
|
-
// for (const key in errors) {
|
|
4302
|
-
// if (errors.hasOwnProperty(key)) {
|
|
4303
|
-
// for (const iterator of errors[key]) {
|
|
4304
|
-
// const formControl = formGroup.get(key) as FormControl;
|
|
4305
|
-
// formControl.setErrors({ "FluentApi": iterator });
|
|
4306
|
-
// formControl.markAsTouched();
|
|
4307
|
-
// }
|
|
4308
|
-
// }
|
|
4309
|
-
// }
|
|
4310
|
-
// }
|
|
4311
4565
|
ngOnInit() {
|
|
4312
4566
|
this.controlValidationService.isCreatedBefor = false;
|
|
4567
|
+
if (!this.options.MaxLength)
|
|
4568
|
+
this.options.MaxLength = this.globalSettings.MaxLengthTextBox;
|
|
4313
4569
|
if (!this.options.ViewType)
|
|
4314
4570
|
this.options.ViewType = this.globalSettings.ViewType;
|
|
4315
4571
|
if (this.options.MaskPattern != null && this.options.MaskPattern != "") {
|
|
@@ -4333,7 +4589,12 @@ class TextboxComponent {
|
|
|
4333
4589
|
this.options.Placeholder = this.MaskPattern;
|
|
4334
4590
|
break;
|
|
4335
4591
|
case InputType.Number:
|
|
4336
|
-
this.validationRules.push(Validators.
|
|
4592
|
+
this.validationRules.push(Validators.compose([
|
|
4593
|
+
this.controlUtility.patternValidator(/^[0-9]*$/, { IntegerNumberValidationKey: "" }),
|
|
4594
|
+
]));
|
|
4595
|
+
this.validationRules.push(Validators.compose([
|
|
4596
|
+
this.controlUtility.patternValidator(/^[+]?([.]\d+|\d+[.]?\d*)$/, { PositiveNumberValidationKey: "" }),
|
|
4597
|
+
]));
|
|
4337
4598
|
if (this.options.NumberRange != null) {
|
|
4338
4599
|
this.validationRules.push(Validators.min(this.options.NumberRange.From));
|
|
4339
4600
|
this.validationRules.push(Validators.max(this.options.NumberRange.To));
|
|
@@ -4375,6 +4636,9 @@ class TextboxComponent {
|
|
|
4375
4636
|
}
|
|
4376
4637
|
if (this.options.MaxLength > 0) {
|
|
4377
4638
|
this.validationRules.push(Validators.maxLength(this.options.MaxLength));
|
|
4639
|
+
if (!this.options.MaxLengthWarningLimit)
|
|
4640
|
+
this.options.MaxLengthWarningLimit = this.globalSettings.MaxLengthWarningLimit;
|
|
4641
|
+
this.minCharsLimit = this.options.MaxLength - this.options.MaxLengthWarningLimit;
|
|
4378
4642
|
}
|
|
4379
4643
|
if (this.options.IsRequired) {
|
|
4380
4644
|
this.validationRules.push(Validators.required);
|
|
@@ -4441,18 +4705,46 @@ class TextboxComponent {
|
|
|
4441
4705
|
this.WordCount = this.WordCountArray;
|
|
4442
4706
|
}
|
|
4443
4707
|
}
|
|
4708
|
+
//Check for maxlength limit count
|
|
4709
|
+
//MaxLength should be gretaer than or equals chars limit so that minCharsLimit would be >= 0
|
|
4710
|
+
if (this.options.MaxLength && this.minCharsLimit >= 0) {
|
|
4711
|
+
this.currentCharsCount = this.TextBoxFormControl.value.length;
|
|
4712
|
+
if (this.currentCharsCount >= this.minCharsLimit) {
|
|
4713
|
+
this.showCharsLimitMsg = true;
|
|
4714
|
+
this.hasCharsLimitValidationError = true;
|
|
4715
|
+
if (this.currentCharsCount == this.options.MaxLength)
|
|
4716
|
+
this.charsLimitMsgClass = "danger";
|
|
4717
|
+
else
|
|
4718
|
+
this.charsLimitMsgClass = "warning";
|
|
4719
|
+
}
|
|
4720
|
+
else {
|
|
4721
|
+
this.showCharsLimitMsg = false;
|
|
4722
|
+
this.hasCharsLimitValidationError = false;
|
|
4723
|
+
}
|
|
4724
|
+
var max = this.options.MaxLength;
|
|
4725
|
+
var current = this.currentCharsCount;
|
|
4726
|
+
var resource = this.UtilityService.getResourceValue("MaxLengthLimitWarning");
|
|
4727
|
+
this.maxLimitWarningMsg = eval('`' + resource + '`');
|
|
4728
|
+
}
|
|
4444
4729
|
}
|
|
4445
4730
|
this.OnChange.emit(this.TextBoxFormControl.value);
|
|
4446
4731
|
}
|
|
4447
|
-
|
|
4448
|
-
this.IsShowWordCount =
|
|
4732
|
+
onFocus(isFocus) {
|
|
4733
|
+
this.IsShowWordCount = isFocus;
|
|
4734
|
+
//onFocus
|
|
4735
|
+
if (isFocus) {
|
|
4736
|
+
if (this.hasCharsLimitValidationError) //check if there was previous validation error
|
|
4737
|
+
this.showCharsLimitMsg = true;
|
|
4738
|
+
}
|
|
4739
|
+
else //onFocusOut
|
|
4740
|
+
this.showCharsLimitMsg = false;
|
|
4449
4741
|
}
|
|
4450
4742
|
}
|
|
4451
4743
|
TextboxComponent.controlContainerstatic = null;
|
|
4452
4744
|
TextboxComponent.decorators = [
|
|
4453
4745
|
{ type: Component, args: [{
|
|
4454
4746
|
selector: 'BBSF-TextBox',
|
|
4455
|
-
template: "<div class=\"b-control b-textbox\">\r\n <div class=\"form-group row validate is-invalid\" [formGroup]=\"group\" [ngClass]=\"(options.NoMargin==true)?'':'NoMargin'\">\r\n <label class=\"b-label col-form-label col-sm-12 \" [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\" *ngIf=\"!options.HideLabel\">\r\n {{options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger Required-text\"\r\n aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'': ((options.HideLabel)?'col-md-12':'col-md-9')\">\r\n <div class=\"input-group align-items-center\" *ngIf=\"MaskPattern!=null&&MaskPattern!=''\">\r\n <div class=\"svg svg-icon-grey\" [ngClass]=\"(options.IconPosition==1)?'left-icon':'right-icon'\" *ngIf=\"options.Icon!=null\">\r\n <span [inlineSVG]=\"options.Icon\"></span>\r\n </div>\r\n <input [mask]=\"MaskPattern\" placeHolderCharacter=\" \" [showMaskTyped]=\"true\" [validation]=\"true\"\r\n class=\"form-control bnsights-control {{options.ExtraClasses}}\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"{{options.Name}}\"\r\n type=\"{{getInputType(options.Type)}}\"\r\n [class.is-invalid]=\"TextBoxFormControl.invalid && TextBoxFormControl.touched\"\r\n placeholder=\"{{options.Placeholder}}\" id=\"{{options.Name}}\" autocomplete=\"{{options.AutoComplete}}\"\r\n (change)=\"trimControlValue()\" (keyup)=\"onTextChange()\"\r\n (keydown)=\"WordCountArray>options.MaxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #userinput>\r\n <div class=\"input-group-append\">\r\n <span class=\"input-group-text\" *ngIf=\"options.EnableCopyToClipboard\" (click)=\"copyInputMessage(userinput)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>\r\n </div>\r\n <div class=\"text-muted font-weight-500 word-count\" *ngIf=\"options.MaxWordCount>0&&IsShowWordCount\">{{WordCount}}/{{options.MaxWordCount}} Words</div>\r\n </div>\r\n\r\n <div class=\"input-group align-items-center\" *ngIf=\"MaskPattern==null||MaskPattern==''\">\r\n <div class=\"svg svg-icon-grey\" [ngClass]=\"(options.IconPosition==1)?'left-icon':'right-icon'\" *ngIf=\"options.Icon!=null\">\r\n <span [inlineSVG]=\"options.Icon\"></span>\r\n </div>\r\n <input class=\"form-control bnsights-control {{options.ExtraClasses}} \"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n (focus)=\"
|
|
4747
|
+
template: "<div class=\"b-control b-textbox\">\r\n <div class=\"form-group row validate is-invalid\" [formGroup]=\"group\" [ngClass]=\"(options.NoMargin==true)?'':'NoMargin'\">\r\n <label class=\"b-label col-form-label col-sm-12 \" [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\" *ngIf=\"!options.HideLabel\">\r\n {{options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger Required-text\"\r\n aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'': ((options.HideLabel)?'col-md-12':'col-md-9')\">\r\n <div class=\"input-group align-items-center\" *ngIf=\"MaskPattern!=null&&MaskPattern!=''\">\r\n <div class=\"svg svg-icon-grey\" [ngClass]=\"(options.IconPosition==1)?'left-icon':'right-icon'\" *ngIf=\"options.Icon!=null\">\r\n <span [inlineSVG]=\"options.Icon\"></span>\r\n </div>\r\n <input [mask]=\"MaskPattern\" placeHolderCharacter=\" \" [showMaskTyped]=\"true\" [validation]=\"true\"\r\n class=\"form-control bnsights-control {{options.ExtraClasses}}\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"{{options.Name}}\"\r\n type=\"{{getInputType(options.Type)}}\"\r\n [class.is-invalid]=\"TextBoxFormControl.invalid && TextBoxFormControl.touched\"\r\n placeholder=\"{{options.Placeholder}}\" id=\"{{options.Name}}\" autocomplete=\"{{options.AutoComplete}}\"\r\n (change)=\"trimControlValue()\" (keyup)=\"onTextChange()\"\r\n (keydown)=\"WordCountArray>options.MaxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #userinput>\r\n <div class=\"input-group-append\">\r\n <span class=\"input-group-text\" *ngIf=\"options.EnableCopyToClipboard\" (click)=\"copyInputMessage(userinput)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>\r\n </div>\r\n <div class=\"text-muted font-weight-500 word-count\" *ngIf=\"options.MaxWordCount>0&&IsShowWordCount\">{{WordCount}}/{{options.MaxWordCount}} Words</div>\r\n\r\n </div>\r\n\r\n <div class=\"input-group align-items-center\" *ngIf=\"MaskPattern==null||MaskPattern==''\">\r\n <div class=\"svg svg-icon-grey\" [ngClass]=\"(options.IconPosition==1)?'left-icon':'right-icon'\" *ngIf=\"options.Icon!=null\">\r\n <span [inlineSVG]=\"options.Icon\"></span>\r\n </div>\r\n <input class=\"form-control bnsights-control {{options.ExtraClasses}} \"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n (focus)=\"onFocus(true)\" (focusout)=\"onFocus(false)\"\r\n maxlength=\"{{options.MaxLength}}\" minlength=\"{{options.MinLength}}\"\r\n aria-describedby=\"email-error\"\r\n aria-invalid=\"true\" formControlName=\"{{options.Name}}\" type=\"{{getInputType(options.Type)}}\"\r\n [class.is-invalid]=\"TextBoxFormControl.invalid && TextBoxFormControl.touched\"\r\n placeholder=\"{{options.Placeholder}}\" id=\"{{options.Name}}\" autocomplete=\"{{options.AutoComplete}}\"\r\n (change)=\"trimControlValue()\" (keyup)=\"onTextChange()\"\r\n (keydown)=\"WordCountArray>options.MaxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #userinput>\r\n <div class=\"input-group-append\" *ngIf=\"options.EnableCopyToClipboard\">\r\n <span class=\"input-group-text\" (click)=\"copyInputMessage(userinput)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>\r\n </div>\r\n <div class=\"text-muted font-weight-500 word-count float-end\" *ngIf=\"options.MaxWordCount>0&&IsShowWordCount\">{{WordCount}}/{{options.MaxWordCount}} Words</div>\r\n </div>\r\n <div class=\"text-danger Required-text\" dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n *ngIf=\"(TextBoxFormControl.invalid && TextBoxFormControl.touched)\">\r\n {{getErrorValidation(TextBoxFormControl.errors|keyvalue)}}\r\n </div>\r\n <div *ngIf=\"showCharsLimitMsg\">\r\n <span class=\"badge b-character-warning float-end\" [ngClass]=\"{'badge-light-warning': charsLimitMsgClass === 'warning', 'badge-light-danger' : charsLimitMsgClass === 'danger' }\">\r\n {{maxLimitWarningMsg}}\r\n </span>\r\n </div>\r\n <div class=\"control-desc\" *ngIf=\"options.LabelDescription!=null\">{{options.LabelDescription}}</div>\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n </div>\r\n </div>\r\n</div>\r\n",
|
|
4456
4748
|
styles: [".example-form{min-width:150px;max-width:500px;width:100%}.example-full-width{width:100%}.flip_V{transform:scaleY(-1)}\n"]
|
|
4457
4749
|
},] }
|
|
4458
4750
|
];
|
|
@@ -4977,23 +5269,7 @@ class FormComponent {
|
|
|
4977
5269
|
this.utilityService.notifyErrorMessage();
|
|
4978
5270
|
}
|
|
4979
5271
|
else {
|
|
4980
|
-
|
|
4981
|
-
if (err.status == 400) {
|
|
4982
|
-
this.controlValidationService.renderServerErrors(this.options.FormGroup, err, new RequestOptionsModel(), this.fromName);
|
|
4983
|
-
}
|
|
4984
|
-
else if (err.status == 401) {
|
|
4985
|
-
this.router.navigate(["/Admin/account/login"]);
|
|
4986
|
-
}
|
|
4987
|
-
else if (err.status == 510) {
|
|
4988
|
-
errorMessage = this.utilityService.getCurrentLanguage() == "en" ? "Can not delete this item as it is related to others" : "لا يمكن حذف هذا العنصر لأنه مرتبط بعناصر أخرى";
|
|
4989
|
-
if (!this.options.DisableErrorNotification)
|
|
4990
|
-
this.utilityService.notifyErrorMessage(errorMessage);
|
|
4991
|
-
}
|
|
4992
|
-
else {
|
|
4993
|
-
errorMessage = `error message is: ${err.error ? err.error.Message : err.message}`;
|
|
4994
|
-
if (!this.options.DisableErrorNotification)
|
|
4995
|
-
this.utilityService.notifyErrorMessage(errorMessage);
|
|
4996
|
-
}
|
|
5272
|
+
this.controlValidationService.renderServerErrors(this.options.FormGroup, err, new RequestOptionsModel(), this.fromName);
|
|
4997
5273
|
}
|
|
4998
5274
|
if (!this.options.DisableBlockUI)
|
|
4999
5275
|
this.utilityService.stopBlockUI();
|
|
@@ -5360,6 +5636,8 @@ class DatePickerOptions {
|
|
|
5360
5636
|
/**To set SelectMode to DatePicker is Single or Range */
|
|
5361
5637
|
this.SelectMode = SelectMode.Single;
|
|
5362
5638
|
this.ForceDirection = ForceDirection.English;
|
|
5639
|
+
/**Name of DatePicker control to compare value with it */
|
|
5640
|
+
this.StartControlToCompareWith = null;
|
|
5363
5641
|
}
|
|
5364
5642
|
}
|
|
5365
5643
|
|
|
@@ -6458,7 +6736,6 @@ BBSFControlsModule.decorators = [
|
|
|
6458
6736
|
FullCalendarModule,
|
|
6459
6737
|
TypeaheadModule.forRoot(),
|
|
6460
6738
|
AngularEditorModule,
|
|
6461
|
-
AutocompleteLibModule,
|
|
6462
6739
|
BBSFUtilitiesModule,
|
|
6463
6740
|
InlineSVGModule.forRoot(),
|
|
6464
6741
|
SweetAlert2Module
|
|
@@ -6519,7 +6796,7 @@ BBSFControlsModule.ctorParameters = () => [
|
|
|
6519
6796
|
// This file can be replaced during build by using the `fileReplacements` array.
|
|
6520
6797
|
// `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`.
|
|
6521
6798
|
// The list of file replacements can be found in `angular.json`.
|
|
6522
|
-
const environment = Object.assign({}, window.
|
|
6799
|
+
const environment = Object.assign({}, window.Environment);
|
|
6523
6800
|
/*
|
|
6524
6801
|
* In development mode, to ignore zone related error stack frames such as
|
|
6525
6802
|
* `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can
|
|
@@ -6871,7 +7148,6 @@ class RepeaterField {
|
|
|
6871
7148
|
|
|
6872
7149
|
class RepeaterOptions {
|
|
6873
7150
|
constructor() {
|
|
6874
|
-
this.MinRequiredItems = 1;
|
|
6875
7151
|
this.ActionLabelKey = "";
|
|
6876
7152
|
this.AddButtonText = "Add";
|
|
6877
7153
|
this.DeleteButtonText = "Delete";
|