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';
|
|
@@ -3092,16 +3091,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3092
3091
|
}]
|
|
3093
3092
|
}] });
|
|
3094
3093
|
|
|
3095
|
-
// notification.component.ts
|
|
3096
3094
|
const borderColorMap = {
|
|
3097
|
-
success: 'var(--rd-
|
|
3098
|
-
warn: 'var(--rd-
|
|
3095
|
+
success: 'var(--rd-toast-fg-success)',
|
|
3096
|
+
warn: 'var(--rd-toast-fg-warning)',
|
|
3099
3097
|
error: 'var(--rd-toast-fg-danger)',
|
|
3100
3098
|
};
|
|
3101
3099
|
class RdNotificationComponent {
|
|
3102
|
-
constructor(notificationService
|
|
3100
|
+
constructor(notificationService) {
|
|
3103
3101
|
this.notificationService = notificationService;
|
|
3104
|
-
this.sanitizer = sanitizer;
|
|
3105
3102
|
this.notifications = new Map();
|
|
3106
3103
|
}
|
|
3107
3104
|
showNotification(data) {
|
|
@@ -3111,7 +3108,7 @@ class RdNotificationComponent {
|
|
|
3111
3108
|
nzDuration: data.duration || 8 * 1000,
|
|
3112
3109
|
nzStyle: {
|
|
3113
3110
|
borderRadius: '4px',
|
|
3114
|
-
border: `1px solid
|
|
3111
|
+
border: `1px solid ${borderColorMap[data === null || data === void 0 ? void 0 : data.type] || 'var(--rd-bg-panel-border)'}`,
|
|
3115
3112
|
boxShadow: '0px 8px 16px 0px rgba(31, 41, 55, 0.08)',
|
|
3116
3113
|
display: 'flex',
|
|
3117
3114
|
padding: '0',
|
|
@@ -3120,16 +3117,15 @@ class RdNotificationComponent {
|
|
|
3120
3117
|
},
|
|
3121
3118
|
nzClass: 'custom-wallet-notification',
|
|
3122
3119
|
nzCloseIcon: this.closeTpl,
|
|
3123
|
-
nzKey: notificationId,
|
|
3120
|
+
nzKey: notificationId,
|
|
3124
3121
|
});
|
|
3125
3122
|
this.notifications.set(notificationId, notification);
|
|
3126
|
-
// 自动清理
|
|
3127
3123
|
setTimeout(() => {
|
|
3128
3124
|
this.notifications.delete(notificationId);
|
|
3129
3125
|
}, data.duration || 8000);
|
|
3130
3126
|
}
|
|
3131
3127
|
getDesc(desc) {
|
|
3132
|
-
return
|
|
3128
|
+
return desc;
|
|
3133
3129
|
}
|
|
3134
3130
|
onClick(data) {
|
|
3135
3131
|
if (data.onLinkClick) {
|
|
@@ -3142,19 +3138,18 @@ class RdNotificationComponent {
|
|
|
3142
3138
|
.substr(2, 9)}`;
|
|
3143
3139
|
}
|
|
3144
3140
|
ngOnDestroy() {
|
|
3145
|
-
|
|
3146
|
-
this.notifications.forEach((notification, id) => {
|
|
3141
|
+
this.notifications.forEach((_notification, id) => {
|
|
3147
3142
|
this.notificationService.remove(id);
|
|
3148
3143
|
});
|
|
3149
3144
|
this.notifications.clear();
|
|
3150
3145
|
}
|
|
3151
3146
|
}
|
|
3152
|
-
RdNotificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdNotificationComponent, deps: [{ token: i1$2.NzNotificationService }
|
|
3153
|
-
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]=\"
|
|
3147
|
+
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 });
|
|
3148
|
+
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 });
|
|
3154
3149
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdNotificationComponent, decorators: [{
|
|
3155
3150
|
type: Component,
|
|
3156
|
-
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]=\"
|
|
3157
|
-
}], ctorParameters: function () { return [{ type: i1$2.NzNotificationService }
|
|
3151
|
+
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"] }]
|
|
3152
|
+
}], ctorParameters: function () { return [{ type: i1$2.NzNotificationService }]; }, propDecorators: { notificationTpl: [{
|
|
3158
3153
|
type: ViewChild,
|
|
3159
3154
|
args: ['notificationTpl', { static: true }]
|
|
3160
3155
|
}], closeTpl: [{
|
|
@@ -3163,12 +3158,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3163
3158
|
}] } });
|
|
3164
3159
|
|
|
3165
3160
|
class RdNotificationService {
|
|
3166
|
-
constructor(injector, environmentInjector
|
|
3167
|
-
) {
|
|
3161
|
+
constructor(injector, environmentInjector) {
|
|
3168
3162
|
this.injector = injector;
|
|
3169
3163
|
this.environmentInjector = environmentInjector;
|
|
3170
3164
|
this.isCreating = false;
|
|
3171
|
-
// 防止重复实例化
|
|
3172
3165
|
if (RdNotificationService.instance) {
|
|
3173
3166
|
return RdNotificationService.instance;
|
|
3174
3167
|
}
|
|
@@ -3181,7 +3174,6 @@ class RdNotificationService {
|
|
|
3181
3174
|
return;
|
|
3182
3175
|
}
|
|
3183
3176
|
if (this.isCreating) {
|
|
3184
|
-
// 如果正在创建,等待创建完成
|
|
3185
3177
|
const checkInterval = setInterval(() => {
|
|
3186
3178
|
if (this.notificationComponentRef && !this.isCreating) {
|
|
3187
3179
|
clearInterval(checkInterval);
|
|
@@ -3192,9 +3184,7 @@ class RdNotificationService {
|
|
|
3192
3184
|
}
|
|
3193
3185
|
this.isCreating = true;
|
|
3194
3186
|
try {
|
|
3195
|
-
// 使用 setTimeout 避免在 Angular 生命周期内创建组件
|
|
3196
3187
|
setTimeout(() => {
|
|
3197
|
-
// Angular 15+ 的正确用法
|
|
3198
3188
|
this.notificationComponentRef = createComponent(RdNotificationComponent, {
|
|
3199
3189
|
environmentInjector: this.environmentInjector,
|
|
3200
3190
|
elementInjector: this.injector,
|
|
@@ -3206,7 +3196,6 @@ class RdNotificationService {
|
|
|
3206
3196
|
document.body.appendChild(rootNode);
|
|
3207
3197
|
}
|
|
3208
3198
|
else {
|
|
3209
|
-
// 如果 document.body 还不存在,等待 DOM 准备就绪
|
|
3210
3199
|
document.addEventListener('DOMContentLoaded', () => {
|
|
3211
3200
|
document.body.appendChild(rootNode);
|
|
3212
3201
|
});
|
|
@@ -3228,7 +3217,6 @@ class RdNotificationService {
|
|
|
3228
3217
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3229
3218
|
yield this.ensureComponentCreated();
|
|
3230
3219
|
if ((_a = this.notificationComponentRef) === null || _a === void 0 ? void 0 : _a.instance) {
|
|
3231
|
-
// 使用 setTimeout 确保在下一个 Angular 周期执行
|
|
3232
3220
|
setTimeout(() => {
|
|
3233
3221
|
this.notificationComponentRef.instance.showNotification(data);
|
|
3234
3222
|
});
|
|
@@ -3242,7 +3230,6 @@ class RdNotificationService {
|
|
|
3242
3230
|
}
|
|
3243
3231
|
RdNotificationService.instance = null;
|
|
3244
3232
|
}
|
|
3245
|
-
// 静态方法用于快速访问
|
|
3246
3233
|
static show(data) {
|
|
3247
3234
|
setTimeout(() => {
|
|
3248
3235
|
const instance = this.getInstance();
|
|
@@ -3265,21 +3252,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3265
3252
|
}]
|
|
3266
3253
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.EnvironmentInjector }]; } });
|
|
3267
3254
|
|
|
3268
|
-
// notification.module.ts (在 NPM 包中)
|
|
3269
3255
|
class RdNotificationModule {
|
|
3270
3256
|
constructor(parentModule) {
|
|
3271
3257
|
if (parentModule) {
|
|
3272
3258
|
throw new Error('RdNotificationModule is already loaded. Import it in the AppModule only');
|
|
3273
3259
|
}
|
|
3274
3260
|
}
|
|
3275
|
-
// 修复:使用正确的类型和静态方法
|
|
3276
3261
|
static forRoot(config) {
|
|
3277
3262
|
return {
|
|
3278
3263
|
ngModule: RdNotificationModule,
|
|
3279
3264
|
providers: [
|
|
3280
3265
|
RdNotificationService,
|
|
3281
|
-
|
|
3282
|
-
|
|
3266
|
+
...(config
|
|
3267
|
+
? [{ provide: 'RD_NOTIFICATION_CONFIG', useValue: config }]
|
|
3268
|
+
: []),
|
|
3283
3269
|
],
|
|
3284
3270
|
};
|
|
3285
3271
|
}
|
|
@@ -3302,6 +3288,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3302
3288
|
}] }];
|
|
3303
3289
|
} });
|
|
3304
3290
|
|
|
3291
|
+
class RdCommonBoxComponent {
|
|
3292
|
+
constructor() {
|
|
3293
|
+
this.value = null;
|
|
3294
|
+
this.rightContent = false;
|
|
3295
|
+
}
|
|
3296
|
+
}
|
|
3297
|
+
RdCommonBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdCommonBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3298
|
+
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"] }] });
|
|
3299
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdCommonBoxComponent, decorators: [{
|
|
3300
|
+
type: Component,
|
|
3301
|
+
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"] }]
|
|
3302
|
+
}], propDecorators: { label: [{
|
|
3303
|
+
type: Input
|
|
3304
|
+
}], value: [{
|
|
3305
|
+
type: Input
|
|
3306
|
+
}], rightContent: [{
|
|
3307
|
+
type: Input
|
|
3308
|
+
}] } });
|
|
3309
|
+
|
|
3310
|
+
class RdCommonBoxModule {
|
|
3311
|
+
}
|
|
3312
|
+
RdCommonBoxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdCommonBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3313
|
+
RdCommonBoxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: RdCommonBoxModule, declarations: [RdCommonBoxComponent], imports: [CommonModule], exports: [RdCommonBoxComponent] });
|
|
3314
|
+
RdCommonBoxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdCommonBoxModule, imports: [CommonModule] });
|
|
3315
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdCommonBoxModule, decorators: [{
|
|
3316
|
+
type: NgModule,
|
|
3317
|
+
args: [{
|
|
3318
|
+
declarations: [RdCommonBoxComponent],
|
|
3319
|
+
imports: [CommonModule],
|
|
3320
|
+
exports: [RdCommonBoxComponent],
|
|
3321
|
+
}]
|
|
3322
|
+
}] });
|
|
3323
|
+
|
|
3305
3324
|
class SearchListBaseComponent {
|
|
3306
3325
|
constructor(searchStorageKey = '', isOutDatePicker = false) {
|
|
3307
3326
|
this.searchStorageKey = searchStorageKey;
|
|
@@ -6160,5 +6179,5 @@ function DebounceSearch(milliseconds = 300, queryMinLength = 0, queryMaxLength)
|
|
|
6160
6179
|
* Generated bundle index. Do not edit.
|
|
6161
6180
|
*/
|
|
6162
6181
|
|
|
6163
|
-
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 };
|
|
6182
|
+
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 };
|
|
6164
6183
|
//# sourceMappingURL=rd-outer-component.mjs.map
|