@rxap/material-table-system 13.0.0 → 13.0.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.
@@ -3,7 +3,7 @@ import { TemplateRef, Directive, Inject, Injectable, ViewContainerRef, Component
3
3
  import { __decorate, __metadata } from 'tslib';
4
4
  import * as i1 from '@angular/cdk/portal';
5
5
  import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
6
- import { Required, equals, coerceBoolean, coerceArray } from '@rxap/utilities';
6
+ import { Required, clone, DeleteEmptyProperties, equals, coerceBoolean, coerceArray } from '@rxap/utilities';
7
7
  import { trigger, state, style, transition, animate, sequence } from '@angular/animations';
8
8
  import { BehaviorSubject, EMPTY, ReplaySubject, Subscription, Subject, isObservable, of } from 'rxjs';
9
9
  import { map, filter, tap, distinctUntilChanged, debounceTime, delay, startWith } from 'rxjs/operators';
@@ -500,8 +500,11 @@ class TableFilterService {
500
500
  }
501
501
  setMap(map) {
502
502
  const current = this.current;
503
- const next = Object.assign(current, map);
504
- this.change.next(next);
503
+ const copy = clone(this.current);
504
+ const next = DeleteEmptyProperties(Object.assign(current, map));
505
+ if (!equals(copy, next)) {
506
+ this.change.next(next);
507
+ }
505
508
  }
506
509
  set(key, value) {
507
510
  const current = this.current;
@@ -746,9 +749,7 @@ class FilterHeaderRowDirective extends FormDirective {
746
749
  ngOnInit() {
747
750
  super.ngOnInit();
748
751
  this._subscription = this.form.value$
749
- .pipe(debounceTime(1000), map((values) => Object.entries(values)
750
- .filter(([key, value]) => value !== null && value !== undefined && value !== '')
751
- .reduce((obj, [key, value]) => ({ ...obj, [key]: value }), {})), distinctUntilChanged((a, b) => equals(a, b)), tap(values => this.tableFilter.setMap(values)))
752
+ .pipe(debounceTime(1000), distinctUntilChanged((a, b) => equals(a, b)), tap(values => this.tableFilter.setMap(values)))
752
753
  .subscribe();
753
754
  }
754
755
  ngOnDestroy() {