@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.
- package/README.md +4 -1
- package/craftsjs-alert.d.ts +1 -0
- package/{esm2015/craftsjs-alert.js → esm2020/craftsjs-alert.mjs} +0 -0
- package/esm2020/lib/alert.module.mjs +69 -0
- package/esm2020/lib/components/dialog-alert/components/alert-info/alert-info.component.mjs +13 -0
- package/esm2020/lib/components/dialog-alert/components/alert-success/alert-success.component.mjs +13 -0
- package/esm2020/lib/components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component.mjs +18 -0
- package/esm2020/lib/components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component.mjs +18 -0
- package/{esm2015/lib/components/dialog-alert/components/components.js → esm2020/lib/components/dialog-alert/components/components.mjs} +0 -0
- package/esm2020/lib/components/dialog-alert/components/error/error.component.mjs +13 -0
- package/esm2020/lib/components/dialog-alert/components/warning/warning.component.mjs +13 -0
- package/esm2020/lib/components/dialog-alert/dialog-alert.component.mjs +74 -0
- package/{esm2015/lib/models/alert-enum.model.js → esm2020/lib/models/alert-enum.model.mjs} +0 -0
- package/{esm2015/lib/models/alert.model.js → esm2020/lib/models/alert.model.mjs} +1 -0
- package/esm2020/lib/services/alert.service.mjs +64 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/fesm2015/craftsjs-alert.mjs +300 -0
- package/fesm2015/craftsjs-alert.mjs.map +1 -0
- package/fesm2020/craftsjs-alert.mjs +298 -0
- package/fesm2020/craftsjs-alert.mjs.map +1 -0
- package/lib/alert.module.d.ts +16 -0
- package/lib/components/dialog-alert/components/alert-info/alert-info.component.d.ts +3 -0
- package/lib/components/dialog-alert/components/alert-success/alert-success.component.d.ts +3 -0
- package/lib/components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component.d.ts +3 -0
- package/lib/components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component.d.ts +3 -0
- package/lib/components/dialog-alert/components/error/error.component.d.ts +3 -0
- package/lib/components/dialog-alert/components/warning/warning.component.d.ts +3 -0
- package/lib/components/dialog-alert/dialog-alert.component.d.ts +5 -3
- package/lib/services/alert.service.d.ts +3 -0
- package/package.json +27 -15
- package/bundles/craftsjs-alert.umd.js +0 -333
- package/bundles/craftsjs-alert.umd.js.map +0 -1
- package/bundles/craftsjs-alert.umd.min.js +0 -2
- package/bundles/craftsjs-alert.umd.min.js.map +0 -1
- package/craftsjs-alert.metadata.json +0 -1
- package/esm2015/lib/alert.module.js +0 -55
- package/esm2015/lib/components/dialog-alert/components/alert-info/alert-info.component.js +0 -16
- package/esm2015/lib/components/dialog-alert/components/alert-success/alert-success.component.js +0 -16
- package/esm2015/lib/components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component.js +0 -18
- package/esm2015/lib/components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component.js +0 -18
- package/esm2015/lib/components/dialog-alert/components/error/error.component.js +0 -16
- package/esm2015/lib/components/dialog-alert/components/warning/warning.component.js +0 -16
- package/esm2015/lib/components/dialog-alert/dialog-alert.component.js +0 -67
- package/esm2015/lib/services/alert.service.js +0 -64
- package/fesm2015/craftsjs-alert.js +0 -302
- package/fesm2015/craftsjs-alert.js.map +0 -1
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/button'), require('@angular/material/dialog'), require('@ngx-translate/core'), require('@angular/common'), require('@craftsjs/core'), require('@angular/cdk/portal')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@craftsjs/alert', ['exports', '@angular/core', '@angular/material/button', '@angular/material/dialog', '@ngx-translate/core', '@angular/common', '@craftsjs/core', '@angular/cdk/portal'], factory) :
|
|
4
|
-
(global = global || self, factory((global.craftsjs = global.craftsjs || {}, global.craftsjs.alert = {}), global.ng.core, global.ng.material.button, global.ng.material.dialog, global['ngx-translate-core'], global.ng.common, global['crafts-core'], global.ng.cdk.portal));
|
|
5
|
-
}(this, (function (exports, core, button, dialog, core$1, common, core$2, portal) { 'use strict';
|
|
6
|
-
|
|
7
|
-
var AlertSuccessComponent = /** @class */ (function () {
|
|
8
|
-
function AlertSuccessComponent() {
|
|
9
|
-
}
|
|
10
|
-
return AlertSuccessComponent;
|
|
11
|
-
}());
|
|
12
|
-
AlertSuccessComponent.decorators = [
|
|
13
|
-
{ type: core.Component, args: [{
|
|
14
|
-
selector: 'alert-success',
|
|
15
|
-
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>",
|
|
16
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
17
|
-
encapsulation: core.ViewEncapsulation.None,
|
|
18
|
-
host: {
|
|
19
|
-
class: 'alert-icon alert-icon-success'
|
|
20
|
-
},
|
|
21
|
-
styles: [""]
|
|
22
|
-
},] }
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
(function (AlertEnum) {
|
|
26
|
-
AlertEnum["success"] = "success";
|
|
27
|
-
AlertEnum["error"] = "error";
|
|
28
|
-
AlertEnum["info"] = "info";
|
|
29
|
-
AlertEnum["warning"] = "warning";
|
|
30
|
-
})(exports.AlertEnum || (exports.AlertEnum = {}));
|
|
31
|
-
|
|
32
|
-
var AlertInfoComponent = /** @class */ (function () {
|
|
33
|
-
function AlertInfoComponent() {
|
|
34
|
-
}
|
|
35
|
-
return AlertInfoComponent;
|
|
36
|
-
}());
|
|
37
|
-
AlertInfoComponent.decorators = [
|
|
38
|
-
{ type: core.Component, args: [{
|
|
39
|
-
selector: 'alert-info',
|
|
40
|
-
template: "",
|
|
41
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
42
|
-
encapsulation: core.ViewEncapsulation.None,
|
|
43
|
-
host: {
|
|
44
|
-
class: 'alert-icon alert-icon-info'
|
|
45
|
-
},
|
|
46
|
-
styles: [""]
|
|
47
|
-
},] }
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
var WarningComponent = /** @class */ (function () {
|
|
51
|
-
function WarningComponent() {
|
|
52
|
-
}
|
|
53
|
-
return WarningComponent;
|
|
54
|
-
}());
|
|
55
|
-
WarningComponent.decorators = [
|
|
56
|
-
{ type: core.Component, args: [{
|
|
57
|
-
selector: 'alert-warning',
|
|
58
|
-
template: "<span class=\"alert-icon-warning-body\">\r\n <span class=\"alert-icon-warning-dot\"></span>\r\n</span>",
|
|
59
|
-
host: {
|
|
60
|
-
class: 'alert-icon alert-icon-warning '
|
|
61
|
-
},
|
|
62
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
63
|
-
encapsulation: core.ViewEncapsulation.None,
|
|
64
|
-
styles: [""]
|
|
65
|
-
},] }
|
|
66
|
-
];
|
|
67
|
-
|
|
68
|
-
var ErrorComponent = /** @class */ (function () {
|
|
69
|
-
function ErrorComponent() {
|
|
70
|
-
}
|
|
71
|
-
return ErrorComponent;
|
|
72
|
-
}());
|
|
73
|
-
ErrorComponent.decorators = [
|
|
74
|
-
{ type: core.Component, args: [{
|
|
75
|
-
selector: 'alert-error',
|
|
76
|
-
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>",
|
|
77
|
-
host: {
|
|
78
|
-
class: 'alert-icon alert-icon-error'
|
|
79
|
-
},
|
|
80
|
-
encapsulation: core.ViewEncapsulation.None,
|
|
81
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
82
|
-
styles: [""]
|
|
83
|
-
},] }
|
|
84
|
-
];
|
|
85
|
-
|
|
86
|
-
var alertComponents = [
|
|
87
|
-
{
|
|
88
|
-
type: exports.AlertEnum.success,
|
|
89
|
-
component: AlertSuccessComponent
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
type: exports.AlertEnum.info,
|
|
93
|
-
component: AlertInfoComponent
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
type: exports.AlertEnum.warning,
|
|
97
|
-
component: WarningComponent
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
type: exports.AlertEnum.error,
|
|
101
|
-
component: ErrorComponent
|
|
102
|
-
}
|
|
103
|
-
];
|
|
104
|
-
|
|
105
|
-
var CRAFTSJS_ALERT_DATA = new core.InjectionToken('CraftsjsAlertData');
|
|
106
|
-
var DialogAlertComponent = /** @class */ (function () {
|
|
107
|
-
function DialogAlertComponent(dialogRef, data, componentFactoryResolver) {
|
|
108
|
-
this.dialogRef = dialogRef;
|
|
109
|
-
this.data = data;
|
|
110
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
|
111
|
-
}
|
|
112
|
-
DialogAlertComponent.prototype.ngOnInit = function () {
|
|
113
|
-
};
|
|
114
|
-
DialogAlertComponent.prototype.ngAfterViewInit = function () {
|
|
115
|
-
this.loadComponents();
|
|
116
|
-
};
|
|
117
|
-
DialogAlertComponent.prototype.loadComponents = function () {
|
|
118
|
-
var _this = this;
|
|
119
|
-
var itemComponent = alertComponents.find(function (x) { return x.type === _this.data.type; });
|
|
120
|
-
var component = itemComponent && itemComponent.component;
|
|
121
|
-
this.resolveComponent(component, this.appDynamic.find(function (x) { return x.name === 'alert-icon'; }).viewContainerRef);
|
|
122
|
-
this.resolveComponent(this.data.customBody, this.appDynamic.find(function (x) { return x.name === 'alert-body'; }).viewContainerRef);
|
|
123
|
-
this.resolveComponent(this.data.customButtonComponent, this.appDynamic.find(function (x) { return x.name === 'alert-buttons'; }).viewContainerRef);
|
|
124
|
-
};
|
|
125
|
-
DialogAlertComponent.prototype.resolveComponent = function (component, viewContainerRef) {
|
|
126
|
-
if (!component) {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
viewContainerRef.clear();
|
|
130
|
-
if (component instanceof core.TemplateRef) {
|
|
131
|
-
viewContainerRef.createEmbeddedView(component, { $implicit: this.data, dialogRef: this.dialogRef });
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
var componentFactory = component && this.componentFactoryResolver.resolveComponentFactory(component);
|
|
135
|
-
var injector = this.createInjector(viewContainerRef.injector);
|
|
136
|
-
viewContainerRef.createComponent(componentFactory, null, injector);
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
DialogAlertComponent.prototype.createInjector = function (injector) {
|
|
140
|
-
var injectionTokens = new WeakMap([
|
|
141
|
-
[CRAFTSJS_ALERT_DATA, this.data],
|
|
142
|
-
[dialog.MatDialogRef, this.dialogRef]
|
|
143
|
-
]);
|
|
144
|
-
return new portal.PortalInjector(injector, injectionTokens);
|
|
145
|
-
};
|
|
146
|
-
DialogAlertComponent.prototype.buttonClick = function (result) {
|
|
147
|
-
this.dialogRef.close({ data: this.data, result: result });
|
|
148
|
-
};
|
|
149
|
-
return DialogAlertComponent;
|
|
150
|
-
}());
|
|
151
|
-
DialogAlertComponent.decorators = [
|
|
152
|
-
{ type: core.Component, args: [{
|
|
153
|
-
selector: 'dialog-alert',
|
|
154
|
-
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>",
|
|
155
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
156
|
-
encapsulation: core.ViewEncapsulation.None,
|
|
157
|
-
styles: [".alert-icon{border-radius:50%;border-style:solid;border-width:4px;box-sizing:content-box;height:80px;margin:20px auto;padding:0;position:relative;width:80px}.alert-icon-custom{border:none;border-radius:0;height:auto;max-width:100%;width:auto}.alert-icon img{max-height:100%;max-width:100%}.alert-title{color:rgba(0,0,0,.65);display:block;font-size:27px;font-weight:600;line-height:normal;margin-bottom:0;position:relative;text-align:center;text-transform:none}.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{box-sizing:border-box;color:rgba(0,0,0,.64);display:inline-block;float:none;font-size:16px;font-weight:400;line-height:normal;margin:0;overflow-wrap:break-word;padding:0 10px;position:relative;text-align:center;vertical-align:top;width:100%}.alert-text:first-child{margin-top:45px}.alert-text:last-child{margin-bottom:45px}.alert-footer{border-radius:inherit;border-top-left-radius:0;border-top-right-radius:0;margin-top:13px;padding:13px 16px;text-align:right}.alert-footer-button-container{display:inline-block;margin:5px;position:relative}.alert-footer>*{display:inline-block;margin-right:.5em}.alert-footer>:last-child{margin-right:inherit}"]
|
|
158
|
-
},] }
|
|
159
|
-
];
|
|
160
|
-
DialogAlertComponent.ctorParameters = function () { return [
|
|
161
|
-
{ type: dialog.MatDialogRef },
|
|
162
|
-
{ type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
|
|
163
|
-
{ type: core.ComponentFactoryResolver }
|
|
164
|
-
]; };
|
|
165
|
-
DialogAlertComponent.propDecorators = {
|
|
166
|
-
appDynamic: [{ type: core.ViewChildren, args: [core$2.DynamicDirective,] }]
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
var AlertOkButtonComponent = /** @class */ (function () {
|
|
170
|
-
function AlertOkButtonComponent() {
|
|
171
|
-
this.click = new core.EventEmitter();
|
|
172
|
-
}
|
|
173
|
-
return AlertOkButtonComponent;
|
|
174
|
-
}());
|
|
175
|
-
AlertOkButtonComponent.decorators = [
|
|
176
|
-
{ type: core.Component, args: [{
|
|
177
|
-
selector: 'alert-ok-button',
|
|
178
|
-
template: "<button mat-raised-button color=\"primary\" (click)=\"click.emit($event)\">{{'general.ok' | translate}}</button>",
|
|
179
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
180
|
-
styles: [""]
|
|
181
|
-
},] }
|
|
182
|
-
];
|
|
183
|
-
AlertOkButtonComponent.propDecorators = {
|
|
184
|
-
click: [{ type: core.Output }]
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
var AlertCancelButtonComponent = /** @class */ (function () {
|
|
188
|
-
function AlertCancelButtonComponent() {
|
|
189
|
-
this.click = new core.EventEmitter();
|
|
190
|
-
}
|
|
191
|
-
return AlertCancelButtonComponent;
|
|
192
|
-
}());
|
|
193
|
-
AlertCancelButtonComponent.decorators = [
|
|
194
|
-
{ type: core.Component, args: [{
|
|
195
|
-
selector: 'alert-cancel-button',
|
|
196
|
-
template: "<button mat-raised-button (click)=\"click.emit($event)\">{{'general.cancel' | translate}}</button>",
|
|
197
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
198
|
-
styles: [""]
|
|
199
|
-
},] }
|
|
200
|
-
];
|
|
201
|
-
AlertCancelButtonComponent.propDecorators = {
|
|
202
|
-
click: [{ type: core.Output }]
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
var AlertService = /** @class */ (function () {
|
|
206
|
-
function AlertService(_dialog) {
|
|
207
|
-
this._dialog = _dialog;
|
|
208
|
-
}
|
|
209
|
-
AlertService.prototype.showSimple = function (title, message) {
|
|
210
|
-
return this._open({
|
|
211
|
-
title: title,
|
|
212
|
-
text: message
|
|
213
|
-
});
|
|
214
|
-
};
|
|
215
|
-
AlertService.prototype.showSuccess = function (title, message) {
|
|
216
|
-
return this._open({
|
|
217
|
-
title: title,
|
|
218
|
-
text: message,
|
|
219
|
-
type: exports.AlertEnum.success
|
|
220
|
-
});
|
|
221
|
-
};
|
|
222
|
-
AlertService.prototype.showError = function (title, message) {
|
|
223
|
-
return this._open({
|
|
224
|
-
title: title,
|
|
225
|
-
text: message,
|
|
226
|
-
type: exports.AlertEnum.error
|
|
227
|
-
});
|
|
228
|
-
};
|
|
229
|
-
AlertService.prototype.showInfo = function (title, message) {
|
|
230
|
-
return this._open({
|
|
231
|
-
title: title,
|
|
232
|
-
text: message,
|
|
233
|
-
type: exports.AlertEnum.info
|
|
234
|
-
});
|
|
235
|
-
};
|
|
236
|
-
AlertService.prototype.showWarning = function (title, message) {
|
|
237
|
-
return this._open({
|
|
238
|
-
title: title,
|
|
239
|
-
text: message,
|
|
240
|
-
type: exports.AlertEnum.warning
|
|
241
|
-
});
|
|
242
|
-
};
|
|
243
|
-
AlertService.prototype.showConfirmation = function (title, message) {
|
|
244
|
-
return this._open({
|
|
245
|
-
title: title,
|
|
246
|
-
text: message,
|
|
247
|
-
type: exports.AlertEnum.warning,
|
|
248
|
-
showCancelButton: true
|
|
249
|
-
});
|
|
250
|
-
};
|
|
251
|
-
AlertService.prototype._open = function (alertModel) {
|
|
252
|
-
return this._dialog.open(DialogAlertComponent, {
|
|
253
|
-
width: '500px',
|
|
254
|
-
data: alertModel
|
|
255
|
-
});
|
|
256
|
-
};
|
|
257
|
-
return AlertService;
|
|
258
|
-
}());
|
|
259
|
-
AlertService.decorators = [
|
|
260
|
-
{ type: core.Injectable }
|
|
261
|
-
];
|
|
262
|
-
AlertService.ctorParameters = function () { return [
|
|
263
|
-
{ type: dialog.MatDialog }
|
|
264
|
-
]; };
|
|
265
|
-
|
|
266
|
-
var AlertModule = /** @class */ (function () {
|
|
267
|
-
function AlertModule() {
|
|
268
|
-
}
|
|
269
|
-
AlertModule.forRoot = function () {
|
|
270
|
-
return {
|
|
271
|
-
ngModule: AlertModule,
|
|
272
|
-
providers: [
|
|
273
|
-
AlertService
|
|
274
|
-
]
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
return AlertModule;
|
|
278
|
-
}());
|
|
279
|
-
AlertModule.decorators = [
|
|
280
|
-
{ type: core.NgModule, args: [{
|
|
281
|
-
imports: [
|
|
282
|
-
common.CommonModule,
|
|
283
|
-
core$1.TranslateModule,
|
|
284
|
-
button.MatButtonModule,
|
|
285
|
-
core$2.CoreModule,
|
|
286
|
-
dialog.MatDialogModule
|
|
287
|
-
],
|
|
288
|
-
declarations: [
|
|
289
|
-
DialogAlertComponent,
|
|
290
|
-
AlertSuccessComponent,
|
|
291
|
-
AlertInfoComponent,
|
|
292
|
-
WarningComponent,
|
|
293
|
-
ErrorComponent,
|
|
294
|
-
AlertOkButtonComponent,
|
|
295
|
-
AlertCancelButtonComponent
|
|
296
|
-
],
|
|
297
|
-
exports: [
|
|
298
|
-
DialogAlertComponent
|
|
299
|
-
],
|
|
300
|
-
entryComponents: [
|
|
301
|
-
DialogAlertComponent,
|
|
302
|
-
AlertSuccessComponent,
|
|
303
|
-
AlertInfoComponent,
|
|
304
|
-
WarningComponent,
|
|
305
|
-
ErrorComponent
|
|
306
|
-
]
|
|
307
|
-
},] }
|
|
308
|
-
];
|
|
309
|
-
|
|
310
|
-
/*
|
|
311
|
-
* Public API Surface of alert
|
|
312
|
-
*/
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Generated bundle index. Do not edit.
|
|
316
|
-
*/
|
|
317
|
-
|
|
318
|
-
exports.AlertCancelButtonComponent = AlertCancelButtonComponent;
|
|
319
|
-
exports.AlertInfoComponent = AlertInfoComponent;
|
|
320
|
-
exports.AlertModule = AlertModule;
|
|
321
|
-
exports.AlertOkButtonComponent = AlertOkButtonComponent;
|
|
322
|
-
exports.AlertService = AlertService;
|
|
323
|
-
exports.AlertSuccessComponent = AlertSuccessComponent;
|
|
324
|
-
exports.CRAFTSJS_ALERT_DATA = CRAFTSJS_ALERT_DATA;
|
|
325
|
-
exports.DialogAlertComponent = DialogAlertComponent;
|
|
326
|
-
exports.ErrorComponent = ErrorComponent;
|
|
327
|
-
exports.WarningComponent = WarningComponent;
|
|
328
|
-
exports.alertComponents = alertComponents;
|
|
329
|
-
|
|
330
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
331
|
-
|
|
332
|
-
})));
|
|
333
|
-
//# sourceMappingURL=craftsjs-alert.umd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"craftsjs-alert.umd.js","sources":["../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/alert-success/alert-success.component.ts","../../../../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/warning/warning.component.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/error/error.component.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/components.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/dialog-alert.component.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-cancel-button/alert-cancel-button.component.ts","../../../../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","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","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","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 {\r\n Component,\r\n ChangeDetectionStrategy,\r\n Inject,\r\n ViewEncapsulation,\r\n OnInit,\r\n ComponentFactoryResolver,\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 { PortalInjector } from '@angular/cdk/portal';\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 private componentFactoryResolver: ComponentFactoryResolver\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<{}> | TemplateRef<{}>, 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 componentFactory = component && this.componentFactoryResolver.resolveComponentFactory(component);\r\n const injector = this.createInjector(viewContainerRef.injector);\r\n viewContainerRef.createComponent(componentFactory, null, injector);\r\n }\r\n }\r\n\r\n private createInjector(injector: Injector): PortalInjector {\r\n const injectionTokens = new WeakMap<any, any>([\r\n [CRAFTSJS_ALERT_DATA, this.data],\r\n [MatDialogRef, this.dialogRef]\r\n ]);\r\n return new PortalInjector(injector, injectionTokens);\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","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","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","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 entryComponents: [\r\n DialogAlertComponent,\r\n AlertSuccessComponent,\r\n AlertInfoComponent,\r\n WarningComponent,\r\n ErrorComponent\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":["Component","ChangeDetectionStrategy","ViewEncapsulation","AlertEnum","InjectionToken","TemplateRef","MatDialogRef","PortalInjector","Inject","MAT_DIALOG_DATA","ComponentFactoryResolver","ViewChildren","DynamicDirective","EventEmitter","Output","Injectable","MatDialog","NgModule","CommonModule","TranslateModule","MatButtonModule","CoreModule","MatDialogModule"],"mappings":";;;;;;;QAYA;;;;;gBAVCA,cAAS,SAAC;oBACT,QAAQ,EAAE,eAAe;oBACzB,iRAA6C;oBAE7C,eAAe,EAAEC,4BAAuB,CAAC,MAAM;oBAC/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xB,CAAC,CAAC;SACJ;QAED,uCAAgB,GAAhB,UAAiB,KAAa,EAAE,OAAe;YAC7C,OAAO,IAAI,CAAC,KAAK,CAAC;gBAChB,KAAK,OAAA;gBACL,IAAI,EAAE,OAAO;gBACb,IAAI,EAAEA,iBAAS,CAAC,OAAO;gBACvB,gBAAgB,EAAE,IAAI;aACvB,CAAC,CAAC;SACJ;QAEO,4BAAK,GAAL,UAAM,UAAsB;YAClC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE;gBAC7C,KAAK,EAAE,OAAO;gBACd,IAAI,EAAE,UAAU;aACjB,CAAC,CAAC;SACJ;;;;gBA1DFY,eAAU;;;gBALFC,gBAAS;;;;QC4ClB;;QACS,mBAAO,GAAd;YACE,OAAO;gBACL,QAAQ,EAAE,WAAW;gBACrB,SAAS,EAAE;oBACT,YAAY;iBACb;aACF,CAAC;SACH;;;;gBApCFC,aAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;wBACZC,sBAAe;wBACfC,sBAAe;wBACfC,iBAAU;wBACVC,sBAAe;qBAChB;oBACD,YAAY,EAAE;wBACZ,oBAAoB;wBACpB,qBAAqB;wBACrB,kBAAkB;wBAClB,gBAAgB;wBAChB,cAAc;wBACd,sBAAsB;wBACtB,0BAA0B;qBAC3B;oBACD,OAAO,EAAE;wBACP,oBAAoB;qBACrB;oBACD,eAAe,EAAE;wBACf,oBAAoB;wBACpB,qBAAqB;wBACrB,kBAAkB;wBAClB,gBAAgB;wBAChB,cAAc;qBACf;iBACF;;;IC5CD;;;;ICAA;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/button"),require("@angular/material/dialog"),require("@ngx-translate/core"),require("@angular/common"),require("@craftsjs/core"),require("@angular/cdk/portal")):"function"==typeof define&&define.amd?define("@craftsjs/alert",["exports","@angular/core","@angular/material/button","@angular/material/dialog","@ngx-translate/core","@angular/common","@craftsjs/core","@angular/cdk/portal"],e):e(((t=t||self).craftsjs=t.craftsjs||{},t.craftsjs.alert={}),t.ng.core,t.ng.material.button,t.ng.material.dialog,t["ngx-translate-core"],t.ng.common,t["crafts-core"],t.ng.cdk.portal)}(this,(function(t,e,n,o,r,a,i,l){"use strict";var s,c=function(){};c.decorators=[{type:e.Component,args:[{selector:"alert-success",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>',changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,host:{class:"alert-icon alert-icon-success"},styles:[""]}]}],(s=t.AlertEnum||(t.AlertEnum={})).success="success",s.error="error",s.info="info",s.warning="warning";var p=function(){};p.decorators=[{type:e.Component,args:[{selector:"alert-info",template:"",changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,host:{class:"alert-icon alert-icon-info"},styles:[""]}]}];var u=function(){};u.decorators=[{type:e.Component,args:[{selector:"alert-warning",template:'<span class="alert-icon-warning-body">\r\n <span class="alert-icon-warning-dot"></span>\r\n</span>',host:{class:"alert-icon alert-icon-warning "},changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,styles:[""]}]}];var d=function(){};d.decorators=[{type:e.Component,args:[{selector:"alert-error",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>',host:{class:"alert-icon alert-icon-error"},encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,styles:[""]}]}];var m=[{type:t.AlertEnum.success,component:c},{type:t.AlertEnum.info,component:p},{type:t.AlertEnum.warning,component:u},{type:t.AlertEnum.error,component:d}],g=new e.InjectionToken("CraftsjsAlertData"),f=function(){function t(t,e,n){this.dialogRef=t,this.data=e,this.componentFactoryResolver=n}return t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){this.loadComponents()},t.prototype.loadComponents=function(){var t=this,e=m.find((function(e){return e.type===t.data.type})),n=e&&e.component;this.resolveComponent(n,this.appDynamic.find((function(t){return"alert-icon"===t.name})).viewContainerRef),this.resolveComponent(this.data.customBody,this.appDynamic.find((function(t){return"alert-body"===t.name})).viewContainerRef),this.resolveComponent(this.data.customButtonComponent,this.appDynamic.find((function(t){return"alert-buttons"===t.name})).viewContainerRef)},t.prototype.resolveComponent=function(t,n){if(t)if(n.clear(),t instanceof e.TemplateRef)n.createEmbeddedView(t,{$implicit:this.data,dialogRef:this.dialogRef});else{var o=t&&this.componentFactoryResolver.resolveComponentFactory(t),r=this.createInjector(n.injector);n.createComponent(o,null,r)}},t.prototype.createInjector=function(t){var e=new WeakMap([[g,this.data],[o.MatDialogRef,this.dialogRef]]);return new l.PortalInjector(t,e)},t.prototype.buttonClick=function(t){this.dialogRef.close({data:this.data,result:t})},t}();f.decorators=[{type:e.Component,args:[{selector:"dialog-alert",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>',changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,styles:[".alert-icon{border-radius:50%;border-style:solid;border-width:4px;box-sizing:content-box;height:80px;margin:20px auto;padding:0;position:relative;width:80px}.alert-icon-custom{border:none;border-radius:0;height:auto;max-width:100%;width:auto}.alert-icon img{max-height:100%;max-width:100%}.alert-title{color:rgba(0,0,0,.65);display:block;font-size:27px;font-weight:600;line-height:normal;margin-bottom:0;position:relative;text-align:center;text-transform:none}.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{box-sizing:border-box;color:rgba(0,0,0,.64);display:inline-block;float:none;font-size:16px;font-weight:400;line-height:normal;margin:0;overflow-wrap:break-word;padding:0 10px;position:relative;text-align:center;vertical-align:top;width:100%}.alert-text:first-child{margin-top:45px}.alert-text:last-child{margin-bottom:45px}.alert-footer{border-radius:inherit;border-top-left-radius:0;border-top-right-radius:0;margin-top:13px;padding:13px 16px;text-align:right}.alert-footer-button-container{display:inline-block;margin:5px;position:relative}.alert-footer>*{display:inline-block;margin-right:.5em}.alert-footer>:last-child{margin-right:inherit}"]}]}],f.ctorParameters=function(){return[{type:o.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[o.MAT_DIALOG_DATA]}]},{type:e.ComponentFactoryResolver}]},f.propDecorators={appDynamic:[{type:e.ViewChildren,args:[i.DynamicDirective]}]};var h=function(){this.click=new e.EventEmitter};h.decorators=[{type:e.Component,args:[{selector:"alert-ok-button",template:'<button mat-raised-button color="primary" (click)="click.emit($event)">{{\'general.ok\' | translate}}</button>',changeDetection:e.ChangeDetectionStrategy.OnPush,styles:[""]}]}],h.propDecorators={click:[{type:e.Output}]};var y=function(){this.click=new e.EventEmitter};y.decorators=[{type:e.Component,args:[{selector:"alert-cancel-button",template:"<button mat-raised-button (click)=\"click.emit($event)\">{{'general.cancel' | translate}}</button>",changeDetection:e.ChangeDetectionStrategy.OnPush,styles:[""]}]}],y.propDecorators={click:[{type:e.Output}]};var b=function(){function e(t){this._dialog=t}return e.prototype.showSimple=function(t,e){return this._open({title:t,text:e})},e.prototype.showSuccess=function(e,n){return this._open({title:e,text:n,type:t.AlertEnum.success})},e.prototype.showError=function(e,n){return this._open({title:e,text:n,type:t.AlertEnum.error})},e.prototype.showInfo=function(e,n){return this._open({title:e,text:n,type:t.AlertEnum.info})},e.prototype.showWarning=function(e,n){return this._open({title:e,text:n,type:t.AlertEnum.warning})},e.prototype.showConfirmation=function(e,n){return this._open({title:e,text:n,type:t.AlertEnum.warning,showCancelButton:!0})},e.prototype._open=function(t){return this._dialog.open(f,{width:"500px",data:t})},e}();b.decorators=[{type:e.Injectable}],b.ctorParameters=function(){return[{type:o.MatDialog}]};var v=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[b]}},t}();v.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,r.TranslateModule,n.MatButtonModule,i.CoreModule,o.MatDialogModule],declarations:[f,c,p,u,d,h,y],exports:[f],entryComponents:[f,c,p,u,d]}]}],t.AlertCancelButtonComponent=y,t.AlertInfoComponent=p,t.AlertModule=v,t.AlertOkButtonComponent=h,t.AlertService=b,t.AlertSuccessComponent=c,t.CRAFTSJS_ALERT_DATA=g,t.DialogAlertComponent=f,t.ErrorComponent=d,t.WarningComponent=u,t.alertComponents=m,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
2
|
-
//# sourceMappingURL=craftsjs-alert.umd.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../projects/craftsjs/alert/src/lib/models/alert-enum.model.ts","../../../../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-info/alert-info.component.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/warning/warning.component.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/error/error.component.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/components/components.ts","../../../../projects/craftsjs/alert/src/lib/components/dialog-alert/dialog-alert.component.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-cancel-button/alert-cancel-button.component.ts","../../../../projects/craftsjs/alert/src/lib/services/alert.service.ts","../../../../projects/craftsjs/alert/src/lib/alert.module.ts"],"names":["AlertEnum","Component","args","selector","template","changeDetection","ChangeDetectionStrategy","OnPush","encapsulation","ViewEncapsulation","None","host","class","alertComponents","type","success","component","AlertSuccessComponent","info","AlertInfoComponent","warning","WarningComponent","error","ErrorComponent","CRAFTSJS_ALERT_DATA","InjectionToken","DialogAlertComponent","dialogRef","data","componentFactoryResolver","this","prototype","ngOnInit","ngAfterViewInit","loadComponents","_this","itemComponent","find","x","resolveComponent","appDynamic","name","viewContainerRef","customBody","customButtonComponent","clear","TemplateRef","createEmbeddedView","$implicit","componentFactory","resolveComponentFactory","injector","createInjector","createComponent","injectionTokens","WeakMap","MatDialogRef","PortalInjector","buttonClick","result","close","Inject","MAT_DIALOG_DATA","ComponentFactoryResolver","ViewChildren","DynamicDirective","click","EventEmitter","Output","AlertService","_dialog","showSimple","title","message","_open","text","showSuccess","showError","showInfo","showWarning","showConfirmation","showCancelButton","alertModel","open","width","Injectable","MatDialog","AlertModule","forRoot","ngModule","providers","NgModule","imports","CommonModule","TranslateModule","MatButtonModule","CoreModule","MatDialogModule","declarations","AlertOkButtonComponent","AlertCancelButtonComponent","exports","entryComponents"],"mappings":"8uBAAYA,ICYZ,iCAVCC,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,gBACVC,SAAA,gQAEAC,gBAAiBC,EAAAA,wBAAwBC,OACzCC,cAAeC,EAAAA,kBAAkBC,KACjCC,KAAM,CACJC,MAAO,kDDTCZ,EAAAA,EAAAA,YAAAA,EAAAA,UAAS,KACjB,QAAA,UACAA,EAAA,MAAA,QACAA,EAAA,KAAA,OACAA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AC,CACR0F,QAAS,CACPC,EAAAA,aACAC,EAAAA,gBACAC,EAAAA,gBACAC,EAAAA,WACAC,EAAAA,iBAEFC,aAAc,CACZxE,EACAT,EACAE,EACAE,EACAE,EACA4E,EACAC,GAEFC,QAAS,CACP3E,GAEF4E,gBAAiB,CACf5E,EACAT,EACAE,EACAE,EACAE","sourcesContent":["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-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","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","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","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 {\r\n Component,\r\n ChangeDetectionStrategy,\r\n Inject,\r\n ViewEncapsulation,\r\n OnInit,\r\n ComponentFactoryResolver,\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 { PortalInjector } from '@angular/cdk/portal';\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 private componentFactoryResolver: ComponentFactoryResolver\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<{}> | TemplateRef<{}>, 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 componentFactory = component && this.componentFactoryResolver.resolveComponentFactory(component);\r\n const injector = this.createInjector(viewContainerRef.injector);\r\n viewContainerRef.createComponent(componentFactory, null, injector);\r\n }\r\n }\r\n\r\n private createInjector(injector: Injector): PortalInjector {\r\n const injectionTokens = new WeakMap<any, any>([\r\n [CRAFTSJS_ALERT_DATA, this.data],\r\n [MatDialogRef, this.dialogRef]\r\n ]);\r\n return new PortalInjector(injector, injectionTokens);\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","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","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","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 entryComponents: [\r\n DialogAlertComponent,\r\n AlertSuccessComponent,\r\n AlertInfoComponent,\r\n WarningComponent,\r\n ErrorComponent\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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"AlertModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":17,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":19,"character":4},{"__symbolic":"reference","module":"@ngx-translate/core","name":"TranslateModule","line":20,"character":4},{"__symbolic":"reference","module":"@angular/material/button","name":"MatButtonModule","line":21,"character":4},{"__symbolic":"reference","module":"@craftsjs/core","name":"CoreModule","line":22,"character":4},{"__symbolic":"reference","module":"@angular/material/dialog","name":"MatDialogModule","line":23,"character":4}],"declarations":[{"__symbolic":"reference","name":"DialogAlertComponent"},{"__symbolic":"reference","name":"AlertSuccessComponent"},{"__symbolic":"reference","name":"AlertInfoComponent"},{"__symbolic":"reference","name":"WarningComponent"},{"__symbolic":"reference","name":"ErrorComponent"},{"__symbolic":"reference","name":"AlertOkButtonComponent"},{"__symbolic":"reference","name":"AlertCancelButtonComponent"}],"exports":[{"__symbolic":"reference","name":"DialogAlertComponent"}],"entryComponents":[{"__symbolic":"reference","name":"DialogAlertComponent"},{"__symbolic":"reference","name":"AlertSuccessComponent"},{"__symbolic":"reference","name":"AlertInfoComponent"},{"__symbolic":"reference","name":"WarningComponent"},{"__symbolic":"reference","name":"ErrorComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"AlertModule"},"providers":[{"__symbolic":"reference","name":"AlertService"}]}}}},"CRAFTSJS_ALERT_DATA":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":22,"character":39},"arguments":["CraftsjsAlertData"]},"DialogAlertComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":24,"character":1},"arguments":[{"selector":"dialog-alert","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":28,"character":19},"member":"OnPush"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":29,"character":17},"member":"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{border-radius:50%;border-style:solid;border-width:4px;box-sizing:content-box;height:80px;margin:20px auto;padding:0;position:relative;width:80px}.alert-icon-custom{border:none;border-radius:0;height:auto;max-width:100%;width:auto}.alert-icon img{max-height:100%;max-width:100%}.alert-title{color:rgba(0,0,0,.65);display:block;font-size:27px;font-weight:600;line-height:normal;margin-bottom:0;position:relative;text-align:center;text-transform:none}.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{box-sizing:border-box;color:rgba(0,0,0,.64);display:inline-block;float:none;font-size:16px;font-weight:400;line-height:normal;margin:0;overflow-wrap:break-word;padding:0 10px;position:relative;text-align:center;vertical-align:top;width:100%}.alert-text:first-child{margin-top:45px}.alert-text:last-child{margin-bottom:45px}.alert-footer{border-radius:inherit;border-top-left-radius:0;border-top-right-radius:0;margin-top:13px;padding:13px 16px;text-align:right}.alert-footer-button-container{display:inline-block;margin:5px;position:relative}.alert-footer>*{display:inline-block;margin-right:.5em}.alert-footer>:last-child{margin-right:inherit}"]}]}],"members":{"appDynamic":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChildren","line":33,"character":3},"arguments":[{"__symbolic":"reference","module":"@craftsjs/core","name":"DynamicDirective","line":33,"character":16}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":38,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/material/dialog","name":"MAT_DIALOG_DATA","line":38,"character":12}]}],null],"parameters":[{"__symbolic":"reference","name":"MatDialogRef","module":"@angular/material/dialog","arguments":[{"__symbolic":"reference","name":"DialogAlertComponent"}]},{"__symbolic":"reference","name":"AlertModel"},{"__symbolic":"reference","module":"@angular/core","name":"ComponentFactoryResolver","line":39,"character":38}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"loadComponents":[{"__symbolic":"method"}],"resolveComponent":[{"__symbolic":"method"}],"createInjector":[{"__symbolic":"method"}],"buttonClick":[{"__symbolic":"method"}]}},"AlertInfoComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"alert-info","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":6,"character":19},"member":"OnPush"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":7,"character":17},"member":"None"},"host":{"class":"alert-icon alert-icon-info"},"template":"","styles":[""]}]}],"members":{}},"AlertSuccessComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"alert-success","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":6,"character":19},"member":"OnPush"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":7,"character":17},"member":"None"},"host":{"class":"alert-icon alert-icon-success"},"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":[""]}]}],"members":{}},"AlertCancelButtonComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"alert-cancel-button","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":6,"character":19},"member":"OnPush"},"template":"<button mat-raised-button (click)=\"click.emit($event)\">{{'general.cancel' | translate}}</button>","styles":[""]}]}],"members":{"click":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":9,"character":3}}]}]}},"AlertOkButtonComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"alert-ok-button","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":6,"character":19},"member":"OnPush"},"template":"<button mat-raised-button color=\"primary\" (click)=\"click.emit($event)\">{{'general.ok' | translate}}</button>","styles":[""]}]}],"members":{"click":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":9,"character":3}}]}]}},"alertComponents":[{"type":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"AlertEnum"},"member":"success"},"component":{"__symbolic":"reference","name":"AlertSuccessComponent"}},{"type":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"AlertEnum"},"member":"info"},"component":{"__symbolic":"reference","name":"AlertInfoComponent"}},{"type":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"AlertEnum"},"member":"warning"},"component":{"__symbolic":"reference","name":"WarningComponent"}},{"type":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"AlertEnum"},"member":"error"},"component":{"__symbolic":"reference","name":"ErrorComponent"}}],"ErrorComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"alert-error","host":{"class":"alert-icon alert-icon-error"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":9,"character":17},"member":"None"},"changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":10,"character":19},"member":"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":[""]}]}],"members":{}},"WarningComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"alert-warning","host":{"class":"alert-icon alert-icon-warning "},"changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":9,"character":19},"member":"OnPush"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":10,"character":17},"member":"None"},"template":"<span class=\"alert-icon-warning-body\">\r\n <span class=\"alert-icon-warning-dot\"></span>\r\n</span>","styles":[""]}]}],"members":{}},"AlertEnum":{"success":"success","error":"error","info":"info","warning":"warning"},"AlertModel":{"__symbolic":"interface"},"AlertService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":6,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/material/dialog","name":"MatDialog","line":9,"character":31}]}],"showSimple":[{"__symbolic":"method"}],"showSuccess":[{"__symbolic":"method"}],"showError":[{"__symbolic":"method"}],"showInfo":[{"__symbolic":"method"}],"showWarning":[{"__symbolic":"method"}],"showConfirmation":[{"__symbolic":"method"}],"_open":[{"__symbolic":"method"}]}}},"origins":{"AlertModule":"./lib/alert.module","CRAFTSJS_ALERT_DATA":"./lib/components/dialog-alert/dialog-alert.component","DialogAlertComponent":"./lib/components/dialog-alert/dialog-alert.component","AlertInfoComponent":"./lib/components/dialog-alert/components/alert-info/alert-info.component","AlertSuccessComponent":"./lib/components/dialog-alert/components/alert-success/alert-success.component","AlertCancelButtonComponent":"./lib/components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component","AlertOkButtonComponent":"./lib/components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component","alertComponents":"./lib/components/dialog-alert/components/components","ErrorComponent":"./lib/components/dialog-alert/components/error/error.component","WarningComponent":"./lib/components/dialog-alert/components/warning/warning.component","AlertEnum":"./lib/models/alert-enum.model","AlertModel":"./lib/models/alert.model","AlertService":"./lib/services/alert.service"},"importAs":"@craftsjs/alert"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
3
|
-
import { MatDialogModule } from '@angular/material/dialog';
|
|
4
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
5
|
-
import { CommonModule } from '@angular/common';
|
|
6
|
-
import { CoreModule } from '@craftsjs/core';
|
|
7
|
-
import { DialogAlertComponent } from './components/dialog-alert/dialog-alert.component';
|
|
8
|
-
import { AlertSuccessComponent } from './components/dialog-alert/components/alert-success/alert-success.component';
|
|
9
|
-
import { AlertInfoComponent } from './components/dialog-alert/components/alert-info/alert-info.component';
|
|
10
|
-
import { WarningComponent } from './components/dialog-alert/components/warning/warning.component';
|
|
11
|
-
import { ErrorComponent } from './components/dialog-alert/components/error/error.component';
|
|
12
|
-
import { AlertOkButtonComponent } from './components/dialog-alert/components/buttons/alert-ok-button/alert-ok-button.component';
|
|
13
|
-
import { AlertCancelButtonComponent } from './components/dialog-alert/components/buttons/alert-cancel-button/alert-cancel-button.component';
|
|
14
|
-
import { AlertService } from './services/alert.service';
|
|
15
|
-
export class AlertModule {
|
|
16
|
-
static forRoot() {
|
|
17
|
-
return {
|
|
18
|
-
ngModule: AlertModule,
|
|
19
|
-
providers: [
|
|
20
|
-
AlertService
|
|
21
|
-
]
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
AlertModule.decorators = [
|
|
26
|
-
{ type: NgModule, args: [{
|
|
27
|
-
imports: [
|
|
28
|
-
CommonModule,
|
|
29
|
-
TranslateModule,
|
|
30
|
-
MatButtonModule,
|
|
31
|
-
CoreModule,
|
|
32
|
-
MatDialogModule
|
|
33
|
-
],
|
|
34
|
-
declarations: [
|
|
35
|
-
DialogAlertComponent,
|
|
36
|
-
AlertSuccessComponent,
|
|
37
|
-
AlertInfoComponent,
|
|
38
|
-
WarningComponent,
|
|
39
|
-
ErrorComponent,
|
|
40
|
-
AlertOkButtonComponent,
|
|
41
|
-
AlertCancelButtonComponent
|
|
42
|
-
],
|
|
43
|
-
exports: [
|
|
44
|
-
DialogAlertComponent
|
|
45
|
-
],
|
|
46
|
-
entryComponents: [
|
|
47
|
-
DialogAlertComponent,
|
|
48
|
-
AlertSuccessComponent,
|
|
49
|
-
AlertInfoComponent,
|
|
50
|
-
WarningComponent,
|
|
51
|
-
ErrorComponent
|
|
52
|
-
]
|
|
53
|
-
},] }
|
|
54
|
-
];
|
|
55
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxlcnQubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY3JhZnRzanMvYWxlcnQvc3JjL2xpYi9hbGVydC5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBdUIsTUFBTSxlQUFlLENBQUM7QUFDOUQsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQzNELE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTS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cnRDb21wb25lbnQsXHJcbiAgICBBbGVydFN1Y2Nlc3NDb21wb25lbnQsXHJcbiAgICBBbGVydEluZm9Db21wb25lbnQsXHJcbiAgICBXYXJuaW5nQ29tcG9uZW50LFxyXG4gICAgRXJyb3JDb21wb25lbnQsXHJcbiAgICBBbGVydE9rQnV0dG9uQ29tcG9uZW50LFxyXG4gICAgQWxlcnRDYW5jZWxCdXR0b25Db21wb25lbnRcclxuICBdLFxyXG4gIGV4cG9ydHM6IFtcclxuICAgIERpYWxvZ0FsZXJ0Q29tcG9uZW50XHJcbiAgXSxcclxuICBlbnRyeUNvbXBvbmVudHM6IFtcclxuICAgIERpYWxvZ0FsZXJ0Q29tcG9uZW50LFxyXG4gICAgQWxlcnRTdWNjZXNzQ29tcG9uZW50LFxyXG4gICAgQWxlcnRJbmZvQ29tcG9uZW50LFxyXG4gICAgV2FybmluZ0NvbXBvbmVudCxcclxuICAgIEVycm9yQ29tcG9uZW50XHJcbiAgXVxyXG59KVxyXG5leHBvcnQgY2xhc3MgQWxlcnRNb2R1bGUge1xyXG4gIHN0YXRpYyBmb3JSb290KCk6IE1vZHVsZVdpdGhQcm92aWRlcnM8QWxlcnRNb2R1bGU+IHtcclxuICAgIHJldHVybiB7XHJcbiAgICAgIG5nTW9kdWxlOiBBbGVydE1vZHVsZSxcclxuICAgICAgcHJvdmlkZXJzOiBbXHJcbiAgICAgICAgQWxlcnRTZXJ2aWNlXHJcbiAgICAgIF1cclxuICAgIH07XHJcbiAgfVxyXG59XHJcbiJdfQ==
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
|
|
2
|
-
export class AlertInfoComponent {
|
|
3
|
-
}
|
|
4
|
-
AlertInfoComponent.decorators = [
|
|
5
|
-
{ type: Component, args: [{
|
|
6
|
-
selector: 'alert-info',
|
|
7
|
-
template: "",
|
|
8
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
-
encapsulation: ViewEncapsulation.None,
|
|
10
|
-
host: {
|
|
11
|
-
class: 'alert-icon alert-icon-info'
|
|
12
|
-
},
|
|
13
|
-
styles: [""]
|
|
14
|
-
},] }
|
|
15
|
-
];
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxlcnQtaW5mby5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jcmFmdHNqcy9hbGVydC9zcmMvbGliL2NvbXBvbmVudHMvZGlhbG9nLWFsZXJ0L2NvbXBvbmVudHMvYWxlcnQtaW5mby9hbGVydC1pbmZvLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLHVCQUF1QixFQUFFLGlCQUFpQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBWXRGLE1BQU0sT0FBTyxrQkFBa0I7OztZQVY5QixTQUFTLFNBQUM7Z0JBQ1QsUUFBUSxFQUFFLFlBQVk7Z0JBQ3RCLFlBQTBDO2dCQUUxQyxlQUFlLEVBQUUsdUJBQXVCLENBQUMsTUFBTTtnQkFDL0MsYUFBYSxFQUFFLGlCQUFpQixDQUFDLElBQUk7Z0JBQ3JDLElBQUksRUFBRTtvQkFDSixLQUFLLEVBQUUsNEJBQTRCO2lCQUNwQzs7YUFDRiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCwgQ2hhbmdlRGV0ZWN0aW9uU3RyYXRlZ3ksIFZpZXdFbmNhcHN1bGF0aW9uIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XHJcblxyXG5AQ29tcG9uZW50KHtcclxuICBzZWxlY3RvcjogJ2FsZXJ0LWluZm8nLFxyXG4gIHRlbXBsYXRlVXJsOiAnLi9hbGVydC1pbmZvLmNvbXBvbmVudC5odG1sJyxcclxuICBzdHlsZVVybHM6IFsnLi9hbGVydC1pbmZvLmNvbXBvbmVudC5zY3NzJ10sXHJcbiAgY2hhbmdlRGV0ZWN0aW9uOiBDaGFuZ2VEZXRlY3Rpb25TdHJhdGVneS5PblB1c2gsXHJcbiAgZW5jYXBzdWxhdGlvbjogVmlld0VuY2Fwc3VsYXRpb24uTm9uZSxcclxuICBob3N0OiB7XHJcbiAgICBjbGFzczogJ2FsZXJ0LWljb24gYWxlcnQtaWNvbi1pbmZvJ1xyXG4gIH1cclxufSlcclxuZXhwb3J0IGNsYXNzIEFsZXJ0SW5mb0NvbXBvbmVudCB7IH1cclxuIl19
|
package/esm2015/lib/components/dialog-alert/components/alert-success/alert-success.component.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
|
|
2
|
-
export class AlertSuccessComponent {
|
|
3
|
-
}
|
|
4
|
-
AlertSuccessComponent.decorators = [
|
|
5
|
-
{ type: Component, args: [{
|
|
6
|
-
selector: 'alert-success',
|
|
7
|
-
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>",
|
|
8
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
-
encapsulation: ViewEncapsulation.None,
|
|
10
|
-
host: {
|
|
11
|
-
class: 'alert-icon alert-icon-success'
|
|
12
|
-
},
|
|
13
|
-
styles: [""]
|
|
14
|
-
},] }
|
|
15
|
-
];
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxlcnQtc3VjY2Vzcy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZW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GFsZXJ0LWljb24tc3VjY2VzcydcclxuICB9XHJcbn0pXHJcbmV4cG9ydCBjbGFzcyBBbGVydFN1Y2Nlc3NDb21wb25lbnQgeyB9XHJcbiJdfQ==
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy, Output, EventEmitter } from '@angular/core';
|
|
2
|
-
export class AlertCancelButtonComponent {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.click = new EventEmitter();
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
AlertCancelButtonComponent.decorators = [
|
|
8
|
-
{ type: Component, args: [{
|
|
9
|
-
selector: 'alert-cancel-button',
|
|
10
|
-
template: "<button mat-raised-button (click)=\"click.emit($event)\">{{'general.cancel' | translate}}</button>",
|
|
11
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
-
styles: [""]
|
|
13
|
-
},] }
|
|
14
|
-
];
|
|
15
|
-
AlertCancelButtonComponent.propDecorators = {
|
|
16
|
-
click: [{ type: Output }]
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxlcnQtY2FuY2VsLWJ1dHRvbi5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jcmFmdHNqcy9hbGVydC9zcmMvbGliL2NvbXBvbmVudHMvZGlhbG9nLWFsZXJ0L2NvbXBvbmVudHMvYnV0dG9ucy9hbGVydC1jYW5jZWwtYnV0dG9uL2FsZXJ0LWNhbmNlbC1idXR0b24uY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxNQUFNLGVBQWUsQ0FBQztBQVF6RixNQUFNLE9BQU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