@stemy/ngx-utils 19.2.7 → 19.2.8
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.
|
|
3674
|
+
this.translate(message, params, "info");
|
|
3675
3675
|
}
|
|
3676
3676
|
success(message, params) {
|
|
3677
|
-
this.
|
|
3677
|
+
this.translate(message, params, "success");
|
|
3678
3678
|
}
|
|
3679
3679
|
warning(message, params) {
|
|
3680
|
-
this.
|
|
3680
|
+
this.translate(message, params, "warning");
|
|
3681
3681
|
}
|
|
3682
3682
|
error(message, params) {
|
|
3683
|
-
this.
|
|
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
|
-
|
|
3710
|
+
translate(message, params, type) {
|
|
3699
3711
|
this.language.getTranslation(message, params).then(str => {
|
|
3700
|
-
this.show(
|
|
3712
|
+
this.show(str, type);
|
|
3701
3713
|
});
|
|
3702
3714
|
}
|
|
3715
|
+
async translatePromised(message, params, type) {
|
|
3716
|
+
const str = await this.language.getTranslation(message, params);
|
|
3717
|
+
return this.show(str, type);
|
|
3718
|
+
}
|
|
3703
3719
|
show(message, type) {
|
|
3704
3720
|
console.log(message, `background: ${this.colorMap[type]}; color: #ffffff`);
|
|
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 }); }
|