@bnsights/bbsf-controls 1.0.77 → 1.0.79
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 +8 -0
- package/bnsights-bbsf-controls-1.0.79.tgz +0 -0
- package/bnsights-bbsf-controls.metadata.json +1 -1
- package/bundles/bnsights-bbsf-controls.umd.js +36 -15
- package/bundles/bnsights-bbsf-controls.umd.js.map +1 -1
- package/esm2015/lib/Shared/components/app-base-component.js +22 -7
- package/esm2015/lib/Shared/default_intl.js +9 -5
- package/esm2015/lib/controls/DateTimePicker/DateTimePicker.component.js +2 -2
- package/esm2015/lib/controls/ImageUpload/ImageUpload.component.js +3 -3
- package/esm2015/lib/controls/MultiLingualTextBox/MultiLingualTextBox.component.js +5 -3
- package/esm2015/lib/controls/bbsf-controls.module.js +1 -1
- package/fesm2015/bnsights-bbsf-controls.js +36 -15
- package/fesm2015/bnsights-bbsf-controls.js.map +1 -1
- package/lib/Shared/components/app-base-component.d.ts +1 -0
- package/lib/Shared/default_intl.d.ts +4 -0
- package/package.json +1 -1
- package/src/lib/assets/sass/base.scss +1 -0
- package/src/lib/assets/sass/checkbox.scss +1 -0
- package/src/lib/assets/sass/datetime-picker.scss +5 -0
- package/bnsights-bbsf-controls-1.0.77.tgz +0 -0
|
@@ -704,13 +704,17 @@
|
|
|
704
704
|
var _this = _super.call(this) || this;
|
|
705
705
|
_this.utilityService = utilityService;
|
|
706
706
|
/** A label for the range 'from' in picker info */
|
|
707
|
-
_this.rangeFromLabel = _this.utilityService.getResourceValue(
|
|
707
|
+
_this.rangeFromLabel = _this.utilityService.getResourceValue('From');
|
|
708
708
|
/** A label for the range 'to' in picker info */
|
|
709
|
-
_this.rangeToLabel = _this.utilityService.getResourceValue(
|
|
709
|
+
_this.rangeToLabel = _this.utilityService.getResourceValue('To');
|
|
710
710
|
/** A label for the cancel button */
|
|
711
|
-
_this.cancelBtnLabel = _this.utilityService.getResourceValue(
|
|
711
|
+
_this.cancelBtnLabel = _this.utilityService.getResourceValue('Cancel');
|
|
712
712
|
/** A label for the set button */
|
|
713
|
-
_this.setBtnLabel = _this.utilityService.getResourceValue(
|
|
713
|
+
_this.setBtnLabel = _this.utilityService.getResourceValue('Save');
|
|
714
|
+
/** A label for the hour12 button (AM) */
|
|
715
|
+
_this.hour12AMLabel = _this.utilityService.getResourceValue('AM');
|
|
716
|
+
/** A label for the hour12 button (PM) */
|
|
717
|
+
_this.hour12PMLabel = _this.utilityService.getResourceValue('PM');
|
|
714
718
|
return _this;
|
|
715
719
|
}
|
|
716
720
|
return DefaultIntl;
|
|
@@ -904,7 +908,7 @@
|
|
|
904
908
|
DateInputComponent.decorators = [
|
|
905
909
|
{ type: i0.Component, args: [{
|
|
906
910
|
selector: 'BBSF-DateTimePicker',
|
|
907
|
-
template: "\r\n<div class=\"form-group bbsf-control bbsf-datetime-picker\" [formGroup]=\"group\">\r\n <div [ngClass]=\"(options.ViewType==1)?'bbsf-vertical':'bbsf-horizontal'\">\r\n <!--label-->\r\n <label *ngIf=\"!options.HideLabel\" class=\"bbsf-label {{options.LabelExtraClasses}}\">\r\n {{options.LabelValue}}\r\n </label>\r\n <
|
|
911
|
+
template: "\r\n<div class=\"form-group bbsf-control bbsf-datetime-picker\" [formGroup]=\"group\">\r\n <div [ngClass]=\"(options.ViewType==1)?'bbsf-vertical':'bbsf-horizontal'\">\r\n <!--label-->\r\n <label *ngIf=\"!options.HideLabel\" class=\"bbsf-label {{options.LabelExtraClasses}}\">\r\n {{options.LabelValue}}\r\n </label>\r\n <!--Asterisk-->\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\" class=\"text-danger\"\r\n aria-required=\"true\">*</span>\r\n <div class=\"bbsf-input-container\">\r\n <!--input-->\r\n <input autocomplete=\"off\" (dateTimeChange)=\"onDateSelect($event)\"\r\n dir=\"{{options.ForceDirection==2?'rtl':''}}\"\r\n class=\"form-control bnsights-control {{options.ExtraClasses}} \"\r\n [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\" aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n formControlName=\"{{options.Name}}\" [owlDateTime]=\"dt1\" [owlDateTimeTrigger]=\"dt1\"\r\n [class.is-invalid]=\"DatePickerFormControl.invalid && DatePickerFormControl.touched\"\r\n [min]=\"options.StartDate\" [max]=\"options.EndDate\" [hour12Timer]=\"options.Hour12Timer\" [selectMode]=\"getSelectMode(options.SelectMode)\"\r\n placeholder=\"{{options.Placeholder}}\" id=\"{{options.Name}}\" #Dateinput>\r\n\r\n <owl-date-time [pickerType]=\"getPickerType(options.PickerType)\"\r\n [startView]=\"getStartView(options.StartView)\" [firstDayOfWeek]=\"options.FirstDayOfWeek\"\r\n [hour12Timer]=\"options.Hour12Timer\" #dt1></owl-date-time>\r\n <!--icon-->\r\n <span class=\"copy-clipboard\" [owlDateTimeTrigger]=\"dt1\">\r\n <span class=\"svg-icon\">\r\n <svg id=\"Group_356\" data-name=\"Group 356\" xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"15\" viewBox=\"0 0 48 48\">\r\n <path id=\"Path_6737\" data-name=\"Path 6737\" d=\"M11.583,1a1,1,0,0,0-2,0V5.7h2Z\" style=\"\"></path>\r\n <path id=\"Path_6738\" data-name=\"Path 6738\" d=\"M38.417,1a1,1,0,0,0-2,0V5.7h2Z\"></path>\r\n <path id=\"Path_6739\" data-name=\"Path 6739\" d=\"M0,43.146C0,45.822,1.826,48,4.07,48H43.928C46.174,48,48,45.822,48,43.146V17.121H0Z\" fill=\"#d5d5d5\"></path>\r\n <path id=\"Path_6740\" data-name=\"Path 6740\" d=\"M43.929,5.7H38.417v5.512a1,1,0,1,1-2,0V5.7H11.583v5.512a1,1,0,1,1-2,0V5.7H4.07C1.826,5.7,0,7.877,0,10.555v4.566H48V10.555C48,7.877,46.174,5.7,43.929,5.7Z\" fill=\"#595959\"></path>\r\n </svg>\r\n </span>\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"subtext-container\">\r\n <!-- LabelDescription-->\r\n <div class=\"bbsf-control-desc\" *ngIf=\"options.LabelDescription!=null\">{{options.LabelDescription}}</div>\r\n <!-- requiredText-->\r\n <div class=\"bbsf-validation\" *ngIf=\"(DatePickerFormControl.invalid && DatePickerFormControl.touched)\">\r\n {{getErrorValidation(DatePickerFormControl.errors|keyvalue)}}\r\n </div>\r\n </div>\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n</div>\r\n",
|
|
908
912
|
providers: [
|
|
909
913
|
{ provide: ngPickDatetime.OwlDateTimeIntl, useClass: DefaultIntl }
|
|
910
914
|
]
|
|
@@ -1625,7 +1629,8 @@
|
|
|
1625
1629
|
MultiLingualTextBoxComponent.prototype.trimControlValue = function (type) {
|
|
1626
1630
|
var whitespace = ' ';
|
|
1627
1631
|
if (type == "En") {
|
|
1628
|
-
var originalValue = this.EnglishFormControl.value;
|
|
1632
|
+
var originalValue = this.controlUtility.trimControlValue(this.EnglishFormControl.value);
|
|
1633
|
+
this.EnglishFormControl.patchValue(originalValue);
|
|
1629
1634
|
if (this.options.PatchFunction && this.options.PatchPath && this.EnglishFormControl.valid) {
|
|
1630
1635
|
this.controlUtility.patchControlValue(originalValue, this.options.PatchFunction, this.options.PatchPath);
|
|
1631
1636
|
}
|
|
@@ -1634,7 +1639,8 @@
|
|
|
1634
1639
|
}
|
|
1635
1640
|
}
|
|
1636
1641
|
if (type == "Ar") {
|
|
1637
|
-
var originalValue = this.ArabicFormControl.value;
|
|
1642
|
+
var originalValue = this.controlUtility.trimControlValue(this.ArabicFormControl.value);
|
|
1643
|
+
this.ArabicFormControl.patchValue(originalValue);
|
|
1638
1644
|
if (this.options.PatchFunction && this.options.PatchPath && this.ArabicFormControl.valid) {
|
|
1639
1645
|
this.controlUtility.patchControlValue(originalValue, this.options.PatchFunction, this.options.PatchPath);
|
|
1640
1646
|
}
|
|
@@ -3658,8 +3664,8 @@
|
|
|
3658
3664
|
}
|
|
3659
3665
|
this.group.addControl(this.options.Name, new forms.FormControl(''));
|
|
3660
3666
|
this.ImageUploadFormControl = this.group.controls[this.options.Name]; // new FormControl('',validationRules);
|
|
3661
|
-
|
|
3662
|
-
|
|
3667
|
+
if (this.options.Value != null)
|
|
3668
|
+
this.group.get(this.options.Name).setValue(this.options.Value);
|
|
3663
3669
|
if (this.options.LabelKey != null && this.options.LabelKey != '')
|
|
3664
3670
|
this.options.LabelValue = this.UtilityService.getResourceValue(this.options.LabelKey);
|
|
3665
3671
|
if (this.options.CustomValidation.length > 0) {
|
|
@@ -8181,6 +8187,7 @@
|
|
|
8181
8187
|
this.filtersLabel = this.utilityService.getResourceValue("Filters");
|
|
8182
8188
|
this.addLabel = this.utilityService.getResourceValue("Add");
|
|
8183
8189
|
this.userName = this.auhService.name();
|
|
8190
|
+
this.isEN = this.utilityService.isCurrentLanguageEnglish();
|
|
8184
8191
|
}
|
|
8185
8192
|
AppBaseComponent.prototype.updatePageTitle = function (title) {
|
|
8186
8193
|
this.titleService.setTitle(this.calculatePageTitle(title));
|
|
@@ -8285,12 +8292,26 @@
|
|
|
8285
8292
|
return this.utilityService.isCurrentLanguageEnglish();
|
|
8286
8293
|
};
|
|
8287
8294
|
AppBaseComponent.prototype.calculateInitials = function (name) {
|
|
8288
|
-
var
|
|
8289
|
-
var
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8295
|
+
var language = localStorage.getItem("language");
|
|
8296
|
+
var currentUser = this.auhService.user.profile;
|
|
8297
|
+
console.log(currentUser);
|
|
8298
|
+
var userName = language == "en" ? currentUser.given_nameEn : currentUser.given_nameAr;
|
|
8299
|
+
if (currentUser) {
|
|
8300
|
+
var fullName = userName.split(" ");
|
|
8301
|
+
var initials = void 0;
|
|
8302
|
+
if (fullName.length > 1) {
|
|
8303
|
+
if (this.isEN)
|
|
8304
|
+
initials = fullName.shift().charAt(0) + fullName.pop().charAt(0);
|
|
8305
|
+
else
|
|
8306
|
+
initials =
|
|
8307
|
+
fullName.shift().charAt(0) + " " + fullName.pop().charAt(0);
|
|
8308
|
+
}
|
|
8309
|
+
else {
|
|
8310
|
+
initials = fullName.pop().charAt(0);
|
|
8311
|
+
}
|
|
8312
|
+
return initials.toUpperCase();
|
|
8313
|
+
}
|
|
8314
|
+
return "";
|
|
8294
8315
|
};
|
|
8295
8316
|
AppBaseComponent.prototype.getCurrentUserInitials = function () {
|
|
8296
8317
|
return this.calculateInitials(this.auhService.name());
|