rd-outer-component 0.0.25 → 0.0.26

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, forwardRef, Component, Input, Output, NgModule, ViewChild, Pipe } from '@angular/core';
2
+ import { EventEmitter, forwardRef, Component, Input, Output, NgModule, ViewChild, createComponent, Injectable, Pipe } from '@angular/core';
3
3
  import * as i2 from '@angular/forms';
4
4
  import { NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule, NG_VALIDATORS } from '@angular/forms';
5
5
  import * as i1 from '@angular/common';
@@ -1774,6 +1774,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1774
1774
  }]
1775
1775
  }] });
1776
1776
 
1777
+ class RdNotificationService {
1778
+ constructor(applicationRef, injector) {
1779
+ this.applicationRef = applicationRef;
1780
+ this.injector = injector;
1781
+ this.createNotificationComponent();
1782
+ }
1783
+ createNotificationComponent() {
1784
+ // 创建组件
1785
+ this.notificationComponent = createComponent(RdNotificationComponent, {
1786
+ environmentInjector: this.applicationRef.injector,
1787
+ elementInjector: this.injector,
1788
+ });
1789
+ // 添加到 DOM
1790
+ const domElem = this.notificationComponent.hostView.rootNodes[0];
1791
+ document.body.appendChild(domElem);
1792
+ // 添加到 ApplicationRef
1793
+ this.applicationRef.attachView(this.notificationComponent.hostView);
1794
+ }
1795
+ /**
1796
+ * 显示通知
1797
+ */
1798
+ show(data) {
1799
+ this.notificationComponent?.instance.showNotification(data);
1800
+ }
1801
+ }
1802
+ RdNotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdNotificationService, deps: [{ token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
1803
+ RdNotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdNotificationService, providedIn: 'root' });
1804
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdNotificationService, decorators: [{
1805
+ type: Injectable,
1806
+ args: [{
1807
+ providedIn: 'root',
1808
+ }]
1809
+ }], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i0.Injector }]; } });
1810
+
1777
1811
  class BigNumberPipe {
1778
1812
  transform(value, precision = 6, mode = 'cut') {
1779
1813
  if (!value)
@@ -1856,5 +1890,5 @@ function DebounceSearch(milliseconds = 300, queryMinLength = 0, queryMaxLength)
1856
1890
  * Generated bundle index. Do not edit.
1857
1891
  */
1858
1892
 
1859
- export { BigNumberPipe, CustomCheckboxComponent, CustomDateComponent, CustomInputAmountComponent, CustomInputComponent, CustomPaginatorComponent, CustomRadioComponent, CustomSelectComponent, CustomTextareaComponent, DebounceSearch, FilterTypeEnum, HeaderStepComponent, PipesModule, PureSelectTokenComponent, RdCheckboxModule, RdDateModule, RdFilterComponent, RdFilterModule, RdHeaderStepModule, RdInputAmountModule, RdInputModule, RdNotificationComponent, RdNotificationModule, RdPaginatorModule, RdPureSelectTokenModule, RdRadioModule, RdSelectModule, RdStatusFieldModule, RdTextareaModule, StatusFieldComponent };
1893
+ export { BigNumberPipe, CustomCheckboxComponent, CustomDateComponent, CustomInputAmountComponent, CustomInputComponent, CustomPaginatorComponent, CustomRadioComponent, CustomSelectComponent, CustomTextareaComponent, DebounceSearch, FilterTypeEnum, HeaderStepComponent, PipesModule, PureSelectTokenComponent, RdCheckboxModule, RdDateModule, RdFilterComponent, RdFilterModule, RdHeaderStepModule, RdInputAmountModule, RdInputModule, RdNotificationComponent, RdNotificationModule, RdNotificationService, RdPaginatorModule, RdPureSelectTokenModule, RdRadioModule, RdSelectModule, RdStatusFieldModule, RdTextareaModule, StatusFieldComponent };
1860
1894
  //# sourceMappingURL=rd-outer-component.mjs.map