monkey-front-core 0.0.601 → 0.0.602
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/esm2020/lib/core/services/alerts/monkeyecx-alerts.service.mjs +47 -1
- package/fesm2015/monkey-front-core.mjs +42 -0
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +46 -0
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/services/alerts/monkeyecx-alerts.service.d.ts +28 -0
- package/monkey-front-core-0.0.602.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.601.tgz +0 -0
|
@@ -4866,6 +4866,52 @@ class MonkeyEcxAlertsService {
|
|
|
4866
4866
|
verticalPosition: 'top'
|
|
4867
4867
|
});
|
|
4868
4868
|
}
|
|
4869
|
+
showWithClose({ type = 'warning', title, message }) {
|
|
4870
|
+
const i18n = this.translateService.instant([
|
|
4871
|
+
`MECX-ALERTS.${type}`.toUpperCase(),
|
|
4872
|
+
'MECX-ALERTS.BUTTONS'
|
|
4873
|
+
]);
|
|
4874
|
+
this.snackbarService.show({
|
|
4875
|
+
title: i18n?.[`MECX-ALERTS.${type}`.toUpperCase()].TITLES?.[title],
|
|
4876
|
+
message: i18n?.[`MECX-ALERTS.${type}`.toUpperCase()].MESSAGES[message],
|
|
4877
|
+
type,
|
|
4878
|
+
keepOpen: true,
|
|
4879
|
+
horizontalPosition: 'center',
|
|
4880
|
+
verticalPosition: 'top',
|
|
4881
|
+
action: {
|
|
4882
|
+
cancel: {
|
|
4883
|
+
style: 'button',
|
|
4884
|
+
label: i18n?.['MECX-ALERTS.BUTTONS'].CLOSE,
|
|
4885
|
+
action: () => { }
|
|
4886
|
+
}
|
|
4887
|
+
}
|
|
4888
|
+
});
|
|
4889
|
+
}
|
|
4890
|
+
showWithActions({ type = 'warning', title, message, duration, keepOpen, action }) {
|
|
4891
|
+
const i18n = this.translateService.instant([
|
|
4892
|
+
`MECX-ALERTS.${type}`.toUpperCase(),
|
|
4893
|
+
'MECX-ALERTS.BUTTONS'
|
|
4894
|
+
]);
|
|
4895
|
+
action = {
|
|
4896
|
+
...action,
|
|
4897
|
+
confirm: action.confirm
|
|
4898
|
+
? { ...action.confirm, label: i18n?.['MECX-ALERTS.BUTTONS'][action.confirm.label] }
|
|
4899
|
+
: action.confirm,
|
|
4900
|
+
cancel: action.cancel
|
|
4901
|
+
? { ...action.cancel, label: i18n?.['MECX-ALERTS.BUTTONS'][action.cancel.label] }
|
|
4902
|
+
: action.cancel
|
|
4903
|
+
};
|
|
4904
|
+
this.snackbarService.show({
|
|
4905
|
+
title: i18n?.[`MECX-ALERTS.${type}`.toUpperCase()].TITLES?.[title],
|
|
4906
|
+
message: i18n?.[`MECX-ALERTS.${type}`.toUpperCase()].MESSAGES[message],
|
|
4907
|
+
type,
|
|
4908
|
+
duration: duration || undefined,
|
|
4909
|
+
keepOpen: keepOpen || false,
|
|
4910
|
+
horizontalPosition: 'center',
|
|
4911
|
+
verticalPosition: 'top',
|
|
4912
|
+
action
|
|
4913
|
+
});
|
|
4914
|
+
}
|
|
4869
4915
|
}
|
|
4870
4916
|
MonkeyEcxAlertsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxAlertsService, deps: [{ token: i1.MonkeyStyleGuideSnackbarService }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4871
4917
|
MonkeyEcxAlertsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxAlertsService, providedIn: 'root' });
|