@vendure/admin-ui 1.9.0 → 1.9.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.
@@ -1950,19 +1950,9 @@
1950
1950
  var _this = this;
1951
1951
  this.init();
1952
1952
  this.product$ = this.entity$;
1953
- this.totalItems$ = this.product$.pipe(operators.map(function (product) { return product.variantList.totalItems; }));
1954
- this.paginationConfig$ = rxjs.combineLatest(this.totalItems$, this.itemsPerPage$, this.currentPage$).pipe(operators.map(function (_c) {
1955
- var _d = __read(_c, 3), totalItems = _d[0], itemsPerPage = _d[1], currentPage = _d[2];
1956
- return ({
1957
- totalItems: totalItems,
1958
- itemsPerPage: itemsPerPage,
1959
- currentPage: currentPage,
1960
- });
1961
- }));
1962
- var variants$ = this.product$.pipe(operators.map(function (product) { return product.variantList.items; }));
1963
- var filterTerm$ = this.filterInput.valueChanges.pipe(operators.startWith(''), operators.debounceTime(200), operators.shareReplay());
1953
+ var filterTerm$ = this.filterInput.valueChanges.pipe(operators.startWith(''), operators.debounceTime(200), operators.shareReplay(), operators.tap(function () { return _this.currentPage$.next(1); }));
1964
1954
  var initialVariants$ = this.product$.pipe(operators.map(function (p) { return p.variantList.items; }));
1965
- var updatedVariants$ = rxjs.combineLatest(filterTerm$, this.currentPage$, this.itemsPerPage$).pipe(operators.skipUntil(initialVariants$), operators.skip(1), operators.switchMap(function (_c) {
1955
+ var variantsList$ = rxjs.combineLatest(filterTerm$, this.currentPage$, this.itemsPerPage$).pipe(operators.skipUntil(initialVariants$), operators.skip(1), operators.debounceTime(100), operators.switchMap(function (_c) {
1966
1956
  var _d = __read(_c, 3), term = _d[0], currentPage = _d[1], itemsPerPage = _d[2];
1967
1957
  return _this.dataService.product
1968
1958
  .getProductVariants(Object.assign(Object.assign({ skip: (currentPage - 1) * itemsPerPage, take: itemsPerPage }, (term
@@ -1970,9 +1960,10 @@
1970
1960
  : {})), { filterOperator: i2.LogicalOperator.OR }), _this.id)
1971
1961
  .mapStream(function (_c) {
1972
1962
  var productVariants = _c.productVariants;
1973
- return productVariants.items;
1963
+ return productVariants;
1974
1964
  });
1975
1965
  }), operators.shareReplay({ bufferSize: 1, refCount: true }));
1966
+ var updatedVariants$ = variantsList$.pipe(operators.map(function (result) { return result.items; }));
1976
1967
  this.variants$ = rxjs.merge(initialVariants$, updatedVariants$).pipe(operators.tap(function (variants) {
1977
1968
  var e_1, _c;
1978
1969
  try {
@@ -1989,6 +1980,15 @@
1989
1980
  finally { if (e_1) throw e_1.error; }
1990
1981
  }
1991
1982
  }));
1983
+ this.totalItems$ = rxjs.merge(this.product$.pipe(operators.map(function (product) { return product.variantList.totalItems; })), variantsList$.pipe(operators.map(function (result) { return result.totalItems; })));
1984
+ this.paginationConfig$ = rxjs.combineLatest(this.totalItems$, this.itemsPerPage$, this.currentPage$).pipe(operators.map(function (_c) {
1985
+ var _d = __read(_c, 3), totalItems = _d[0], itemsPerPage = _d[1], currentPage = _d[2];
1986
+ return ({
1987
+ totalItems: totalItems,
1988
+ itemsPerPage: itemsPerPage,
1989
+ currentPage: currentPage,
1990
+ });
1991
+ }));
1992
1992
  this.taxCategories$ = this.productDetailService.getTaxCategories().pipe(operators.takeUntil(this.destroy$));
1993
1993
  this.activeTab$ = this.route.paramMap.pipe(operators.map(function (qpm) { return qpm.get('tab'); }));
1994
1994
  rxjs.combineLatest(updatedVariants$, this.languageCode$)
@@ -5229,7 +5229,7 @@
5229
5229
  };
5230
5230
  ProductVariantsListComponent.prototype.onAssetChange = function (variantId, event) {
5231
5231
  this.assetChange.emit(Object.assign({ variantId: variantId }, event));
5232
- var index = this.variants.findIndex(function (v) { return v.id === variantId; });
5232
+ var index = this.formArray.controls.findIndex(function (c) { return c.value.id === variantId; });
5233
5233
  this.formArray.at(index).markAsDirty();
5234
5234
  };
5235
5235
  ProductVariantsListComponent.prototype.toggleSelectAll = function () {