@trudb/tru-common-lib 0.0.323 → 0.0.325

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.
@@ -5,7 +5,7 @@ import * as i1$3 from '@angular/common';
5
5
  import { CommonModule } from '@angular/common';
6
6
  import * as i7 from '@angular/forms';
7
7
  import { FormsModule, FormGroup, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
8
- import { Subject, BehaviorSubject, defer, from, of, skip, forkJoin, throwError } from 'rxjs';
8
+ import { Subject, BehaviorSubject, defer, from, of, Observable, skip, forkJoin, throwError } from 'rxjs';
9
9
  import * as _ from 'underscore';
10
10
  import moment from 'moment/moment';
11
11
  import * as i1 from '@angular/material/dialog';
@@ -1475,6 +1475,11 @@ class TruDataContext {
1475
1475
  this.uiNotification = uiNotification;
1476
1476
  this._pendingDeleteEntities = [];
1477
1477
  this._pendingCascadeDeleteEntities = [];
1478
+ this.entityManagerChangeDetection = new Observable((observer) => {
1479
+ of(this.entityManager.getChanges()).subscribe(entities => {
1480
+ observer.next(entities);
1481
+ });
1482
+ });
1478
1483
  this.getValidationErrors = (entities = null) => {
1479
1484
  entities = entities || this.entityManager.getChanges();
1480
1485
  var errorsPerEntity = entities.map((entity) => {
@@ -4900,15 +4905,19 @@ class TruBreezeValidator {
4900
4905
  this.el = el;
4901
4906
  this.dataContext = dataContext;
4902
4907
  this.configModel = {};
4903
- this.getValidationErrors = () => {
4904
- return this.configModel.field.getValidationErrors().length > 0;
4905
- };
4908
+ this.subs = [];
4906
4909
  this.valErrsChanged = (newValue) => {
4907
4910
  console.log(newValue);
4908
4911
  };
4909
- this.dataContext.getValidationErrors().subscribe(errors => {
4910
- this.valErrsChanged(errors);
4911
- });
4912
+ }
4913
+ ngOnInit() {
4914
+ this.subs.push(this.dataContext.entityManagerChangeDetection.subscribe(entities => {
4915
+ console.log(entities);
4916
+ this.valErrsChanged(entities);
4917
+ }));
4918
+ }
4919
+ ngOnDestroy() {
4920
+ this.subs.forEach(s => s.unsubscribe());
4912
4921
  }
4913
4922
  }
4914
4923
  TruBreezeValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruBreezeValidator, deps: [{ token: i0.ElementRef }, { token: TruDataContext }], target: i0.ɵɵFactoryTarget.Directive });