@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.
@@ -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("From");
707
+ _this.rangeFromLabel = _this.utilityService.getResourceValue('From');
708
708
  /** A label for the range 'to' in picker info */
709
- _this.rangeToLabel = _this.utilityService.getResourceValue("To");
709
+ _this.rangeToLabel = _this.utilityService.getResourceValue('To');
710
710
  /** A label for the cancel button */
711
- _this.cancelBtnLabel = _this.utilityService.getResourceValue("Cancel");
711
+ _this.cancelBtnLabel = _this.utilityService.getResourceValue('Cancel');
712
712
  /** A label for the set button */
713
- _this.setBtnLabel = _this.utilityService.getResourceValue("Set");
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 <div class=\"bbsf-input-container\" [ngClass]=\"options.EnableCopyToClipboard? 'p-40px' : '' \">\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\">\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",
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
- // if (this.options.Value != null)
3662
- // this.group.get(this.options.Name).setValue(this.options.Value);
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 _a;
8289
- var fullName = name === null || name === void 0 ? void 0 : name.split(' ');
8290
- if (!fullName)
8291
- return null;
8292
- var initials = fullName.shift().charAt(0) + ((_a = fullName.pop()) === null || _a === void 0 ? void 0 : _a.charAt(0));
8293
- return initials.toUpperCase();
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());