@bnsights/bbsf-controls 1.0.81 → 1.0.83
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 +10 -0
- package/bnsights-bbsf-controls-1.0.83.tgz +0 -0
- package/bnsights-bbsf-controls.metadata.json +1 -1
- package/bundles/bnsights-bbsf-controls.umd.js +38 -26
- package/bundles/bnsights-bbsf-controls.umd.js.map +1 -1
- package/esm2015/lib/Shared/components/app-base-component.js +35 -24
- package/esm2015/lib/Shared/components/ng-tag-input.js +9 -9
- package/esm2015/lib/controls/ConfirmationModal/ConfirmationModal.component.js +2 -1
- package/esm2015/lib/controls/MultiLingualHtmlEditor/MultiLingualHtmlEditor.component.js +2 -2
- package/esm2015/lib/controls/MultiLingualTextArea/MultiLingualTextArea.component.js +2 -2
- package/esm2015/lib/controls/MultiLingualTextBox/MultiLingualTextBox.component.js +2 -2
- package/esm2015/lib/controls/TextBox/TextBox.component.js +2 -2
- package/fesm2015/bnsights-bbsf-controls.js +45 -33
- package/fesm2015/bnsights-bbsf-controls.js.map +1 -1
- package/package.json +1 -1
- package/bnsights-bbsf-controls-1.0.81.tgz +0 -0
|
@@ -1147,7 +1147,7 @@ class MultiLingualTextBoxComponent {
|
|
|
1147
1147
|
this.controlUtility.arabicValidator({ ArabicIsRequiredAndOnly50CharactersEnglish: this.ArabicLetterOnly }),
|
|
1148
1148
|
]));
|
|
1149
1149
|
this.EnglishValidationRules.push(Validators.compose([
|
|
1150
|
-
this.controlUtility.patternValidator(/^[\
|
|
1150
|
+
this.controlUtility.patternValidator(/^[~`!@#$%^&*()‘’“”_+=[\]\\{}|;':",.\/<>?a-zA-Z0-9- ]*$/, { EnglishLetterOnly: this.EnglishLetterOnly }),
|
|
1151
1151
|
]));
|
|
1152
1152
|
this.ArabicFormControl.setValidators(this.ArabicValidationRules);
|
|
1153
1153
|
this.ArabicFormControl.setAsyncValidators(this.ArabicValidationRulesasync);
|
|
@@ -1766,7 +1766,7 @@ class MultiLingualTextAreaComponent {
|
|
|
1766
1766
|
this.controlUtility.arabicValidator({ ArabicIsRequiredAndOnly50CharactersEnglish: this.ArabicLetterOnly }),
|
|
1767
1767
|
]));
|
|
1768
1768
|
this.EnglishValidationRules.push(Validators.compose([
|
|
1769
|
-
this.controlUtility.patternValidator(/^[\
|
|
1769
|
+
this.controlUtility.patternValidator(/^[~`!@#$%^&*()‘’“”_+=[\]\\{}|;':",.\/<>?a-zA-Z0-9- ]*$/, { EnglishLetterOnly: this.EnglishLetterOnly }),
|
|
1770
1770
|
]));
|
|
1771
1771
|
this.ArabicTextAreaFormControl.setValidators(this.ArabicValidationRules);
|
|
1772
1772
|
this.ArabicTextAreaFormControl.setAsyncValidators(this.ArabicValidationRulesasync);
|
|
@@ -2962,7 +2962,7 @@ class MultiLingualHtmlEditorComponent {
|
|
|
2962
2962
|
this.controlUtility.patternValidator(/^[\u0621-\u064A\u0660-\u0669 ]+$/, { ArabicLetterOnly: this.ArabicLetterOnly }),
|
|
2963
2963
|
]));
|
|
2964
2964
|
this.EnglishValidationRules.push(Validators.compose([
|
|
2965
|
-
this.controlUtility.patternValidator(/^[\
|
|
2965
|
+
this.controlUtility.patternValidator(/^[~`!@#$%^&*()‘’“”_+=[\]\\{}|;':",.\/<>?a-zA-Z0-9- ]*$/, { EnglishLetterOnly: this.EnglishLetterOnly }),
|
|
2966
2966
|
]));
|
|
2967
2967
|
// this.ArabicHtmlEditorFormControl.setValidators(this.ArabicValidationRules);
|
|
2968
2968
|
// this.ArabicHtmlEditorFormControl.setAsyncValidators(this.ArabicValidationRulesasync);
|
|
@@ -5012,7 +5012,7 @@ class TextboxComponent {
|
|
|
5012
5012
|
}
|
|
5013
5013
|
else if (this.options.LanguageValidation == LanguageValidation.English) {
|
|
5014
5014
|
this.validationRules.push(Validators.compose([
|
|
5015
|
-
this.controlUtility.patternValidator(/^[\
|
|
5015
|
+
this.controlUtility.patternValidator(/^[~`!@#$%^&*()‘’“”_+=[\]\\{}|;':",.\/<>?a-zA-Z0-9- ]*$/, { EnglishLetterOnly: this.EnglishLetterOnly }),
|
|
5016
5016
|
]));
|
|
5017
5017
|
}
|
|
5018
5018
|
}
|
|
@@ -5806,6 +5806,7 @@ class ConfirmationModalComponent {
|
|
|
5806
5806
|
confirmButtonText: this.options.SubmitButtonText,
|
|
5807
5807
|
showCancelButton: this.options.showCancelButton,
|
|
5808
5808
|
showCloseButton: this.options.showCloseButton,
|
|
5809
|
+
allowOutsideClick: false
|
|
5809
5810
|
}).then((result) => {
|
|
5810
5811
|
if (result.isConfirmed) {
|
|
5811
5812
|
this.submit();
|
|
@@ -7126,18 +7127,18 @@ const TAGS_INPUT_TEMPLATE = `
|
|
|
7126
7127
|
<span [ngSwitch]="ViewMode">
|
|
7127
7128
|
<span *ngSwitchCase="tagInputViewEnum.WithImage">
|
|
7128
7129
|
<img style="border-radius:50%; height:40px; width: 40px; float:left; margin-left:5px ; margin-top: 5px;margin-right: 5px;"
|
|
7129
|
-
src="{{(tag.
|
|
7130
|
+
src="{{(tag.imageURL?tag.imageURL:defaultImageURL)}}" />
|
|
7130
7131
|
</span>
|
|
7131
7132
|
|
|
7132
7133
|
<span *ngSwitchCase="tagInputViewEnum.WithInitial">
|
|
7133
|
-
<div class="user-initials">{{calculateInitials(tag.
|
|
7134
|
+
<div class="user-initials">{{calculateInitials(tag.name)}}</div>
|
|
7134
7135
|
</span>
|
|
7135
7136
|
|
|
7136
7137
|
<span *ngSwitchDefault>
|
|
7137
7138
|
</span>
|
|
7138
7139
|
|
|
7139
7140
|
</span>
|
|
7140
|
-
{{tag
|
|
7141
|
+
{{tag[displayField]}}
|
|
7141
7142
|
<span *ngIf="isDeleteable(tag)" role="button" class="tags-input__tag-remove-btn" (click)="removeTag(tag)"
|
|
7142
7143
|
(touch)="removeTag(tag)">
|
|
7143
7144
|
<span aria-hidden="true">×</span>
|
|
@@ -7210,9 +7211,9 @@ src="{{(tag.image?tag.image:defaultImageURL)}}" />
|
|
|
7210
7211
|
<ng-template #itemTemplateWithImage let-model="item" let-index="index">
|
|
7211
7212
|
<img
|
|
7212
7213
|
style="border-radius:50%; height:40px; width: 40px; float:left; margin-left:5px ; margin-top: 5px;margin-right: 5px;"
|
|
7213
|
-
src="{{(model.
|
|
7214
|
+
src="{{(model.imageURL?model.imageURL:defaultImageURL)}}" />
|
|
7214
7215
|
<div>
|
|
7215
|
-
<a [innerHTML]="model.
|
|
7216
|
+
<a [innerHTML]="model.name"></a>
|
|
7216
7217
|
<p *ngIf="showDescription">
|
|
7217
7218
|
{{model.description}}
|
|
7218
7219
|
</p>
|
|
@@ -7221,7 +7222,7 @@ src="{{(tag.image?tag.image:defaultImageURL)}}" />
|
|
|
7221
7222
|
|
|
7222
7223
|
<ng-template #itemTemplateWithoutImage let-model="item" let-index="index">
|
|
7223
7224
|
<div>
|
|
7224
|
-
<a [innerHTML]="model.
|
|
7225
|
+
<a [innerHTML]="model.name"></a>
|
|
7225
7226
|
<p *ngIf="showDescription">
|
|
7226
7227
|
{{model.description}}
|
|
7227
7228
|
</p>
|
|
@@ -7230,10 +7231,10 @@ src="{{(tag.image?tag.image:defaultImageURL)}}" />
|
|
|
7230
7231
|
|
|
7231
7232
|
<ng-template #itemTemplateWithoutInitial let-model="item" let-index="index">
|
|
7232
7233
|
<div class="user-image">
|
|
7233
|
-
<div class="user-initials">{{calculateInitials(model.
|
|
7234
|
+
<div class="user-initials">{{calculateInitials(model.name)}}</div>
|
|
7234
7235
|
</div>
|
|
7235
7236
|
<div>
|
|
7236
|
-
<a [innerHTML]="model.
|
|
7237
|
+
<a [innerHTML]="model.name"></a>
|
|
7237
7238
|
<p *ngIf="showDescription">
|
|
7238
7239
|
{{model.description}}
|
|
7239
7240
|
</p>
|
|
@@ -7774,16 +7775,16 @@ class CustomValidator {
|
|
|
7774
7775
|
|
|
7775
7776
|
class AppBaseComponent {
|
|
7776
7777
|
constructor(injector) {
|
|
7777
|
-
this.pageTitle =
|
|
7778
|
+
this.pageTitle = '';
|
|
7778
7779
|
this.PageCount = 12;
|
|
7779
7780
|
this.onSuccessAddHandler = (success) => {
|
|
7780
|
-
this.utilityService.notifySuccessMessage(this.l(
|
|
7781
|
+
this.utilityService.notifySuccessMessage(this.l('RecordAdded'), null, null, false);
|
|
7781
7782
|
};
|
|
7782
7783
|
this.onSuccessEditHandler = (success) => {
|
|
7783
|
-
this.utilityService.notifySuccessMessage(this.l(
|
|
7784
|
+
this.utilityService.notifySuccessMessage(this.l('RecordUpdated'), null, null, false);
|
|
7784
7785
|
};
|
|
7785
7786
|
this.onSuccessDeleteHandler = (success) => {
|
|
7786
|
-
this.utilityService.notifySuccessMessage(this.l(
|
|
7787
|
+
this.utilityService.notifySuccessMessage(this.l('RecordDeleted'), null, null, false);
|
|
7787
7788
|
};
|
|
7788
7789
|
this.utilityService = injector.get(UtilityService);
|
|
7789
7790
|
this.controlUtility = injector.get(ControlUtility);
|
|
@@ -7792,9 +7793,9 @@ class AppBaseComponent {
|
|
|
7792
7793
|
this.modalService = injector.get(NgbModal);
|
|
7793
7794
|
this.titleService = injector.get(Title);
|
|
7794
7795
|
this.auhService = injector.get(AuthService);
|
|
7795
|
-
this.exportLabel = this.utilityService.getResourceValue(
|
|
7796
|
-
this.filtersLabel = this.utilityService.getResourceValue(
|
|
7797
|
-
this.addLabel = this.utilityService.getResourceValue(
|
|
7796
|
+
this.exportLabel = this.utilityService.getResourceValue('Export');
|
|
7797
|
+
this.filtersLabel = this.utilityService.getResourceValue('Filters');
|
|
7798
|
+
this.addLabel = this.utilityService.getResourceValue('Add');
|
|
7798
7799
|
this.userName = this.auhService.name();
|
|
7799
7800
|
this.isEN = this.utilityService.isCurrentLanguageEnglish();
|
|
7800
7801
|
}
|
|
@@ -7808,7 +7809,7 @@ class AppBaseComponent {
|
|
|
7808
7809
|
return this.configurationService.getConfigurationValue(key);
|
|
7809
7810
|
}
|
|
7810
7811
|
getLanguageModeValue() {
|
|
7811
|
-
return this.configurationService.getConfigurationValue(
|
|
7812
|
+
return this.configurationService.getConfigurationValue('LanguageMode');
|
|
7812
7813
|
}
|
|
7813
7814
|
stopBlockUI() {
|
|
7814
7815
|
this.utilityService.stopBlockUI();
|
|
@@ -7818,13 +7819,19 @@ class AppBaseComponent {
|
|
|
7818
7819
|
}
|
|
7819
7820
|
openModal(modal, size) {
|
|
7820
7821
|
if (size)
|
|
7821
|
-
this.modalService.open(modal, {
|
|
7822
|
+
this.modalService.open(modal, {
|
|
7823
|
+
size: size,
|
|
7824
|
+
backdrop: 'static',
|
|
7825
|
+
keyboard: false,
|
|
7826
|
+
});
|
|
7822
7827
|
else
|
|
7823
|
-
this.modalService.open(modal, { backdrop: 'static' });
|
|
7828
|
+
this.modalService.open(modal, { backdrop: 'static', keyboard: false });
|
|
7824
7829
|
}
|
|
7825
7830
|
download(fileDTO, fileName) {
|
|
7826
7831
|
/*let blob = new Blob([file]);*/
|
|
7827
|
-
let file = new Blob([fileDTO], {
|
|
7832
|
+
let file = new Blob([fileDTO], {
|
|
7833
|
+
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
7834
|
+
});
|
|
7828
7835
|
saveAs(file, fileName);
|
|
7829
7836
|
}
|
|
7830
7837
|
base64toBlob(base64Data, contentType) {
|
|
@@ -7846,7 +7853,9 @@ class AppBaseComponent {
|
|
|
7846
7853
|
return new Blob(byteArrays, { type: contentType });
|
|
7847
7854
|
}
|
|
7848
7855
|
calculatePageTitle(title) {
|
|
7849
|
-
return title
|
|
7856
|
+
return title
|
|
7857
|
+
? title.substring(0, 100) + ` | ${this.l('ApplicationName')}`
|
|
7858
|
+
: `${this.l('ApplicationName')}`;
|
|
7850
7859
|
}
|
|
7851
7860
|
getPagingFiltersValues(form, filters) {
|
|
7852
7861
|
let model = new Object();
|
|
@@ -7854,7 +7863,10 @@ class AppBaseComponent {
|
|
|
7854
7863
|
let filterItem = filters[i];
|
|
7855
7864
|
if (form.controls[filterItem.FormControlName].value == undefined)
|
|
7856
7865
|
continue;
|
|
7857
|
-
model[filterItem.ActionParameterName] =
|
|
7866
|
+
model[filterItem.ActionParameterName] =
|
|
7867
|
+
form.controls[filterItem.FormControlName].value == undefined
|
|
7868
|
+
? ''
|
|
7869
|
+
: form.controls[filterItem.FormControlName].value;
|
|
7858
7870
|
// params = params.append(filterItem.ActionParameterName, form.controls[filterItem.FormControlName].value == undefined ? '' : form.controls[filterItem.FormControlName].value);
|
|
7859
7871
|
}
|
|
7860
7872
|
return model;
|
|
@@ -7874,7 +7886,7 @@ class AppBaseComponent {
|
|
|
7874
7886
|
selBox.select();
|
|
7875
7887
|
document.execCommand('copy');
|
|
7876
7888
|
document.body.removeChild(selBox);
|
|
7877
|
-
this.utilityService.notifySuccessMessage(this.l(
|
|
7889
|
+
this.utilityService.notifySuccessMessage(this.l('CopiedSuccessfully'));
|
|
7878
7890
|
}
|
|
7879
7891
|
addRequiredRule(control, controlOptions) {
|
|
7880
7892
|
this.controlUtility.addRequiredToControl(control, controlOptions);
|
|
@@ -7888,39 +7900,39 @@ class AppBaseComponent {
|
|
|
7888
7900
|
let fromDate = form.controls[fromDateControl].value;
|
|
7889
7901
|
let toDate = form.controls[toDateControl].value;
|
|
7890
7902
|
if (fromDate && toDate && toDate <= fromDate)
|
|
7891
|
-
return {
|
|
7903
|
+
return { customerError: true };
|
|
7892
7904
|
return null;
|
|
7893
7905
|
};
|
|
7894
7906
|
validator.massage = this.l(validationMessageKey);
|
|
7895
7907
|
return validator;
|
|
7896
7908
|
}
|
|
7897
7909
|
recalculatePageTitle() {
|
|
7898
|
-
this.titleService.setTitle(this.calculatePageTitle(
|
|
7910
|
+
this.titleService.setTitle(this.calculatePageTitle(''));
|
|
7899
7911
|
}
|
|
7900
7912
|
isEnglish() {
|
|
7901
7913
|
return this.utilityService.isCurrentLanguageEnglish();
|
|
7902
7914
|
}
|
|
7903
7915
|
calculateInitials(name) {
|
|
7904
|
-
let language = localStorage.getItem(
|
|
7916
|
+
let language = localStorage.getItem('language');
|
|
7905
7917
|
let currentUser = this.auhService.user.profile;
|
|
7906
7918
|
console.log(currentUser);
|
|
7907
|
-
let userName = language ==
|
|
7919
|
+
let userName = language == 'en' ? currentUser.given_nameEn : currentUser.given_nameAr;
|
|
7908
7920
|
if (currentUser) {
|
|
7909
|
-
let fullName = userName.split(
|
|
7921
|
+
let fullName = userName.split(' ');
|
|
7910
7922
|
let initials;
|
|
7911
7923
|
if (fullName.length > 1) {
|
|
7912
7924
|
if (this.isEN)
|
|
7913
7925
|
initials = fullName.shift().charAt(0) + fullName.pop().charAt(0);
|
|
7914
7926
|
else
|
|
7915
7927
|
initials =
|
|
7916
|
-
fullName.shift().charAt(0) +
|
|
7928
|
+
fullName.shift().charAt(0) + ' ' + fullName.pop().charAt(0);
|
|
7917
7929
|
}
|
|
7918
7930
|
else {
|
|
7919
7931
|
initials = fullName.pop().charAt(0);
|
|
7920
7932
|
}
|
|
7921
7933
|
return initials.toUpperCase();
|
|
7922
7934
|
}
|
|
7923
|
-
return
|
|
7935
|
+
return '';
|
|
7924
7936
|
}
|
|
7925
7937
|
getCurrentUserInitials() {
|
|
7926
7938
|
return this.calculateInitials(this.auhService.name());
|