simpo-component-library 1.6.84 → 1.6.86
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/lib/components/image-loading/image-loading.component.mjs +49 -0
- package/esm2022/lib/ecommerce/sections/featured-category/featured-collection.component.mjs +14 -1
- package/esm2022/lib/ecommerce/sections/small-product-listing/small-product-listing.component.mjs +5 -3
- package/esm2022/lib/ecommerce/styles/product.modal.mjs +1 -1
- package/esm2022/lib/sections/image-section/image-section.component.mjs +22 -3
- package/fesm2022/simpo-component-library.mjs +84 -5
- package/fesm2022/simpo-component-library.mjs.map +1 -1
- package/lib/components/image-loading/image-loading.component.d.ts +15 -0
- package/lib/ecommerce/sections/featured-category/featured-collection.component.d.ts +1 -0
- package/lib/ecommerce/styles/product.modal.d.ts +2 -5
- package/lib/sections/banner-carousel/banner-carousel.component.d.ts +1 -1
- package/lib/sections/image-section/image-section.component.d.ts +3 -0
- package/package.json +1 -1
- package/simpo-component-library-1.6.86.tgz +0 -0
- package/simpo-component-library-1.6.83.tgz +0 -0
- package/simpo-component-library-1.6.84.tgz +0 -0
@@ -28,6 +28,7 @@ import { MatMenuModule } from '@angular/material/menu';
|
|
28
28
|
import * as i2$4 from '@angular/material/snack-bar';
|
29
29
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
30
30
|
import * as mapboxgl from 'mapbox-gl';
|
31
|
+
import { isBlurhashValid, decode } from 'blurhash';
|
31
32
|
import * as i14 from 'ngx-image-zoom';
|
32
33
|
import { NgxImageZoomModule } from 'ngx-image-zoom';
|
33
34
|
import * as i15 from 'primeng/rating';
|
@@ -39,7 +40,7 @@ import { MatSliderModule } from '@angular/material/slider';
|
|
39
40
|
import { MatSelectModule } from '@angular/material/select';
|
40
41
|
import * as i16$1 from '@angular/material/radio';
|
41
42
|
import { MatRadioModule } from '@angular/material/radio';
|
42
|
-
import { CdkDrag } from '@angular/cdk/drag-drop';
|
43
|
+
import { CdkDrag, moveItemInArray } from '@angular/cdk/drag-drop';
|
43
44
|
import * as i4 from 'primeng/timeline';
|
44
45
|
import { TimelineModule } from 'primeng/timeline';
|
45
46
|
import * as i6 from 'primeng/progressbar';
|
@@ -2677,6 +2678,25 @@ class ImageSectionComponent extends BaseSection {
|
|
2677
2678
|
}
|
2678
2679
|
return this.style?.merge;
|
2679
2680
|
}
|
2681
|
+
get getBackgroundOpacity() {
|
2682
|
+
if (this.data?.styles?.background?.overlay)
|
2683
|
+
return this.opacityValue(this.data?.styles?.background?.overlay);
|
2684
|
+
return '1';
|
2685
|
+
}
|
2686
|
+
opacityValue(value) {
|
2687
|
+
switch (value) {
|
2688
|
+
case "LIGHT":
|
2689
|
+
return '0.2';
|
2690
|
+
case "MODERATE":
|
2691
|
+
return '0.3';
|
2692
|
+
case "STRONG":
|
2693
|
+
return '0.5';
|
2694
|
+
case "VERY_STRONG":
|
2695
|
+
return '0.7';
|
2696
|
+
default:
|
2697
|
+
return '1';
|
2698
|
+
}
|
2699
|
+
}
|
2680
2700
|
editSection() {
|
2681
2701
|
if (window.innerWidth <= 475)
|
2682
2702
|
return;
|
@@ -2686,7 +2706,7 @@ class ImageSectionComponent extends BaseSection {
|
|
2686
2706
|
}, 100);
|
2687
2707
|
}
|
2688
2708
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: ImageSectionComponent, deps: [{ token: EventsService }], target: i0.ɵɵFactoryTarget.Component }); }
|
2689
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.4", type: ImageSectionComponent, isStandalone: true, selector: "simpo-image-section", inputs: { data: "data", index: "index", edit: "edit", delete: "delete", customClass: "customClass" }, viewQueries: [{ propertyName: "_mainContainer", first: true, predicate: ["mainContainer"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<section [id]=\"data?.id\" [ngClass]=\"{'mergeNavbar':canMergeNavbar}\" [simpoBackground]=\"style?.background\" simpoHover (hovering)=\"showEditTabs($event)\"\r\n class=\"total-container\" (click)=\"editSection()\" [attr.style]=\"customClass\">\r\n <div #mainContainer [id]=\"data?.id\" [simpoOverlay]=\"style?.background\">\r\n <div class=\"main-section\" [ngClass]=\"{'px-0 py-0': style?.fullWidth}\" [id]=\"data?.id\" [simpoBorder]=\"style?.border\"\r\n [simpoLayout]=\"style?.layout\">\r\n <div class=\"img-text-card\" [id]=\"data?.id\" [simpoAnimation]=\"style?.animation\">\r\n <!-- <div *ngFor=\"let text of data?.content?.inputText\">\r\n <div class=\"heading-large mb-1\" [innerHTML]=\"text.value\"></div>\r\n </div> -->\r\n\r\n <div class=\"image-section w-100\">\r\n <img loading=\"lazy\" [ngClass]=\"{'h-80': style?.layout?.fit === 'content', 'image': style?.layout?.fit === 'screen'}\" [class]=\"data?.id+(content?.image?.id || '')\"\r\n [src]=\"content?.image?.url\" [ngStyle]=\"{'opacity': (canMergeNavbar ? '0' :
|
2709
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.4", type: ImageSectionComponent, isStandalone: true, selector: "simpo-image-section", inputs: { data: "data", index: "index", edit: "edit", delete: "delete", customClass: "customClass" }, viewQueries: [{ propertyName: "_mainContainer", first: true, predicate: ["mainContainer"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<section [id]=\"data?.id\" [ngClass]=\"{'mergeNavbar':canMergeNavbar}\" [simpoBackground]=\"style?.background\" simpoHover (hovering)=\"showEditTabs($event)\"\r\n class=\"total-container\" (click)=\"editSection()\" [attr.style]=\"customClass\">\r\n <div #mainContainer [id]=\"data?.id\" [simpoOverlay]=\"style?.background\">\r\n <div class=\"main-section\" [ngClass]=\"{'px-0 py-0': style?.fullWidth}\" [id]=\"data?.id\" [simpoBorder]=\"style?.border\"\r\n [simpoLayout]=\"style?.layout\">\r\n <div class=\"img-text-card\" [id]=\"data?.id\" [simpoAnimation]=\"style?.animation\">\r\n <!-- <div *ngFor=\"let text of data?.content?.inputText\">\r\n <div class=\"heading-large mb-1\" [innerHTML]=\"text.value\"></div>\r\n </div> -->\r\n\r\n <div class=\"image-section w-100\">\r\n <img loading=\"lazy\" [ngClass]=\"{'h-80': style?.layout?.fit === 'content', 'image': style?.layout?.fit === 'screen'}\" [class]=\"data?.id+(content?.image?.id || '')\"\r\n [src]=\"content?.image?.url\" [ngStyle]=\"{'opacity': (canMergeNavbar ? '0' : getBackgroundOpacity)}\" [alt]=\"content?.image?.altText\" [simpoCorner]=\"style?.corners\" [simpoObjectPosition]=\"content?.image?.position\"\r\n [id]=\"data?.id\"\r\n loading=\"lazy\" />\r\n \r\n </div>\r\n <div *ngIf=\"style?.showText\" class=\"col-lg-9 d-flex flex-column\" style=\"position: absolute;\" [simpoPositionLayoutDirective]=\"style?.positionLayout\" [simpoContentAlignment]=\"style?.contentAlignment\" [id]=\"data?.id\">\r\n <div *ngFor=\"let item of content?.inputText\">\r\n <div [innerHTML]=\"item.value\" [ngClass]=\"item.label === 'Heading' ? 'heading-large lh-2 mb-3' : 'body-large'\"></div>\r\n </div>\r\n <div *ngIf=\"data?.action && data?.action?.display\" class=\"button-display\">\r\n <div *ngFor=\"let button of data?.action?.buttons\">\r\n <app-button-element [buttonContent]=\"button.content\" [buttonStyle]=\"button.styles\" [sectionId]=\"data?.id\" [buttonId]=\"button.id\" [color]=\"data?.styles?.background?.accentColor\"></app-button-element>\r\n </div>\r\n </div>\r\n </div> \r\n \r\n\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div [ngClass]=\"{'hover_effect': edit}\" *ngIf=\"showEditors\">\r\n <simpo-hover-elements [data]=\"data\" [index]=\"index\" [editOptions]=\"edit\" [isMerged]=\"style?.merge ?? false\"></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>\r\n", styles: [".image{width:100%}.main-section{width:100%;height:100%!important;display:block!important}.img-text-card{display:flex;align-items:center;justify-content:center}.h-80{width:100%;height:80vh}.mb-1{margin-bottom:1.5rem!important}.mergeNavbar{margin-top:-175px}.total-container{height:auto;position:relative}.hover_effect{position:absolute;width:100%;top:0;left:0;height:100%}.image-section img{object-fit:cover}.text-content-card{justify-content:center;align-items:center}@media screen and (min-width: 760px){.cards{padding-bottom:24px}}@media only screen and (max-width: 475px){.h-80{height:15rem;border-radius:1rem}.main-section{min-height:auto!important}}\n"], dependencies: [{ kind: "ngmodule", type: SimpoElementsModule }, { kind: "component", type: SimpoButtonComponent, selector: "app-button-element", inputs: ["buttonContent", "buttonStyle", "buttonId", "color", "sectionId"] }, { 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: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { 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"] }, { kind: "directive", type:
|
2690
2710
|
//directive
|
2691
2711
|
AnimationDirective, selector: "[simpoAnimation]", inputs: ["simpoAnimation"] }, { kind: "directive", type: BackgroundDirective, selector: "[simpoBackground]", inputs: ["simpoBackground", "scrollValue"] }, { kind: "directive", type: BorderDirective, selector: "[simpoBorder]", inputs: ["simpoBorder"] }, { kind: "directive", type: simpoConetenAlignmentDirective, selector: "[simpoContentAlignment]", inputs: ["simpoContentAlignment"] }, { kind: "directive", type: CornerDirective, selector: "[simpoCorner]", inputs: ["simpoCorner"] }, { kind: "directive", type: HoverDirective, selector: "[simpoHover]", outputs: ["hovering"] }, { kind: "directive", type: OverlayDirective, selector: "[simpoOverlay]", inputs: ["simpoOverlay"] }, { kind: "directive", type: PositionLayoutDirectiveDirective, selector: "[simpoPositionLayoutDirective]", inputs: ["simpoPositionLayoutDirective"] }, { kind: "directive", type: ObjectPositionDirective, selector: "[simpoObjectPosition]", inputs: ["simpoObjectPosition"] }] }); }
|
2692
2712
|
}
|
@@ -2716,7 +2736,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImpor
|
|
2716
2736
|
PositionLayoutDirectiveDirective,
|
2717
2737
|
TextBackgroundDirectiveDirective,
|
2718
2738
|
ObjectPositionDirective
|
2719
|
-
], template: "<section [id]=\"data?.id\" [ngClass]=\"{'mergeNavbar':canMergeNavbar}\" [simpoBackground]=\"style?.background\" simpoHover (hovering)=\"showEditTabs($event)\"\r\n class=\"total-container\" (click)=\"editSection()\" [attr.style]=\"customClass\">\r\n <div #mainContainer [id]=\"data?.id\" [simpoOverlay]=\"style?.background\">\r\n <div class=\"main-section\" [ngClass]=\"{'px-0 py-0': style?.fullWidth}\" [id]=\"data?.id\" [simpoBorder]=\"style?.border\"\r\n [simpoLayout]=\"style?.layout\">\r\n <div class=\"img-text-card\" [id]=\"data?.id\" [simpoAnimation]=\"style?.animation\">\r\n <!-- <div *ngFor=\"let text of data?.content?.inputText\">\r\n <div class=\"heading-large mb-1\" [innerHTML]=\"text.value\"></div>\r\n </div> -->\r\n\r\n <div class=\"image-section w-100\">\r\n <img loading=\"lazy\" [ngClass]=\"{'h-80': style?.layout?.fit === 'content', 'image': style?.layout?.fit === 'screen'}\" [class]=\"data?.id+(content?.image?.id || '')\"\r\n [src]=\"content?.image?.url\" [ngStyle]=\"{'opacity': (canMergeNavbar ? '0' :
|
2739
|
+
], template: "<section [id]=\"data?.id\" [ngClass]=\"{'mergeNavbar':canMergeNavbar}\" [simpoBackground]=\"style?.background\" simpoHover (hovering)=\"showEditTabs($event)\"\r\n class=\"total-container\" (click)=\"editSection()\" [attr.style]=\"customClass\">\r\n <div #mainContainer [id]=\"data?.id\" [simpoOverlay]=\"style?.background\">\r\n <div class=\"main-section\" [ngClass]=\"{'px-0 py-0': style?.fullWidth}\" [id]=\"data?.id\" [simpoBorder]=\"style?.border\"\r\n [simpoLayout]=\"style?.layout\">\r\n <div class=\"img-text-card\" [id]=\"data?.id\" [simpoAnimation]=\"style?.animation\">\r\n <!-- <div *ngFor=\"let text of data?.content?.inputText\">\r\n <div class=\"heading-large mb-1\" [innerHTML]=\"text.value\"></div>\r\n </div> -->\r\n\r\n <div class=\"image-section w-100\">\r\n <img loading=\"lazy\" [ngClass]=\"{'h-80': style?.layout?.fit === 'content', 'image': style?.layout?.fit === 'screen'}\" [class]=\"data?.id+(content?.image?.id || '')\"\r\n [src]=\"content?.image?.url\" [ngStyle]=\"{'opacity': (canMergeNavbar ? '0' : getBackgroundOpacity)}\" [alt]=\"content?.image?.altText\" [simpoCorner]=\"style?.corners\" [simpoObjectPosition]=\"content?.image?.position\"\r\n [id]=\"data?.id\"\r\n loading=\"lazy\" />\r\n \r\n </div>\r\n <div *ngIf=\"style?.showText\" class=\"col-lg-9 d-flex flex-column\" style=\"position: absolute;\" [simpoPositionLayoutDirective]=\"style?.positionLayout\" [simpoContentAlignment]=\"style?.contentAlignment\" [id]=\"data?.id\">\r\n <div *ngFor=\"let item of content?.inputText\">\r\n <div [innerHTML]=\"item.value\" [ngClass]=\"item.label === 'Heading' ? 'heading-large lh-2 mb-3' : 'body-large'\"></div>\r\n </div>\r\n <div *ngIf=\"data?.action && data?.action?.display\" class=\"button-display\">\r\n <div *ngFor=\"let button of data?.action?.buttons\">\r\n <app-button-element [buttonContent]=\"button.content\" [buttonStyle]=\"button.styles\" [sectionId]=\"data?.id\" [buttonId]=\"button.id\" [color]=\"data?.styles?.background?.accentColor\"></app-button-element>\r\n </div>\r\n </div>\r\n </div> \r\n \r\n\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div [ngClass]=\"{'hover_effect': edit}\" *ngIf=\"showEditors\">\r\n <simpo-hover-elements [data]=\"data\" [index]=\"index\" [editOptions]=\"edit\" [isMerged]=\"style?.merge ?? false\"></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>\r\n", styles: [".image{width:100%}.main-section{width:100%;height:100%!important;display:block!important}.img-text-card{display:flex;align-items:center;justify-content:center}.h-80{width:100%;height:80vh}.mb-1{margin-bottom:1.5rem!important}.mergeNavbar{margin-top:-175px}.total-container{height:auto;position:relative}.hover_effect{position:absolute;width:100%;top:0;left:0;height:100%}.image-section img{object-fit:cover}.text-content-card{justify-content:center;align-items:center}@media screen and (min-width: 760px){.cards{padding-bottom:24px}}@media only screen and (max-width: 475px){.h-80{height:15rem;border-radius:1rem}.main-section{min-height:auto!important}}\n"] }]
|
2720
2740
|
}], ctorParameters: () => [{ type: EventsService }], propDecorators: { data: [{
|
2721
2741
|
type: Input
|
2722
2742
|
}], index: [{
|
@@ -6387,6 +6407,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImpor
|
|
6387
6407
|
type: Input
|
6388
6408
|
}] } });
|
6389
6409
|
|
6410
|
+
class ImageLoadingComponent {
|
6411
|
+
constructor(renderer) {
|
6412
|
+
this.renderer = renderer;
|
6413
|
+
this.hash = null;
|
6414
|
+
}
|
6415
|
+
ngOnInit() {
|
6416
|
+
this.renderer.setStyle(this.image, "display", "none");
|
6417
|
+
}
|
6418
|
+
ngAfterViewInit() {
|
6419
|
+
if (this.hash && this.canvas && this.image) {
|
6420
|
+
if (isBlurhashValid(this.hash).result) {
|
6421
|
+
const pixels = decode(this.hash, 300, 300);
|
6422
|
+
const ctx = this.canvas.nativeElement.getContext("2d");
|
6423
|
+
if (ctx) {
|
6424
|
+
const imageData = ctx.createImageData(300, 300);
|
6425
|
+
imageData.data.set(pixels);
|
6426
|
+
ctx.putImageData(imageData, 0, 0);
|
6427
|
+
}
|
6428
|
+
}
|
6429
|
+
this.image.addEventListener("load", () => this.onImageLoad());
|
6430
|
+
}
|
6431
|
+
}
|
6432
|
+
ngOnDestroy() {
|
6433
|
+
if (this.image) {
|
6434
|
+
this.image.removeEventListener("load", this.onImageLoad);
|
6435
|
+
}
|
6436
|
+
}
|
6437
|
+
onImageLoad() {
|
6438
|
+
this.renderer.setStyle(this.image, 'display', 'block');
|
6439
|
+
this.renderer.setStyle(this.canvas?.nativeElement, 'display', 'none');
|
6440
|
+
}
|
6441
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: ImageLoadingComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
6442
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.4", type: ImageLoadingComponent, isStandalone: true, selector: "image-loading", inputs: { hash: "hash", image: "image" }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true }], ngImport: i0, template: "<canvas #canvas class=\"mask\"></canvas>", styles: [".mask{height:100%;width:100%}\n"] }); }
|
6443
|
+
}
|
6444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: ImageLoadingComponent, decorators: [{
|
6445
|
+
type: Component,
|
6446
|
+
args: [{ selector: "image-loading", standalone: true, template: "<canvas #canvas class=\"mask\"></canvas>", styles: [".mask{height:100%;width:100%}\n"] }]
|
6447
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { hash: [{
|
6448
|
+
type: Input
|
6449
|
+
}], image: [{
|
6450
|
+
type: Input
|
6451
|
+
}], canvas: [{
|
6452
|
+
type: ViewChild,
|
6453
|
+
args: ["canvas"]
|
6454
|
+
}] } });
|
6455
|
+
|
6390
6456
|
class SmallProductListingComponent {
|
6391
6457
|
constructor(cartService, router) {
|
6392
6458
|
this.cartService = cartService;
|
@@ -6467,15 +6533,16 @@ class SmallProductListingComponent {
|
|
6467
6533
|
return BUSINESS_CONSTANTS.CURRENCY;
|
6468
6534
|
}
|
6469
6535
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SmallProductListingComponent, deps: [{ token: CartService }, { token: i2$3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
6470
|
-
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", isScrollable: "isScrollable", isCategoryProductList: "isCategoryProductList", customClass: "customClass" }, ngImport: i0, template: "<div class=\"product\" [ngClass]=\"{'width' : isScrollable, 'adjustHeightWidth': isCategoryProductList}\" [style.opacity]=\"product?.itemInventory?.openingStock == 0 ? 0.5 : 1\" (click)=\"goToProductDetail(product)\" [attr.style]=\"customClass\">\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\" [simpoColor]=\"data?.styles?.background?.color\"\r\n *ngIf=\"getPercentage(product) > '0'\">{{getPercentage(product)}}% off</div>\r\n </div>\r\n <div class=\"p-2 h-40\">\r\n <span class=\"trim-text color\">{{product.name}}</span>\r\n <div class=\"bottom\">\r\n <span class=\"m-1\">\r\n <span class=\"discount-price color\"><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\"\r\n [style.borderColor]=\"data.styles?.background?.accentColor\"\r\n [ngClass]=\"{'justify-content-between p-0 d-flex': product.quantity, 'justify-content-center': !product.quantity}\" (click)=\"removeDefault($event)\">\r\n <ng-container *ngIf=\"product?.itemInventory?.openingStock\">\r\n <ng-container *ngIf=\"!product.quantity\">\r\n <div (click)=\"addItemToCart($event, product, 'ADD')\" [style.color]=\"data.styles?.background?.accentColor\">Add to Cart</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"product.quantity\">\r\n <span class=\"quantity-btn\" (click)=\"addItemToCart($event, product, 'SUBSTRACT')\" [style.backgroundColor]=\"getSupportingColor(data.styles?.background?.accentColor)\" [style.color]=\"data.styles?.background?.accentColor\">-</span>\r\n <span class=\"quantity\" [style.color]=\"data.styles?.background?.accentColor\">{{product.quantity}}</span>\r\n <span class=\"quantity-btn\" (click)=\"addItemToCart($event, product, 'ADD')\" [style.backgroundColor]=\"getSupportingColor(data.styles?.background?.accentColor)\" [style.color]=\"data.styles?.background?.accentColor\">+</span>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!product?.itemInventory?.openingStock\">\r\n <span class=\"d-flex align-items-center justify-content-center w-100\">\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>\r\n</div>\r\n\r\n<!-- <ng-template #loadingScreen>\r\n <ngx-skeleton-loader *ngIf=\"filterLoading\" count=\"1\" appearance=\"circle\" [theme]=\"{\r\n width: '100%',\r\n height: '100%',\r\n 'border-radius': '10px',\r\n 'position': 'relative',\r\n 'right': '5px'\r\n }\" />\r\n</ng-template> -->\r\n", styles: [".product{position:relative;display:flex;flex-direction:column;cursor:pointer;margin-bottom:10px;border-radius:10px;overflow:hidden;height:350px;background-color:#fff}.product .prod-img{position:relative;height:55%;width:100%;overflow:hidden;border:1.8px solid;border-radius:10px;border-color:#e5e7eb}.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}.width{margin-right:10px;min-width:195px;max-width:195px}.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 transparent;border-radius:5px;padding:5px;text-align:center;align-items:center}.add-to-cart .quantity-btn{padding:5px 10px;font-weight:700}.discount{position:absolute;top:0;padding:5px;width:60px;text-align:center;font-size:12px;border-bottom-right-radius:3px}@media screen and (max-width: 475px){.width{max-width:160px;min-width:160px;height:300px}.adjustHeightWidth{max-width:100%;min-width:100%}}@-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)}}.h-40{height:45%;position:relative}.bottom{position:absolute;bottom:10px;width:93%;display:flex;flex-direction:column}.discount-price{font-weight:600;font-size:14px}.color{color:#000}\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"] }, { kind: "directive", type: ColorDirective, selector: "[simpoColor]", inputs: ["simpoColor"] }] }); }
|
6536
|
+
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", isScrollable: "isScrollable", isCategoryProductList: "isCategoryProductList", customClass: "customClass" }, ngImport: i0, template: "<div class=\"product\" [ngClass]=\"{'width' : isScrollable, 'adjustHeightWidth': isCategoryProductList}\" [style.opacity]=\"product?.itemInventory?.openingStock == 0 ? 0.5 : 1\" (click)=\"goToProductDetail(product)\" [attr.style]=\"customClass\">\r\n <div class=\"prod-img\">\r\n <img [src]=\"product.itemImages?.[0]?.imgUrl\" alt=\"\" #productImage>\r\n <image-loading [image]=\"productImage\" [hash]=\"product.itemImages?.[0]?.blurhash\"></image-loading>\r\n <div class=\"discount\" [style.backgroundColor]=\"data?.styles?.background?.color\" [simpoColor]=\"data?.styles?.background?.color\"\r\n *ngIf=\"getPercentage(product) > '0'\">{{getPercentage(product)}}% off</div>\r\n </div>\r\n <div class=\"p-2 h-40\">\r\n <span class=\"trim-text color\">{{product.name}}</span>\r\n <div class=\"bottom\">\r\n <span class=\"m-1\">\r\n <span class=\"discount-price color\"><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\"\r\n [style.borderColor]=\"data.styles?.background?.accentColor\"\r\n [ngClass]=\"{'justify-content-between p-0 d-flex': product.quantity, 'justify-content-center': !product.quantity}\" (click)=\"removeDefault($event)\">\r\n <ng-container *ngIf=\"product?.itemInventory?.openingStock\">\r\n <ng-container *ngIf=\"!product.quantity\">\r\n <div (click)=\"addItemToCart($event, product, 'ADD')\" [style.color]=\"data.styles?.background?.accentColor\">Add to Cart</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"product.quantity\">\r\n <span class=\"quantity-btn\" (click)=\"addItemToCart($event, product, 'SUBSTRACT')\" [style.backgroundColor]=\"getSupportingColor(data.styles?.background?.accentColor)\" [style.color]=\"data.styles?.background?.accentColor\">-</span>\r\n <span class=\"quantity\" [style.color]=\"data.styles?.background?.accentColor\">{{product.quantity}}</span>\r\n <span class=\"quantity-btn\" (click)=\"addItemToCart($event, product, 'ADD')\" [style.backgroundColor]=\"getSupportingColor(data.styles?.background?.accentColor)\" [style.color]=\"data.styles?.background?.accentColor\">+</span>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!product?.itemInventory?.openingStock\">\r\n <span class=\"d-flex align-items-center justify-content-center w-100\">\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>\r\n</div>\r\n\r\n<!-- <ng-template #loadingScreen>\r\n <ngx-skeleton-loader *ngIf=\"filterLoading\" count=\"1\" appearance=\"circle\" [theme]=\"{\r\n width: '100%',\r\n height: '100%',\r\n 'border-radius': '10px',\r\n 'position': 'relative',\r\n 'right': '5px'\r\n }\" />\r\n</ng-template> -->\r\n", styles: [".product{position:relative;display:flex;flex-direction:column;cursor:pointer;margin-bottom:10px;border-radius:10px;overflow:hidden;height:350px;background-color:#fff}.product .prod-img{position:relative;height:55%;width:100%;overflow:hidden;border:1.8px solid;border-radius:10px;border-color:#e5e7eb}.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}.width{margin-right:10px;min-width:195px;max-width:195px}.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 transparent;border-radius:5px;padding:5px;text-align:center;align-items:center}.add-to-cart .quantity-btn{padding:5px 10px;font-weight:700}.discount{position:absolute;top:0;padding:5px;width:60px;text-align:center;font-size:12px;border-bottom-right-radius:3px}@media screen and (max-width: 475px){.width{max-width:160px;min-width:160px;height:300px}.adjustHeightWidth{max-width:100%;min-width:100%}}@-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)}}.h-40{height:45%;position:relative}.bottom{position:absolute;bottom:10px;width:93%;display:flex;flex-direction:column}.discount-price{font-weight:600;font-size:14px}.color{color:#000}\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"] }, { kind: "component", type: ImageLoadingComponent, selector: "image-loading", inputs: ["hash", "image"] }, { kind: "directive", type: ColorDirective, selector: "[simpoColor]", inputs: ["simpoColor"] }] }); }
|
6471
6537
|
}
|
6472
6538
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SmallProductListingComponent, decorators: [{
|
6473
6539
|
type: Component,
|
6474
6540
|
args: [{ selector: 'simpo-small-product-listing', standalone: true, imports: [
|
6475
6541
|
CommonModule,
|
6476
6542
|
MatIcon,
|
6543
|
+
ImageLoadingComponent,
|
6477
6544
|
ColorDirective
|
6478
|
-
], template: "<div class=\"product\" [ngClass]=\"{'width' : isScrollable, 'adjustHeightWidth': isCategoryProductList}\" [style.opacity]=\"product?.itemInventory?.openingStock == 0 ? 0.5 : 1\" (click)=\"goToProductDetail(product)\" [attr.style]=\"customClass\">\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\" [simpoColor]=\"data?.styles?.background?.color\"\r\n *ngIf=\"getPercentage(product) > '0'\">{{getPercentage(product)}}% off</div>\r\n </div>\r\n <div class=\"p-2 h-40\">\r\n <span class=\"trim-text color\">{{product.name}}</span>\r\n <div class=\"bottom\">\r\n <span class=\"m-1\">\r\n <span class=\"discount-price color\"><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\"\r\n [style.borderColor]=\"data.styles?.background?.accentColor\"\r\n [ngClass]=\"{'justify-content-between p-0 d-flex': product.quantity, 'justify-content-center': !product.quantity}\" (click)=\"removeDefault($event)\">\r\n <ng-container *ngIf=\"product?.itemInventory?.openingStock\">\r\n <ng-container *ngIf=\"!product.quantity\">\r\n <div (click)=\"addItemToCart($event, product, 'ADD')\" [style.color]=\"data.styles?.background?.accentColor\">Add to Cart</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"product.quantity\">\r\n <span class=\"quantity-btn\" (click)=\"addItemToCart($event, product, 'SUBSTRACT')\" [style.backgroundColor]=\"getSupportingColor(data.styles?.background?.accentColor)\" [style.color]=\"data.styles?.background?.accentColor\">-</span>\r\n <span class=\"quantity\" [style.color]=\"data.styles?.background?.accentColor\">{{product.quantity}}</span>\r\n <span class=\"quantity-btn\" (click)=\"addItemToCart($event, product, 'ADD')\" [style.backgroundColor]=\"getSupportingColor(data.styles?.background?.accentColor)\" [style.color]=\"data.styles?.background?.accentColor\">+</span>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!product?.itemInventory?.openingStock\">\r\n <span class=\"d-flex align-items-center justify-content-center w-100\">\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>\r\n</div>\r\n\r\n<!-- <ng-template #loadingScreen>\r\n <ngx-skeleton-loader *ngIf=\"filterLoading\" count=\"1\" appearance=\"circle\" [theme]=\"{\r\n width: '100%',\r\n height: '100%',\r\n 'border-radius': '10px',\r\n 'position': 'relative',\r\n 'right': '5px'\r\n }\" />\r\n</ng-template> -->\r\n", styles: [".product{position:relative;display:flex;flex-direction:column;cursor:pointer;margin-bottom:10px;border-radius:10px;overflow:hidden;height:350px;background-color:#fff}.product .prod-img{position:relative;height:55%;width:100%;overflow:hidden;border:1.8px solid;border-radius:10px;border-color:#e5e7eb}.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}.width{margin-right:10px;min-width:195px;max-width:195px}.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 transparent;border-radius:5px;padding:5px;text-align:center;align-items:center}.add-to-cart .quantity-btn{padding:5px 10px;font-weight:700}.discount{position:absolute;top:0;padding:5px;width:60px;text-align:center;font-size:12px;border-bottom-right-radius:3px}@media screen and (max-width: 475px){.width{max-width:160px;min-width:160px;height:300px}.adjustHeightWidth{max-width:100%;min-width:100%}}@-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)}}.h-40{height:45%;position:relative}.bottom{position:absolute;bottom:10px;width:93%;display:flex;flex-direction:column}.discount-price{font-weight:600;font-size:14px}.color{color:#000}\n"] }]
|
6545
|
+
], template: "<div class=\"product\" [ngClass]=\"{'width' : isScrollable, 'adjustHeightWidth': isCategoryProductList}\" [style.opacity]=\"product?.itemInventory?.openingStock == 0 ? 0.5 : 1\" (click)=\"goToProductDetail(product)\" [attr.style]=\"customClass\">\r\n <div class=\"prod-img\">\r\n <img [src]=\"product.itemImages?.[0]?.imgUrl\" alt=\"\" #productImage>\r\n <image-loading [image]=\"productImage\" [hash]=\"product.itemImages?.[0]?.blurhash\"></image-loading>\r\n <div class=\"discount\" [style.backgroundColor]=\"data?.styles?.background?.color\" [simpoColor]=\"data?.styles?.background?.color\"\r\n *ngIf=\"getPercentage(product) > '0'\">{{getPercentage(product)}}% off</div>\r\n </div>\r\n <div class=\"p-2 h-40\">\r\n <span class=\"trim-text color\">{{product.name}}</span>\r\n <div class=\"bottom\">\r\n <span class=\"m-1\">\r\n <span class=\"discount-price color\"><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\"\r\n [style.borderColor]=\"data.styles?.background?.accentColor\"\r\n [ngClass]=\"{'justify-content-between p-0 d-flex': product.quantity, 'justify-content-center': !product.quantity}\" (click)=\"removeDefault($event)\">\r\n <ng-container *ngIf=\"product?.itemInventory?.openingStock\">\r\n <ng-container *ngIf=\"!product.quantity\">\r\n <div (click)=\"addItemToCart($event, product, 'ADD')\" [style.color]=\"data.styles?.background?.accentColor\">Add to Cart</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"product.quantity\">\r\n <span class=\"quantity-btn\" (click)=\"addItemToCart($event, product, 'SUBSTRACT')\" [style.backgroundColor]=\"getSupportingColor(data.styles?.background?.accentColor)\" [style.color]=\"data.styles?.background?.accentColor\">-</span>\r\n <span class=\"quantity\" [style.color]=\"data.styles?.background?.accentColor\">{{product.quantity}}</span>\r\n <span class=\"quantity-btn\" (click)=\"addItemToCart($event, product, 'ADD')\" [style.backgroundColor]=\"getSupportingColor(data.styles?.background?.accentColor)\" [style.color]=\"data.styles?.background?.accentColor\">+</span>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!product?.itemInventory?.openingStock\">\r\n <span class=\"d-flex align-items-center justify-content-center w-100\">\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>\r\n</div>\r\n\r\n<!-- <ng-template #loadingScreen>\r\n <ngx-skeleton-loader *ngIf=\"filterLoading\" count=\"1\" appearance=\"circle\" [theme]=\"{\r\n width: '100%',\r\n height: '100%',\r\n 'border-radius': '10px',\r\n 'position': 'relative',\r\n 'right': '5px'\r\n }\" />\r\n</ng-template> -->\r\n", styles: [".product{position:relative;display:flex;flex-direction:column;cursor:pointer;margin-bottom:10px;border-radius:10px;overflow:hidden;height:350px;background-color:#fff}.product .prod-img{position:relative;height:55%;width:100%;overflow:hidden;border:1.8px solid;border-radius:10px;border-color:#e5e7eb}.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}.width{margin-right:10px;min-width:195px;max-width:195px}.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 transparent;border-radius:5px;padding:5px;text-align:center;align-items:center}.add-to-cart .quantity-btn{padding:5px 10px;font-weight:700}.discount{position:absolute;top:0;padding:5px;width:60px;text-align:center;font-size:12px;border-bottom-right-radius:3px}@media screen and (max-width: 475px){.width{max-width:160px;min-width:160px;height:300px}.adjustHeightWidth{max-width:100%;min-width:100%}}@-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)}}.h-40{height:45%;position:relative}.bottom{position:absolute;bottom:10px;width:93%;display:flex;flex-direction:column}.discount-price{font-weight:600;font-size:14px}.color{color:#000}\n"] }]
|
6479
6546
|
}], ctorParameters: () => [{ type: CartService }, { type: i2$3.Router }], propDecorators: { product: [{
|
6480
6547
|
type: Input
|
6481
6548
|
}], data: [{
|
@@ -9184,8 +9251,20 @@ class FeaturedCollectionComponent extends BaseSection {
|
|
9184
9251
|
categoryId: collection.collectionId
|
9185
9252
|
};
|
9186
9253
|
});
|
9254
|
+
this.content?.collectionIds?.forEach((id, collectionIndex) => {
|
9255
|
+
let index = -1;
|
9256
|
+
this.responseData?.forEach((data, idx) => {
|
9257
|
+
if (data.collectionId == id)
|
9258
|
+
index = idx;
|
9259
|
+
});
|
9260
|
+
this.dropCollection(index, collectionIndex);
|
9261
|
+
});
|
9187
9262
|
});
|
9188
9263
|
}
|
9264
|
+
dropCollection(startIdx, endIdx) {
|
9265
|
+
if (this.responseData)
|
9266
|
+
moveItemInArray(this.responseData, startIdx, endIdx);
|
9267
|
+
}
|
9189
9268
|
redirectToListPage(collection) {
|
9190
9269
|
collection = collection.collectionId;
|
9191
9270
|
this.router.navigate(['/list-category'], { queryParams: { collectionId: collection } });
|