@ts-core/angular 13.1.0 → 13.1.1

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.
@@ -7720,23 +7720,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
7720
7720
  }] });
7721
7721
 
7722
7722
  class CdkTableCellValuePipe {
7723
+ // --------------------------------------------------------------------------
7724
+ //
7725
+ // Constructor
7726
+ //
7727
+ // --------------------------------------------------------------------------
7728
+ constructor(detection) {
7729
+ this.detection = detection;
7730
+ }
7723
7731
  // --------------------------------------------------------------------------
7724
7732
  //
7725
7733
  // Public Methods
7726
7734
  //
7727
7735
  // --------------------------------------------------------------------------
7728
7736
  transform(item, column) {
7729
- return !_.isNil(column) && !_.isNil(column.format) ? column.format(item, column) : item[column.name];
7737
+ if (!_.isNil(this.value)) {
7738
+ return this.value;
7739
+ }
7740
+ let value = CdkTableCellValuePipe.PENDING_SYMBOL;
7741
+ if (_.isNil(column.format)) {
7742
+ value = this.value = item[column.name];
7743
+ return value;
7744
+ }
7745
+ let result = column.format(item, column);
7746
+ if (!(result instanceof Promise)) {
7747
+ value = this.value = result;
7748
+ return value;
7749
+ }
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;
7730
7761
  }
7731
7762
  }
7732
- CdkTableCellValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CdkTableCellValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
7763
+ // --------------------------------------------------------------------------
7764
+ //
7765
+ // Static Properties
7766
+ //
7767
+ // --------------------------------------------------------------------------
7768
+ CdkTableCellValuePipe.ERROR_SYMBOL = 'x';
7769
+ CdkTableCellValuePipe.PENDING_SYMBOL = '-';
7770
+ CdkTableCellValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CdkTableCellValuePipe, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe });
7733
7771
  CdkTableCellValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CdkTableCellValuePipe, name: "viCdkTableCellValue" });
7734
7772
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CdkTableCellValuePipe, decorators: [{
7735
7773
  type: Pipe,
7736
7774
  args: [{
7737
7775
  name: 'viCdkTableCellValue'
7738
7776
  }]
7739
- }] });
7777
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
7740
7778
 
7741
7779
  class CdkTableRowClassNamePipe {
7742
7780
  // --------------------------------------------------------------------------