rd-outer-component 0.1.22 → 0.1.24
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/esm2020/lib/modules/rd-common-box/index.mjs +3 -0
- package/esm2020/lib/modules/rd-common-box/rd-common-box.component.mjs +22 -0
- package/esm2020/lib/modules/rd-common-box/rd-common-box.module.mjs +18 -0
- package/esm2020/lib/modules/rd-notification/index.mjs +2 -2
- package/esm2020/lib/modules/rd-notification/notification.component.mjs +14 -19
- package/esm2020/lib/modules/rd-notification/notification.module.mjs +4 -5
- package/esm2020/lib/modules/rd-notification/notification.service.mjs +3 -13
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/rd-outer-component.mjs +50 -31
- package/fesm2015/rd-outer-component.mjs.map +1 -1
- package/fesm2020/rd-outer-component.mjs +50 -32
- package/fesm2020/rd-outer-component.mjs.map +1 -1
- package/lib/modules/rd-common-box/index.d.ts +2 -0
- package/lib/modules/rd-common-box/rd-common-box.component.d.ts +8 -0
- package/lib/modules/rd-common-box/rd-common-box.module.d.ts +8 -0
- package/lib/modules/rd-notification/index.d.ts +1 -1
- package/lib/modules/rd-notification/notification.component.d.ts +5 -7
- package/lib/modules/rd-notification/notification.service.d.ts +6 -3
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, forwardRef, Component, Input, HostBinding, Output, NgModule, ViewChild, ChangeDetectionStrategy, HostListener, createComponent, Injectable, Optional, SkipSelf, Pipe } from '@angular/core';
|
|
2
|
+
import { EventEmitter, forwardRef, Component, Input, HostBinding, Output, NgModule, ViewChild, ChangeDetectionStrategy, HostListener, ViewEncapsulation, createComponent, Injectable, Optional, SkipSelf, Pipe } from '@angular/core';
|
|
3
3
|
import * as i3 from '@angular/forms';
|
|
4
4
|
import { NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule, NG_VALIDATORS, FormControl, Validators } from '@angular/forms';
|
|
5
5
|
import * as i1 from '@angular/common';
|
|
@@ -45,7 +45,6 @@ import * as i5$1 from 'ng-zorro-antd/grid';
|
|
|
45
45
|
import { NzGridModule } from 'ng-zorro-antd/grid';
|
|
46
46
|
import * as i1$2 from 'ng-zorro-antd/notification';
|
|
47
47
|
import { NzNotificationModule } from 'ng-zorro-antd/notification';
|
|
48
|
-
import * as i2$2 from '@angular/platform-browser';
|
|
49
48
|
import { Subject, isObservable, of } from 'rxjs';
|
|
50
49
|
import lottie from 'lottie-web';
|
|
51
50
|
import * as i4$6 from 'ng-zorro-antd/switch';
|
|
@@ -3068,16 +3067,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3068
3067
|
}]
|
|
3069
3068
|
}] });
|
|
3070
3069
|
|
|
3071
|
-
// notification.component.ts
|
|
3072
3070
|
const borderColorMap = {
|
|
3073
|
-
success: 'var(--rd-
|
|
3074
|
-
warn: 'var(--rd-
|
|
3071
|
+
success: 'var(--rd-toast-fg-success)',
|
|
3072
|
+
warn: 'var(--rd-toast-fg-warning)',
|
|
3075
3073
|
error: 'var(--rd-toast-fg-danger)',
|
|
3076
3074
|
};
|
|
3077
3075
|
class RdNotificationComponent {
|
|
3078
|
-
constructor(notificationService
|
|
3076
|
+
constructor(notificationService) {
|
|
3079
3077
|
this.notificationService = notificationService;
|
|
3080
|
-
this.sanitizer = sanitizer;
|
|
3081
3078
|
this.notifications = new Map();
|
|
3082
3079
|
}
|
|
3083
3080
|
showNotification(data) {
|
|
@@ -3087,7 +3084,7 @@ class RdNotificationComponent {
|
|
|
3087
3084
|
nzDuration: data.duration || 8 * 1000,
|
|
3088
3085
|
nzStyle: {
|
|
3089
3086
|
borderRadius: '4px',
|
|
3090
|
-
border: `1px solid
|
|
3087
|
+
border: `1px solid ${borderColorMap[data?.type] || 'var(--rd-bg-panel-border)'}`,
|
|
3091
3088
|
boxShadow: '0px 8px 16px 0px rgba(31, 41, 55, 0.08)',
|
|
3092
3089
|
display: 'flex',
|
|
3093
3090
|
padding: '0',
|
|
@@ -3096,16 +3093,15 @@ class RdNotificationComponent {
|
|
|
3096
3093
|
},
|
|
3097
3094
|
nzClass: 'custom-wallet-notification',
|
|
3098
3095
|
nzCloseIcon: this.closeTpl,
|
|
3099
|
-
nzKey: notificationId,
|
|
3096
|
+
nzKey: notificationId,
|
|
3100
3097
|
});
|
|
3101
3098
|
this.notifications.set(notificationId, notification);
|
|
3102
|
-
// 自动清理
|
|
3103
3099
|
setTimeout(() => {
|
|
3104
3100
|
this.notifications.delete(notificationId);
|
|
3105
3101
|
}, data.duration || 8000);
|
|
3106
3102
|
}
|
|
3107
3103
|
getDesc(desc) {
|
|
3108
|
-
return
|
|
3104
|
+
return desc;
|
|
3109
3105
|
}
|
|
3110
3106
|
onClick(data) {
|
|
3111
3107
|
if (data.onLinkClick) {
|
|
@@ -3118,19 +3114,18 @@ class RdNotificationComponent {
|
|
|
3118
3114
|
.substr(2, 9)}`;
|
|
3119
3115
|
}
|
|
3120
3116
|
ngOnDestroy() {
|
|
3121
|
-
|
|
3122
|
-
this.notifications.forEach((notification, id) => {
|
|
3117
|
+
this.notifications.forEach((_notification, id) => {
|
|
3123
3118
|
this.notificationService.remove(id);
|
|
3124
3119
|
});
|
|
3125
3120
|
this.notifications.clear();
|
|
3126
3121
|
}
|
|
3127
3122
|
}
|
|
3128
|
-
RdNotificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdNotificationComponent, deps: [{ token: i1$2.NzNotificationService }
|
|
3129
|
-
RdNotificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RdNotificationComponent, selector: "app-rd-notification", viewQueries: [{ propertyName: "notificationTpl", first: true, predicate: ["notificationTpl"], descendants: true, static: true }, { propertyName: "closeTpl", first: true, predicate: ["closeTpl"], descendants: true, static: true }], ngImport: i0, template: "<ng-template #notificationTpl let-data=\"data\">\n <div class=\"rd-custom-notification\"></div>\n <div\n class=\"rd-custom-notification-icon\"\n [class]=\"
|
|
3123
|
+
RdNotificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdNotificationComponent, deps: [{ token: i1$2.NzNotificationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3124
|
+
RdNotificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RdNotificationComponent, selector: "app-rd-notification", viewQueries: [{ propertyName: "notificationTpl", first: true, predicate: ["notificationTpl"], descendants: true, static: true }, { propertyName: "closeTpl", first: true, predicate: ["closeTpl"], descendants: true, static: true }], ngImport: i0, template: "<ng-template #notificationTpl let-data=\"data\">\n <div class=\"rd-custom-notification\"></div>\n <div\n class=\"rd-custom-notification-icon\"\n [class.rd-custom-warn-background]=\"data.type === 'warn'\"\n [class.rd-custom-error-background]=\"data.type === 'error'\"\n >\n <svg\n *ngIf=\"data.type === 'success'\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M9.99935 18.3332C14.6017 18.3332 18.3327 14.6022 18.3327 9.99984C18.3327 5.39746 14.6017 1.6665 9.99935 1.6665C5.39698 1.6665 1.66602 5.39746 1.66602 9.99984C1.66602 14.6022 5.39698 18.3332 9.99935 18.3332Z\"\n fill=\"var(--rd-copy-success)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M13.8434 6.3216C14.264 6.6033 14.3767 7.17266 14.095 7.59331L10.1887 13.4266C10.034 13.6576 9.78287 13.8059 9.50591 13.8299C9.22895 13.8538 8.9561 13.7507 8.76411 13.5497L6.00375 10.6593C5.6541 10.2932 5.66745 9.71294 6.03357 9.36329C6.39969 9.01364 6.97994 9.02699 7.32959 9.39311L9.30099 11.4574L12.5717 6.57322C12.8534 6.15256 13.4227 6.03991 13.8434 6.3216Z\"\n fill=\"#F8F9FA\"\n />\n </svg>\n <svg\n *ngIf=\"data.type === 'warn'\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10.0003 18.3332C14.6027 18.3332 18.3337 14.6022 18.3337 9.99984C18.3337 5.39746 14.6027 1.6665 10.0003 1.6665C5.39795 1.6665 1.66699 5.39746 1.66699 9.99984C1.66699 14.6022 5.39795 18.3332 10.0003 18.3332Z\"\n fill=\"var(--rd-copy-warning)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10.0007 4.79175C10.5759 4.79175 11.0423 5.25812 11.0423 5.83341V10.0001C11.0423 10.5754 10.5759 11.0417 10.0007 11.0417C9.42535 11.0417 8.95898 10.5754 8.95898 10.0001V5.83341C8.95898 5.25812 9.42535 4.79175 10.0007 4.79175ZM10.0007 12.7084C10.5759 12.7084 11.0423 13.1748 11.0423 13.7501V14.1667C11.0423 14.742 10.5759 15.2084 10.0007 15.2084C9.42535 15.2084 8.95898 14.742 8.95898 14.1667V13.7501C8.95898 13.1748 9.42535 12.7084 10.0007 12.7084Z\"\n fill=\"#F8F9FA\"\n />\n </svg>\n <svg\n *ngIf=\"data.type === 'error'\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M9.99959 18.3332C14.602 18.3332 18.3329 14.6022 18.3329 9.99984C18.3329 5.39746 14.602 1.6665 9.99959 1.6665C5.39722 1.6665 1.66626 5.39746 1.66626 9.99984C1.66626 14.6022 5.39722 18.3332 9.99959 18.3332Z\"\n fill=\"var(--rd-copy-danger)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M6.40545 6.40545C6.76343 6.04747 7.34383 6.04747 7.70181 6.40545L9.99991 8.70355L12.298 6.40545C12.656 6.04747 13.2364 6.04747 13.5944 6.40545C13.9523 6.76343 13.9523 7.34383 13.5944 7.70181L11.2963 9.99991L13.5944 12.298C13.9523 12.656 13.9523 13.2364 13.5944 13.5944C13.2364 13.9523 12.656 13.9523 12.298 13.5944L9.99991 11.2963L7.70181 13.5944C7.34383 13.9523 6.76343 13.9523 6.40545 13.5944C6.04747 13.2364 6.04747 12.656 6.40545 12.298L8.70355 9.99991L6.40545 7.70181C6.04747 7.34383 6.04747 6.76343 6.40545 6.40545Z\"\n fill=\"#F8F9FA\"\n />\n </svg>\n </div>\n <div class=\"rd-custom-notification-container\">\n <div class=\"rd-custom-notification-title\">{{ data.title }}</div>\n <div\n class=\"rd-custom-notification-desc\"\n [innerHTML]=\"getDesc(data.desc)\"\n ></div>\n <div\n *ngIf=\"data.actionDesc\"\n class=\"rd-custom-notification-link\"\n [class.rd-custom-notification-link--bpn]=\"data.originType === 'bpn'\"\n (click)=\"onClick(data)\"\n >\n {{ data.actionDesc }}\n </div>\n </div>\n</ng-template>\n\n<ng-template #closeTpl>\n <div class=\"rd-custom-notification-close\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M3.40039 3.3999L8.00039 7.9999M12.6004 12.5999L8.00039 7.9999M8.00039 7.9999L12.6004 3.3999L3.40039 12.5999\"\n stroke=\"currentColor\"\n stroke-width=\"1.36\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n</ng-template>\n", styles: [".rd-custom-notification-container{padding:12px 40px 12px 12px}.rd-custom-notification-container .rd-custom-notification-title{font-size:12px;font-weight:600}.rd-custom-notification-container .rd-custom-notification-desc{font-size:12px;font-weight:500;margin-top:4px}.rd-custom-notification-container .rd-custom-notification-link{color:var(--rd-copy-brand);font-size:13px;font-style:normal;font-weight:600;line-height:16px;cursor:pointer;margin-top:12px;padding:0 2px}.rd-custom-notification-container .rd-custom-notification-link--bpn{font-family:Binance Nova,sans-serif;color:var(--rd-copy-warning)!important}.rd-custom-notification-icon{display:flex;width:40px;padding:16px 12px;justify-content:center;align-items:center;flex-shrink:0;align-self:stretch;background-color:var(--rd-toast-accent-success)}.rd-custom-notification-icon svg{flex-shrink:0;width:20px;height:20px}.rd-custom-warn-background{background-color:var(--rd-toast-accent-warning)!important}.rd-custom-error-background{background-color:var(--rd-toast-accent-danger)!important}.rd-custom-notification-close{padding:16px 12px}.rd-custom-notification-close svg{width:16px}.custom-wallet-notification .ant-notification-notice-close{position:absolute;top:0;right:0;width:40px;bottom:0;display:flex;align-items:center;border-left:1px solid var(--rd-bg-panel-border)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
3130
3125
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdNotificationComponent, decorators: [{
|
|
3131
3126
|
type: Component,
|
|
3132
|
-
args: [{ selector: 'app-rd-notification', template: "<ng-template #notificationTpl let-data=\"data\">\n <div class=\"rd-custom-notification\"></div>\n <div\n class=\"rd-custom-notification-icon\"\n [class]=\"
|
|
3133
|
-
}], ctorParameters: function () { return [{ type: i1$2.NzNotificationService }
|
|
3127
|
+
args: [{ selector: 'app-rd-notification', encapsulation: ViewEncapsulation.None, template: "<ng-template #notificationTpl let-data=\"data\">\n <div class=\"rd-custom-notification\"></div>\n <div\n class=\"rd-custom-notification-icon\"\n [class.rd-custom-warn-background]=\"data.type === 'warn'\"\n [class.rd-custom-error-background]=\"data.type === 'error'\"\n >\n <svg\n *ngIf=\"data.type === 'success'\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M9.99935 18.3332C14.6017 18.3332 18.3327 14.6022 18.3327 9.99984C18.3327 5.39746 14.6017 1.6665 9.99935 1.6665C5.39698 1.6665 1.66602 5.39746 1.66602 9.99984C1.66602 14.6022 5.39698 18.3332 9.99935 18.3332Z\"\n fill=\"var(--rd-copy-success)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M13.8434 6.3216C14.264 6.6033 14.3767 7.17266 14.095 7.59331L10.1887 13.4266C10.034 13.6576 9.78287 13.8059 9.50591 13.8299C9.22895 13.8538 8.9561 13.7507 8.76411 13.5497L6.00375 10.6593C5.6541 10.2932 5.66745 9.71294 6.03357 9.36329C6.39969 9.01364 6.97994 9.02699 7.32959 9.39311L9.30099 11.4574L12.5717 6.57322C12.8534 6.15256 13.4227 6.03991 13.8434 6.3216Z\"\n fill=\"#F8F9FA\"\n />\n </svg>\n <svg\n *ngIf=\"data.type === 'warn'\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10.0003 18.3332C14.6027 18.3332 18.3337 14.6022 18.3337 9.99984C18.3337 5.39746 14.6027 1.6665 10.0003 1.6665C5.39795 1.6665 1.66699 5.39746 1.66699 9.99984C1.66699 14.6022 5.39795 18.3332 10.0003 18.3332Z\"\n fill=\"var(--rd-copy-warning)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10.0007 4.79175C10.5759 4.79175 11.0423 5.25812 11.0423 5.83341V10.0001C11.0423 10.5754 10.5759 11.0417 10.0007 11.0417C9.42535 11.0417 8.95898 10.5754 8.95898 10.0001V5.83341C8.95898 5.25812 9.42535 4.79175 10.0007 4.79175ZM10.0007 12.7084C10.5759 12.7084 11.0423 13.1748 11.0423 13.7501V14.1667C11.0423 14.742 10.5759 15.2084 10.0007 15.2084C9.42535 15.2084 8.95898 14.742 8.95898 14.1667V13.7501C8.95898 13.1748 9.42535 12.7084 10.0007 12.7084Z\"\n fill=\"#F8F9FA\"\n />\n </svg>\n <svg\n *ngIf=\"data.type === 'error'\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M9.99959 18.3332C14.602 18.3332 18.3329 14.6022 18.3329 9.99984C18.3329 5.39746 14.602 1.6665 9.99959 1.6665C5.39722 1.6665 1.66626 5.39746 1.66626 9.99984C1.66626 14.6022 5.39722 18.3332 9.99959 18.3332Z\"\n fill=\"var(--rd-copy-danger)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M6.40545 6.40545C6.76343 6.04747 7.34383 6.04747 7.70181 6.40545L9.99991 8.70355L12.298 6.40545C12.656 6.04747 13.2364 6.04747 13.5944 6.40545C13.9523 6.76343 13.9523 7.34383 13.5944 7.70181L11.2963 9.99991L13.5944 12.298C13.9523 12.656 13.9523 13.2364 13.5944 13.5944C13.2364 13.9523 12.656 13.9523 12.298 13.5944L9.99991 11.2963L7.70181 13.5944C7.34383 13.9523 6.76343 13.9523 6.40545 13.5944C6.04747 13.2364 6.04747 12.656 6.40545 12.298L8.70355 9.99991L6.40545 7.70181C6.04747 7.34383 6.04747 6.76343 6.40545 6.40545Z\"\n fill=\"#F8F9FA\"\n />\n </svg>\n </div>\n <div class=\"rd-custom-notification-container\">\n <div class=\"rd-custom-notification-title\">{{ data.title }}</div>\n <div\n class=\"rd-custom-notification-desc\"\n [innerHTML]=\"getDesc(data.desc)\"\n ></div>\n <div\n *ngIf=\"data.actionDesc\"\n class=\"rd-custom-notification-link\"\n [class.rd-custom-notification-link--bpn]=\"data.originType === 'bpn'\"\n (click)=\"onClick(data)\"\n >\n {{ data.actionDesc }}\n </div>\n </div>\n</ng-template>\n\n<ng-template #closeTpl>\n <div class=\"rd-custom-notification-close\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M3.40039 3.3999L8.00039 7.9999M12.6004 12.5999L8.00039 7.9999M8.00039 7.9999L12.6004 3.3999L3.40039 12.5999\"\n stroke=\"currentColor\"\n stroke-width=\"1.36\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n</ng-template>\n", styles: [".rd-custom-notification-container{padding:12px 40px 12px 12px}.rd-custom-notification-container .rd-custom-notification-title{font-size:12px;font-weight:600}.rd-custom-notification-container .rd-custom-notification-desc{font-size:12px;font-weight:500;margin-top:4px}.rd-custom-notification-container .rd-custom-notification-link{color:var(--rd-copy-brand);font-size:13px;font-style:normal;font-weight:600;line-height:16px;cursor:pointer;margin-top:12px;padding:0 2px}.rd-custom-notification-container .rd-custom-notification-link--bpn{font-family:Binance Nova,sans-serif;color:var(--rd-copy-warning)!important}.rd-custom-notification-icon{display:flex;width:40px;padding:16px 12px;justify-content:center;align-items:center;flex-shrink:0;align-self:stretch;background-color:var(--rd-toast-accent-success)}.rd-custom-notification-icon svg{flex-shrink:0;width:20px;height:20px}.rd-custom-warn-background{background-color:var(--rd-toast-accent-warning)!important}.rd-custom-error-background{background-color:var(--rd-toast-accent-danger)!important}.rd-custom-notification-close{padding:16px 12px}.rd-custom-notification-close svg{width:16px}.custom-wallet-notification .ant-notification-notice-close{position:absolute;top:0;right:0;width:40px;bottom:0;display:flex;align-items:center;border-left:1px solid var(--rd-bg-panel-border)}\n"] }]
|
|
3128
|
+
}], ctorParameters: function () { return [{ type: i1$2.NzNotificationService }]; }, propDecorators: { notificationTpl: [{
|
|
3134
3129
|
type: ViewChild,
|
|
3135
3130
|
args: ['notificationTpl', { static: true }]
|
|
3136
3131
|
}], closeTpl: [{
|
|
@@ -3138,14 +3133,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3138
3133
|
args: ['closeTpl', { static: true }]
|
|
3139
3134
|
}] } });
|
|
3140
3135
|
|
|
3141
|
-
// notification.service.ts
|
|
3142
3136
|
class RdNotificationService {
|
|
3143
|
-
constructor(injector, environmentInjector
|
|
3144
|
-
) {
|
|
3137
|
+
constructor(injector, environmentInjector) {
|
|
3145
3138
|
this.injector = injector;
|
|
3146
3139
|
this.environmentInjector = environmentInjector;
|
|
3147
3140
|
this.isCreating = false;
|
|
3148
|
-
// 防止重复实例化
|
|
3149
3141
|
if (RdNotificationService.instance) {
|
|
3150
3142
|
return RdNotificationService.instance;
|
|
3151
3143
|
}
|
|
@@ -3158,7 +3150,6 @@ class RdNotificationService {
|
|
|
3158
3150
|
return;
|
|
3159
3151
|
}
|
|
3160
3152
|
if (this.isCreating) {
|
|
3161
|
-
// 如果正在创建,等待创建完成
|
|
3162
3153
|
const checkInterval = setInterval(() => {
|
|
3163
3154
|
if (this.notificationComponentRef && !this.isCreating) {
|
|
3164
3155
|
clearInterval(checkInterval);
|
|
@@ -3169,9 +3160,7 @@ class RdNotificationService {
|
|
|
3169
3160
|
}
|
|
3170
3161
|
this.isCreating = true;
|
|
3171
3162
|
try {
|
|
3172
|
-
// 使用 setTimeout 避免在 Angular 生命周期内创建组件
|
|
3173
3163
|
setTimeout(() => {
|
|
3174
|
-
// Angular 15+ 的正确用法
|
|
3175
3164
|
this.notificationComponentRef = createComponent(RdNotificationComponent, {
|
|
3176
3165
|
environmentInjector: this.environmentInjector,
|
|
3177
3166
|
elementInjector: this.injector,
|
|
@@ -3183,7 +3172,6 @@ class RdNotificationService {
|
|
|
3183
3172
|
document.body.appendChild(rootNode);
|
|
3184
3173
|
}
|
|
3185
3174
|
else {
|
|
3186
|
-
// 如果 document.body 还不存在,等待 DOM 准备就绪
|
|
3187
3175
|
document.addEventListener('DOMContentLoaded', () => {
|
|
3188
3176
|
document.body.appendChild(rootNode);
|
|
3189
3177
|
});
|
|
@@ -3203,7 +3191,6 @@ class RdNotificationService {
|
|
|
3203
3191
|
async show(data) {
|
|
3204
3192
|
await this.ensureComponentCreated();
|
|
3205
3193
|
if (this.notificationComponentRef?.instance) {
|
|
3206
|
-
// 使用 setTimeout 确保在下一个 Angular 周期执行
|
|
3207
3194
|
setTimeout(() => {
|
|
3208
3195
|
this.notificationComponentRef.instance.showNotification(data);
|
|
3209
3196
|
});
|
|
@@ -3216,7 +3203,6 @@ class RdNotificationService {
|
|
|
3216
3203
|
}
|
|
3217
3204
|
RdNotificationService.instance = null;
|
|
3218
3205
|
}
|
|
3219
|
-
// 静态方法用于快速访问
|
|
3220
3206
|
static show(data) {
|
|
3221
3207
|
setTimeout(() => {
|
|
3222
3208
|
const instance = this.getInstance();
|
|
@@ -3239,21 +3225,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3239
3225
|
}]
|
|
3240
3226
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.EnvironmentInjector }]; } });
|
|
3241
3227
|
|
|
3242
|
-
// notification.module.ts (在 NPM 包中)
|
|
3243
3228
|
class RdNotificationModule {
|
|
3244
3229
|
constructor(parentModule) {
|
|
3245
3230
|
if (parentModule) {
|
|
3246
3231
|
throw new Error('RdNotificationModule is already loaded. Import it in the AppModule only');
|
|
3247
3232
|
}
|
|
3248
3233
|
}
|
|
3249
|
-
// 修复:使用正确的类型和静态方法
|
|
3250
3234
|
static forRoot(config) {
|
|
3251
3235
|
return {
|
|
3252
3236
|
ngModule: RdNotificationModule,
|
|
3253
3237
|
providers: [
|
|
3254
3238
|
RdNotificationService,
|
|
3255
|
-
|
|
3256
|
-
|
|
3239
|
+
...(config
|
|
3240
|
+
? [{ provide: 'RD_NOTIFICATION_CONFIG', useValue: config }]
|
|
3241
|
+
: []),
|
|
3257
3242
|
],
|
|
3258
3243
|
};
|
|
3259
3244
|
}
|
|
@@ -3274,6 +3259,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3274
3259
|
type: SkipSelf
|
|
3275
3260
|
}] }]; } });
|
|
3276
3261
|
|
|
3262
|
+
class RdCommonBoxComponent {
|
|
3263
|
+
constructor() {
|
|
3264
|
+
this.value = null;
|
|
3265
|
+
this.rightContent = false;
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
RdCommonBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdCommonBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3269
|
+
RdCommonBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RdCommonBoxComponent, selector: "app-rd-box-item", inputs: { label: "label", value: "value", rightContent: "rightContent" }, ngImport: i0, template: "<div class=\"custom-common-item-box\">\n <div class=\"custom-common-item-box-label\">\n {{ label }} <ng-content select=\"[left]\"></ng-content>\n </div>\n <div class=\"custom-common-item-box-value\">\n {{ value }}\n <span *ngIf=\"!value && !rightContent\" class=\"rd-box-empty\">--</span>\n <ng-content select=\"[right]\"></ng-content>\n </div>\n</div>\n", styles: [":host .custom-common-item-box{margin-top:12px;display:flex;justify-content:space-between;gap:8px;align-items:flex-start}:host .custom-common-item-box-label{color:var(--rd-copy-secondary);font-size:13px;line-height:18px;font-weight:400;flex-shrink:0;display:flex;align-items:center}:host .custom-common-item-box-value{color:var(--rd-copy-primary);font-size:13px;line-height:18px;font-weight:400;word-break:break-all;flex:1;display:flex;align-items:center;justify-content:flex-end;text-align:right}:host .rd-box-empty{color:var(--rd-copy-disable);font-size:14px;font-weight:500}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdCommonBoxComponent, decorators: [{
|
|
3271
|
+
type: Component,
|
|
3272
|
+
args: [{ selector: 'app-rd-box-item', template: "<div class=\"custom-common-item-box\">\n <div class=\"custom-common-item-box-label\">\n {{ label }} <ng-content select=\"[left]\"></ng-content>\n </div>\n <div class=\"custom-common-item-box-value\">\n {{ value }}\n <span *ngIf=\"!value && !rightContent\" class=\"rd-box-empty\">--</span>\n <ng-content select=\"[right]\"></ng-content>\n </div>\n</div>\n", styles: [":host .custom-common-item-box{margin-top:12px;display:flex;justify-content:space-between;gap:8px;align-items:flex-start}:host .custom-common-item-box-label{color:var(--rd-copy-secondary);font-size:13px;line-height:18px;font-weight:400;flex-shrink:0;display:flex;align-items:center}:host .custom-common-item-box-value{color:var(--rd-copy-primary);font-size:13px;line-height:18px;font-weight:400;word-break:break-all;flex:1;display:flex;align-items:center;justify-content:flex-end;text-align:right}:host .rd-box-empty{color:var(--rd-copy-disable);font-size:14px;font-weight:500}\n"] }]
|
|
3273
|
+
}], propDecorators: { label: [{
|
|
3274
|
+
type: Input
|
|
3275
|
+
}], value: [{
|
|
3276
|
+
type: Input
|
|
3277
|
+
}], rightContent: [{
|
|
3278
|
+
type: Input
|
|
3279
|
+
}] } });
|
|
3280
|
+
|
|
3281
|
+
class RdCommonBoxModule {
|
|
3282
|
+
}
|
|
3283
|
+
RdCommonBoxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdCommonBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3284
|
+
RdCommonBoxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: RdCommonBoxModule, declarations: [RdCommonBoxComponent], imports: [CommonModule], exports: [RdCommonBoxComponent] });
|
|
3285
|
+
RdCommonBoxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdCommonBoxModule, imports: [CommonModule] });
|
|
3286
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdCommonBoxModule, decorators: [{
|
|
3287
|
+
type: NgModule,
|
|
3288
|
+
args: [{
|
|
3289
|
+
declarations: [RdCommonBoxComponent],
|
|
3290
|
+
imports: [CommonModule],
|
|
3291
|
+
exports: [RdCommonBoxComponent],
|
|
3292
|
+
}]
|
|
3293
|
+
}] });
|
|
3294
|
+
|
|
3277
3295
|
class SearchListBaseComponent {
|
|
3278
3296
|
constructor(searchStorageKey = '', isOutDatePicker = false) {
|
|
3279
3297
|
this.searchStorageKey = searchStorageKey;
|
|
@@ -6126,5 +6144,5 @@ function DebounceSearch(milliseconds = 300, queryMinLength = 0, queryMaxLength)
|
|
|
6126
6144
|
* Generated bundle index. Do not edit.
|
|
6127
6145
|
*/
|
|
6128
6146
|
|
|
6129
|
-
export { BigNumberPipe, CustomCheckboxComponent, CustomDateComponent, CustomInputAmountComponent, CustomInputComponent, CustomPaginatorComponent, CustomRadioComponent, CustomTextareaComponent, DebounceSearch, FilterTypeEnum, HeaderStepComponent, IndustryCascaderComponent, IndustryCascaderModule, PipesModule, PureSelectTokenComponent, RdButtonComponent, RdButtonModule, RdCheckboxModule, RdDateModule, RdFilterComponent, RdFilterModule, RdFilterSelectComponent, RdFilterSelectModule, RdHeaderStepModule, RdInputAmountModule, RdInputModule, RdLoadingComponent, RdLoadingModule, RdNotificationComponent, RdNotificationModule, RdNotificationService, RdPaginatorModule, RdPhoneComponent, RdPhoneModule, RdPureSelectTokenModule, RdRadioModule, RdRemarkHistoryComponent, RdRemarkHistoryModule, RdSelectComponent, RdSelectModule, RdSelectValueComponent, RdSelectValueModule, RdStatusFieldModule, RdSwitchComponent, RdSwitchModule, RdTextareaModule, SearchListBaseComponent, StatusFieldComponent };
|
|
6147
|
+
export { BigNumberPipe, CustomCheckboxComponent, CustomDateComponent, CustomInputAmountComponent, CustomInputComponent, CustomPaginatorComponent, CustomRadioComponent, CustomTextareaComponent, DebounceSearch, FilterTypeEnum, HeaderStepComponent, IndustryCascaderComponent, IndustryCascaderModule, PipesModule, PureSelectTokenComponent, RdButtonComponent, RdButtonModule, RdCheckboxModule, RdCommonBoxComponent, RdCommonBoxModule, RdDateModule, RdFilterComponent, RdFilterModule, RdFilterSelectComponent, RdFilterSelectModule, RdHeaderStepModule, RdInputAmountModule, RdInputModule, RdLoadingComponent, RdLoadingModule, RdNotificationComponent, RdNotificationModule, RdNotificationService, RdPaginatorModule, RdPhoneComponent, RdPhoneModule, RdPureSelectTokenModule, RdRadioModule, RdRemarkHistoryComponent, RdRemarkHistoryModule, RdSelectComponent, RdSelectModule, RdSelectValueComponent, RdSelectValueModule, RdStatusFieldModule, RdSwitchComponent, RdSwitchModule, RdTextareaModule, SearchListBaseComponent, StatusFieldComponent };
|
|
6130
6148
|
//# sourceMappingURL=rd-outer-component.mjs.map
|