@wizishop/angular-components 15.1.135 → 15.1.137
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/angular-components.scss +19 -11
- package/esm2020/lib/components/alert-popup/alert-popup.component.mjs +36 -5
- package/fesm2015/wizishop-angular-components.mjs +36 -4
- package/fesm2015/wizishop-angular-components.mjs.map +1 -1
- package/fesm2020/wizishop-angular-components.mjs +35 -4
- package/fesm2020/wizishop-angular-components.mjs.map +1 -1
- package/lib/components/alert-popup/alert-popup.component.d.ts +8 -2
- package/package.json +1 -1
- package/wizishop-angular-components-15.1.137.tgz +0 -0
- package/wizishop-angular-components-15.1.135.tgz +0 -0
package/angular-components.scss
CHANGED
|
@@ -505,6 +505,8 @@ $wac-tab-colunm-blue: #3ba6ec!default;.zindexToggle {
|
|
|
505
505
|
width: auto;
|
|
506
506
|
box-shadow: 0 0 20px rgba(50, 50, 50, 0.1);
|
|
507
507
|
font-size: 14px;
|
|
508
|
+
visibility: hidden;
|
|
509
|
+
opacity: 0!important;
|
|
508
510
|
|
|
509
511
|
&.with-icon {
|
|
510
512
|
.alert--message {
|
|
@@ -515,6 +517,12 @@ $wac-tab-colunm-blue: #3ba6ec!default;.zindexToggle {
|
|
|
515
517
|
}
|
|
516
518
|
}
|
|
517
519
|
|
|
520
|
+
&.is-loaded {
|
|
521
|
+
visibility: visible;
|
|
522
|
+
opacity: 1!important;
|
|
523
|
+
transition: opacity .3s ease .3s, visibility 0s!important;
|
|
524
|
+
}
|
|
525
|
+
|
|
518
526
|
.icon + .wac-alert-popup__close + .wac-alert-popup__text {
|
|
519
527
|
width: auto;
|
|
520
528
|
}
|
|
@@ -9084,16 +9092,7 @@ span.wac-tooltip {
|
|
|
9084
9092
|
}
|
|
9085
9093
|
}
|
|
9086
9094
|
|
|
9087
|
-
|
|
9088
|
-
font-size: rem(18);
|
|
9089
|
-
line-height: rem(21);
|
|
9090
|
-
font-weight: 500;
|
|
9091
|
-
color: $wac-main-text;
|
|
9092
|
-
|
|
9093
|
-
&.no-margin {
|
|
9094
|
-
margin: 0 !important;
|
|
9095
|
-
}
|
|
9096
|
-
}h1.wac-h1 {
|
|
9095
|
+
h1.wac-h1 {
|
|
9097
9096
|
font-size: rem(30);
|
|
9098
9097
|
line-height: rem(35);
|
|
9099
9098
|
font-weight: 600;
|
|
@@ -9125,7 +9124,16 @@ h2.wac-h2 {
|
|
|
9125
9124
|
font-weight: normal;
|
|
9126
9125
|
}
|
|
9127
9126
|
}
|
|
9128
|
-
|
|
9127
|
+
h2.wac-h2 {
|
|
9128
|
+
font-size: rem(18);
|
|
9129
|
+
line-height: rem(21);
|
|
9130
|
+
font-weight: 500;
|
|
9131
|
+
color: $wac-main-text;
|
|
9132
|
+
|
|
9133
|
+
&.no-margin {
|
|
9134
|
+
margin: 0 !important;
|
|
9135
|
+
}
|
|
9136
|
+
}h3.wac-h3 {
|
|
9129
9137
|
font-size: rem(16);
|
|
9130
9138
|
line-height: rem(19);
|
|
9131
9139
|
font-weight: 500;
|
|
@@ -3,7 +3,9 @@ import { Component, ViewEncapsulation } from '@angular/core';
|
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import * as i1 from "@angular/common";
|
|
5
5
|
export class AlertPopupComponent {
|
|
6
|
-
constructor() {
|
|
6
|
+
constructor(elRef, renderer) {
|
|
7
|
+
this.elRef = elRef;
|
|
8
|
+
this.renderer = renderer;
|
|
7
9
|
/** Subject for notifying the user that the dialog has finished closing. */
|
|
8
10
|
this.afterClosedPopup = new Subject();
|
|
9
11
|
this.open = false;
|
|
@@ -11,7 +13,22 @@ export class AlertPopupComponent {
|
|
|
11
13
|
ngOnInit() {
|
|
12
14
|
setTimeout(() => {
|
|
13
15
|
this.open = true;
|
|
14
|
-
},
|
|
16
|
+
}, 100);
|
|
17
|
+
this.observer = new MutationObserver(() => {
|
|
18
|
+
const alert = document.querySelector('.wac-alert-popup:last-child .alert');
|
|
19
|
+
if (alert) {
|
|
20
|
+
const bgColor = getComputedStyle(alert).backgroundColor;
|
|
21
|
+
const hexColor = this.rgbToHex(bgColor);
|
|
22
|
+
if ((hexColor === '#2ecc71' || hexColor === '#e95656') && !alert.classList.contains('is-loaded')) {
|
|
23
|
+
alert.classList.add('is-loaded');
|
|
24
|
+
this.observer.disconnect();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
this.observer.observe(document.body, {
|
|
29
|
+
childList: true,
|
|
30
|
+
subtree: true
|
|
31
|
+
});
|
|
15
32
|
if (this.config.duration > 0) {
|
|
16
33
|
this.timer = setTimeout(() => this.dismiss(), this.config.duration);
|
|
17
34
|
}
|
|
@@ -29,13 +46,27 @@ export class AlertPopupComponent {
|
|
|
29
46
|
afterClosed() {
|
|
30
47
|
return this.afterClosedPopup.asObservable();
|
|
31
48
|
}
|
|
49
|
+
ngOnDestroy() {
|
|
50
|
+
this.observer?.disconnect();
|
|
51
|
+
}
|
|
52
|
+
rgbToHex(rgb) {
|
|
53
|
+
const result = rgb.match(/\d+/g);
|
|
54
|
+
if (!result)
|
|
55
|
+
return '';
|
|
56
|
+
const [r, g, b] = result.map(Number);
|
|
57
|
+
return ('#' +
|
|
58
|
+
[r, g, b]
|
|
59
|
+
.map((x) => x.toString(16).padStart(2, '0'))
|
|
60
|
+
.join('')
|
|
61
|
+
.toLowerCase());
|
|
62
|
+
}
|
|
32
63
|
}
|
|
33
|
-
AlertPopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AlertPopupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
64
|
+
AlertPopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AlertPopupComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
34
65
|
AlertPopupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: AlertPopupComponent, selector: "wac-alert-popup", host: { classAttribute: "wac-alert-popup" }, ngImport: i0, template: "<div\r\n [class]=\"'alert ' + ((config.color) ? config.color : ' is-primary') + ((config.extraClasses) ? ' ' + config.extraClasses : '') + ((config.position) ? ' ' + config.position : '') + ((config.fullsize) ? ' fullsize' : '') + ((config.opacity) ? ' opacity-active' : '') + ((config.small) ? ' small' : '') + ((config.icon) ? ' with-icon' : '') + ((config.duration) ? '' : ' no-duration')\"\r\n [ngClass]=\"{'is-active': open, 'has-close': config.closeButton}\"\r\n>\r\n <div class=\"alert--message\">\r\n <span class=\"icon\" *ngIf=\"config.icon\">\r\n <i [class]=\"config.icon\"></i>\r\n </span>\r\n <span (click)=\"dismiss()\" class=\"wac-alert-popup__close\" *ngIf=\"!config.small || (config.small && config.closeButton)\"><i class=\"far fa-times\"></i></span>\r\n <p *ngIf=\"config.title\" class=\"wac-alert-popup__title\" [innerHTML]=\"config.title\"></p>\r\n <p *ngIf=\"config.message\" class=\"wac-alert-popup__text\" [innerHTML]=\"config.message\"></p>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
35
66
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AlertPopupComponent, decorators: [{
|
|
36
67
|
type: Component,
|
|
37
68
|
args: [{ selector: 'wac-alert-popup', host: {
|
|
38
69
|
class: 'wac-alert-popup'
|
|
39
70
|
}, encapsulation: ViewEncapsulation.None, template: "<div\r\n [class]=\"'alert ' + ((config.color) ? config.color : ' is-primary') + ((config.extraClasses) ? ' ' + config.extraClasses : '') + ((config.position) ? ' ' + config.position : '') + ((config.fullsize) ? ' fullsize' : '') + ((config.opacity) ? ' opacity-active' : '') + ((config.small) ? ' small' : '') + ((config.icon) ? ' with-icon' : '') + ((config.duration) ? '' : ' no-duration')\"\r\n [ngClass]=\"{'is-active': open, 'has-close': config.closeButton}\"\r\n>\r\n <div class=\"alert--message\">\r\n <span class=\"icon\" *ngIf=\"config.icon\">\r\n <i [class]=\"config.icon\"></i>\r\n </span>\r\n <span (click)=\"dismiss()\" class=\"wac-alert-popup__close\" *ngIf=\"!config.small || (config.small && config.closeButton)\"><i class=\"far fa-times\"></i></span>\r\n <p *ngIf=\"config.title\" class=\"wac-alert-popup__title\" [innerHTML]=\"config.title\"></p>\r\n <p *ngIf=\"config.message\" class=\"wac-alert-popup__text\" [innerHTML]=\"config.message\"></p>\r\n </div>\r\n</div>\r\n" }]
|
|
40
|
-
}] });
|
|
41
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
71
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
|
|
72
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxlcnQtcG9wdXAuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYW5ndWxhci1jb21wb25lbnRzL3NyYy9saWIvY29tcG9uZW50cy9hbGVydC1wb3B1cC9hbGVydC1wb3B1cC5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyLWNvbXBvbmVudHMvc3JjL2xpYi9jb21wb25lbnRzL2FsZXJ0LXBvcHVwL2FsZXJ0LXBvcHVwLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBYSxPQUFPLEVBQWUsTUFBTSxNQUFNLENBQUM7QUFFdkQsT0FBTyxFQUFnQixTQUFTLEVBQTRDLGlCQUFpQixFQUFDLE1BQU0sZUFBZ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"12.0.0", version: "15.1.5", ngImpor
|
|
|
4612
4612
|
}] } });
|
|
4613
4613
|
|
|
4614
4614
|
class AlertPopupComponent {
|
|
4615
|
-
constructor() {
|
|
4615
|
+
constructor(elRef, renderer) {
|
|
4616
|
+
this.elRef = elRef;
|
|
4617
|
+
this.renderer = renderer;
|
|
4616
4618
|
/** Subject for notifying the user that the dialog has finished closing. */
|
|
4617
4619
|
this.afterClosedPopup = new Subject();
|
|
4618
4620
|
this.open = false;
|
|
@@ -4620,7 +4622,22 @@ class AlertPopupComponent {
|
|
|
4620
4622
|
ngOnInit() {
|
|
4621
4623
|
setTimeout(() => {
|
|
4622
4624
|
this.open = true;
|
|
4623
|
-
},
|
|
4625
|
+
}, 100);
|
|
4626
|
+
this.observer = new MutationObserver(() => {
|
|
4627
|
+
const alert = document.querySelector('.wac-alert-popup:last-child .alert');
|
|
4628
|
+
if (alert) {
|
|
4629
|
+
const bgColor = getComputedStyle(alert).backgroundColor;
|
|
4630
|
+
const hexColor = this.rgbToHex(bgColor);
|
|
4631
|
+
if ((hexColor === '#2ecc71' || hexColor === '#e95656') && !alert.classList.contains('is-loaded')) {
|
|
4632
|
+
alert.classList.add('is-loaded');
|
|
4633
|
+
this.observer.disconnect();
|
|
4634
|
+
}
|
|
4635
|
+
}
|
|
4636
|
+
});
|
|
4637
|
+
this.observer.observe(document.body, {
|
|
4638
|
+
childList: true,
|
|
4639
|
+
subtree: true
|
|
4640
|
+
});
|
|
4624
4641
|
if (this.config.duration > 0) {
|
|
4625
4642
|
this.timer = setTimeout(() => this.dismiss(), this.config.duration);
|
|
4626
4643
|
}
|
|
@@ -4638,15 +4655,30 @@ class AlertPopupComponent {
|
|
|
4638
4655
|
afterClosed() {
|
|
4639
4656
|
return this.afterClosedPopup.asObservable();
|
|
4640
4657
|
}
|
|
4658
|
+
ngOnDestroy() {
|
|
4659
|
+
var _a;
|
|
4660
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
4661
|
+
}
|
|
4662
|
+
rgbToHex(rgb) {
|
|
4663
|
+
const result = rgb.match(/\d+/g);
|
|
4664
|
+
if (!result)
|
|
4665
|
+
return '';
|
|
4666
|
+
const [r, g, b] = result.map(Number);
|
|
4667
|
+
return ('#' +
|
|
4668
|
+
[r, g, b]
|
|
4669
|
+
.map((x) => x.toString(16).padStart(2, '0'))
|
|
4670
|
+
.join('')
|
|
4671
|
+
.toLowerCase());
|
|
4672
|
+
}
|
|
4641
4673
|
}
|
|
4642
|
-
AlertPopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AlertPopupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4674
|
+
AlertPopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AlertPopupComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
4643
4675
|
AlertPopupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: AlertPopupComponent, selector: "wac-alert-popup", host: { classAttribute: "wac-alert-popup" }, ngImport: i0, template: "<div\r\n [class]=\"'alert ' + ((config.color) ? config.color : ' is-primary') + ((config.extraClasses) ? ' ' + config.extraClasses : '') + ((config.position) ? ' ' + config.position : '') + ((config.fullsize) ? ' fullsize' : '') + ((config.opacity) ? ' opacity-active' : '') + ((config.small) ? ' small' : '') + ((config.icon) ? ' with-icon' : '') + ((config.duration) ? '' : ' no-duration')\"\r\n [ngClass]=\"{'is-active': open, 'has-close': config.closeButton}\"\r\n>\r\n <div class=\"alert--message\">\r\n <span class=\"icon\" *ngIf=\"config.icon\">\r\n <i [class]=\"config.icon\"></i>\r\n </span>\r\n <span (click)=\"dismiss()\" class=\"wac-alert-popup__close\" *ngIf=\"!config.small || (config.small && config.closeButton)\"><i class=\"far fa-times\"></i></span>\r\n <p *ngIf=\"config.title\" class=\"wac-alert-popup__title\" [innerHTML]=\"config.title\"></p>\r\n <p *ngIf=\"config.message\" class=\"wac-alert-popup__text\" [innerHTML]=\"config.message\"></p>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
4644
4676
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AlertPopupComponent, decorators: [{
|
|
4645
4677
|
type: Component,
|
|
4646
4678
|
args: [{ selector: 'wac-alert-popup', host: {
|
|
4647
4679
|
class: 'wac-alert-popup'
|
|
4648
4680
|
}, encapsulation: ViewEncapsulation.None, template: "<div\r\n [class]=\"'alert ' + ((config.color) ? config.color : ' is-primary') + ((config.extraClasses) ? ' ' + config.extraClasses : '') + ((config.position) ? ' ' + config.position : '') + ((config.fullsize) ? ' fullsize' : '') + ((config.opacity) ? ' opacity-active' : '') + ((config.small) ? ' small' : '') + ((config.icon) ? ' with-icon' : '') + ((config.duration) ? '' : ' no-duration')\"\r\n [ngClass]=\"{'is-active': open, 'has-close': config.closeButton}\"\r\n>\r\n <div class=\"alert--message\">\r\n <span class=\"icon\" *ngIf=\"config.icon\">\r\n <i [class]=\"config.icon\"></i>\r\n </span>\r\n <span (click)=\"dismiss()\" class=\"wac-alert-popup__close\" *ngIf=\"!config.small || (config.small && config.closeButton)\"><i class=\"far fa-times\"></i></span>\r\n <p *ngIf=\"config.title\" class=\"wac-alert-popup__title\" [innerHTML]=\"config.title\"></p>\r\n <p *ngIf=\"config.message\" class=\"wac-alert-popup__text\" [innerHTML]=\"config.message\"></p>\r\n </div>\r\n</div>\r\n" }]
|
|
4649
|
-
}] });
|
|
4681
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
|
|
4650
4682
|
|
|
4651
4683
|
class AlertPopupService {
|
|
4652
4684
|
constructor(domService) {
|