@wizishop/angular-components 0.0.85 → 0.0.88

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.
@@ -698,6 +698,8 @@
698
698
  currentPage: 0
699
699
  };
700
700
  var filterGroup = this.filterRoutingBuilder.group(dataTableFilters, dataTableName);
701
+ filterGroup.tableFiltersValuesChange$ = new rxjs.ReplaySubject(1);
702
+ filterGroup.tableFiltersValuesDebouncedChange$ = filterGroup.tableFiltersValuesChange$.pipe(operators.debounceTime(300));
701
703
  this.filterGroups.set(dataTableName, filterGroup);
702
704
  return filterGroup;
703
705
  };
@@ -762,12 +764,14 @@
762
764
  this.headerCheckBoxId = uuid.v4(); // Create checkbox unique id
763
765
  /* Handle routing filters */
764
766
  if (this.tableRoutingName) {
765
- this._filterGroup = this.filtersTableService.getTableFilterGroup(this.tableRoutingName);
767
+ console.log('ngOnInit TableComponent');
768
+ this._tableFiltersGroup = this.filtersTableService.getTableFilterGroup(this.tableRoutingName);
766
769
  this.setTablesFilters();
767
770
  // Performe initial fetch data
768
- this._filterGroup.valuesChange$.next([]);
771
+ //this._tableFiltersGroup.valuesChange$.next([]);
769
772
  // Listen to filters changes with debounced time to limit multiple api calls
770
- this.filterGroupChangeSub = this._filterGroup.valuesChange$.subscribe(function (filters) {
773
+ this.filterGroupChangeSub = this._tableFiltersGroup.valuesChange$.subscribe(function (filters) {
774
+ console.log('valuesChange', filters);
771
775
  _this.setTablesFilters();
772
776
  });
773
777
  }
@@ -782,8 +786,8 @@
782
786
  this.tableFilters.currentPage = 1;
783
787
  this.tableFiltersChange.emit(this.tableFilters);
784
788
  // Reset routing filters
785
- if (this._filterGroup) {
786
- this._filterGroup.setValues({
789
+ if (this._tableFiltersGroup) {
790
+ this._tableFiltersGroup.setValues({
787
791
  searchValue: this.tableFilters.searchValue,
788
792
  sort: undefined,
789
793
  order: undefined,
@@ -793,8 +797,8 @@
793
797
  };
794
798
  TableComponent.prototype.pageChange = function () {
795
799
  this.tableFiltersChange.emit(this.tableFilters);
796
- if (this._filterGroup) {
797
- this._filterGroup.setValues({
800
+ if (this._tableFiltersGroup) {
801
+ this._tableFiltersGroup.setValues({
798
802
  itemsPerPage: this.tableFilters.itemsPerPage,
799
803
  currentPage: this.tableFilters.currentPage
800
804
  });
@@ -805,14 +809,16 @@
805
809
  * */
806
810
  TableComponent.prototype.setTablesFilters = function () {
807
811
  this.tableFilters = {
808
- sort: this._filterGroup.get('sort'),
809
- order: this._filterGroup.get('order'),
810
- searchValue: this._filterGroup.get('searchValue'),
811
- itemsPerPage: this._filterGroup.get('itemsPerPage') ? parseInt(this._filterGroup.get('itemsPerPage')) : 0,
812
- currentPage: this._filterGroup.get('currentPage') ? parseInt(this._filterGroup.get('currentPage')) : 0,
812
+ sort: this._tableFiltersGroup.get('sort'),
813
+ order: this._tableFiltersGroup.get('order'),
814
+ searchValue: this._tableFiltersGroup.get('searchValue'),
815
+ itemsPerPage: this._tableFiltersGroup.get('itemsPerPage') ? parseInt(this._tableFiltersGroup.get('itemsPerPage')) : 0,
816
+ currentPage: this._tableFiltersGroup.get('currentPage') ? parseInt(this._tableFiltersGroup.get('currentPage')) : 0,
813
817
  totalItems: this.tableFilters.totalItems
814
818
  };
815
819
  this.tableFiltersChange.emit(this.tableFilters);
820
+ console.log('tableFiltersValuesChange$.next');
821
+ this._tableFiltersGroup.tableFiltersValuesChange$.next(this.tableFilters);
816
822
  };
817
823
  TableComponent.prototype.ngDestroy = function () {
818
824
  if (this.filterGroupChangeSub) {
@@ -4039,6 +4045,14 @@
4039
4045
  },] }
4040
4046
  ];
4041
4047
 
4048
+ var TableFiltersGroup = /** @class */ (function (_super) {
4049
+ __extends(TableFiltersGroup, _super);
4050
+ function TableFiltersGroup() {
4051
+ return _super !== null && _super.apply(this, arguments) || this;
4052
+ }
4053
+ return TableFiltersGroup;
4054
+ }(i1$1.NwbFilterGroup));
4055
+
4042
4056
  /*
4043
4057
  * Public API Surface of angular-components
4044
4058
  */
@@ -4105,6 +4119,7 @@
4105
4119
  exports.TableColumn = TableColumn;
4106
4120
  exports.TableColumnHeader = TableColumnHeader;
4107
4121
  exports.TableComponent = TableComponent;
4122
+ exports.TableFiltersGroup = TableFiltersGroup;
4108
4123
  exports.TableRow = TableRow;
4109
4124
  exports.TagComponent = TagComponent;
4110
4125
  exports.TextAreaComponent = TextAreaComponent;