@craftsjs/alert 1.0.0 → 4.0.0

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.
Files changed (46) hide show
  1. package/README.md +4 -1
  2. package/craftsjs-alert.d.ts +1 -0
  3. package/{esm2015/craftsjs-alert.js → esm2020/craftsjs-alert.mjs} +0 -0
  4. package/esm2020/lib/alert.module.mjs +69 -0
  5. package/esm2020/lib/components/dialog-alert/components/alert-info/alert-info.component.mjs +13 -0
  6. package/esm2020/lib/components/dialog-alert/components/alert-success/alert-success.component.mjs +13 -0
  7. package/esm2020/lib/components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component.mjs +18 -0
  8. package/esm2020/lib/components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component.mjs +18 -0
  9. package/{esm2015/lib/components/dialog-alert/components/components.js → esm2020/lib/components/dialog-alert/components/components.mjs} +0 -0
  10. package/esm2020/lib/components/dialog-alert/components/error/error.component.mjs +13 -0
  11. package/esm2020/lib/components/dialog-alert/components/warning/warning.component.mjs +13 -0
  12. package/esm2020/lib/components/dialog-alert/dialog-alert.component.mjs +74 -0
  13. package/{esm2015/lib/models/alert-enum.model.js → esm2020/lib/models/alert-enum.model.mjs} +0 -0
  14. package/{esm2015/lib/models/alert.model.js → esm2020/lib/models/alert.model.mjs} +1 -0
  15. package/esm2020/lib/services/alert.service.mjs +64 -0
  16. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  17. package/fesm2015/craftsjs-alert.mjs +300 -0
  18. package/fesm2015/craftsjs-alert.mjs.map +1 -0
  19. package/fesm2020/craftsjs-alert.mjs +298 -0
  20. package/fesm2020/craftsjs-alert.mjs.map +1 -0
  21. package/lib/alert.module.d.ts +16 -0
  22. package/lib/components/dialog-alert/components/alert-info/alert-info.component.d.ts +3 -0
  23. package/lib/components/dialog-alert/components/alert-success/alert-success.component.d.ts +3 -0
  24. package/lib/components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component.d.ts +3 -0
  25. package/lib/components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component.d.ts +3 -0
  26. package/lib/components/dialog-alert/components/error/error.component.d.ts +3 -0
  27. package/lib/components/dialog-alert/components/warning/warning.component.d.ts +3 -0
  28. package/lib/components/dialog-alert/dialog-alert.component.d.ts +5 -3
  29. package/lib/services/alert.service.d.ts +3 -0
  30. package/package.json +27 -15
  31. package/bundles/craftsjs-alert.umd.js +0 -333
  32. package/bundles/craftsjs-alert.umd.js.map +0 -1
  33. package/bundles/craftsjs-alert.umd.min.js +0 -2
  34. package/bundles/craftsjs-alert.umd.min.js.map +0 -1
  35. package/craftsjs-alert.metadata.json +0 -1
  36. package/esm2015/lib/alert.module.js +0 -55
  37. package/esm2015/lib/components/dialog-alert/components/alert-info/alert-info.component.js +0 -16
  38. package/esm2015/lib/components/dialog-alert/components/alert-success/alert-success.component.js +0 -16
  39. package/esm2015/lib/components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component.js +0 -18
  40. package/esm2015/lib/components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component.js +0 -18
  41. package/esm2015/lib/components/dialog-alert/components/error/error.component.js +0 -16
  42. package/esm2015/lib/components/dialog-alert/components/warning/warning.component.js +0 -16
  43. package/esm2015/lib/components/dialog-alert/dialog-alert.component.js +0 -67
  44. package/esm2015/lib/services/alert.service.js +0 -64
  45. package/fesm2015/craftsjs-alert.js +0 -302
  46. package/fesm2015/craftsjs-alert.js.map +0 -1
@@ -0,0 +1,298 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, ViewEncapsulation, EventEmitter, Output, InjectionToken, TemplateRef, Injector, Inject, ViewChildren, Injectable, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/material/button';
4
+ import { MatButtonModule } from '@angular/material/button';
5
+ import * as i1$1 from '@angular/material/dialog';
6
+ import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
7
+ import * as i2 from '@ngx-translate/core';
8
+ import { TranslateModule } from '@ngx-translate/core';
9
+ import * as i5 from '@angular/common';
10
+ import { CommonModule } from '@angular/common';
11
+ import * as i4 from '@craftsjs/core';
12
+ import { DynamicDirective, CoreModule } from '@craftsjs/core';
13
+
14
+ class AlertSuccessComponent {
15
+ }
16
+ AlertSuccessComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertSuccessComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
17
+ AlertSuccessComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.7", type: AlertSuccessComponent, selector: "alert-success", host: { classAttribute: "alert-icon alert-icon-success" }, ngImport: i0, template: "<span class=\"alert-icon-success-line alert-icon-success-line-long\"></span>\r\n<span class=\"alert-icon-success-line alert-icon-success-line-tip\"></span>\r\n<div class=\"alert-icon-success-ring\"></div>\r\n<div class=\"alert-icon-success-hide-corners\"></div>", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
18
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertSuccessComponent, decorators: [{
19
+ type: Component,
20
+ args: [{ selector: 'alert-success', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
21
+ class: 'alert-icon alert-icon-success'
22
+ }, template: "<span class=\"alert-icon-success-line alert-icon-success-line-long\"></span>\r\n<span class=\"alert-icon-success-line alert-icon-success-line-tip\"></span>\r\n<div class=\"alert-icon-success-ring\"></div>\r\n<div class=\"alert-icon-success-hide-corners\"></div>", styles: [""] }]
23
+ }] });
24
+
25
+ var AlertEnum;
26
+ (function (AlertEnum) {
27
+ AlertEnum["success"] = "success";
28
+ AlertEnum["error"] = "error";
29
+ AlertEnum["info"] = "info";
30
+ AlertEnum["warning"] = "warning";
31
+ })(AlertEnum || (AlertEnum = {}));
32
+
33
+ class AlertInfoComponent {
34
+ }
35
+ AlertInfoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
36
+ AlertInfoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.7", type: AlertInfoComponent, selector: "alert-info", host: { classAttribute: "alert-icon alert-icon-info" }, ngImport: i0, template: "", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertInfoComponent, decorators: [{
38
+ type: Component,
39
+ args: [{ selector: 'alert-info', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
40
+ class: 'alert-icon alert-icon-info'
41
+ }, template: "", styles: [""] }]
42
+ }] });
43
+
44
+ class WarningComponent {
45
+ }
46
+ WarningComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: WarningComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
47
+ WarningComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.7", type: WarningComponent, selector: "alert-warning", host: { classAttribute: "alert-icon alert-icon-warning " }, ngImport: i0, template: "<span class=\"alert-icon-warning-body\">\r\n <span class=\"alert-icon-warning-dot\"></span>\r\n</span>", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
48
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: WarningComponent, decorators: [{
49
+ type: Component,
50
+ args: [{ selector: 'alert-warning', host: {
51
+ class: 'alert-icon alert-icon-warning '
52
+ }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<span class=\"alert-icon-warning-body\">\r\n <span class=\"alert-icon-warning-dot\"></span>\r\n</span>", styles: [""] }]
53
+ }] });
54
+
55
+ class ErrorComponent {
56
+ }
57
+ ErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: ErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
58
+ ErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.7", type: ErrorComponent, selector: "alert-error", host: { classAttribute: "alert-icon alert-icon-error" }, ngImport: i0, template: "<div class=\"alert-icon-error-x-mark\">\r\n <span class=\"alert-icon-error-line alert-icon-error-line-left\"></span>\r\n <span class=\"alert-icon-error-line alert-icon-error-line-right\"></span>\r\n</div>", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: ErrorComponent, decorators: [{
60
+ type: Component,
61
+ args: [{ selector: 'alert-error', host: {
62
+ class: 'alert-icon alert-icon-error'
63
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"alert-icon-error-x-mark\">\r\n <span class=\"alert-icon-error-line alert-icon-error-line-left\"></span>\r\n <span class=\"alert-icon-error-line alert-icon-error-line-right\"></span>\r\n</div>", styles: [""] }]
64
+ }] });
65
+
66
+ const alertComponents = [
67
+ {
68
+ type: AlertEnum.success,
69
+ component: AlertSuccessComponent
70
+ },
71
+ {
72
+ type: AlertEnum.info,
73
+ component: AlertInfoComponent
74
+ },
75
+ {
76
+ type: AlertEnum.warning,
77
+ component: WarningComponent
78
+ },
79
+ {
80
+ type: AlertEnum.error,
81
+ component: ErrorComponent
82
+ }
83
+ ];
84
+
85
+ class AlertOkButtonComponent {
86
+ constructor() {
87
+ this.click = new EventEmitter();
88
+ }
89
+ }
90
+ AlertOkButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertOkButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
91
+ AlertOkButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.7", type: AlertOkButtonComponent, selector: "alert-ok-button", outputs: { click: "click" }, ngImport: i0, template: "<button mat-raised-button color=\"primary\" (click)=\"click.emit($event)\">{{'general.ok' | translate}}</button>", styles: [""], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], pipes: { "translate": i2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertOkButtonComponent, decorators: [{
93
+ type: Component,
94
+ args: [{ selector: 'alert-ok-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button mat-raised-button color=\"primary\" (click)=\"click.emit($event)\">{{'general.ok' | translate}}</button>", styles: [""] }]
95
+ }], propDecorators: { click: [{
96
+ type: Output
97
+ }] } });
98
+
99
+ class AlertCancelButtonComponent {
100
+ constructor() {
101
+ this.click = new EventEmitter();
102
+ }
103
+ }
104
+ AlertCancelButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertCancelButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
105
+ AlertCancelButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.7", type: AlertCancelButtonComponent, selector: "alert-cancel-button", outputs: { click: "click" }, ngImport: i0, template: "<button mat-raised-button (click)=\"click.emit($event)\">{{'general.cancel' | translate}}</button>", styles: [""], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], pipes: { "translate": i2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertCancelButtonComponent, decorators: [{
107
+ type: Component,
108
+ args: [{ selector: 'alert-cancel-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button mat-raised-button (click)=\"click.emit($event)\">{{'general.cancel' | translate}}</button>", styles: [""] }]
109
+ }], propDecorators: { click: [{
110
+ type: Output
111
+ }] } });
112
+
113
+ const CRAFTSJS_ALERT_DATA = new InjectionToken('CraftsjsAlertData');
114
+ class DialogAlertComponent {
115
+ constructor(dialogRef, data) {
116
+ this.dialogRef = dialogRef;
117
+ this.data = data;
118
+ }
119
+ ngOnInit() {
120
+ }
121
+ ngAfterViewInit() {
122
+ this.loadComponents();
123
+ }
124
+ loadComponents() {
125
+ const itemComponent = alertComponents.find(x => x.type === this.data.type);
126
+ const component = itemComponent && itemComponent.component;
127
+ this.resolveComponent(component, this.appDynamic.find(x => x.name === 'alert-icon').viewContainerRef);
128
+ this.resolveComponent(this.data.customBody, this.appDynamic.find(x => x.name === 'alert-body').viewContainerRef);
129
+ this.resolveComponent(this.data.customButtonComponent, this.appDynamic.find(x => x.name === 'alert-buttons').viewContainerRef);
130
+ }
131
+ resolveComponent(component, viewContainerRef) {
132
+ if (!component) {
133
+ return;
134
+ }
135
+ viewContainerRef.clear();
136
+ if (component instanceof TemplateRef) {
137
+ viewContainerRef.createEmbeddedView(component, { $implicit: this.data, dialogRef: this.dialogRef });
138
+ }
139
+ else {
140
+ const injector = this.createInjector(viewContainerRef.injector);
141
+ viewContainerRef.createComponent(component, {
142
+ injector
143
+ });
144
+ }
145
+ }
146
+ createInjector(injector) {
147
+ return Injector.create({
148
+ providers: [{
149
+ provide: CRAFTSJS_ALERT_DATA,
150
+ useValue: this.data
151
+ },
152
+ {
153
+ provide: MatDialogRef,
154
+ useValue: this.dialogRef
155
+ }],
156
+ parent: injector
157
+ });
158
+ }
159
+ buttonClick(result) {
160
+ this.dialogRef.close({ data: this.data, result });
161
+ }
162
+ }
163
+ DialogAlertComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: DialogAlertComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
164
+ DialogAlertComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.7", type: DialogAlertComponent, selector: "dialog-alert", viewQueries: [{ propertyName: "appDynamic", predicate: DynamicDirective, descendants: true }], ngImport: i0, template: "<ng-template craftsjsDynamic name=\"alert-icon\"></ng-template>\r\n<div *ngIf=\"data?.title\" class=\"alert-title\">\r\n <span>\r\n {{data.title | translate}}\r\n </span>\r\n</div>\r\n<div *ngIf=\"data?.text\" class=\"alert-text\">\r\n <span>\r\n {{data.text | translate}}\r\n </span>\r\n</div>\r\n<ng-template craftsjsDynamic name=\"alert-body\"></ng-template>\r\n<div class=\"alert-footer\" *ngIf=\"!data?.hiddenButtons\">\r\n <alert-ok-button *ngIf=\"!data?.customButtonComponent\" (click)=\"buttonClick('ok')\">\r\n </alert-ok-button>\r\n <alert-cancel-button *ngIf=\"!data?.customButtonComponent && data?.showCancelButton\"\r\n (click)=\"buttonClick('cancel')\">\r\n </alert-cancel-button>\r\n</div>\r\n<ng-template craftsjsDynamic name=\"alert-buttons\"></ng-template>", styles: [".alert-icon{width:80px;height:80px;border-width:4px;border-style:solid;border-radius:50%;padding:0;position:relative;box-sizing:content-box;margin:20px auto}.alert-icon-custom{width:auto;height:auto;max-width:100%;border:none;border-radius:0}.alert-icon img{max-width:100%;max-height:100%}.alert-title{color:#000000a6;font-weight:600;text-transform:none;position:relative;display:block;font-size:27px;line-height:normal;text-align:center;margin-bottom:0}.alert-title:first-child{margin-top:26px}.alert-title:not(:first-child){padding-bottom:0}.alert-title:not(:last-child){margin-bottom:13px}.alert-text{font-size:16px;position:relative;float:none;line-height:normal;vertical-align:top;text-align:center;display:inline-block;margin:0;padding:0 10px;font-weight:400;color:#000000a3;overflow-wrap:break-word;box-sizing:border-box;width:100%}.alert-text:first-child{margin-top:45px}.alert-text:last-child{margin-bottom:45px}.alert-footer{text-align:right;margin-top:13px;padding:13px 16px;border-radius:inherit;border-top-left-radius:0;border-top-right-radius:0}.alert-footer-button-container{margin:5px;display:inline-block;position:relative}.alert-footer>*{display:inline-block;margin-right:.5em}.alert-footer>:last-child{margin-right:inherit}\n"], components: [{ type: AlertOkButtonComponent, selector: "alert-ok-button", outputs: ["click"] }, { type: AlertCancelButtonComponent, selector: "alert-cancel-button", outputs: ["click"] }], directives: [{ type: i4.DynamicDirective, selector: "[craftsjsDynamic]", inputs: ["name"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: DialogAlertComponent, decorators: [{
166
+ type: Component,
167
+ args: [{ selector: 'dialog-alert', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-template craftsjsDynamic name=\"alert-icon\"></ng-template>\r\n<div *ngIf=\"data?.title\" class=\"alert-title\">\r\n <span>\r\n {{data.title | translate}}\r\n </span>\r\n</div>\r\n<div *ngIf=\"data?.text\" class=\"alert-text\">\r\n <span>\r\n {{data.text | translate}}\r\n </span>\r\n</div>\r\n<ng-template craftsjsDynamic name=\"alert-body\"></ng-template>\r\n<div class=\"alert-footer\" *ngIf=\"!data?.hiddenButtons\">\r\n <alert-ok-button *ngIf=\"!data?.customButtonComponent\" (click)=\"buttonClick('ok')\">\r\n </alert-ok-button>\r\n <alert-cancel-button *ngIf=\"!data?.customButtonComponent && data?.showCancelButton\"\r\n (click)=\"buttonClick('cancel')\">\r\n </alert-cancel-button>\r\n</div>\r\n<ng-template craftsjsDynamic name=\"alert-buttons\"></ng-template>", styles: [".alert-icon{width:80px;height:80px;border-width:4px;border-style:solid;border-radius:50%;padding:0;position:relative;box-sizing:content-box;margin:20px auto}.alert-icon-custom{width:auto;height:auto;max-width:100%;border:none;border-radius:0}.alert-icon img{max-width:100%;max-height:100%}.alert-title{color:#000000a6;font-weight:600;text-transform:none;position:relative;display:block;font-size:27px;line-height:normal;text-align:center;margin-bottom:0}.alert-title:first-child{margin-top:26px}.alert-title:not(:first-child){padding-bottom:0}.alert-title:not(:last-child){margin-bottom:13px}.alert-text{font-size:16px;position:relative;float:none;line-height:normal;vertical-align:top;text-align:center;display:inline-block;margin:0;padding:0 10px;font-weight:400;color:#000000a3;overflow-wrap:break-word;box-sizing:border-box;width:100%}.alert-text:first-child{margin-top:45px}.alert-text:last-child{margin-bottom:45px}.alert-footer{text-align:right;margin-top:13px;padding:13px 16px;border-radius:inherit;border-top-left-radius:0;border-top-right-radius:0}.alert-footer-button-container{margin:5px;display:inline-block;position:relative}.alert-footer>*{display:inline-block;margin-right:.5em}.alert-footer>:last-child{margin-right:inherit}\n"] }]
168
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
169
+ type: Inject,
170
+ args: [MAT_DIALOG_DATA]
171
+ }] }]; }, propDecorators: { appDynamic: [{
172
+ type: ViewChildren,
173
+ args: [DynamicDirective]
174
+ }] } });
175
+
176
+ class AlertService {
177
+ constructor(_dialog) {
178
+ this._dialog = _dialog;
179
+ }
180
+ showSimple(title, message) {
181
+ return this._open({
182
+ title,
183
+ text: message
184
+ });
185
+ }
186
+ showSuccess(title, message) {
187
+ return this._open({
188
+ title,
189
+ text: message,
190
+ type: AlertEnum.success
191
+ });
192
+ }
193
+ showError(title, message) {
194
+ return this._open({
195
+ title,
196
+ text: message,
197
+ type: AlertEnum.error
198
+ });
199
+ }
200
+ showInfo(title, message) {
201
+ return this._open({
202
+ title,
203
+ text: message,
204
+ type: AlertEnum.info
205
+ });
206
+ }
207
+ showWarning(title, message) {
208
+ return this._open({
209
+ title,
210
+ text: message,
211
+ type: AlertEnum.warning
212
+ });
213
+ }
214
+ showConfirmation(title, message) {
215
+ return this._open({
216
+ title,
217
+ text: message,
218
+ type: AlertEnum.warning,
219
+ showCancelButton: true
220
+ });
221
+ }
222
+ _open(alertModel) {
223
+ return this._dialog.open(DialogAlertComponent, {
224
+ width: '500px',
225
+ data: alertModel
226
+ });
227
+ }
228
+ }
229
+ AlertService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertService, deps: [{ token: i1$1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
230
+ AlertService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertService });
231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertService, decorators: [{
232
+ type: Injectable
233
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialog }]; } });
234
+
235
+ class AlertModule {
236
+ static forRoot() {
237
+ return {
238
+ ngModule: AlertModule,
239
+ providers: [
240
+ AlertService
241
+ ]
242
+ };
243
+ }
244
+ }
245
+ AlertModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
246
+ AlertModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertModule, declarations: [DialogAlertComponent,
247
+ AlertSuccessComponent,
248
+ AlertInfoComponent,
249
+ WarningComponent,
250
+ ErrorComponent,
251
+ AlertOkButtonComponent,
252
+ AlertCancelButtonComponent], imports: [CommonModule,
253
+ TranslateModule,
254
+ MatButtonModule,
255
+ CoreModule,
256
+ MatDialogModule], exports: [DialogAlertComponent] });
257
+ AlertModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertModule, imports: [[
258
+ CommonModule,
259
+ TranslateModule,
260
+ MatButtonModule,
261
+ CoreModule,
262
+ MatDialogModule
263
+ ]] });
264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.7", ngImport: i0, type: AlertModule, decorators: [{
265
+ type: NgModule,
266
+ args: [{
267
+ imports: [
268
+ CommonModule,
269
+ TranslateModule,
270
+ MatButtonModule,
271
+ CoreModule,
272
+ MatDialogModule
273
+ ],
274
+ declarations: [
275
+ DialogAlertComponent,
276
+ AlertSuccessComponent,
277
+ AlertInfoComponent,
278
+ WarningComponent,
279
+ ErrorComponent,
280
+ AlertOkButtonComponent,
281
+ AlertCancelButtonComponent
282
+ ],
283
+ exports: [
284
+ DialogAlertComponent
285
+ ]
286
+ }]
287
+ }] });
288
+
289
+ /*
290
+ * Public API Surface of alert
291
+ */
292
+
293
+ /**
294
+ * Generated bundle index. Do not edit.
295
+ */
296
+
297
+ export { AlertCancelButtonComponent, AlertEnum, AlertInfoComponent, AlertModule, AlertOkButtonComponent, AlertService, AlertSuccessComponent, CRAFTSJS_ALERT_DATA, DialogAlertComponent, ErrorComponent, WarningComponent, alertComponents };
298
+ //# sourceMappingURL=craftsjs-alert.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"craftsjs-alert.mjs","sources":["../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/alert-success/alert-success.component.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/alert-success/alert-success.component.html","../../../../projects/craftsjs/alert/src/lib/models/alert-enum.model.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/alert-info/alert-info.component.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/alert-info/alert-info.component.html","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/warning/warning.component.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/warning/warning.component.html","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/error/error.component.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/error/error.component.html","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/components.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component.html","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component.html","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/dialog-alert.component.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/dialog-alert.component.html","../../../../projects/craftsjs/alert/src/lib/services/alert.service.ts","../../../../projects/craftsjs/alert/src/lib/alert.module.ts","../../../../projects/craftsjs/alert/src/public-api.ts","../../../../projects/craftsjs/alert/src/craftsjs-alert.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'alert-success',\r\n templateUrl: './alert-success.component.html',\r\n styleUrls: ['./alert-success.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n host: {\r\n class: 'alert-icon alert-icon-success'\r\n }\r\n})\r\nexport class AlertSuccessComponent { }\r\n","<span class=\"alert-icon-success-line alert-icon-success-line-long\"></span>\r\n<span class=\"alert-icon-success-line alert-icon-success-line-tip\"></span>\r\n<div class=\"alert-icon-success-ring\"></div>\r\n<div class=\"alert-icon-success-hide-corners\"></div>","export enum AlertEnum {\r\n success = 'success',\r\n error = 'error',\r\n info = 'info',\r\n warning = 'warning'\r\n}\r\n","import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'alert-info',\r\n templateUrl: './alert-info.component.html',\r\n styleUrls: ['./alert-info.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n host: {\r\n class: 'alert-icon alert-icon-info'\r\n }\r\n})\r\nexport class AlertInfoComponent { }\r\n","","import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'alert-warning',\r\n templateUrl: './warning.component.html',\r\n styleUrls: ['./warning.component.scss'],\r\n host: {\r\n class: 'alert-icon alert-icon-warning '\r\n },\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class WarningComponent { }\r\n","<span class=\"alert-icon-warning-body\">\r\n <span class=\"alert-icon-warning-dot\"></span>\r\n</span>","import { Component, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'alert-error',\r\n templateUrl: './error.component.html',\r\n styleUrls: ['./error.component.scss'],\r\n host: {\r\n class: 'alert-icon alert-icon-error'\r\n },\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class ErrorComponent { }\r\n","<div class=\"alert-icon-error-x-mark\">\r\n <span class=\"alert-icon-error-line alert-icon-error-line-left\"></span>\r\n <span class=\"alert-icon-error-line alert-icon-error-line-right\"></span>\r\n</div>","import { AlertSuccessComponent } from './alert-success/alert-success.component';\r\nimport { AlertEnum } from '../../../models/alert-enum.model';\r\nimport { AlertInfoComponent } from './alert-info/alert-info.component';\r\nimport { WarningComponent } from './warning/warning.component';\r\nimport { ErrorComponent } from './error/error.component';\r\n\r\nexport const alertComponents = [\r\n {\r\n type: AlertEnum.success,\r\n component: AlertSuccessComponent\r\n },\r\n {\r\n type: AlertEnum.info,\r\n component: AlertInfoComponent\r\n },\r\n {\r\n type: AlertEnum.warning,\r\n component: WarningComponent\r\n },\r\n {\r\n type: AlertEnum.error,\r\n component: ErrorComponent\r\n }\r\n];\r\n","import { Component, ChangeDetectionStrategy, Output, EventEmitter } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'alert-ok-button',\r\n templateUrl: './alert-ok-button.component.html',\r\n styleUrls: ['./alert-ok-button.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class AlertOkButtonComponent {\r\n @Output()\r\n click = new EventEmitter();\r\n}\r\n","<button mat-raised-button color=\"primary\" (click)=\"click.emit($event)\">{{'general.ok' | translate}}</button>","import { Component, ChangeDetectionStrategy, Output, EventEmitter } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'alert-cancel-button',\r\n templateUrl: './alert-cancel-button.component.html',\r\n styleUrls: ['./alert-cancel-button.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class AlertCancelButtonComponent {\r\n @Output()\r\n click = new EventEmitter();\r\n}\r\n","<button mat-raised-button (click)=\"click.emit($event)\">{{'general.cancel' | translate}}</button>","import {\r\n Component,\r\n ChangeDetectionStrategy,\r\n Inject,\r\n ViewEncapsulation,\r\n OnInit,\r\n Injector,\r\n InjectionToken,\r\n Type,\r\n ViewContainerRef,\r\n QueryList,\r\n ViewChildren,\r\n AfterViewInit,\r\n TemplateRef\r\n} from '@angular/core';\r\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\r\nimport { AlertModel } from '../../models/alert.model';\r\nimport { alertComponents } from './components/components';\r\nimport { DynamicDirective } from '@craftsjs/core';\r\n\r\nexport const CRAFTSJS_ALERT_DATA = new InjectionToken<any>('CraftsjsAlertData');\r\n\r\n@Component({\r\n selector: 'dialog-alert',\r\n templateUrl: './dialog-alert.component.html',\r\n styleUrls: ['./dialog-alert.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class DialogAlertComponent implements OnInit, AfterViewInit {\r\n\r\n @ViewChildren(DynamicDirective)\r\n appDynamic: QueryList<DynamicDirective>;\r\n\r\n constructor(\r\n public dialogRef: MatDialogRef<DialogAlertComponent>,\r\n @Inject(MAT_DIALOG_DATA) public data: AlertModel,\r\n ) {\r\n }\r\n\r\n ngOnInit(): void {\r\n\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n this.loadComponents();\r\n }\r\n\r\n private loadComponents() {\r\n const itemComponent = alertComponents.find(x => x.type === this.data.type);\r\n const component = itemComponent && itemComponent.component;\r\n this.resolveComponent(component, this.appDynamic.find(x => x.name === 'alert-icon').viewContainerRef);\r\n this.resolveComponent(this.data.customBody, this.appDynamic.find(x => x.name === 'alert-body').viewContainerRef);\r\n this.resolveComponent(this.data.customButtonComponent, this.appDynamic.find(x => x.name === 'alert-buttons').viewContainerRef);\r\n }\r\n\r\n private resolveComponent(component: Type<any> | TemplateRef<any>, viewContainerRef: ViewContainerRef) {\r\n if (!component) { return; }\r\n viewContainerRef.clear();\r\n if (component instanceof TemplateRef) {\r\n viewContainerRef.createEmbeddedView(component, { $implicit: this.data, dialogRef: this.dialogRef });\r\n } else {\r\n const injector = this.createInjector(viewContainerRef.injector);\r\n viewContainerRef.createComponent(component, {\r\n injector\r\n });\r\n }\r\n }\r\n\r\n private createInjector(injector: Injector) {\r\n return Injector.create({\r\n providers: [{\r\n provide: CRAFTSJS_ALERT_DATA,\r\n useValue: this.data\r\n },\r\n {\r\n provide: MatDialogRef,\r\n useValue: this.dialogRef\r\n }],\r\n parent: injector\r\n })\r\n }\r\n\r\n buttonClick(result: string) {\r\n this.dialogRef.close({ data: this.data, result });\r\n }\r\n\r\n}\r\n","<ng-template craftsjsDynamic name=\"alert-icon\"></ng-template>\r\n<div *ngIf=\"data?.title\" class=\"alert-title\">\r\n <span>\r\n {{data.title | translate}}\r\n </span>\r\n</div>\r\n<div *ngIf=\"data?.text\" class=\"alert-text\">\r\n <span>\r\n {{data.text | translate}}\r\n </span>\r\n</div>\r\n<ng-template craftsjsDynamic name=\"alert-body\"></ng-template>\r\n<div class=\"alert-footer\" *ngIf=\"!data?.hiddenButtons\">\r\n <alert-ok-button *ngIf=\"!data?.customButtonComponent\" (click)=\"buttonClick('ok')\">\r\n </alert-ok-button>\r\n <alert-cancel-button *ngIf=\"!data?.customButtonComponent && data?.showCancelButton\"\r\n (click)=\"buttonClick('cancel')\">\r\n </alert-cancel-button>\r\n</div>\r\n<ng-template craftsjsDynamic name=\"alert-buttons\"></ng-template>","import { Injectable } from '@angular/core';\r\nimport { MatDialog } from '@angular/material/dialog';\r\nimport { AlertModel } from '../models/alert.model';\r\nimport { AlertEnum } from '../models/alert-enum.model';\r\nimport { DialogAlertComponent } from '../components/dialog-alert/dialog-alert.component';\r\n\r\n@Injectable()\r\nexport class AlertService {\r\n\r\n constructor(private _dialog: MatDialog) { }\r\n\r\n showSimple(title: string, message: string) {\r\n return this._open({\r\n title,\r\n text: message\r\n } as AlertModel);\r\n }\r\n\r\n showSuccess(title: string, message: string) {\r\n return this._open({\r\n title,\r\n text: message,\r\n type: AlertEnum.success\r\n });\r\n }\r\n\r\n showError(title: string, message: string) {\r\n return this._open({\r\n title,\r\n text: message,\r\n type: AlertEnum.error\r\n });\r\n }\r\n\r\n showInfo(title: string, message: string) {\r\n return this._open({\r\n title,\r\n text: message,\r\n type: AlertEnum.info\r\n });\r\n }\r\n\r\n showWarning(title: string, message: string) {\r\n return this._open({\r\n title,\r\n text: message,\r\n type: AlertEnum.warning\r\n });\r\n }\r\n\r\n showConfirmation(title: string, message: string) {\r\n return this._open({\r\n title,\r\n text: message,\r\n type: AlertEnum.warning,\r\n showCancelButton: true\r\n });\r\n }\r\n\r\n private _open(alertModel: AlertModel) {\r\n return this._dialog.open(DialogAlertComponent, {\r\n width: '500px',\r\n data: alertModel\r\n });\r\n }\r\n}\r\n","import { NgModule, ModuleWithProviders } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { CoreModule } from '@craftsjs/core';\r\nimport { DialogAlertComponent } from './components/dialog-alert/dialog-alert.component';\r\nimport { AlertSuccessComponent } from './components/dialog-alert/components/alert-success/alert-success.component';\r\nimport { AlertInfoComponent } from './components/dialog-alert/components/alert-info/alert-info.component';\r\nimport { WarningComponent } from './components/dialog-alert/components/warning/warning.component';\r\nimport { ErrorComponent } from './components/dialog-alert/components/error/error.component';\r\nimport { AlertOkButtonComponent } from './components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component';\r\nimport {\r\n AlertCancelButtonComponent\r\n} from './components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component';\r\nimport { AlertService } from './services/alert.service';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n TranslateModule,\r\n MatButtonModule,\r\n CoreModule,\r\n MatDialogModule\r\n ],\r\n declarations: [\r\n DialogAlertComponent,\r\n AlertSuccessComponent,\r\n AlertInfoComponent,\r\n WarningComponent,\r\n ErrorComponent,\r\n AlertOkButtonComponent,\r\n AlertCancelButtonComponent\r\n ],\r\n exports: [\r\n DialogAlertComponent\r\n ]\r\n})\r\nexport class AlertModule {\r\n static forRoot(): ModuleWithProviders<AlertModule> {\r\n return {\r\n ngModule: AlertModule,\r\n providers: [\r\n AlertService\r\n ]\r\n };\r\n }\r\n}\r\n","/*\r\n * Public API Surface of alert\r\n */\r\n\r\nexport * from './lib/alert.module';\r\nexport * from './lib/components/dialog-alert/dialog-alert.component';\r\nexport * from './lib/components/dialog-alert/components/alert-info/alert-info.component';\r\nexport * from './lib/components/dialog-alert/components/alert-success/alert-success.component';\r\nexport * from './lib/components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component';\r\nexport * from './lib/components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component';\r\nexport * from './lib/components/dialog-alert/components/components';\r\nexport * from './lib/components/dialog-alert/components/error/error.component';\r\nexport * from './lib/components/dialog-alert/components/warning/warning.component';\r\nexport * from './lib/models/alert-enum.model';\r\nexport * from './lib/models/alert.model';\r\nexport * from './lib/services/alert.service';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAYa,qBAAqB;;kHAArB,qBAAqB;sGAArB,qBAAqB,gHCZlC,uQAGmD;2FDStC,qBAAqB;kBAVjC,SAAS;+BACE,eAAe,mBAGR,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,QAC/B;wBACJ,KAAK,EAAE,+BAA+B;qBACvC;;;IEVS;AAAZ,WAAY,SAAS;IACjB,gCAAmB,CAAA;IACnB,4BAAe,CAAA;IACf,0BAAa,CAAA;IACb,gCAAmB,CAAA;AACvB,CAAC,EALW,SAAS,KAAT,SAAS;;MCYR,kBAAkB;;+GAAlB,kBAAkB;mGAAlB,kBAAkB,0GCZ/B,EAAA;2FDYa,kBAAkB;kBAV9B,SAAS;+BACE,YAAY,mBAGL,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,QAC/B;wBACJ,KAAK,EAAE,4BAA4B;qBACpC;;;MEEU,gBAAgB;;6GAAhB,gBAAgB;iGAAhB,gBAAgB,iHCZ7B,yGAEO;2FDUM,gBAAgB;kBAV5B,SAAS;+BACE,eAAe,QAGnB;wBACJ,KAAK,EAAE,gCAAgC;qBACxC,mBACgB,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI;;;MEE1B,cAAc;;2GAAd,cAAc;+FAAd,cAAc,4GCZ3B,gNAGM;2FDSO,cAAc;kBAV1B,SAAS;+BACE,aAAa,QAGjB;wBACJ,KAAK,EAAE,6BAA6B;qBACrC,iBACc,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM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ModuleWithProviders } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "./components/dialog-alert/dialog-alert.component";
4
+ import * as i2 from "./components/dialog-alert/components/alert-success/alert-success.component";
5
+ import * as i3 from "./components/dialog-alert/components/alert-info/alert-info.component";
6
+ import * as i4 from "./components/dialog-alert/components/warning/warning.component";
7
+ import * as i5 from "./components/dialog-alert/components/error/error.component";
8
+ import * as i6 from "./components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component";
9
+ import * as i7 from "./components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component";
10
+ import * as i8 from "@angular/common";
11
+ import * as i9 from "@ngx-translate/core";
12
+ import * as i10 from "@angular/material/button";
13
+ import * as i11 from "@craftsjs/core";
14
+ import * as i12 from "@angular/material/dialog";
2
15
  export declare class AlertModule {
3
16
  static forRoot(): ModuleWithProviders<AlertModule>;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<AlertModule, never>;
18
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AlertModule, [typeof i1.DialogAlertComponent, typeof i2.AlertSuccessComponent, typeof i3.AlertInfoComponent, typeof i4.WarningComponent, typeof i5.ErrorComponent, typeof i6.AlertOkButtonComponent, typeof i7.AlertCancelButtonComponent], [typeof i8.CommonModule, typeof i9.TranslateModule, typeof i10.MatButtonModule, typeof i11.CoreModule, typeof i12.MatDialogModule], [typeof i1.DialogAlertComponent]>;
19
+ static ɵinj: i0.ɵɵInjectorDeclaration<AlertModule>;
4
20
  }
@@ -1,2 +1,5 @@
1
+ import * as i0 from "@angular/core";
1
2
  export declare class AlertInfoComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<AlertInfoComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<AlertInfoComponent, "alert-info", never, {}, {}, never, never>;
2
5
  }
@@ -1,2 +1,5 @@
1
+ import * as i0 from "@angular/core";
1
2
  export declare class AlertSuccessComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<AlertSuccessComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<AlertSuccessComponent, "alert-success", never, {}, {}, never, never>;
2
5
  }
@@ -1,4 +1,7 @@
1
1
  import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
2
3
  export declare class AlertCancelButtonComponent {
3
4
  click: EventEmitter<any>;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<AlertCancelButtonComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<AlertCancelButtonComponent, "alert-cancel-button", never, {}, { "click": "click"; }, never, never>;
4
7
  }
@@ -1,4 +1,7 @@
1
1
  import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
2
3
  export declare class AlertOkButtonComponent {
3
4
  click: EventEmitter<any>;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<AlertOkButtonComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<AlertOkButtonComponent, "alert-ok-button", never, {}, { "click": "click"; }, never, never>;
4
7
  }
@@ -1,2 +1,5 @@
1
+ import * as i0 from "@angular/core";
1
2
  export declare class ErrorComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<ErrorComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<ErrorComponent, "alert-error", never, {}, {}, never, never>;
2
5
  }
@@ -1,2 +1,5 @@
1
+ import * as i0 from "@angular/core";
1
2
  export declare class WarningComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<WarningComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<WarningComponent, "alert-warning", never, {}, {}, never, never>;
2
5
  }
@@ -1,18 +1,20 @@
1
- import { OnInit, ComponentFactoryResolver, InjectionToken, QueryList, AfterViewInit } from '@angular/core';
1
+ import { OnInit, InjectionToken, QueryList, AfterViewInit } from '@angular/core';
2
2
  import { MatDialogRef } from '@angular/material/dialog';
3
3
  import { AlertModel } from '../../models/alert.model';
4
4
  import { DynamicDirective } from '@craftsjs/core';
5
+ import * as i0 from "@angular/core";
5
6
  export declare const CRAFTSJS_ALERT_DATA: InjectionToken<any>;
6
7
  export declare class DialogAlertComponent implements OnInit, AfterViewInit {
7
8
  dialogRef: MatDialogRef<DialogAlertComponent>;
8
9
  data: AlertModel;
9
- private componentFactoryResolver;
10
10
  appDynamic: QueryList<DynamicDirective>;
11
- constructor(dialogRef: MatDialogRef<DialogAlertComponent>, data: AlertModel, componentFactoryResolver: ComponentFactoryResolver);
11
+ constructor(dialogRef: MatDialogRef<DialogAlertComponent>, data: AlertModel);
12
12
  ngOnInit(): void;
13
13
  ngAfterViewInit(): void;
14
14
  private loadComponents;
15
15
  private resolveComponent;
16
16
  private createInjector;
17
17
  buttonClick(result: string): void;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<DialogAlertComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<DialogAlertComponent, "dialog-alert", never, {}, {}, never, never>;
18
20
  }
@@ -1,5 +1,6 @@
1
1
  import { MatDialog } from '@angular/material/dialog';
2
2
  import { DialogAlertComponent } from '../components/dialog-alert/dialog-alert.component';
3
+ import * as i0 from "@angular/core";
3
4
  export declare class AlertService {
4
5
  private _dialog;
5
6
  constructor(_dialog: MatDialog);
@@ -10,4 +11,6 @@ export declare class AlertService {
10
11
  showWarning(title: string, message: string): import("@angular/material/dialog").MatDialogRef<DialogAlertComponent, any>;
11
12
  showConfirmation(title: string, message: string): import("@angular/material/dialog").MatDialogRef<DialogAlertComponent, any>;
12
13
  private _open;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<AlertService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<AlertService>;
13
16
  }
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@craftsjs/alert",
3
- "version": "1.0.0",
3
+ "version": "4.0.0",
4
4
  "author": "craftsjs",
5
5
  "description": "Material alert library for angular",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/addapptables/angular-miscellaneous",
8
8
  "peerDependencies": {
9
- "@angular/common": ">= 10.0.0 < 11.0.0",
10
- "@angular/core": ">= 10.0.0 < 11.0.0",
11
- "@angular/material": ">= 10.0.0 < 11.0.0",
12
- "@angular/cdk": ">= 10.0.0 < 11.0.0",
13
- "@angular/animations": ">= 10.0.0 < 11.0.0",
14
- "angular-l10n": ">= 10.0.0 < 11.0.0",
15
- "@craftsjs/core": ">=1.0.0 < 2.0.0"
9
+ "@angular/common": ">= 13.0.0 < 14.0.0",
10
+ "@angular/core": ">= 13.0.0 < 14.0.0",
11
+ "@angular/material": ">= 13.0.0 < 14.0.0",
12
+ "@angular/cdk": ">= 13.0.0 < 14.0.0",
13
+ "@angular/animations": ">= 13.0.0 < 14.0.0",
14
+ "@ngx-translate/core": ">= 14.0.0 < 17.0.0",
15
+ "@craftsjs/core": ">=4.0.0 < 5.0.0"
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
@@ -31,12 +31,24 @@
31
31
  "dependencies": {
32
32
  "tslib": "^2.0.0"
33
33
  },
34
- "main": "bundles/craftsjs-alert.umd.js",
35
- "module": "fesm2015/craftsjs-alert.js",
36
- "es2015": "fesm2015/craftsjs-alert.js",
37
- "esm2015": "esm2015/craftsjs-alert.js",
38
- "fesm2015": "fesm2015/craftsjs-alert.js",
34
+ "module": "fesm2015/craftsjs-alert.mjs",
35
+ "es2020": "fesm2020/craftsjs-alert.mjs",
36
+ "esm2020": "esm2020/craftsjs-alert.mjs",
37
+ "fesm2020": "fesm2020/craftsjs-alert.mjs",
38
+ "fesm2015": "fesm2015/craftsjs-alert.mjs",
39
39
  "typings": "craftsjs-alert.d.ts",
40
- "metadata": "craftsjs-alert.metadata.json",
40
+ "exports": {
41
+ "./package.json": {
42
+ "default": "./package.json"
43
+ },
44
+ ".": {
45
+ "types": "./craftsjs-alert.d.ts",
46
+ "esm2020": "./esm2020/craftsjs-alert.mjs",
47
+ "es2020": "./fesm2020/craftsjs-alert.mjs",
48
+ "es2015": "./fesm2015/craftsjs-alert.mjs",
49
+ "node": "./fesm2015/craftsjs-alert.mjs",
50
+ "default": "./fesm2020/craftsjs-alert.mjs"
51
+ }
52
+ },
41
53
  "sideEffects": false
42
- }
54
+ }