ngx-smz-ui 3.1.17 → 3.1.18
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/bundles/ngx-smz-ui.umd.js +17 -9
- package/bundles/ngx-smz-ui.umd.js.map +1 -1
- package/esm2015/lib/modules/rbk-utils/misc/toast.service.js +18 -10
- package/fesm2015/ngx-smz-ui.js +17 -9
- package/fesm2015/ngx-smz-ui.js.map +1 -1
- package/lib/modules/rbk-utils/misc/toast.service.d.ts +3 -3
- package/package.json +1 -1
|
@@ -14031,18 +14031,26 @@
|
|
|
14031
14031
|
}
|
|
14032
14032
|
|
|
14033
14033
|
var ToastService = /** @class */ (function () {
|
|
14034
|
-
function ToastService(messageService, config,
|
|
14034
|
+
function ToastService(messageService, config, appRef) {
|
|
14035
|
+
// if (this.config.toastConfig == null || this.config.toastConfig.debounceDistinctDelay == null) {
|
|
14036
|
+
// throw Error('You need to set the \'debounceDistinctDelay\' at rbkconfig.toastConfig.');
|
|
14037
|
+
// }
|
|
14035
14038
|
this.messageService = messageService;
|
|
14036
14039
|
this.config = config;
|
|
14037
|
-
this.
|
|
14040
|
+
this.appRef = appRef;
|
|
14038
14041
|
this.messages$ = new rxjs.BehaviorSubject(null);
|
|
14039
|
-
if (this.config.toastConfig
|
|
14040
|
-
|
|
14042
|
+
if (this.config.toastConfig.debounceDistinctDelay != null) {
|
|
14043
|
+
this.watch();
|
|
14041
14044
|
}
|
|
14042
|
-
this.watch();
|
|
14043
14045
|
}
|
|
14044
14046
|
ToastService.prototype.add = function (message) {
|
|
14045
|
-
this.
|
|
14047
|
+
if (this.config.toastConfig.debounceDistinctDelay != null) {
|
|
14048
|
+
this.messages$.next(message);
|
|
14049
|
+
}
|
|
14050
|
+
else {
|
|
14051
|
+
this.messageService.add(message);
|
|
14052
|
+
this.appRef.tick();
|
|
14053
|
+
}
|
|
14046
14054
|
};
|
|
14047
14055
|
ToastService.prototype.watch = function () {
|
|
14048
14056
|
var _this = this;
|
|
@@ -14050,7 +14058,7 @@
|
|
|
14050
14058
|
.pipe(debounceDistinctMessage(this.config.toastConfig.debounceDistinctDelay))
|
|
14051
14059
|
.subscribe(function (message) {
|
|
14052
14060
|
_this.messageService.add(message);
|
|
14053
|
-
_this.
|
|
14061
|
+
_this.appRef.tick();
|
|
14054
14062
|
});
|
|
14055
14063
|
};
|
|
14056
14064
|
ToastService.prototype.test = function () {
|
|
@@ -14074,12 +14082,12 @@
|
|
|
14074
14082
|
};
|
|
14075
14083
|
return ToastService;
|
|
14076
14084
|
}());
|
|
14077
|
-
ToastService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: ToastService, deps: [{ token: i1__namespace$6.MessageService }, { token: NgxRbkUtilsConfig }, { token: i0__namespace.
|
|
14085
|
+
ToastService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: ToastService, deps: [{ token: i1__namespace$6.MessageService }, { token: NgxRbkUtilsConfig }, { token: i0__namespace.ApplicationRef }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
14078
14086
|
ToastService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: ToastService, providedIn: 'root' });
|
|
14079
14087
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: ToastService, decorators: [{
|
|
14080
14088
|
type: i0.Injectable,
|
|
14081
14089
|
args: [{ providedIn: 'root' }]
|
|
14082
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$6.MessageService }, { type: NgxRbkUtilsConfig }, { type: i0__namespace.
|
|
14090
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$6.MessageService }, { type: NgxRbkUtilsConfig }, { type: i0__namespace.ApplicationRef }]; } });
|
|
14083
14091
|
|
|
14084
14092
|
// Initial application state, to be used ONLY when the application is starting
|
|
14085
14093
|
var getInitialApplicationState = function () { return ({
|