@stemy/ngx-utils 19.2.7 → 19.2.9

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.
@@ -3671,16 +3671,28 @@ class BaseToasterService {
3671
3671
  };
3672
3672
  }
3673
3673
  info(message, params) {
3674
- this.translateMessage(message, params, "info");
3674
+ this.translate(message, params, "info");
3675
3675
  }
3676
3676
  success(message, params) {
3677
- this.translateMessage(message, params, "success");
3677
+ this.translate(message, params, "success");
3678
3678
  }
3679
3679
  warning(message, params) {
3680
- this.translateMessage(message, params, "warning");
3680
+ this.translate(message, params, "warning");
3681
3681
  }
3682
3682
  error(message, params) {
3683
- this.translateMessage(message, params, "error");
3683
+ this.translate(message, params, "error");
3684
+ }
3685
+ infoPromised(message, params) {
3686
+ return this.translatePromised(message, params, "info");
3687
+ }
3688
+ successPromised(message, params) {
3689
+ return this.translatePromised(message, params, "success");
3690
+ }
3691
+ warningPromised(message, params) {
3692
+ return this.translatePromised(message, params, "warning");
3693
+ }
3694
+ errorPromised(message, params) {
3695
+ return this.translatePromised(message, params, "error");
3684
3696
  }
3685
3697
  handleAsyncMethod(method) {
3686
3698
  if (!method)
@@ -3695,13 +3707,18 @@ class BaseToasterService {
3695
3707
  this.error(reason.message, reason.context);
3696
3708
  });
3697
3709
  }
3698
- translateMessage(message, params, type) {
3710
+ translate(message, params, type) {
3699
3711
  this.language.getTranslation(message, params).then(str => {
3700
- this.show(message, type);
3712
+ this.show(str, type, params);
3701
3713
  });
3702
3714
  }
3703
- show(message, type) {
3704
- console.log(message, `background: ${this.colorMap[type]}; color: #ffffff`);
3715
+ async translatePromised(message, params, type) {
3716
+ const str = await this.language.getTranslation(message, params);
3717
+ return this.show(str, type, params);
3718
+ }
3719
+ show(message, type, params) {
3720
+ console.log(message, `background: ${this.colorMap[type]}; color: #ffffff`, params);
3721
+ return null;
3705
3722
  }
3706
3723
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: BaseToasterService, deps: [{ token: LANGUAGE_SERVICE }], target: i0.ɵɵFactoryTarget.Injectable }); }
3707
3724
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: BaseToasterService }); }