simpo-component-library 1.4.227 → 1.4.230
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/lib/ecommerce/sections/cart/cart.component.mjs +4 -1
- package/esm2022/lib/ecommerce/sections/featured-products/featured-products.component.mjs +2 -2
- package/esm2022/lib/ecommerce/sections/pagnination/pagnination.component.mjs +5 -3
- package/esm2022/lib/ecommerce/sections/product-desc/product-desc.component.mjs +2 -2
- package/esm2022/lib/ecommerce/sections/product-list/product-list.component.mjs +3 -2
- package/fesm2022/simpo-component-library.mjs +11 -5
- package/fesm2022/simpo-component-library.mjs.map +1 -1
- package/package.json +1 -1
- package/simpo-component-library-1.4.228.tgz +0 -0
- package/simpo-component-library-1.4.230.tgz +0 -0
@@ -5449,7 +5449,7 @@ class FeaturedProductsComponent extends BaseSection {
|
|
5449
5449
|
}, 50);
|
5450
5450
|
}
|
5451
5451
|
isItemOutOfStock(product) {
|
5452
|
-
return product.itemInventory
|
5452
|
+
return product.itemInventory?.openingStock == 0;
|
5453
5453
|
}
|
5454
5454
|
getItemVarient(product, varientId) {
|
5455
5455
|
let selectedVarient = null;
|
@@ -5785,7 +5785,7 @@ class ProductDescComponent extends BaseSection {
|
|
5785
5785
|
if (this.responseData.itemVariant?.length > 0) {
|
5786
5786
|
const itemVarient = this.getItemVarient();
|
5787
5787
|
if (itemVarient) {
|
5788
|
-
itemVarient.quantity
|
5788
|
+
itemVarient.quantity += (type == 'ADD' ? 1 : -1);
|
5789
5789
|
this.responseData.quantity = itemVarient.quantity;
|
5790
5790
|
this.responseData.itemInventory = itemVarient.itemInventory;
|
5791
5791
|
this.responseData.itemImages = itemVarient.variantImages;
|
@@ -5932,6 +5932,8 @@ class PagninationComponent {
|
|
5932
5932
|
this.bound = 5;
|
5933
5933
|
}
|
5934
5934
|
ngOnInit() {
|
5935
|
+
console.log(this.totalPages, this.currentPage);
|
5936
|
+
debugger;
|
5935
5937
|
}
|
5936
5938
|
goToNext() {
|
5937
5939
|
this.paginationChange.emit(this.currentPage + 1);
|
@@ -5947,13 +5949,13 @@ class PagninationComponent {
|
|
5947
5949
|
// this.router.navigate(['/list'], { queryParams: {pageNo: this.currentPage} });
|
5948
5950
|
}
|
5949
5951
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: PagninationComponent, deps: [{ token: i2$3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
5950
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.4", type: PagninationComponent, isStandalone: true, selector: "simpo-pagnination", inputs: { totalPages: "totalPages", currentPage: "currentPage" }, outputs: { paginationChange: "paginationChange" }, ngImport: i0, template: "<section class=\"d-flex w-100 justify-content-center main-section\">\r\n <div class=\"pagniation-btn\" (click)=\"goToPrev()\" [style.visibility]=\"currentPage == 1 ? 'hidden' : 'visible'\">Prev</div>\r\n <ng-container *ngFor=\"let _ of [].constructor(totalPages); let idx = index\">\r\n <span class=\"pagniation-btn\" [ngClass]=\"{'selected-page': (idx +1) == currentPage}\" (click)=\"goToSelection(idx)\">{{idx +1}}</span>\r\n </ng-container>\r\n <!-- <div *ngIf=\"totalPages > 6\" class=\"d-flex align-items-center\">\r\n <span class=\"pagniation-btn fs-2\">...</span>\r\n <span class=\"pagniation-btn\">{{totalPages}}</span>\r\n </div> -->\r\n <div class=\"pagniation-btn\" (click)=\"goToNext()\" [style.visibility]=\"currentPage == totalPages ? 'hidden' : 'visible'\">Next</div>\r\n</section>\r\n", styles: [".pagniation-btn{font-size:14px;padding:5px;border-radius:2px;width:45px;height:40px;cursor:pointer;display:flex;align-items:center;justify-content:center}.selected-page{background-color:#000;color:#fff}@media only screen and (max-width: 475px){.main-section{position:relative;right:22px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
|
5952
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.4", type: PagninationComponent, isStandalone: true, selector: "simpo-pagnination", inputs: { totalPages: "totalPages", currentPage: "currentPage" }, outputs: { paginationChange: "paginationChange" }, ngImport: i0, template: "<section class=\"d-flex w-100 justify-content-center main-section\">\r\n <div class=\"pagniation-btn\" (click)=\"goToPrev()\" [style.visibility]=\"currentPage == 1 ? 'hidden' : 'visible'\">Prev</div>\r\n <ng-container *ngFor=\"let _ of [].constructor(totalPages); let idx = index\">\r\n <span class=\"pagniation-btn\" [ngClass]=\"{'selected-page': (idx +1) == currentPage}\" (click)=\"goToSelection(idx)\">{{idx +1}}</span>\r\n </ng-container>\r\n <!-- <div *ngIf=\"totalPages > 6\" class=\"d-flex align-items-center\">\r\n <span class=\"pagniation-btn fs-2\">...</span>\r\n <span class=\"pagniation-btn\">{{totalPages}}</span>\r\n </div> -->\r\n <div class=\"pagniation-btn\" (click)=\"goToNext()\" [style.visibility]=\"currentPage == totalPages ? 'hidden' : 'visible'\">Next</div>\r\n</section>\r\n", styles: [".pagniation-btn{font-size:14px;padding:5px;border-radius:2px;width:45px;height:40px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#000}.selected-page{background-color:#000;color:#fff}@media only screen and (max-width: 475px){.main-section{position:relative;right:22px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
|
5951
5953
|
}
|
5952
5954
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: PagninationComponent, decorators: [{
|
5953
5955
|
type: Component,
|
5954
5956
|
args: [{ selector: 'simpo-pagnination', standalone: true, imports: [
|
5955
5957
|
CommonModule
|
5956
|
-
], template: "<section class=\"d-flex w-100 justify-content-center main-section\">\r\n <div class=\"pagniation-btn\" (click)=\"goToPrev()\" [style.visibility]=\"currentPage == 1 ? 'hidden' : 'visible'\">Prev</div>\r\n <ng-container *ngFor=\"let _ of [].constructor(totalPages); let idx = index\">\r\n <span class=\"pagniation-btn\" [ngClass]=\"{'selected-page': (idx +1) == currentPage}\" (click)=\"goToSelection(idx)\">{{idx +1}}</span>\r\n </ng-container>\r\n <!-- <div *ngIf=\"totalPages > 6\" class=\"d-flex align-items-center\">\r\n <span class=\"pagniation-btn fs-2\">...</span>\r\n <span class=\"pagniation-btn\">{{totalPages}}</span>\r\n </div> -->\r\n <div class=\"pagniation-btn\" (click)=\"goToNext()\" [style.visibility]=\"currentPage == totalPages ? 'hidden' : 'visible'\">Next</div>\r\n</section>\r\n", styles: [".pagniation-btn{font-size:14px;padding:5px;border-radius:2px;width:45px;height:40px;cursor:pointer;display:flex;align-items:center;justify-content:center}.selected-page{background-color:#000;color:#fff}@media only screen and (max-width: 475px){.main-section{position:relative;right:22px}}\n"] }]
|
5958
|
+
], template: "<section class=\"d-flex w-100 justify-content-center main-section\">\r\n <div class=\"pagniation-btn\" (click)=\"goToPrev()\" [style.visibility]=\"currentPage == 1 ? 'hidden' : 'visible'\">Prev</div>\r\n <ng-container *ngFor=\"let _ of [].constructor(totalPages); let idx = index\">\r\n <span class=\"pagniation-btn\" [ngClass]=\"{'selected-page': (idx +1) == currentPage}\" (click)=\"goToSelection(idx)\">{{idx +1}}</span>\r\n </ng-container>\r\n <!-- <div *ngIf=\"totalPages > 6\" class=\"d-flex align-items-center\">\r\n <span class=\"pagniation-btn fs-2\">...</span>\r\n <span class=\"pagniation-btn\">{{totalPages}}</span>\r\n </div> -->\r\n <div class=\"pagniation-btn\" (click)=\"goToNext()\" [style.visibility]=\"currentPage == totalPages ? 'hidden' : 'visible'\">Next</div>\r\n</section>\r\n", styles: [".pagniation-btn{font-size:14px;padding:5px;border-radius:2px;width:45px;height:40px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#000}.selected-page{background-color:#000;color:#fff}@media only screen and (max-width: 475px){.main-section{position:relative;right:22px}}\n"] }]
|
5957
5959
|
}], ctorParameters: () => [{ type: i2$3.Router }], propDecorators: { totalPages: [{
|
5958
5960
|
type: Input
|
5959
5961
|
}], currentPage: [{
|
@@ -6239,6 +6241,7 @@ class ProductListComponent extends BaseSection {
|
|
6239
6241
|
this.responseData = response.data;
|
6240
6242
|
this.totalCount = response.count;
|
6241
6243
|
this.totalPages = Math.ceil(response.count / this.size);
|
6244
|
+
debugger;
|
6242
6245
|
this.storageService.getUserCart().then((cartResponse) => {
|
6243
6246
|
cartResponse.onsuccess = (cartData) => {
|
6244
6247
|
this.USER_CART = cartData.target.result;
|
@@ -6305,7 +6308,7 @@ class ProductListComponent extends BaseSection {
|
|
6305
6308
|
this.sortingDialogRef?.dismiss();
|
6306
6309
|
}
|
6307
6310
|
isItemOutOfStock(product) {
|
6308
|
-
return product.itemInventory
|
6311
|
+
return product.itemInventory?.openingStock == 0;
|
6309
6312
|
}
|
6310
6313
|
getItemVarient(product, varientId) {
|
6311
6314
|
let selectedVarient = null;
|
@@ -6647,6 +6650,7 @@ class CartComponent extends BaseSection {
|
|
6647
6650
|
this.storageService.addAllProductsToCart(tempUserCart).oncomplete = () => {
|
6648
6651
|
this.storageService.getUserCart().then((cartResponse) => {
|
6649
6652
|
cartResponse.onsuccess = (cartData) => {
|
6653
|
+
this.cartInfo["orderedItems"]?.forEach((item) => item.itemVariant = null);
|
6650
6654
|
const restResponse = this.restService.addItemToDB(this.cartInfo).toPromise();
|
6651
6655
|
restResponse.finally(() => {
|
6652
6656
|
this.cartInfo.billdetails.totalGrossValue = 0;
|
@@ -6688,6 +6692,7 @@ class CartComponent extends BaseSection {
|
|
6688
6692
|
this.cartInfo.totalAmount = this.cartInfo.billdetails.totalNetValue + this.cartInfo.billdetails.totalTax;
|
6689
6693
|
this.cartInfo.orderedItems = this.USER_CART_ITEMS;
|
6690
6694
|
console.log(this.responseData);
|
6695
|
+
this.cartInfo["orderedItems"]?.forEach((item) => item.itemVariant = null);
|
6691
6696
|
this.responseData = this.cartInfo;
|
6692
6697
|
this.restService.addItemToDB(this.responseData).subscribe((response) => {
|
6693
6698
|
localStorage.setItem('cartId', response.data?.cartId);
|
@@ -6831,6 +6836,7 @@ class CartComponent extends BaseSection {
|
|
6831
6836
|
this.messageService.add({ severity: 'error', summary: 'Payment Failure', detail: 'Please provide address details' });
|
6832
6837
|
return;
|
6833
6838
|
}
|
6839
|
+
this.cartInfo["orderedItems"]?.forEach((item) => item.itemVariant = null);
|
6834
6840
|
this.cartInfo["addressDetails"] = address;
|
6835
6841
|
const updateAddress = await this.restService.addItemToDB(this.cartInfo).toPromise();
|
6836
6842
|
const payload = {
|