@ts-core/angular 13.1.1 → 13.1.2

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.
@@ -10,7 +10,7 @@ import numeral from 'numeral';
10
10
  import * as i1 from '@angular/material/dialog';
11
11
  import { MatDialogConfig, MatDialogModule, MatDialog } from '@angular/material/dialog';
12
12
  import * as i4 from '@angular/common';
13
- import { CommonModule, DatePipe } from '@angular/common';
13
+ import { CommonModule, AsyncPipe, DatePipe } from '@angular/common';
14
14
  import * as i5 from '@angular/forms';
15
15
  import { FormsModule, Validators } from '@angular/forms';
16
16
  import * as Cookie from 'ngx-cookie';
@@ -7719,13 +7719,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
7719
7719
  }]
7720
7720
  }] });
7721
7721
 
7722
- class CdkTableCellValuePipe {
7722
+ class CdkTableCellValuePipe extends DestroyableContainer {
7723
7723
  // --------------------------------------------------------------------------
7724
7724
  //
7725
7725
  // Constructor
7726
7726
  //
7727
7727
  // --------------------------------------------------------------------------
7728
7728
  constructor(detection) {
7729
+ super();
7729
7730
  this.detection = detection;
7730
7731
  }
7731
7732
  // --------------------------------------------------------------------------
@@ -7734,39 +7735,30 @@ class CdkTableCellValuePipe {
7734
7735
  //
7735
7736
  // --------------------------------------------------------------------------
7736
7737
  transform(item, column) {
7737
- if (!_.isNil(this.value)) {
7738
- return this.value;
7739
- }
7740
- let value = CdkTableCellValuePipe.PENDING_SYMBOL;
7741
7738
  if (_.isNil(column.format)) {
7742
- value = this.value = item[column.name];
7743
- return value;
7739
+ return item[column.name];
7744
7740
  }
7745
7741
  let result = column.format(item, column);
7746
7742
  if (!(result instanceof Promise)) {
7747
- value = this.value = result;
7748
- return value;
7743
+ return result;
7749
7744
  }
7750
- result
7751
- .then(item => {
7752
- value = this.value = item;
7753
- })
7754
- .catch(error => {
7755
- value = this.value = CdkTableCellValuePipe.ERROR_SYMBOL;
7756
- })
7757
- .finally(() => {
7758
- this.detection.markForCheck();
7759
- });
7760
- return value;
7745
+ if (_.isNil(this.asyncPipe)) {
7746
+ this.asyncPipe = new AsyncPipe(this.detection);
7747
+ }
7748
+ return this.asyncPipe.transform(result);
7749
+ }
7750
+ destroy() {
7751
+ if (this.isDestroyed) {
7752
+ return;
7753
+ }
7754
+ super.destroy();
7755
+ if (!_.isNil(this.asyncPipe)) {
7756
+ this.asyncPipe.ngOnDestroy();
7757
+ this.asyncPipe = null;
7758
+ }
7759
+ this.detection = null;
7761
7760
  }
7762
7761
  }
7763
- // --------------------------------------------------------------------------
7764
- //
7765
- // Static Properties
7766
- //
7767
- // --------------------------------------------------------------------------
7768
- CdkTableCellValuePipe.ERROR_SYMBOL = 'x';
7769
- CdkTableCellValuePipe.PENDING_SYMBOL = '-';
7770
7762
  CdkTableCellValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CdkTableCellValuePipe, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe });
7771
7763
  CdkTableCellValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CdkTableCellValuePipe, name: "viCdkTableCellValue" });
7772
7764
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CdkTableCellValuePipe, decorators: [{