@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.
- package/bundles/wizishop-angular-components.umd.js +27 -12
- package/bundles/wizishop-angular-components.umd.js.map +1 -1
- package/bundles/wizishop-angular-components.umd.min.js +2 -2
- package/bundles/wizishop-angular-components.umd.min.js.map +1 -1
- package/esm2015/lib/components/table/shared/filters-table.service.js +5 -2
- package/esm2015/lib/components/table/shared/table-filters-group.model.js +4 -0
- package/esm2015/lib/components/table/table.component.js +17 -13
- package/esm2015/public-api.js +3 -1
- package/fesm2015/wizishop-angular-components.js +24 -15
- package/fesm2015/wizishop-angular-components.js.map +1 -1
- package/lib/components/table/shared/filters-table.service.d.ts +2 -1
- package/lib/components/table/shared/table-filters-group.model.d.ts +7 -0
- package/lib/components/table/table.component.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/wizishop-angular-components-0.0.88.tgz +0 -0
- package/wizishop-angular-components.metadata.json +1 -1
- package/wizishop-angular-components-0.0.85.tgz +0 -0
|
@@ -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
|
-
|
|
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.
|
|
771
|
+
//this._tableFiltersGroup.valuesChange$.next([]);
|
|
769
772
|
// Listen to filters changes with debounced time to limit multiple api calls
|
|
770
|
-
this.filterGroupChangeSub = this.
|
|
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.
|
|
786
|
-
this.
|
|
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.
|
|
797
|
-
this.
|
|
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.
|
|
809
|
-
order: this.
|
|
810
|
-
searchValue: this.
|
|
811
|
-
itemsPerPage: this.
|
|
812
|
-
currentPage: this.
|
|
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;
|