@abp/ng.core 5.3.2 → 5.3.3

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.
@@ -4,7 +4,7 @@ import * as i1$1 from '@angular/router';
4
4
  import { PRIMARY_OUTLET, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, ActivatedRoute, Router, RouterModule } from '@angular/router';
5
5
  import * as i5 from '@angular/common';
6
6
  import { registerLocaleData, DOCUMENT, DatePipe, DATE_PIPE_DEFAULT_TIMEZONE, CommonModule } from '@angular/common';
7
- import { BehaviorSubject, Subject, throwError, combineLatest, from, Subscription, fromEvent, of, timer, pipe, Observable, concat, ReplaySubject } from 'rxjs';
7
+ import { BehaviorSubject, Subject, throwError, combineLatest, from, Subscription, fromEvent, ReplaySubject, of, timer, pipe, Observable, concat } from 'rxjs';
8
8
  import { map, distinctUntilChanged, filter, catchError, switchMap, take, mapTo, debounceTime, takeUntil, tap, finalize, retryWhen, delay, shareReplay } from 'rxjs/operators';
9
9
  import * as i1 from '@angular/common/http';
10
10
  import { HttpParams, HttpHeaders, HttpClient, HttpClientModule, HttpClientXsrfModule, HTTP_INTERCEPTORS } from '@angular/common/http';
@@ -1907,6 +1907,8 @@ class PermissionDirective {
1907
1907
  this.permissionService = permissionService;
1908
1908
  this.cdRef = cdRef;
1909
1909
  this.runChangeDetection = true;
1910
+ this.cdrSubject = new ReplaySubject();
1911
+ this.rendered = false;
1910
1912
  }
1911
1913
  check() {
1912
1914
  if (this.subscription) {
@@ -1920,7 +1922,12 @@ class PermissionDirective {
1920
1922
  if (isGranted)
1921
1923
  this.vcRef.createEmbeddedView(this.templateRef);
1922
1924
  if (this.runChangeDetection) {
1923
- this.cdRef.detectChanges();
1925
+ if (!this.rendered) {
1926
+ this.cdrSubject.next();
1927
+ }
1928
+ else {
1929
+ this.cdRef.detectChanges();
1930
+ }
1924
1931
  }
1925
1932
  else {
1926
1933
  this.cdRef.markForCheck();
@@ -1934,6 +1941,10 @@ class PermissionDirective {
1934
1941
  ngOnChanges() {
1935
1942
  this.check();
1936
1943
  }
1944
+ ngAfterViewInit() {
1945
+ this.cdrSubject.pipe(take(1)).subscribe(() => this.cdRef.detectChanges());
1946
+ this.rendered = true;
1947
+ }
1937
1948
  }
1938
1949
  PermissionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: PermissionDirective, deps: [{ token: i0.TemplateRef, optional: true }, { token: i0.ViewContainerRef }, { token: PermissionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
1939
1950
  PermissionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.6", type: PermissionDirective, selector: "[abpPermission]", inputs: { condition: ["abpPermission", "condition"], runChangeDetection: ["abpPermissionRunChangeDetection", "runChangeDetection"] }, usesOnChanges: true, ngImport: i0 });