@ngrdt/gov 0.0.92 → 0.0.95
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/fesm2022/ngrdt-gov.mjs +13 -5
- package/fesm2022/ngrdt-gov.mjs.map +1 -1
- package/index.d.ts +8 -6
- package/package.json +7 -7
package/fesm2022/ngrdt-gov.mjs
CHANGED
|
@@ -614,11 +614,11 @@ const RDT_GOV_NOTIFICATION_DATA_PROVIDER = new InjectionToken('RDT_GOV_NOTIFICAT
|
|
|
614
614
|
class RdtGovNotificationPopupComponent {
|
|
615
615
|
data = inject(RDT_GOV_NOTIFICATION_DATA_PROVIDER);
|
|
616
616
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RdtGovNotificationPopupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
617
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: RdtGovNotificationPopupComponent, isStandalone: true, selector: "rdt-gov-notification-popup", ngImport: i0, template: "@if(data){\n<gov-toast\n [color]=\"data.color\"\n [gravity]=\"data.positionVert\"\n [position]=\"data.positionHoriz\"\n [type]=\"data.type\"\n [closeLabel]=\"data.closeLabel\"\n
|
|
617
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: RdtGovNotificationPopupComponent, isStandalone: true, selector: "rdt-gov-notification-popup", ngImport: i0, template: "@if(data){\n<gov-toast\n [color]=\"data.color\"\n [gravity]=\"data.positionVert\"\n [position]=\"data.positionHoriz\"\n [type]=\"data.type\"\n [closeLabel]=\"data.closeLabel\"\n>\n <div class=\"toast-wrapper\">\n @if (data.icon) {\n <span class=\"toast-icon\">\n <ng-container rdtIconOutlet [inputs]=\"{ name: data.icon }\"></ng-container>\n </span>\n }\n <div>\n @if(data.header) {\n <span class=\"toast-header\">{{ data.header }}</span>\n }\n <span>{{ data.message }}</span>\n </div>\n </div>\n</gov-toast>\n}\n", styles: [".toast-wrapper{display:flex;gap:var(--spacing-s-nudge);align-items:center}.toast-header{font-weight:500}\n"], dependencies: [{ kind: "ngmodule", type: GovDesignSystemModule }, { kind: "component", type: i1.GovToast, selector: "gov-toast", inputs: ["accessibleCloseLabel", "closeLabel", "color", "gravity", "position", "time", "type"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: RdtIconOutletDirective, selector: "[rdtIconOutlet]", exportAs: ["rdtIconOutlet"] }] });
|
|
618
618
|
}
|
|
619
619
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RdtGovNotificationPopupComponent, decorators: [{
|
|
620
620
|
type: Component,
|
|
621
|
-
args: [{ selector: 'rdt-gov-notification-popup', imports: [GovDesignSystemModule, CommonModule, RdtIconOutletDirective], template: "@if(data){\n<gov-toast\n [color]=\"data.color\"\n [gravity]=\"data.positionVert\"\n [position]=\"data.positionHoriz\"\n [type]=\"data.type\"\n [closeLabel]=\"data.closeLabel\"\n
|
|
621
|
+
args: [{ selector: 'rdt-gov-notification-popup', imports: [GovDesignSystemModule, CommonModule, RdtIconOutletDirective], template: "@if(data){\n<gov-toast\n [color]=\"data.color\"\n [gravity]=\"data.positionVert\"\n [position]=\"data.positionHoriz\"\n [type]=\"data.type\"\n [closeLabel]=\"data.closeLabel\"\n>\n <div class=\"toast-wrapper\">\n @if (data.icon) {\n <span class=\"toast-icon\">\n <ng-container rdtIconOutlet [inputs]=\"{ name: data.icon }\"></ng-container>\n </span>\n }\n <div>\n @if(data.header) {\n <span class=\"toast-header\">{{ data.header }}</span>\n }\n <span>{{ data.message }}</span>\n </div>\n </div>\n</gov-toast>\n}\n", styles: [".toast-wrapper{display:flex;gap:var(--spacing-s-nudge);align-items:center}.toast-header{font-weight:500}\n"] }]
|
|
622
622
|
}] });
|
|
623
623
|
|
|
624
624
|
class RdtGovNotificationService {
|
|
@@ -636,13 +636,21 @@ class RdtGovNotificationService {
|
|
|
636
636
|
setTimeout(() => this.close(overlayRef), cfg.duration);
|
|
637
637
|
}
|
|
638
638
|
success(message = this.t.instant('RDT_GOV_NOTIFY_SUCCESS')) {
|
|
639
|
-
this.
|
|
639
|
+
this.showSimple('success', message);
|
|
640
640
|
}
|
|
641
641
|
warn(message = this.t.instant('RDT_GOV_NOTIFY_WARNING')) {
|
|
642
|
-
this.
|
|
642
|
+
this.showSimple('warning', message);
|
|
643
643
|
}
|
|
644
644
|
error(message = this.t.instant('RDT_GOV_NOTIFY_ERROR')) {
|
|
645
|
-
this.
|
|
645
|
+
this.showSimple('error', message);
|
|
646
|
+
}
|
|
647
|
+
showSimple(color, message) {
|
|
648
|
+
if (typeof message === 'object') {
|
|
649
|
+
this.show({ color, ...message });
|
|
650
|
+
}
|
|
651
|
+
else {
|
|
652
|
+
this.show({ color, message });
|
|
653
|
+
}
|
|
646
654
|
}
|
|
647
655
|
mergeConfig(cfg) {
|
|
648
656
|
return {
|