@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
|
@@ -1486,7 +1486,7 @@
|
|
|
1486
1486
|
this.controlUtility.arabicValidator({ ArabicIsRequiredAndOnly50CharactersEnglish: this.ArabicLetterOnly }),
|
|
1487
1487
|
]));
|
|
1488
1488
|
this.EnglishValidationRules.push(forms.Validators.compose([
|
|
1489
|
-
this.controlUtility.patternValidator(/^[\
|
|
1489
|
+
this.controlUtility.patternValidator(/^[~`!@#$%^&*()‘’“”_+=[\]\\{}|;':",.\/<>?a-zA-Z0-9- ]*$/, { EnglishLetterOnly: this.EnglishLetterOnly }),
|
|
1490
1490
|
]));
|
|
1491
1491
|
this.ArabicFormControl.setValidators(this.ArabicValidationRules);
|
|
1492
1492
|
this.ArabicFormControl.setAsyncValidators(this.ArabicValidationRulesasync);
|
|
@@ -2122,7 +2122,7 @@
|
|
|
2122
2122
|
this.controlUtility.arabicValidator({ ArabicIsRequiredAndOnly50CharactersEnglish: this.ArabicLetterOnly }),
|
|
2123
2123
|
]));
|
|
2124
2124
|
this.EnglishValidationRules.push(forms.Validators.compose([
|
|
2125
|
-
this.controlUtility.patternValidator(/^[\
|
|
2125
|
+
this.controlUtility.patternValidator(/^[~`!@#$%^&*()‘’“”_+=[\]\\{}|;':",.\/<>?a-zA-Z0-9- ]*$/, { EnglishLetterOnly: this.EnglishLetterOnly }),
|
|
2126
2126
|
]));
|
|
2127
2127
|
this.ArabicTextAreaFormControl.setValidators(this.ArabicValidationRules);
|
|
2128
2128
|
this.ArabicTextAreaFormControl.setAsyncValidators(this.ArabicValidationRulesasync);
|
|
@@ -3344,7 +3344,7 @@
|
|
|
3344
3344
|
this.controlUtility.patternValidator(/^[\u0621-\u064A\u0660-\u0669 ]+$/, { ArabicLetterOnly: this.ArabicLetterOnly }),
|
|
3345
3345
|
]));
|
|
3346
3346
|
this.EnglishValidationRules.push(forms.Validators.compose([
|
|
3347
|
-
this.controlUtility.patternValidator(/^[\
|
|
3347
|
+
this.controlUtility.patternValidator(/^[~`!@#$%^&*()‘’“”_+=[\]\\{}|;':",.\/<>?a-zA-Z0-9- ]*$/, { EnglishLetterOnly: this.EnglishLetterOnly }),
|
|
3348
3348
|
]));
|
|
3349
3349
|
// this.ArabicHtmlEditorFormControl.setValidators(this.ArabicValidationRules);
|
|
3350
3350
|
// this.ArabicHtmlEditorFormControl.setAsyncValidators(this.ArabicValidationRulesasync);
|
|
@@ -5448,7 +5448,7 @@
|
|
|
5448
5448
|
}
|
|
5449
5449
|
else if (this.options.LanguageValidation == exports.LanguageValidation.English) {
|
|
5450
5450
|
this.validationRules.push(forms.Validators.compose([
|
|
5451
|
-
this.controlUtility.patternValidator(/^[\
|
|
5451
|
+
this.controlUtility.patternValidator(/^[~`!@#$%^&*()‘’“”_+=[\]\\{}|;':",.\/<>?a-zA-Z0-9- ]*$/, { EnglishLetterOnly: this.EnglishLetterOnly }),
|
|
5452
5452
|
]));
|
|
5453
5453
|
}
|
|
5454
5454
|
}
|
|
@@ -6268,6 +6268,7 @@
|
|
|
6268
6268
|
confirmButtonText: this.options.SubmitButtonText,
|
|
6269
6269
|
showCancelButton: this.options.showCancelButton,
|
|
6270
6270
|
showCloseButton: this.options.showCloseButton,
|
|
6271
|
+
allowOutsideClick: false
|
|
6271
6272
|
}).then(function (result) {
|
|
6272
6273
|
if (result.isConfirmed) {
|
|
6273
6274
|
_this.submit();
|
|
@@ -7643,7 +7644,7 @@
|
|
|
7643
7644
|
|
|
7644
7645
|
var noop = function () { };
|
|
7645
7646
|
var ɵ0$1 = noop;
|
|
7646
|
-
var TAGS_INPUT_TEMPLATE = "\n\n<div class=\"tags-input\">\n<span class=\"tags-input__tag label label-primary badge badge-primary\" *ngFor=\"let tag of tags\">\n\n<span [ngSwitch]=\"ViewMode\">\n<span *ngSwitchCase=\"tagInputViewEnum.WithImage\">\n<img style=\"border-radius:50%; height:40px; width: 40px; float:left; margin-left:5px ; margin-top: 5px;margin-right: 5px;\"\nsrc=\"{{(tag.
|
|
7647
|
+
var TAGS_INPUT_TEMPLATE = "\n\n<div class=\"tags-input\">\n<span class=\"tags-input__tag label label-primary badge badge-primary\" *ngFor=\"let tag of tags\">\n\n<span [ngSwitch]=\"ViewMode\">\n<span *ngSwitchCase=\"tagInputViewEnum.WithImage\">\n<img style=\"border-radius:50%; height:40px; width: 40px; float:left; margin-left:5px ; margin-top: 5px;margin-right: 5px;\"\nsrc=\"{{(tag.imageURL?tag.imageURL:defaultImageURL)}}\" />\n</span>\n\n<span *ngSwitchCase=\"tagInputViewEnum.WithInitial\">\n<div class=\"user-initials\">{{calculateInitials(tag.name)}}</div>\n</span>\n\n<span *ngSwitchDefault>\n</span>\n\n</span>\n {{tag[displayField]}}\n <span *ngIf=\"isDeleteable(tag)\" role=\"button\" class=\"tags-input__tag-remove-btn\" (click)=\"removeTag(tag)\"\n (touch)=\"removeTag(tag)\">\n <span aria-hidden=\"true\">×</span>\n <span class=\"sr-only\">Close</span>\n </span>\n</span>\n\n<input *ngIf=\"options === null; else withTypeahead\" class=\"tags-input__input-field\" type=\"text\"\n [placeholder]=\"getPlaceholder()\" name=\"tags\" (keyup.enter)=\"addTag(tagInput)\"\n (keydown.backspace)=\"removeLastTag(tagInput)\" [disabled]=\"!canAddTags || maximumOfTagsReached()\"\n [hidden]=\"!canAddTags || maximumOfTagsReached()\" #tagInput />\n\n<ng-template #withTypeahead>\n <span [ngSwitch]=\"ViewMode\">\n <span *ngSwitchCase=\"tagInputViewEnum.WithImage\">\n <input *ngIf=\"(options !== null)\" class=\"tags-input__input-field\" type=\"text\" [placeholder]=\"getPlaceholder()\"\n name=\"tags\" (keydown.backspace)=\"removeLastTag(tagInput)\" [(ngModel)]=\"selected\" [typeahead]=\"options\"\n [typeaheadOptionField]=\"displayField\" (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n (typeaheadNoResults)=\"typeaheadOnNoMatch($event)\" [typeaheadMinLength]=\"minLengthBeforeOptions\"\n [typeaheadScrollable]=\"scrollableOptions\" [typeaheadLatinize]=\"true\"\n [typeaheadItemTemplate]=\"itemTemplateWithImage\" [typeaheadOptionsInScrollableView]=\"scrollableOptionsInView\"\n [disabled]=\"!canAddTags || maximumOfTagsReached()\" [hidden]=\"!canAddTags || maximumOfTagsReached()\"\n (blur)=\"onBlur()\" autocomplete=\"off\"\n #tagInput />\n </span>\n\n <span *ngSwitchCase=\"tagInputViewEnum.WithoutImage\">\n <input *ngIf=\"(options !== null)\" class=\"tags-input__input-field\" type=\"text\" [placeholder]=\"getPlaceholder()\"\n name=\"tags\" (keydown.backspace)=\"removeLastTag(tagInput)\" [(ngModel)]=\"selected\" [typeahead]=\"options\"\n [typeaheadOptionField]=\"displayField\" (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n (typeaheadNoResults)=\"typeaheadOnNoMatch($event)\" [typeaheadMinLength]=\"minLengthBeforeOptions\"\n [typeaheadScrollable]=\"scrollableOptions\" [typeaheadLatinize]=\"true\"\n [typeaheadItemTemplate]=\"itemTemplateWithoutImage\"\n [typeaheadOptionsInScrollableView]=\"scrollableOptionsInView\"\n [disabled]=\"!canAddTags || maximumOfTagsReached()\" [hidden]=\"!canAddTags || maximumOfTagsReached()\"\n (blur)=\"onBlur()\" autocomplete=\"off\"\n #tagInput />\n </span>\n\n <span *ngSwitchCase=\"tagInputViewEnum.WithInitial\">\n <input *ngIf=\"(options !== null)\" class=\"tags-input__input-field\" type=\"text\" [placeholder]=\"getPlaceholder()\"\n name=\"tags\" (keydown.backspace)=\"removeLastTag(tagInput)\" [(ngModel)]=\"selected\" [typeahead]=\"options\"\n [typeaheadOptionField]=\"displayField\" (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n (typeaheadNoResults)=\"typeaheadOnNoMatch($event)\" [typeaheadMinLength]=\"minLengthBeforeOptions\"\n [typeaheadScrollable]=\"scrollableOptions\" [typeaheadLatinize]=\"true\"\n [typeaheadItemTemplate]=\"itemTemplateWithoutInitial\"\n [typeaheadOptionsInScrollableView]=\"scrollableOptionsInView\"\n [disabled]=\"!canAddTags || maximumOfTagsReached()\" [hidden]=\"!canAddTags || maximumOfTagsReached()\"\n (blur)=\"onBlur()\" autocomplete=\"off\"\n #tagInput />\n </span>\n\n <span *ngSwitchDefault>\n <input *ngIf=\"(options !== null)\" class=\"tags-input__input-field\" type=\"text\" [placeholder]=\"getPlaceholder()\"\n name=\"tags\" (keydown.backspace)=\"removeLastTag(tagInput)\" [(ngModel)]=\"selected\" [typeahead]=\"options\"\n [typeaheadOptionField]=\"displayField\" (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n (typeaheadNoResults)=\"typeaheadOnNoMatch($event)\" [typeaheadMinLength]=\"minLengthBeforeOptions\"\n [typeaheadScrollable]=\"scrollableOptions\" [typeaheadLatinize]=\"true\"\n [typeaheadItemTemplate]=\"itemTemplateWithoutImage\"\n [typeaheadOptionsInScrollableView]=\"scrollableOptionsInView\"\n [disabled]=\"!canAddTags || maximumOfTagsReached()\" [hidden]=\"!canAddTags || maximumOfTagsReached()\"\n (blur)=\"onBlur()\" autocomplete=\"off\"\n #tagInput />\n </span>\n\n </span>\n\n</ng-template>\n\n<ng-template #itemTemplateWithImage let-model=\"item\" let-index=\"index\">\n <img\n style=\"border-radius:50%; height:40px; width: 40px; float:left; margin-left:5px ; margin-top: 5px;margin-right: 5px;\"\n src=\"{{(model.imageURL?model.imageURL:defaultImageURL)}}\" />\n <div>\n <a [innerHTML]=\"model.name\"></a>\n <p *ngIf=\"showDescription\">\n {{model.description}}\n </p>\n </div>\n</ng-template>\n\n<ng-template #itemTemplateWithoutImage let-model=\"item\" let-index=\"index\">\n <div>\n <a [innerHTML]=\"model.name\"></a>\n <p *ngIf=\"showDescription\">\n {{model.description}}\n </p>\n </div>\n</ng-template>\n\n<ng-template #itemTemplateWithoutInitial let-model=\"item\" let-index=\"index\">\n <div class=\"user-image\">\n <div class=\"user-initials\">{{calculateInitials(model.name)}}</div>\n </div>\n <div>\n <a [innerHTML]=\"model.name\"></a>\n <p *ngIf=\"showDescription\">\n {{model.description}}\n </p>\n </div>\n</ng-template>\n</div>\n";
|
|
7647
7648
|
var TAGS_INPUT_STYLE = "\n :host {\n overflow: auto;\n white-space: nowrap;\n }\n\n .tags-input {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n }\n\n .tags-input__tag {\n display: inline-block;\n margin-bottom: 2px;\n margin-right: 5px;\n padding-right: 0.3em;\n }\n\n .tags-input__tag-remove-btn {\n cursor: pointer;\n display: inline-block;\n font-size: 12px;\n margin: -3px 0 0 3px;\n padding: 0;\n vertical-align: top;\n }\n\n .tags-input__input-field {\n border: none;\n flex-grow: 1;\n outline: none;\n }\n";
|
|
7648
7649
|
var CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = {
|
|
7649
7650
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
@@ -8164,16 +8165,16 @@
|
|
|
8164
8165
|
var AppBaseComponent = /** @class */ (function () {
|
|
8165
8166
|
function AppBaseComponent(injector) {
|
|
8166
8167
|
var _this = this;
|
|
8167
|
-
this.pageTitle =
|
|
8168
|
+
this.pageTitle = '';
|
|
8168
8169
|
this.PageCount = 12;
|
|
8169
8170
|
this.onSuccessAddHandler = function (success) {
|
|
8170
|
-
_this.utilityService.notifySuccessMessage(_this.l(
|
|
8171
|
+
_this.utilityService.notifySuccessMessage(_this.l('RecordAdded'), null, null, false);
|
|
8171
8172
|
};
|
|
8172
8173
|
this.onSuccessEditHandler = function (success) {
|
|
8173
|
-
_this.utilityService.notifySuccessMessage(_this.l(
|
|
8174
|
+
_this.utilityService.notifySuccessMessage(_this.l('RecordUpdated'), null, null, false);
|
|
8174
8175
|
};
|
|
8175
8176
|
this.onSuccessDeleteHandler = function (success) {
|
|
8176
|
-
_this.utilityService.notifySuccessMessage(_this.l(
|
|
8177
|
+
_this.utilityService.notifySuccessMessage(_this.l('RecordDeleted'), null, null, false);
|
|
8177
8178
|
};
|
|
8178
8179
|
this.utilityService = injector.get(bbsfUtilities.UtilityService);
|
|
8179
8180
|
this.controlUtility = injector.get(ControlUtility);
|
|
@@ -8182,9 +8183,9 @@
|
|
|
8182
8183
|
this.modalService = injector.get(ngBootstrap.NgbModal);
|
|
8183
8184
|
this.titleService = injector.get(platformBrowser.Title);
|
|
8184
8185
|
this.auhService = injector.get(bbsfUtilities.AuthService);
|
|
8185
|
-
this.exportLabel = this.utilityService.getResourceValue(
|
|
8186
|
-
this.filtersLabel = this.utilityService.getResourceValue(
|
|
8187
|
-
this.addLabel = this.utilityService.getResourceValue(
|
|
8186
|
+
this.exportLabel = this.utilityService.getResourceValue('Export');
|
|
8187
|
+
this.filtersLabel = this.utilityService.getResourceValue('Filters');
|
|
8188
|
+
this.addLabel = this.utilityService.getResourceValue('Add');
|
|
8188
8189
|
this.userName = this.auhService.name();
|
|
8189
8190
|
this.isEN = this.utilityService.isCurrentLanguageEnglish();
|
|
8190
8191
|
}
|
|
@@ -8198,7 +8199,7 @@
|
|
|
8198
8199
|
return this.configurationService.getConfigurationValue(key);
|
|
8199
8200
|
};
|
|
8200
8201
|
AppBaseComponent.prototype.getLanguageModeValue = function () {
|
|
8201
|
-
return this.configurationService.getConfigurationValue(
|
|
8202
|
+
return this.configurationService.getConfigurationValue('LanguageMode');
|
|
8202
8203
|
};
|
|
8203
8204
|
AppBaseComponent.prototype.stopBlockUI = function () {
|
|
8204
8205
|
this.utilityService.stopBlockUI();
|
|
@@ -8208,13 +8209,19 @@
|
|
|
8208
8209
|
};
|
|
8209
8210
|
AppBaseComponent.prototype.openModal = function (modal, size) {
|
|
8210
8211
|
if (size)
|
|
8211
|
-
this.modalService.open(modal, {
|
|
8212
|
+
this.modalService.open(modal, {
|
|
8213
|
+
size: size,
|
|
8214
|
+
backdrop: 'static',
|
|
8215
|
+
keyboard: false,
|
|
8216
|
+
});
|
|
8212
8217
|
else
|
|
8213
|
-
this.modalService.open(modal, { backdrop: 'static' });
|
|
8218
|
+
this.modalService.open(modal, { backdrop: 'static', keyboard: false });
|
|
8214
8219
|
};
|
|
8215
8220
|
AppBaseComponent.prototype.download = function (fileDTO, fileName) {
|
|
8216
8221
|
/*let blob = new Blob([file]);*/
|
|
8217
|
-
var file = new Blob([fileDTO], {
|
|
8222
|
+
var file = new Blob([fileDTO], {
|
|
8223
|
+
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
8224
|
+
});
|
|
8218
8225
|
saveAs__namespace(file, fileName);
|
|
8219
8226
|
};
|
|
8220
8227
|
AppBaseComponent.prototype.base64toBlob = function (base64Data, contentType) {
|
|
@@ -8236,7 +8243,9 @@
|
|
|
8236
8243
|
return new Blob(byteArrays, { type: contentType });
|
|
8237
8244
|
};
|
|
8238
8245
|
AppBaseComponent.prototype.calculatePageTitle = function (title) {
|
|
8239
|
-
return title
|
|
8246
|
+
return title
|
|
8247
|
+
? title.substring(0, 100) + (" | " + this.l('ApplicationName'))
|
|
8248
|
+
: "" + this.l('ApplicationName');
|
|
8240
8249
|
};
|
|
8241
8250
|
AppBaseComponent.prototype.getPagingFiltersValues = function (form, filters) {
|
|
8242
8251
|
var model = new Object();
|
|
@@ -8244,7 +8253,10 @@
|
|
|
8244
8253
|
var filterItem = filters[i];
|
|
8245
8254
|
if (form.controls[filterItem.FormControlName].value == undefined)
|
|
8246
8255
|
continue;
|
|
8247
|
-
model[filterItem.ActionParameterName] =
|
|
8256
|
+
model[filterItem.ActionParameterName] =
|
|
8257
|
+
form.controls[filterItem.FormControlName].value == undefined
|
|
8258
|
+
? ''
|
|
8259
|
+
: form.controls[filterItem.FormControlName].value;
|
|
8248
8260
|
// params = params.append(filterItem.ActionParameterName, form.controls[filterItem.FormControlName].value == undefined ? '' : form.controls[filterItem.FormControlName].value);
|
|
8249
8261
|
}
|
|
8250
8262
|
return model;
|
|
@@ -8264,7 +8276,7 @@
|
|
|
8264
8276
|
selBox.select();
|
|
8265
8277
|
document.execCommand('copy');
|
|
8266
8278
|
document.body.removeChild(selBox);
|
|
8267
|
-
this.utilityService.notifySuccessMessage(this.l(
|
|
8279
|
+
this.utilityService.notifySuccessMessage(this.l('CopiedSuccessfully'));
|
|
8268
8280
|
};
|
|
8269
8281
|
AppBaseComponent.prototype.addRequiredRule = function (control, controlOptions) {
|
|
8270
8282
|
this.controlUtility.addRequiredToControl(control, controlOptions);
|
|
@@ -8278,39 +8290,39 @@
|
|
|
8278
8290
|
var fromDate = form.controls[fromDateControl].value;
|
|
8279
8291
|
var toDate = form.controls[toDateControl].value;
|
|
8280
8292
|
if (fromDate && toDate && toDate <= fromDate)
|
|
8281
|
-
return {
|
|
8293
|
+
return { customerError: true };
|
|
8282
8294
|
return null;
|
|
8283
8295
|
};
|
|
8284
8296
|
validator.massage = this.l(validationMessageKey);
|
|
8285
8297
|
return validator;
|
|
8286
8298
|
};
|
|
8287
8299
|
AppBaseComponent.prototype.recalculatePageTitle = function () {
|
|
8288
|
-
this.titleService.setTitle(this.calculatePageTitle(
|
|
8300
|
+
this.titleService.setTitle(this.calculatePageTitle(''));
|
|
8289
8301
|
};
|
|
8290
8302
|
AppBaseComponent.prototype.isEnglish = function () {
|
|
8291
8303
|
return this.utilityService.isCurrentLanguageEnglish();
|
|
8292
8304
|
};
|
|
8293
8305
|
AppBaseComponent.prototype.calculateInitials = function (name) {
|
|
8294
|
-
var language = localStorage.getItem(
|
|
8306
|
+
var language = localStorage.getItem('language');
|
|
8295
8307
|
var currentUser = this.auhService.user.profile;
|
|
8296
8308
|
console.log(currentUser);
|
|
8297
|
-
var userName = language ==
|
|
8309
|
+
var userName = language == 'en' ? currentUser.given_nameEn : currentUser.given_nameAr;
|
|
8298
8310
|
if (currentUser) {
|
|
8299
|
-
var fullName = userName.split(
|
|
8311
|
+
var fullName = userName.split(' ');
|
|
8300
8312
|
var initials = void 0;
|
|
8301
8313
|
if (fullName.length > 1) {
|
|
8302
8314
|
if (this.isEN)
|
|
8303
8315
|
initials = fullName.shift().charAt(0) + fullName.pop().charAt(0);
|
|
8304
8316
|
else
|
|
8305
8317
|
initials =
|
|
8306
|
-
fullName.shift().charAt(0) +
|
|
8318
|
+
fullName.shift().charAt(0) + ' ' + fullName.pop().charAt(0);
|
|
8307
8319
|
}
|
|
8308
8320
|
else {
|
|
8309
8321
|
initials = fullName.pop().charAt(0);
|
|
8310
8322
|
}
|
|
8311
8323
|
return initials.toUpperCase();
|
|
8312
8324
|
}
|
|
8313
|
-
return
|
|
8325
|
+
return '';
|
|
8314
8326
|
};
|
|
8315
8327
|
AppBaseComponent.prototype.getCurrentUserInitials = function () {
|
|
8316
8328
|
return this.calculateInitials(this.auhService.name());
|