simpo-component-library 1.5.23 → 1.5.25

Sign up to get free protection for your applications and to get access to all the features.
@@ -3040,7 +3040,7 @@ class RestService {
3040
3040
  constructor(http, eventService) {
3041
3041
  this.http = http;
3042
3042
  this.eventService = eventService;
3043
- this.BASE_URL = "https://dev-api.simpo.ai/";
3043
+ this.BASE_URL = "https://api.simpo.ai/";
3044
3044
  this.environmentTypeSubscriber = null;
3045
3045
  this.environmentTypeSubscriber = this.eventService.environmentType.subscribe((response) => {
3046
3046
  if (response == "DEV")
@@ -8145,6 +8145,255 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImpor
8145
8145
  type: Input
8146
8146
  }] } });
8147
8147
 
8148
+ class SmallProductListingComponent {
8149
+ constructor(cartService) {
8150
+ this.cartService = cartService;
8151
+ this.USER_CART = null;
8152
+ }
8153
+ addItemToCart(product, type) {
8154
+ // if (this.isItemOutOfStock(product)) {
8155
+ // this.messageService.add({ severity: 'warn', summary: 'Cart', detail: 'Item is not available as of now. We will notify you once available' });
8156
+ // return;
8157
+ // }
8158
+ if (!product?.quantity)
8159
+ product.quantity = 0;
8160
+ if (type == 'ADD') {
8161
+ product.quantity += 1;
8162
+ }
8163
+ else {
8164
+ product.quantity -= 1;
8165
+ }
8166
+ if (product?.itemVariant?.length) {
8167
+ const itemVarient = this.getItemVarient(product, product.varientId);
8168
+ if (itemVarient) {
8169
+ itemVarient.quantity = product.quantity;
8170
+ this.cartService.addItemToCart(product, itemVarient.variantId);
8171
+ }
8172
+ }
8173
+ else {
8174
+ this.cartService.addItemToCart(product);
8175
+ }
8176
+ if (product.quantity) {
8177
+ let isPresent = false;
8178
+ this.USER_CART?.forEach((item) => {
8179
+ if (item.varientId == product.varientId) {
8180
+ item.quantity = product.quantity;
8181
+ isPresent = true;
8182
+ }
8183
+ });
8184
+ if (!isPresent)
8185
+ this.USER_CART?.push(new OrderedItems(product, product.varientId));
8186
+ }
8187
+ else {
8188
+ this.USER_CART = this.USER_CART?.filter((item) => item.varientId != product.varientId) ?? [];
8189
+ }
8190
+ }
8191
+ getItemVarient(product, varientId) {
8192
+ let selectedVarient = null;
8193
+ product?.itemVariant?.forEach((varient) => {
8194
+ if (varient.variantId == varientId)
8195
+ selectedVarient = varient;
8196
+ });
8197
+ return selectedVarient;
8198
+ }
8199
+ getPercentage(product) {
8200
+ return ((product.price.sellingPrice - product.price.discountedPrice) / 100).toFixed(0);
8201
+ }
8202
+ get currency() {
8203
+ return BUSINESS_CONSTANTS.CURRENCY;
8204
+ }
8205
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SmallProductListingComponent, deps: [{ token: CartService }], target: i0.ɵɵFactoryTarget.Component }); }
8206
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.4", type: SmallProductListingComponent, isStandalone: true, selector: "simpo-small-product-listing", inputs: { product: "product", data: "data" }, ngImport: i0, template: "<div class=\"product\" [style.opacity]=\"product?.itemInventory?.openingStock == 0 ? 0.5 : 1\">\r\n <div class=\"prod-img\">\r\n <img [src]=\"product.itemImages?.[0]?.imgUrl\" alt=\"\">\r\n <div class=\"discount\" [style.backgroundColor]=\"data?.styles?.background?.color\" style=\"color: white;\" *ngIf=\"product.price?.sellingPrice != product.price?.discountedPrice\">{{getPercentage(product)}}% off</div>\r\n </div>\r\n <div class=\"d-flex flex-column p-2\">\r\n <span>{{product.name}}</span>\r\n <span class=\"m-1\">\r\n <span><span [innerHTML]=\"currency\"></span> {{product.price.discountedPrice}}</span>\r\n <span class=\"strike-through\"><span [innerHTML]=\"currency\"></span> {{product.price.sellingPrice}}</span>\r\n </span>\r\n <div class=\"add-to-cart\" [ngClass]=\"{'justify-content-between p-0': product.quantity, 'justify-content-center': !product.quantity}\">\r\n <ng-container *ngIf=\"product?.itemInventory?.openingStock\">\r\n <ng-container *ngIf=\"!product.quantity\">\r\n <span (click)=\"addItemToCart(product, 'ADD')\">Add to Cart</span>\r\n </ng-container>\r\n <ng-container *ngIf=\"product.quantity\">\r\n <span class=\"quantity-btn\" (click)=\"addItemToCart(product, 'SUBSTRACT')\">-</span>\r\n <span class=\"quantity\">{{product.quantity}}</span>\r\n <span class=\"quantity-btn\" (click)=\"addItemToCart(product, 'ADD')\">+</span>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"product?.itemInventory?.openingStock == 0\">\r\n <span (click)=\"addItemToCart(product, 'ADD')\" class=\"d-flex align-items-center\">\r\n <mat-icon>notification_important</mat-icon>\r\n <span class=\"ml-2\">Notify</span>\r\n </span>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>", styles: [".product{position:relative;display:flex;flex-direction:column;cursor:pointer;margin-right:10px;border-radius:10px;overflow:hidden;min-width:195px;max-width:195px;background-color:#fff}.product .prod-img{position:relative;height:200px;width:100%;overflow:hidden}.product .prod-img img{height:100%;width:100%;object-fit:cover}.product img:hover{-webkit-animation:scale-up-center .2s linear both;animation:scale-up-center .2s linear both}.styling{height:30px;width:30px;border-radius:50%;background-color:#fff;position:absolute;bottom:0;right:-12px}.strike-through{text-decoration:line-through;color:#d3d3d3;font-size:12px;margin-left:5px;position:relative}.add-to-cart{width:100%;cursor:pointer;background-color:#fff;border:1.5px solid #EF4C7B;border-radius:5px;color:#ef4c7b;padding:5px;text-align:center;display:flex;align-items:center}.add-to-cart .quantity-btn{background-color:#fb8dac7d;padding:5px}.add-to-cart .quantity{color:#ef4c7b}.discount{position:absolute;top:0;padding:5px;width:60px;text-align:center;font-size:12px;border-bottom-right-radius:3px}@-webkit-keyframes scale-up-center{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(1.08);transform:scale(1.08)}}@keyframes scale-up-center{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(1.08);transform:scale(1.08)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
8207
+ }
8208
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SmallProductListingComponent, decorators: [{
8209
+ type: Component,
8210
+ args: [{ selector: 'simpo-small-product-listing', standalone: true, imports: [
8211
+ CommonModule,
8212
+ MatIcon
8213
+ ], template: "<div class=\"product\" [style.opacity]=\"product?.itemInventory?.openingStock == 0 ? 0.5 : 1\">\r\n <div class=\"prod-img\">\r\n <img [src]=\"product.itemImages?.[0]?.imgUrl\" alt=\"\">\r\n <div class=\"discount\" [style.backgroundColor]=\"data?.styles?.background?.color\" style=\"color: white;\" *ngIf=\"product.price?.sellingPrice != product.price?.discountedPrice\">{{getPercentage(product)}}% off</div>\r\n </div>\r\n <div class=\"d-flex flex-column p-2\">\r\n <span>{{product.name}}</span>\r\n <span class=\"m-1\">\r\n <span><span [innerHTML]=\"currency\"></span> {{product.price.discountedPrice}}</span>\r\n <span class=\"strike-through\"><span [innerHTML]=\"currency\"></span> {{product.price.sellingPrice}}</span>\r\n </span>\r\n <div class=\"add-to-cart\" [ngClass]=\"{'justify-content-between p-0': product.quantity, 'justify-content-center': !product.quantity}\">\r\n <ng-container *ngIf=\"product?.itemInventory?.openingStock\">\r\n <ng-container *ngIf=\"!product.quantity\">\r\n <span (click)=\"addItemToCart(product, 'ADD')\">Add to Cart</span>\r\n </ng-container>\r\n <ng-container *ngIf=\"product.quantity\">\r\n <span class=\"quantity-btn\" (click)=\"addItemToCart(product, 'SUBSTRACT')\">-</span>\r\n <span class=\"quantity\">{{product.quantity}}</span>\r\n <span class=\"quantity-btn\" (click)=\"addItemToCart(product, 'ADD')\">+</span>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"product?.itemInventory?.openingStock == 0\">\r\n <span (click)=\"addItemToCart(product, 'ADD')\" class=\"d-flex align-items-center\">\r\n <mat-icon>notification_important</mat-icon>\r\n <span class=\"ml-2\">Notify</span>\r\n </span>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>", styles: [".product{position:relative;display:flex;flex-direction:column;cursor:pointer;margin-right:10px;border-radius:10px;overflow:hidden;min-width:195px;max-width:195px;background-color:#fff}.product .prod-img{position:relative;height:200px;width:100%;overflow:hidden}.product .prod-img img{height:100%;width:100%;object-fit:cover}.product img:hover{-webkit-animation:scale-up-center .2s linear both;animation:scale-up-center .2s linear both}.styling{height:30px;width:30px;border-radius:50%;background-color:#fff;position:absolute;bottom:0;right:-12px}.strike-through{text-decoration:line-through;color:#d3d3d3;font-size:12px;margin-left:5px;position:relative}.add-to-cart{width:100%;cursor:pointer;background-color:#fff;border:1.5px solid #EF4C7B;border-radius:5px;color:#ef4c7b;padding:5px;text-align:center;display:flex;align-items:center}.add-to-cart .quantity-btn{background-color:#fb8dac7d;padding:5px}.add-to-cart .quantity{color:#ef4c7b}.discount{position:absolute;top:0;padding:5px;width:60px;text-align:center;font-size:12px;border-bottom-right-radius:3px}@-webkit-keyframes scale-up-center{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(1.08);transform:scale(1.08)}}@keyframes scale-up-center{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(1.08);transform:scale(1.08)}}\n"] }]
8214
+ }], ctorParameters: () => [{ type: CartService }], propDecorators: { product: [{
8215
+ type: Input
8216
+ }], data: [{
8217
+ type: Input
8218
+ }] } });
8219
+
8220
+ class ProductCategoryListComponent extends BaseSection {
8221
+ constructor(restService, cartService) {
8222
+ super();
8223
+ this.restService = restService;
8224
+ this.cartService = cartService;
8225
+ this.categories = [];
8226
+ this.productList = [];
8227
+ this.USER_CART = [];
8228
+ this.selectedCategory = null;
8229
+ }
8230
+ ngOnInit() {
8231
+ this.getAllCategories();
8232
+ }
8233
+ getAllCategories() {
8234
+ this.restService.getAllCategories().subscribe((response) => {
8235
+ this.categories = response;
8236
+ this.selectCategory(this.categories[0]);
8237
+ });
8238
+ }
8239
+ selectCategory(category) {
8240
+ this.selectedCategory = category;
8241
+ this.restService.getProductByCategoryId(this.selectedCategory.categoryId).subscribe((response) => {
8242
+ this.productList = response.data;
8243
+ });
8244
+ }
8245
+ addItemToCart(product, type) {
8246
+ // if (this.isItemOutOfStock(product)) {
8247
+ // this.messageService.add({ severity: 'warn', summary: 'Cart', detail: 'Item is not available as of now. We will notify you once available' });
8248
+ // return;
8249
+ // }
8250
+ if (!product?.quantity)
8251
+ product.quantity = 0;
8252
+ if (type == 'ADD') {
8253
+ product.quantity += 1;
8254
+ }
8255
+ else {
8256
+ product.quantity -= 1;
8257
+ }
8258
+ if (product?.itemVariant?.length) {
8259
+ const itemVarient = this.getItemVarient(product, product.varientId);
8260
+ if (itemVarient) {
8261
+ itemVarient.quantity = product.quantity;
8262
+ this.cartService.addItemToCart(product, itemVarient.variantId);
8263
+ }
8264
+ }
8265
+ else {
8266
+ this.cartService.addItemToCart(product);
8267
+ }
8268
+ if (product.quantity) {
8269
+ let isPresent = false;
8270
+ this.USER_CART?.forEach((item) => {
8271
+ if (item.varientId == product.varientId) {
8272
+ item.quantity = product.quantity;
8273
+ isPresent = true;
8274
+ }
8275
+ });
8276
+ if (!isPresent)
8277
+ this.USER_CART?.push(new OrderedItems(product, product.varientId));
8278
+ }
8279
+ else {
8280
+ this.USER_CART = this.USER_CART?.filter((item) => item.varientId != product.varientId) ?? [];
8281
+ }
8282
+ }
8283
+ getItemVarient(product, varientId) {
8284
+ let selectedVarient = null;
8285
+ product?.itemVariant?.forEach((varient) => {
8286
+ if (varient.variantId == varientId)
8287
+ selectedVarient = varient;
8288
+ });
8289
+ return selectedVarient;
8290
+ }
8291
+ getPercentage(product) {
8292
+ return ((product.price.sellingPrice - product.price.discountedPrice) / 100).toFixed(0);
8293
+ }
8294
+ get currency() {
8295
+ return BUSINESS_CONSTANTS.CURRENCY;
8296
+ }
8297
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: ProductCategoryListComponent, deps: [{ token: RestService }, { token: CartService }], target: i0.ɵɵFactoryTarget.Component }); }
8298
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.4", type: ProductCategoryListComponent, isStandalone: true, selector: "simpo-product-category-list", inputs: { responseData: "responseData", data: "data", index: "index", edit: "edit", delete: "delete" }, usesInheritance: true, ngImport: i0, template: "<section class=\"d-flex\">\r\n <div class=\"filter-panel\">\r\n <ng-container *ngFor=\"let category of categories\">\r\n <div class=\"category\" [ngClass]=\"{'category-selected': category.categoryId == selectedCategory?.categoryId}\" (click)=\"selectCategory(category)\">\r\n <div class=\"product-img\">\r\n <img [src]=\"category.imgUrl?.[0]\" alt=\"\">\r\n </div>\r\n <span>{{ category.categoryName }}</span>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-list-container\">\r\n <h2>Buy {{ selectedCategory?.categoryName | titlecase }} Online</h2>\r\n \r\n <section class=\"d-flex product-list\">\r\n <ng-container *ngFor=\"let product of productList\">\r\n <simpo-small-product-listing [product]=\"product\" [data]=\"data\"></simpo-small-product-listing>\r\n \r\n </ng-container>\r\n </section>\r\n </div>\r\n</section>", styles: [".filter-panel{border-right:2px solid rgba(211,211,211,.297);width:25%}.category{display:flex;align-items:center;gap:10px;padding:10px;border-left:5px solid transparent;cursor:pointer}.category-selected{border-left:5px solid #ef4c7b;background-color:#ef4c7b1f}.product-img{height:45px;width:45px;padding:5px;border-radius:50%;background-color:#d3d3d3}.product-img img{height:100%;width:100%;border-radius:50%}.product-list-container{padding:40px 20px;width:80%;background-color:#f5eaff}.product-list{overflow:auto;flex-wrap:wrap;height:90vh}.product{position:relative;display:flex;flex-direction:column;cursor:pointer;border-radius:10px;overflow:hidden;min-width:195px;max-width:195px;margin:10px;background-color:#fff}.product .prod-img{position:relative;height:200px;width:100%;overflow:hidden}.product .prod-img img{height:100%;width:100%;object-fit:cover}.product img:hover{-webkit-animation:scale-up-center .2s linear both;animation:scale-up-center .2s linear both}.styling{height:30px;width:30px;border-radius:50%;background-color:#fff;position:absolute;bottom:0;right:-12px}.strike-through{text-decoration:line-through;color:#d3d3d3;font-size:12px;margin-left:5px;position:relative}.add-to-cart{width:100%;cursor:pointer;background-color:#fff;border:1.5px solid #EF4C7B;border-radius:5px;color:#ef4c7b;padding:5px;text-align:center;display:flex;align-items:center}.add-to-cart .quantity-btn{background-color:#fb8dac7d;padding:5px}.add-to-cart .quantity{color:#ef4c7b}.discount{position:absolute;top:0;padding:5px;width:60px;text-align:center;font-size:12px;border-bottom-right-radius:3px}@-webkit-keyframes scale-up-center{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(1.08);transform:scale(1.08)}}@keyframes scale-up-center{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(1.08);transform:scale(1.08)}}@media screen and (max-width: 475px){.product-list-container{padding:5px!important}.category{flex-direction:column!important;text-align:center!important}.product{min-width:135px!important;max-width:135px!important;margin-left:0!important;margin-right:8px!important}}\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"] }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }, { kind: "ngmodule", type: SimpoComponentModule }, { kind: "component", type: SmallProductListingComponent, selector: "simpo-small-product-listing", inputs: ["product", "data"] }] }); }
8299
+ }
8300
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: ProductCategoryListComponent, decorators: [{
8301
+ type: Component,
8302
+ args: [{ selector: 'simpo-product-category-list', standalone: true, imports: [
8303
+ CommonModule,
8304
+ MatIcon,
8305
+ SimpoComponentModule,
8306
+ SmallProductListingComponent
8307
+ ], template: "<section class=\"d-flex\">\r\n <div class=\"filter-panel\">\r\n <ng-container *ngFor=\"let category of categories\">\r\n <div class=\"category\" [ngClass]=\"{'category-selected': category.categoryId == selectedCategory?.categoryId}\" (click)=\"selectCategory(category)\">\r\n <div class=\"product-img\">\r\n <img [src]=\"category.imgUrl?.[0]\" alt=\"\">\r\n </div>\r\n <span>{{ category.categoryName }}</span>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-list-container\">\r\n <h2>Buy {{ selectedCategory?.categoryName | titlecase }} Online</h2>\r\n \r\n <section class=\"d-flex product-list\">\r\n <ng-container *ngFor=\"let product of productList\">\r\n <simpo-small-product-listing [product]=\"product\" [data]=\"data\"></simpo-small-product-listing>\r\n \r\n </ng-container>\r\n </section>\r\n </div>\r\n</section>", styles: [".filter-panel{border-right:2px solid rgba(211,211,211,.297);width:25%}.category{display:flex;align-items:center;gap:10px;padding:10px;border-left:5px solid transparent;cursor:pointer}.category-selected{border-left:5px solid #ef4c7b;background-color:#ef4c7b1f}.product-img{height:45px;width:45px;padding:5px;border-radius:50%;background-color:#d3d3d3}.product-img img{height:100%;width:100%;border-radius:50%}.product-list-container{padding:40px 20px;width:80%;background-color:#f5eaff}.product-list{overflow:auto;flex-wrap:wrap;height:90vh}.product{position:relative;display:flex;flex-direction:column;cursor:pointer;border-radius:10px;overflow:hidden;min-width:195px;max-width:195px;margin:10px;background-color:#fff}.product .prod-img{position:relative;height:200px;width:100%;overflow:hidden}.product .prod-img img{height:100%;width:100%;object-fit:cover}.product img:hover{-webkit-animation:scale-up-center .2s linear both;animation:scale-up-center .2s linear both}.styling{height:30px;width:30px;border-radius:50%;background-color:#fff;position:absolute;bottom:0;right:-12px}.strike-through{text-decoration:line-through;color:#d3d3d3;font-size:12px;margin-left:5px;position:relative}.add-to-cart{width:100%;cursor:pointer;background-color:#fff;border:1.5px solid #EF4C7B;border-radius:5px;color:#ef4c7b;padding:5px;text-align:center;display:flex;align-items:center}.add-to-cart .quantity-btn{background-color:#fb8dac7d;padding:5px}.add-to-cart .quantity{color:#ef4c7b}.discount{position:absolute;top:0;padding:5px;width:60px;text-align:center;font-size:12px;border-bottom-right-radius:3px}@-webkit-keyframes scale-up-center{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(1.08);transform:scale(1.08)}}@keyframes scale-up-center{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(1.08);transform:scale(1.08)}}@media screen and (max-width: 475px){.product-list-container{padding:5px!important}.category{flex-direction:column!important;text-align:center!important}.product{min-width:135px!important;max-width:135px!important;margin-left:0!important;margin-right:8px!important}}\n"] }]
8308
+ }], ctorParameters: () => [{ type: RestService }, { type: CartService }], propDecorators: { responseData: [{
8309
+ type: Input
8310
+ }], data: [{
8311
+ type: Input
8312
+ }], index: [{
8313
+ type: Input
8314
+ }], edit: [{
8315
+ type: Input
8316
+ }], delete: [{
8317
+ type: Input
8318
+ }] } });
8319
+
8320
+ class CategoryProductComponent extends BaseSection {
8321
+ constructor(restService, cartService, _eventService, activatedRoute) {
8322
+ super();
8323
+ this.restService = restService;
8324
+ this.cartService = cartService;
8325
+ this._eventService = _eventService;
8326
+ this.activatedRoute = activatedRoute;
8327
+ this.categories = [
8328
+ { name: "Kajal", imgUrl: "" },
8329
+ { name: "BB/CC Cream", imgUrl: "" },
8330
+ { name: "Fake Nails", imgUrl: "" },
8331
+ { name: "Eye Liner", imgUrl: "" },
8332
+ { name: "Lipstick", imgUrl: "" },
8333
+ { name: "Primer", imgUrl: "" },
8334
+ { name: "Compact Powder", imgUrl: "" },
8335
+ ];
8336
+ this.selectCategoryId = null;
8337
+ this.categoryList = [];
8338
+ this.USER_CART = null;
8339
+ this.collectionId = null;
8340
+ this.featureProductData = null;
8341
+ this.dataList = [];
8342
+ }
8343
+ ngOnInit() {
8344
+ this.featureProductData = new FeaturedProductModal(this.data);
8345
+ this.styles = this.data?.styles;
8346
+ this.content = this.data?.content;
8347
+ this.activatedRoute.queryParams.subscribe((qParam) => {
8348
+ this.collectionId = qParam["collectionId"];
8349
+ });
8350
+ this.getAllCategories(); // should be replaced by getAllCategories by collectionId
8351
+ }
8352
+ getAllCategories() {
8353
+ this.restService.getAllCategories().subscribe((response) => {
8354
+ this.categoryList = response;
8355
+ this.selectCategoryId = this.categoryList?.[0]?.categoryId;
8356
+ this.selectCategory(this.selectCategoryId);
8357
+ });
8358
+ }
8359
+ selectCategory(categoryId) {
8360
+ this.selectCategoryId = categoryId;
8361
+ this.restService.getProductByCategoryId(categoryId).subscribe((response) => {
8362
+ this.dataList = response.data;
8363
+ });
8364
+ }
8365
+ editSection() {
8366
+ this._eventService.toggleEditorEvent.emit(false);
8367
+ setTimeout(() => {
8368
+ this._eventService.editSection.emit({ data: this.data });
8369
+ }, 100);
8370
+ }
8371
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: CategoryProductComponent, deps: [{ token: RestService }, { token: CartService }, { token: EventsService }, { token: i2$3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
8372
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.4", type: CategoryProductComponent, isStandalone: true, selector: "simpo-category-product", inputs: { data: "data", index: "index", edit: "edit", delete: "delete" }, usesInheritance: true, ngImport: i0, template: "<section class=\"container-fluid total-container\" [id]=\"data?.id\" simpoHover (hovering)=\"showEditTabs($event)\" [simpoBackground]=\"styles?.background\" [simpoLayout]=\"styles?.layout\">\r\n <div *ngFor=\"let item of data?.content?.inputText\">\r\n <div [innerHTML]=\"item.value\" [ngClass]=\"item.label === 'Heading' ? 'heading-large lh-2 mb-3' : 'body-large'\">\r\n </div>\r\n </div>\r\n <section class=\"m-auto\">\r\n <section class=\"d-flex\">\r\n <ng-container *ngFor=\"let category of categoryList; let idx = index\">\r\n <div class=\"d-flex flex-column align-items-center category-tag position-relative\" style=\"gap: 5px;\" [ngClass]=\"{'category-tag-selected': selectCategoryId == category.categoryId}\" (click)=\"selectCategory(category.categoryId)\">\r\n <mat-icon>face</mat-icon>\r\n <span class=\"text-center\" style=\"font-size: 14px;\">{{ category.categoryName | titlecase }}</span>\r\n <!-- <div class=\"styling\"></div> -->\r\n </div>\r\n </ng-container>\r\n </section>\r\n <section class=\"d-flex product-list\">\r\n <ng-container *ngFor=\"let product of dataList\">\r\n <simpo-small-product-listing [product]=\"product\" [data]=\"data\"></simpo-small-product-listing>\r\n </ng-container>\r\n </section>\r\n </section>\r\n <div [ngClass]=\"{'hover_effect': edit}\" *ngIf=\"showEditors\">\r\n <simpo-hover-elements [data]=\"data\" [index]=\"index\" [editOptions]=\"edit\"></simpo-hover-elements>\r\n </div>\r\n <div *ngIf=\"showDelete\" [ngClass]=\"{'hover_effect': delete}\">\r\n <simpo-delete-hover-element [data]=\"data\" [index]=\"index\"></simpo-delete-hover-element>\r\n </div>\r\n</section>", styles: [".category-tag{padding:15px 10px;height:120px;width:80px;border-top-left-radius:10px;border-top-right-radius:10px;cursor:pointer;border-top:8px solid transparent}.category-tag-selected{background-color:#eef4f6;border-top:8px solid #1467A8}.product-list{background-color:#f5eaff;padding:40px 20px;overflow-x:auto}\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"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: SmallProductListingComponent, selector: "simpo-small-product-listing", inputs: ["product", "data"] }, { kind: "directive", type: BackgroundDirective, selector: "[simpoBackground]", inputs: ["simpoBackground", "scrollValue"] }, { kind: "directive", type: HoverDirective, selector: "[simpoHover]", outputs: ["hovering"] }, { kind: "directive", type: ContentFitDirective, selector: "[simpoLayout]", inputs: ["simpoLayout"] }, { kind: "ngmodule", type: SimpoComponentModule }, { kind: "component", type: HoverElementsComponent, selector: "simpo-hover-elements", inputs: ["data", "index", "editOptions", "isMerged", "isEcommerce"], outputs: ["edit"] }, { kind: "component", type: DeleteHoverElementComponent, selector: "simpo-delete-hover-element", inputs: ["index", "data"], outputs: ["edit"] }] }); }
8373
+ }
8374
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: CategoryProductComponent, decorators: [{
8375
+ type: Component,
8376
+ args: [{ selector: 'simpo-category-product', standalone: true, imports: [
8377
+ CommonModule,
8378
+ MatIcon,
8379
+ PositionLayoutDirectiveDirective,
8380
+ FeaturedProductsComponent,
8381
+ SmallProductListingComponent,
8382
+ BackgroundDirective,
8383
+ HoverDirective,
8384
+ ContentFitDirective,
8385
+ SimpoComponentModule
8386
+ ], template: "<section class=\"container-fluid total-container\" [id]=\"data?.id\" simpoHover (hovering)=\"showEditTabs($event)\" [simpoBackground]=\"styles?.background\" [simpoLayout]=\"styles?.layout\">\r\n <div *ngFor=\"let item of data?.content?.inputText\">\r\n <div [innerHTML]=\"item.value\" [ngClass]=\"item.label === 'Heading' ? 'heading-large lh-2 mb-3' : 'body-large'\">\r\n </div>\r\n </div>\r\n <section class=\"m-auto\">\r\n <section class=\"d-flex\">\r\n <ng-container *ngFor=\"let category of categoryList; let idx = index\">\r\n <div class=\"d-flex flex-column align-items-center category-tag position-relative\" style=\"gap: 5px;\" [ngClass]=\"{'category-tag-selected': selectCategoryId == category.categoryId}\" (click)=\"selectCategory(category.categoryId)\">\r\n <mat-icon>face</mat-icon>\r\n <span class=\"text-center\" style=\"font-size: 14px;\">{{ category.categoryName | titlecase }}</span>\r\n <!-- <div class=\"styling\"></div> -->\r\n </div>\r\n </ng-container>\r\n </section>\r\n <section class=\"d-flex product-list\">\r\n <ng-container *ngFor=\"let product of dataList\">\r\n <simpo-small-product-listing [product]=\"product\" [data]=\"data\"></simpo-small-product-listing>\r\n </ng-container>\r\n </section>\r\n </section>\r\n <div [ngClass]=\"{'hover_effect': edit}\" *ngIf=\"showEditors\">\r\n <simpo-hover-elements [data]=\"data\" [index]=\"index\" [editOptions]=\"edit\"></simpo-hover-elements>\r\n </div>\r\n <div *ngIf=\"showDelete\" [ngClass]=\"{'hover_effect': delete}\">\r\n <simpo-delete-hover-element [data]=\"data\" [index]=\"index\"></simpo-delete-hover-element>\r\n </div>\r\n</section>", styles: [".category-tag{padding:15px 10px;height:120px;width:80px;border-top-left-radius:10px;border-top-right-radius:10px;cursor:pointer;border-top:8px solid transparent}.category-tag-selected{background-color:#eef4f6;border-top:8px solid #1467A8}.product-list{background-color:#f5eaff;padding:40px 20px;overflow-x:auto}\n"] }]
8387
+ }], ctorParameters: () => [{ type: RestService }, { type: CartService }, { type: EventsService }, { type: i2$3.ActivatedRoute }], propDecorators: { data: [{
8388
+ type: Input
8389
+ }], index: [{
8390
+ type: Input
8391
+ }], edit: [{
8392
+ type: Input
8393
+ }], delete: [{
8394
+ type: Input
8395
+ }] } });
8396
+
8148
8397
  class EndUserService {
8149
8398
  constructor(storageService) {
8150
8399
  this.storageService = storageService;
@@ -8275,5 +8524,5 @@ class Product {
8275
8524
  * Generated bundle index. Do not edit.
8276
8525
  */
8277
8526
 
8278
- export { AddNewSectionComponent, AlignContent, AnimationDirective, AuthenticateUserComponent, BANNERALIGNMENT, BANNERHALIGN, BackgroundDirective, BannerCarouselComponent, BannerContentFitDirective, BannerGridSectionComponent, BannerSectionComponent, BlogListComponent, BorderDirective, ButtonDirectiveDirective, CarouselBannerComponent, Cart, CartComponent, Category, ChannelType, CheckoutComponent, ChooseUsSectionComponent, Collection, ColorDirective, ColumnDirectiveDirective, ContactUsComponent, ContainerFitDirective, ContentFitDirective, CornerDirective, Corners, EndUserService, EventsService, FaqSectionComponent, FeaturedCategoryComponent, FeaturedProductsComponent, FeaturesSectionComponent, FooterSectionComponent, FooterTypes, HALIGN, HeaderButtonStyle, HeaderTextComponent, HoverDirective, ImageCarouselSectionComponent, ImageDirectiveDirective, ImageFit, ImageGridSectionComponent, ImageRatio, ImageSectionComponent, LocationSectionComponent, LogoShowcaseComponent, MapType, NavbarSectionComponent, ObjectPositionDirective, OverlayDirective, OverlayValue, Padding, PositionLayoutDirectiveDirective, PricingSectionComponent, ProcessModernComponent, ProcessSectionComponent, Product, ProductDescComponent, ProductListComponent, RecentBlogPostSectionComponent, RedirectionLinkType, RemoveCarouselDirective, SPACING$1 as SPACING, SPACINGALIGN, ServiceSectionComponent, SimpoContainerAligment, SimpoFooterLayoutDirective, SimpoStickyDirective, SkeletonLoaderSectionComponent, Style, TEXT_SIZE, TeamMemberSectionComponent, TestimonialFullwidthComponent, TestimonialSectionComponent, TextBackgroundDirectiveDirective, TextImageSectionComponent, TextPosition, TextSectionComponent, UserProfileComponent, VALIGN, VerifyComponent, VideoSectionComponent, ViewBlogComponent, WhislistComponent, animation, applySpacing, applyStyle, contentAlignment, fitContent, fitScreen, fontSize, logoDirection, logoSpeed, logoType, mapStyle, showCaseType, simpoConetenAlignmentDirective };
8527
+ export { AddNewSectionComponent, AlignContent, AnimationDirective, AuthenticateUserComponent, BANNERALIGNMENT, BANNERHALIGN, BackgroundDirective, BannerCarouselComponent, BannerContentFitDirective, BannerGridSectionComponent, BannerSectionComponent, BlogListComponent, BorderDirective, ButtonDirectiveDirective, CarouselBannerComponent, Cart, CartComponent, Category, CategoryProductComponent, ChannelType, CheckoutComponent, ChooseUsSectionComponent, Collection, ColorDirective, ColumnDirectiveDirective, ContactUsComponent, ContainerFitDirective, ContentFitDirective, CornerDirective, Corners, EndUserService, EventsService, FaqSectionComponent, FeaturedCategoryComponent, FeaturedProductsComponent, FeaturesSectionComponent, FooterSectionComponent, FooterTypes, HALIGN, HeaderButtonStyle, HeaderTextComponent, HoverDirective, ImageCarouselSectionComponent, ImageDirectiveDirective, ImageFit, ImageGridSectionComponent, ImageRatio, ImageSectionComponent, LocationSectionComponent, LogoShowcaseComponent, MapType, NavbarSectionComponent, ObjectPositionDirective, OverlayDirective, OverlayValue, Padding, PositionLayoutDirectiveDirective, PricingSectionComponent, ProcessModernComponent, ProcessSectionComponent, Product, ProductCategoryListComponent, ProductDescComponent, ProductListComponent, RecentBlogPostSectionComponent, RedirectionLinkType, RemoveCarouselDirective, SPACING$1 as SPACING, SPACINGALIGN, ServiceSectionComponent, SimpoContainerAligment, SimpoFooterLayoutDirective, SimpoStickyDirective, SkeletonLoaderSectionComponent, Style, TEXT_SIZE, TeamMemberSectionComponent, TestimonialFullwidthComponent, TestimonialSectionComponent, TextBackgroundDirectiveDirective, TextImageSectionComponent, TextPosition, TextSectionComponent, UserProfileComponent, VALIGN, VerifyComponent, VideoSectionComponent, ViewBlogComponent, WhislistComponent, animation, applySpacing, applyStyle, contentAlignment, fitContent, fitScreen, fontSize, logoDirection, logoSpeed, logoType, mapStyle, showCaseType, simpoConetenAlignmentDirective };
8279
8528
  //# sourceMappingURL=simpo-component-library.mjs.map