@datarailsshared/datarailsshared 1.6.263 → 1.6.265
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/datarailsshared-datarailsshared-1.6.265.tgz +0 -0
- package/esm2022/lib/dr-alert/dr-alert.component.mjs +57 -13
- package/esm2022/lib/dr-alert/enums/dr-alert-theme.enum.mjs +2 -1
- package/fesm2022/datarailsshared-datarailsshared.mjs +57 -12
- package/fesm2022/datarailsshared-datarailsshared.mjs.map +1 -1
- package/lib/dr-alert/dr-alert.component.d.ts +4 -1
- package/lib/dr-alert/enums/dr-alert-theme.enum.d.ts +2 -1
- package/package.json +1 -1
- package/datarailsshared-datarailsshared-1.6.263.tgz +0 -0
|
Binary file
|
|
@@ -2,14 +2,49 @@ import { ChangeDetectionStrategy, Component, HostBinding, Input } from '@angular
|
|
|
2
2
|
import { DrAlertTheme } from './enums/dr-alert-theme.enum';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import * as i1 from "@angular/common";
|
|
5
|
-
function
|
|
6
|
-
i0.ɵɵelementStart(0, "span",
|
|
5
|
+
function DrAlertComponent_ng_container_2_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
6
|
+
i0.ɵɵelementStart(0, "span", 7);
|
|
7
7
|
i0.ɵɵtext(1);
|
|
8
8
|
i0.ɵɵelementEnd();
|
|
9
|
+
} if (rf & 2) {
|
|
10
|
+
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
11
|
+
i0.ɵɵadvance(1);
|
|
12
|
+
i0.ɵɵtextInterpolate(ctx_r3.title);
|
|
13
|
+
} }
|
|
14
|
+
function DrAlertComponent_ng_container_2_span_2_Template(rf, ctx) { if (rf & 1) {
|
|
15
|
+
i0.ɵɵelementStart(0, "span");
|
|
16
|
+
i0.ɵɵtext(1, " - ");
|
|
17
|
+
i0.ɵɵelementEnd();
|
|
18
|
+
} }
|
|
19
|
+
function DrAlertComponent_ng_container_2_span_3_Template(rf, ctx) { if (rf & 1) {
|
|
20
|
+
i0.ɵɵelementStart(0, "span", 8);
|
|
21
|
+
i0.ɵɵtext(1);
|
|
22
|
+
i0.ɵɵelementEnd();
|
|
23
|
+
} if (rf & 2) {
|
|
24
|
+
const ctx_r5 = i0.ɵɵnextContext(2);
|
|
25
|
+
i0.ɵɵadvance(1);
|
|
26
|
+
i0.ɵɵtextInterpolate(ctx_r5.text);
|
|
27
|
+
} }
|
|
28
|
+
function DrAlertComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
|
|
29
|
+
i0.ɵɵelementContainerStart(0);
|
|
30
|
+
i0.ɵɵtemplate(1, DrAlertComponent_ng_container_2_span_1_Template, 2, 1, "span", 5);
|
|
31
|
+
i0.ɵɵtemplate(2, DrAlertComponent_ng_container_2_span_2_Template, 2, 0, "span", 1);
|
|
32
|
+
i0.ɵɵtemplate(3, DrAlertComponent_ng_container_2_span_3_Template, 2, 1, "span", 6);
|
|
33
|
+
i0.ɵɵelementContainerEnd();
|
|
9
34
|
} if (rf & 2) {
|
|
10
35
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
11
36
|
i0.ɵɵadvance(1);
|
|
12
|
-
i0.ɵɵ
|
|
37
|
+
i0.ɵɵproperty("ngIf", ctx_r0.title);
|
|
38
|
+
i0.ɵɵadvance(1);
|
|
39
|
+
i0.ɵɵproperty("ngIf", ctx_r0.title && ctx_r0.text);
|
|
40
|
+
i0.ɵɵadvance(1);
|
|
41
|
+
i0.ɵɵproperty("ngIf", ctx_r0.text);
|
|
42
|
+
} }
|
|
43
|
+
function DrAlertComponent_i_6_Template(rf, ctx) { if (rf & 1) {
|
|
44
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
45
|
+
i0.ɵɵelementStart(0, "i", 9);
|
|
46
|
+
i0.ɵɵlistener("click", function DrAlertComponent_i_6_Template_i_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r6 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r6.hidden = true); });
|
|
47
|
+
i0.ɵɵelementEnd();
|
|
13
48
|
} }
|
|
14
49
|
const _c0 = ["*"];
|
|
15
50
|
const ALERT_THEME_ICONS = {
|
|
@@ -18,13 +53,16 @@ const ALERT_THEME_ICONS = {
|
|
|
18
53
|
[DrAlertTheme.ERROR]: 'dr-icon-error',
|
|
19
54
|
[DrAlertTheme.WARNING]: 'dr-icon-warning',
|
|
20
55
|
[DrAlertTheme.INFO]: 'dr-icon-info',
|
|
56
|
+
[DrAlertTheme.TIP]: 'dr-icon-light',
|
|
21
57
|
};
|
|
22
58
|
export class DrAlertComponent {
|
|
23
59
|
constructor() {
|
|
24
60
|
this.theme = DrAlertTheme.INFO;
|
|
61
|
+
this.showClose = false;
|
|
62
|
+
this.hidden = false;
|
|
25
63
|
}
|
|
26
64
|
get elementClass() {
|
|
27
|
-
return
|
|
65
|
+
return `--${this.theme} ${this.hidden ? '--hidden' : ''}`;
|
|
28
66
|
}
|
|
29
67
|
get themeIconClass() {
|
|
30
68
|
return this.customIconClass || ALERT_THEME_ICONS[this.theme];
|
|
@@ -32,33 +70,39 @@ export class DrAlertComponent {
|
|
|
32
70
|
/** @nocollapse */ static { this.ɵfac = function DrAlertComponent_Factory(t) { return new (t || DrAlertComponent)(); }; }
|
|
33
71
|
/** @nocollapse */ static { this.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: DrAlertComponent, selectors: [["dr-alert"]], hostVars: 2, hostBindings: function DrAlertComponent_HostBindings(rf, ctx) { if (rf & 2) {
|
|
34
72
|
i0.ɵɵclassMap(ctx.elementClass);
|
|
35
|
-
} }, inputs: { theme: "theme", customIconClass: "customIconClass", text: "text" }, ngContentSelectors: _c0, decls:
|
|
73
|
+
} }, inputs: { theme: "theme", customIconClass: "customIconClass", title: "title", text: "text", showClose: "showClose" }, ngContentSelectors: _c0, decls: 7, vars: 4, consts: [[1, "dr-alert__content-wrapper"], [4, "ngIf"], [1, "dr-alert__custom-content"], ["contentRef", ""], ["class", "dr-alert__close-icon dr-icon-exit", 3, "click", 4, "ngIf"], ["class", "dr-alert__title", 4, "ngIf"], ["class", "dr-alert__text", 4, "ngIf"], [1, "dr-alert__title"], [1, "dr-alert__text"], [1, "dr-alert__close-icon", "dr-icon-exit", 3, "click"]], template: function DrAlertComponent_Template(rf, ctx) { if (rf & 1) {
|
|
36
74
|
i0.ɵɵprojectionDef();
|
|
37
|
-
i0.ɵɵ
|
|
38
|
-
i0.ɵɵ
|
|
39
|
-
i0.ɵɵtemplate(2,
|
|
75
|
+
i0.ɵɵelement(0, "i");
|
|
76
|
+
i0.ɵɵelementStart(1, "div", 0);
|
|
77
|
+
i0.ɵɵtemplate(2, DrAlertComponent_ng_container_2_Template, 4, 3, "ng-container", 1);
|
|
40
78
|
i0.ɵɵelementStart(3, "div", 2, 3);
|
|
41
79
|
i0.ɵɵprojection(5);
|
|
42
80
|
i0.ɵɵelementEnd()();
|
|
81
|
+
i0.ɵɵtemplate(6, DrAlertComponent_i_6_Template, 1, 0, "i", 4);
|
|
43
82
|
} if (rf & 2) {
|
|
44
83
|
const _r1 = i0.ɵɵreference(4);
|
|
45
|
-
i0.ɵɵadvance(1);
|
|
46
84
|
i0.ɵɵclassMap("dr-alert__icon " + ctx.themeIconClass);
|
|
47
|
-
i0.ɵɵadvance(
|
|
85
|
+
i0.ɵɵadvance(2);
|
|
48
86
|
i0.ɵɵproperty("ngIf", !_r1.innerHTML.trim());
|
|
49
|
-
|
|
87
|
+
i0.ɵɵadvance(4);
|
|
88
|
+
i0.ɵɵproperty("ngIf", ctx.showClose);
|
|
89
|
+
} }, dependencies: [i1.NgIf], styles: ["[_nghost-%COMP%]{font-family:Poppins,sans-serif;display:flex;padding:8px 16px;border-radius:8px;min-height:40px;color:#333;position:relative;gap:8px}.--info[_nghost-%COMP%]{background:#e6efff}.--bold-error[_nghost-%COMP%]{color:#fff;background:#bf1d30}.--error[_nghost-%COMP%]{background:#f7d9dc}.--warning[_nghost-%COMP%]{background:#ffefc7}.--success[_nghost-%COMP%]{background:#dbf5e6}.--tip[_nghost-%COMP%]{background:#eaeaff}.--hidden[_nghost-%COMP%]{display:none}[_nghost-%COMP%] .dr-alert__title[_ngcontent-%COMP%]{font-size:12px;line-height:16px;font-weight:600;white-space:pre-line}[_nghost-%COMP%] .dr-alert__text[_ngcontent-%COMP%]{font-size:12px;line-height:16px;font-weight:400;white-space:pre-line}[_nghost-%COMP%] .dr-alert__content-wrapper[_ngcontent-%COMP%]{padding-top:4px}[_nghost-%COMP%] .dr-alert__custom-content[_ngcontent-%COMP%]{white-space:pre-line}[_nghost-%COMP%] .dr-alert__close-icon[_ngcontent-%COMP%]{margin-left:auto;cursor:pointer}"], changeDetection: 0 }); }
|
|
50
90
|
}
|
|
51
91
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DrAlertComponent, [{
|
|
52
92
|
type: Component,
|
|
53
|
-
args: [{ selector: 'dr-alert', changeDetection: ChangeDetectionStrategy.OnPush, template: "<
|
|
93
|
+
args: [{ selector: 'dr-alert', changeDetection: ChangeDetectionStrategy.OnPush, template: "<i [class]=\"'dr-alert__icon ' + themeIconClass\"></i>\n<div class=\"dr-alert__content-wrapper\">\n <ng-container *ngIf=\"!contentRef.innerHTML.trim()\">\n <span *ngIf=\"title\" class=\"dr-alert__title\">{{ title }}</span>\n <span *ngIf=\"title && text\"> - </span>\n <span *ngIf=\"text\" class=\"dr-alert__text\">{{ text }}</span>\n </ng-container>\n <div class=\"dr-alert__custom-content\" #contentRef>\n <ng-content></ng-content>\n </div>\n</div>\n<i *ngIf=\"showClose\" (click)=\"hidden = true\" class=\"dr-alert__close-icon dr-icon-exit\"></i>\n", styles: [":host{font-family:Poppins,sans-serif;display:flex;padding:8px 16px;border-radius:8px;min-height:40px;color:#333;position:relative;gap:8px}:host.--info{background:#e6efff}:host.--bold-error{color:#fff;background:#bf1d30}:host.--error{background:#f7d9dc}:host.--warning{background:#ffefc7}:host.--success{background:#dbf5e6}:host.--tip{background:#eaeaff}:host.--hidden{display:none}:host .dr-alert__title{font-size:12px;line-height:16px;font-weight:600;white-space:pre-line}:host .dr-alert__text{font-size:12px;line-height:16px;font-weight:400;white-space:pre-line}:host .dr-alert__content-wrapper{padding-top:4px}:host .dr-alert__custom-content{white-space:pre-line}:host .dr-alert__close-icon{margin-left:auto;cursor:pointer}\n"] }]
|
|
54
94
|
}], null, { theme: [{
|
|
55
95
|
type: Input
|
|
56
96
|
}], customIconClass: [{
|
|
57
97
|
type: Input
|
|
98
|
+
}], title: [{
|
|
99
|
+
type: Input
|
|
58
100
|
}], text: [{
|
|
59
101
|
type: Input
|
|
102
|
+
}], showClose: [{
|
|
103
|
+
type: Input
|
|
60
104
|
}], elementClass: [{
|
|
61
105
|
type: HostBinding,
|
|
62
106
|
args: ['class']
|
|
63
107
|
}] }); })();
|
|
64
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
108
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHItYWxlcnQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZGF0YXJhaWxzc2hhcmVkL3NyYy9saWIvZHItYWxlcnQvZHItYWxlcnQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZGF0YXJhaWxzc2hhcmVkL3NyYy9saWIvZHItYWxlcnQvZHItYWxlcnQuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxXQUFXLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3ZGLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQzs7OztJQ0VuRCwrQkFBNEM7SUFBQSxZQUFXO0lBQUEsaUJBQU87OztJQ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cHVibGljIGdldCB0aGVtZUljb25DbGFzcygpOiBzdHJpbmcge1xuICAgICAgICByZXR1cm4gdGhpcy5jdXN0b21JY29uQ2xhc3MgfHwgQUxFUlRfVEhFTUVfSUNPTlNbdGhpcy50aGVtZV07XG4gICAgfVxufVxuIiwiPGkgW2NsYXNzXT1cIidkci1hbGVydF9faWNvbiAnICsgdGhlbWVJY29uQ2xhc3NcIj48L2k+XG48ZGl2IGNsYXNzPVwiZHItYWxlcnRfX2NvbnRlbnQtd3JhcHBlclwiPlxuICAgIDxuZy1jb250YWluZXIgKm5nSWY9XCIhY29udGVudFJlZi5pbm5lckhUTUwudHJpbSgpXCI+XG4gICAgICAgIDxzcGFuICpuZ0lmPVwidGl0bGVcIiBjbGFzcz1cImRyLWFsZXJ0X190aXRsZVwiPnt7IHRpdGxlIH19PC9zcGFuPlxuICAgICAgICA8c3BhbiAqbmdJZj1cInRpdGxlICYmIHRleHRcIj4gLSA8L3NwYW4+XG4gICAgICAgIDxzcGFuICpuZ0lmPVwidGV4dFwiIGNsYXNzPVwiZHItYWxlcnRfX3RleHRcIj57eyB0ZXh0IH19PC9zcGFuPlxuICAgIDwvbmctY29udGFpbmVyPlxuICAgIDxkaXYgY2xhc3M9XCJkci1hbGVydF9fY3VzdG9tLWNvbnRlbnRcIiAjY29udGVudFJlZj5cbiAgICAgICAgPG5nLWNvbnRlbnQ+PC9uZy1jb250ZW50PlxuICAgIDwvZGl2PlxuPC9kaXY+XG48aSAqbmdJZj1cInNob3dDbG9zZVwiIChjbGljayk9XCJoaWRkZW4gPSB0cnVlXCIgY2xhc3M9XCJkci1hbGVydF9fY2xvc2UtaWNvbiBkci1pY29uLWV4aXRcIj48L2k+XG4iXX0=
|
|
@@ -5,5 +5,6 @@ export var DrAlertTheme;
|
|
|
5
5
|
DrAlertTheme["BOLD_ERROR"] = "bold-error";
|
|
6
6
|
DrAlertTheme["WARNING"] = "warning";
|
|
7
7
|
DrAlertTheme["INFO"] = "info";
|
|
8
|
+
DrAlertTheme["TIP"] = "tip";
|
|
8
9
|
})(DrAlertTheme || (DrAlertTheme = {}));
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHItYWxlcnQtdGhlbWUuZW51bS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2RhdGFyYWlsc3NoYXJlZC9zcmMvbGliL2RyLWFsZXJ0L2VudW1zL2RyLWFsZXJ0LXRoZW1lLmVudW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFOLElBQVksWUFPWDtBQVBELFdBQVksWUFBWTtJQUNwQixtQ0FBbUIsQ0FBQTtJQUNuQiwrQkFBZSxDQUFBO0lBQ2YseUNBQXlCLENBQUE7SUFDekIsbUNBQW1CLENBQUE7SUFDbkIsNkJBQWEsQ0FBQTtJQUNiLDJCQUFXLENBQUE7QUFDZixDQUFDLEVBUFcsWUFBWSxLQUFaLFlBQVksUUFPdkIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZW51bSBEckFsZXJ0VGhlbWUge1xuICAgIFNVQ0NFU1MgPSAnc3VjY2VzcycsXG4gICAgRVJST1IgPSAnZXJyb3InLFxuICAgIEJPTERfRVJST1IgPSAnYm9sZC1lcnJvcicsXG4gICAgV0FSTklORyA9ICd3YXJuaW5nJyxcbiAgICBJTkZPID0gJ2luZm8nLFxuICAgIFRJUCA9ICd0aXAnLFxufVxuIl19
|
|
@@ -8528,16 +8528,52 @@ var DrAlertTheme;
|
|
|
8528
8528
|
DrAlertTheme["BOLD_ERROR"] = "bold-error";
|
|
8529
8529
|
DrAlertTheme["WARNING"] = "warning";
|
|
8530
8530
|
DrAlertTheme["INFO"] = "info";
|
|
8531
|
+
DrAlertTheme["TIP"] = "tip";
|
|
8531
8532
|
})(DrAlertTheme || (DrAlertTheme = {}));
|
|
8532
8533
|
|
|
8533
|
-
function
|
|
8534
|
-
i0.ɵɵelementStart(0, "span",
|
|
8534
|
+
function DrAlertComponent_ng_container_2_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
8535
|
+
i0.ɵɵelementStart(0, "span", 7);
|
|
8535
8536
|
i0.ɵɵtext(1);
|
|
8536
8537
|
i0.ɵɵelementEnd();
|
|
8538
|
+
} if (rf & 2) {
|
|
8539
|
+
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
8540
|
+
i0.ɵɵadvance(1);
|
|
8541
|
+
i0.ɵɵtextInterpolate(ctx_r3.title);
|
|
8542
|
+
} }
|
|
8543
|
+
function DrAlertComponent_ng_container_2_span_2_Template(rf, ctx) { if (rf & 1) {
|
|
8544
|
+
i0.ɵɵelementStart(0, "span");
|
|
8545
|
+
i0.ɵɵtext(1, " - ");
|
|
8546
|
+
i0.ɵɵelementEnd();
|
|
8547
|
+
} }
|
|
8548
|
+
function DrAlertComponent_ng_container_2_span_3_Template(rf, ctx) { if (rf & 1) {
|
|
8549
|
+
i0.ɵɵelementStart(0, "span", 8);
|
|
8550
|
+
i0.ɵɵtext(1);
|
|
8551
|
+
i0.ɵɵelementEnd();
|
|
8552
|
+
} if (rf & 2) {
|
|
8553
|
+
const ctx_r5 = i0.ɵɵnextContext(2);
|
|
8554
|
+
i0.ɵɵadvance(1);
|
|
8555
|
+
i0.ɵɵtextInterpolate(ctx_r5.text);
|
|
8556
|
+
} }
|
|
8557
|
+
function DrAlertComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
|
|
8558
|
+
i0.ɵɵelementContainerStart(0);
|
|
8559
|
+
i0.ɵɵtemplate(1, DrAlertComponent_ng_container_2_span_1_Template, 2, 1, "span", 5);
|
|
8560
|
+
i0.ɵɵtemplate(2, DrAlertComponent_ng_container_2_span_2_Template, 2, 0, "span", 1);
|
|
8561
|
+
i0.ɵɵtemplate(3, DrAlertComponent_ng_container_2_span_3_Template, 2, 1, "span", 6);
|
|
8562
|
+
i0.ɵɵelementContainerEnd();
|
|
8537
8563
|
} if (rf & 2) {
|
|
8538
8564
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
8539
8565
|
i0.ɵɵadvance(1);
|
|
8540
|
-
i0.ɵɵ
|
|
8566
|
+
i0.ɵɵproperty("ngIf", ctx_r0.title);
|
|
8567
|
+
i0.ɵɵadvance(1);
|
|
8568
|
+
i0.ɵɵproperty("ngIf", ctx_r0.title && ctx_r0.text);
|
|
8569
|
+
i0.ɵɵadvance(1);
|
|
8570
|
+
i0.ɵɵproperty("ngIf", ctx_r0.text);
|
|
8571
|
+
} }
|
|
8572
|
+
function DrAlertComponent_i_6_Template(rf, ctx) { if (rf & 1) {
|
|
8573
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
8574
|
+
i0.ɵɵelementStart(0, "i", 9);
|
|
8575
|
+
i0.ɵɵlistener("click", function DrAlertComponent_i_6_Template_i_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r6 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r6.hidden = true); });
|
|
8576
|
+
i0.ɵɵelementEnd();
|
|
8541
8577
|
} }
|
|
8542
8578
|
const _c0$F = ["*"];
|
|
8543
8579
|
const ALERT_THEME_ICONS = {
|
|
@@ -8546,13 +8582,16 @@ const ALERT_THEME_ICONS = {
|
|
|
8546
8582
|
[DrAlertTheme.ERROR]: 'dr-icon-error',
|
|
8547
8583
|
[DrAlertTheme.WARNING]: 'dr-icon-warning',
|
|
8548
8584
|
[DrAlertTheme.INFO]: 'dr-icon-info',
|
|
8585
|
+
[DrAlertTheme.TIP]: 'dr-icon-light',
|
|
8549
8586
|
};
|
|
8550
8587
|
class DrAlertComponent {
|
|
8551
8588
|
constructor() {
|
|
8552
8589
|
this.theme = DrAlertTheme.INFO;
|
|
8590
|
+
this.showClose = false;
|
|
8591
|
+
this.hidden = false;
|
|
8553
8592
|
}
|
|
8554
8593
|
get elementClass() {
|
|
8555
|
-
return
|
|
8594
|
+
return `--${this.theme} ${this.hidden ? '--hidden' : ''}`;
|
|
8556
8595
|
}
|
|
8557
8596
|
get themeIconClass() {
|
|
8558
8597
|
return this.customIconClass || ALERT_THEME_ICONS[this.theme];
|
|
@@ -8560,31 +8599,37 @@ class DrAlertComponent {
|
|
|
8560
8599
|
/** @nocollapse */ static { this.ɵfac = function DrAlertComponent_Factory(t) { return new (t || DrAlertComponent)(); }; }
|
|
8561
8600
|
/** @nocollapse */ static { this.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: DrAlertComponent, selectors: [["dr-alert"]], hostVars: 2, hostBindings: function DrAlertComponent_HostBindings(rf, ctx) { if (rf & 2) {
|
|
8562
8601
|
i0.ɵɵclassMap(ctx.elementClass);
|
|
8563
|
-
} }, inputs: { theme: "theme", customIconClass: "customIconClass", text: "text" }, ngContentSelectors: _c0$F, decls:
|
|
8602
|
+
} }, inputs: { theme: "theme", customIconClass: "customIconClass", title: "title", text: "text", showClose: "showClose" }, ngContentSelectors: _c0$F, decls: 7, vars: 4, consts: [[1, "dr-alert__content-wrapper"], [4, "ngIf"], [1, "dr-alert__custom-content"], ["contentRef", ""], ["class", "dr-alert__close-icon dr-icon-exit", 3, "click", 4, "ngIf"], ["class", "dr-alert__title", 4, "ngIf"], ["class", "dr-alert__text", 4, "ngIf"], [1, "dr-alert__title"], [1, "dr-alert__text"], [1, "dr-alert__close-icon", "dr-icon-exit", 3, "click"]], template: function DrAlertComponent_Template(rf, ctx) { if (rf & 1) {
|
|
8564
8603
|
i0.ɵɵprojectionDef();
|
|
8565
|
-
i0.ɵɵ
|
|
8566
|
-
i0.ɵɵ
|
|
8567
|
-
i0.ɵɵtemplate(2,
|
|
8604
|
+
i0.ɵɵelement(0, "i");
|
|
8605
|
+
i0.ɵɵelementStart(1, "div", 0);
|
|
8606
|
+
i0.ɵɵtemplate(2, DrAlertComponent_ng_container_2_Template, 4, 3, "ng-container", 1);
|
|
8568
8607
|
i0.ɵɵelementStart(3, "div", 2, 3);
|
|
8569
8608
|
i0.ɵɵprojection(5);
|
|
8570
8609
|
i0.ɵɵelementEnd()();
|
|
8610
|
+
i0.ɵɵtemplate(6, DrAlertComponent_i_6_Template, 1, 0, "i", 4);
|
|
8571
8611
|
} if (rf & 2) {
|
|
8572
8612
|
const _r1 = i0.ɵɵreference(4);
|
|
8573
|
-
i0.ɵɵadvance(1);
|
|
8574
8613
|
i0.ɵɵclassMap("dr-alert__icon " + ctx.themeIconClass);
|
|
8575
|
-
i0.ɵɵadvance(
|
|
8614
|
+
i0.ɵɵadvance(2);
|
|
8576
8615
|
i0.ɵɵproperty("ngIf", !_r1.innerHTML.trim());
|
|
8577
|
-
|
|
8616
|
+
i0.ɵɵadvance(4);
|
|
8617
|
+
i0.ɵɵproperty("ngIf", ctx.showClose);
|
|
8618
|
+
} }, dependencies: [i1.NgIf], styles: ["[_nghost-%COMP%]{font-family:Poppins,sans-serif;display:flex;padding:8px 16px;border-radius:8px;min-height:40px;color:#333;position:relative;gap:8px}.--info[_nghost-%COMP%]{background:#e6efff}.--bold-error[_nghost-%COMP%]{color:#fff;background:#bf1d30}.--error[_nghost-%COMP%]{background:#f7d9dc}.--warning[_nghost-%COMP%]{background:#ffefc7}.--success[_nghost-%COMP%]{background:#dbf5e6}.--tip[_nghost-%COMP%]{background:#eaeaff}.--hidden[_nghost-%COMP%]{display:none}[_nghost-%COMP%] .dr-alert__title[_ngcontent-%COMP%]{font-size:12px;line-height:16px;font-weight:600;white-space:pre-line}[_nghost-%COMP%] .dr-alert__text[_ngcontent-%COMP%]{font-size:12px;line-height:16px;font-weight:400;white-space:pre-line}[_nghost-%COMP%] .dr-alert__content-wrapper[_ngcontent-%COMP%]{padding-top:4px}[_nghost-%COMP%] .dr-alert__custom-content[_ngcontent-%COMP%]{white-space:pre-line}[_nghost-%COMP%] .dr-alert__close-icon[_ngcontent-%COMP%]{margin-left:auto;cursor:pointer}"], changeDetection: 0 }); }
|
|
8578
8619
|
}
|
|
8579
8620
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DrAlertComponent, [{
|
|
8580
8621
|
type: Component,
|
|
8581
|
-
args: [{ selector: 'dr-alert', changeDetection: ChangeDetectionStrategy.OnPush, template: "<
|
|
8622
|
+
args: [{ selector: 'dr-alert', changeDetection: ChangeDetectionStrategy.OnPush, template: "<i [class]=\"'dr-alert__icon ' + themeIconClass\"></i>\n<div class=\"dr-alert__content-wrapper\">\n <ng-container *ngIf=\"!contentRef.innerHTML.trim()\">\n <span *ngIf=\"title\" class=\"dr-alert__title\">{{ title }}</span>\n <span *ngIf=\"title && text\"> - </span>\n <span *ngIf=\"text\" class=\"dr-alert__text\">{{ text }}</span>\n </ng-container>\n <div class=\"dr-alert__custom-content\" #contentRef>\n <ng-content></ng-content>\n </div>\n</div>\n<i *ngIf=\"showClose\" (click)=\"hidden = true\" class=\"dr-alert__close-icon dr-icon-exit\"></i>\n", styles: [":host{font-family:Poppins,sans-serif;display:flex;padding:8px 16px;border-radius:8px;min-height:40px;color:#333;position:relative;gap:8px}:host.--info{background:#e6efff}:host.--bold-error{color:#fff;background:#bf1d30}:host.--error{background:#f7d9dc}:host.--warning{background:#ffefc7}:host.--success{background:#dbf5e6}:host.--tip{background:#eaeaff}:host.--hidden{display:none}:host .dr-alert__title{font-size:12px;line-height:16px;font-weight:600;white-space:pre-line}:host .dr-alert__text{font-size:12px;line-height:16px;font-weight:400;white-space:pre-line}:host .dr-alert__content-wrapper{padding-top:4px}:host .dr-alert__custom-content{white-space:pre-line}:host .dr-alert__close-icon{margin-left:auto;cursor:pointer}\n"] }]
|
|
8582
8623
|
}], null, { theme: [{
|
|
8583
8624
|
type: Input
|
|
8584
8625
|
}], customIconClass: [{
|
|
8585
8626
|
type: Input
|
|
8627
|
+
}], title: [{
|
|
8628
|
+
type: Input
|
|
8586
8629
|
}], text: [{
|
|
8587
8630
|
type: Input
|
|
8631
|
+
}], showClose: [{
|
|
8632
|
+
type: Input
|
|
8588
8633
|
}], elementClass: [{
|
|
8589
8634
|
type: HostBinding,
|
|
8590
8635
|
args: ['class']
|