keevo-components 1.8.94 → 1.8.95
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.
|
@@ -1,95 +1,27 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "
|
|
4
|
-
import * as i2 from "primeng/
|
|
5
|
-
import * as i3 from "primeng/carousel";
|
|
6
|
-
import * as i4 from "primeng/skeleton";
|
|
3
|
+
import * as i1 from "primeng/api";
|
|
4
|
+
import * as i2 from "primeng/carousel";
|
|
7
5
|
export class KvCarouselComponent {
|
|
8
6
|
constructor() {
|
|
9
7
|
this.carouselData = [];
|
|
10
|
-
this.exibirCarousel = false;
|
|
11
|
-
}
|
|
12
|
-
ngOnInit() {
|
|
13
|
-
this.tamanhoTela = window.innerWidth;
|
|
14
|
-
this.listarCarousel();
|
|
15
|
-
this.ImageSizeTake();
|
|
16
|
-
}
|
|
17
|
-
onWindowResize() {
|
|
18
|
-
this.tamanhoTela = window.innerWidth;
|
|
19
|
-
this.ImageSizeTake();
|
|
20
8
|
}
|
|
21
9
|
navigateToLink(link) {
|
|
22
10
|
window.open(link, '_blank');
|
|
23
11
|
}
|
|
24
|
-
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (isNaN(imageWidth))
|
|
30
|
-
imageWidth = imageWidthskeleton;
|
|
31
|
-
if (this.tamanhoTela < 1200)
|
|
32
|
-
this.imageHeight = `${imageWidth / 3}px`;
|
|
33
|
-
else
|
|
34
|
-
this.imageHeight = '200px';
|
|
35
|
-
}
|
|
36
|
-
listarCarousel() {
|
|
37
|
-
this.validarCarousel(this.carouselData);
|
|
38
|
-
this.ImageSizeTake();
|
|
39
|
-
this.exibirCarousel = true;
|
|
40
|
-
// this.bannerServico.Selecionar(this.usuarioLogadoServico.GetUsuarioLogado().codCliente).subscribe({
|
|
41
|
-
// next: (res: any) => {
|
|
42
|
-
// this.validarCarousel(res);
|
|
43
|
-
// },
|
|
44
|
-
// error: (error) => {},
|
|
45
|
-
// complete: () => {
|
|
46
|
-
// this.ImageSizeTake();
|
|
47
|
-
// this.exibirCarousel = true;
|
|
48
|
-
// }
|
|
49
|
-
// })
|
|
50
|
-
}
|
|
51
|
-
validarCarousel(res) {
|
|
52
|
-
const isValidBanner = (banner, dataExpiracao) => {
|
|
53
|
-
return banner != null && (new Date(dataExpiracao) > new Date() || dataExpiracao == null);
|
|
54
|
-
};
|
|
55
|
-
const getObjectUrl = (base64content) => {
|
|
56
|
-
return URL.createObjectURL(getBlobFrom(base64content));
|
|
57
|
-
};
|
|
58
|
-
const getBlobFrom = (base64content) => {
|
|
59
|
-
const binary = atob(base64content);
|
|
60
|
-
const bytenumbers = new Uint8Array(binary.length);
|
|
61
|
-
for (let i = 0; i < binary.length; i++) {
|
|
62
|
-
bytenumbers[i] = binary.charCodeAt(i);
|
|
63
|
-
}
|
|
64
|
-
return new Blob([bytenumbers]);
|
|
65
|
-
};
|
|
66
|
-
let bannersValidos = [
|
|
67
|
-
{ banner: res?.arquivobanner1, dataExpiracao: res?.dataexpiracaobanner1 },
|
|
68
|
-
{ banner: res?.arquivobanner2, dataExpiracao: res?.dataexpiracaobanner2 },
|
|
69
|
-
{ banner: res?.arquivobanner3, dataExpiracao: res?.dataexpiracaobanner3 },
|
|
70
|
-
{ banner: res?.arquivobanner4, dataExpiracao: res?.dataexpiracaobanner4 }
|
|
71
|
-
];
|
|
72
|
-
bannersValidos.forEach((bannerInfo) => {
|
|
73
|
-
if (isValidBanner(bannerInfo.banner, bannerInfo.dataExpiracao)) {
|
|
74
|
-
let img = { img: getObjectUrl(bannerInfo.banner) };
|
|
75
|
-
this.carouselData.push(img);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
// let imgfixa: any = { img: 'https://work-assets.keevo.com.br/img/keex/banner_fixo_KeeX.png' };
|
|
79
|
-
// this.carouselData.unshift(imgfixa);
|
|
12
|
+
getCarouselHeight() {
|
|
13
|
+
let divCarouselHeight = document.getElementById('carousel')?.offsetHeight;
|
|
14
|
+
console.log(divCarouselHeight, 'divCarouselHeight');
|
|
15
|
+
if (divCarouselHeight)
|
|
16
|
+
this.heightCarousel = divCarouselHeight;
|
|
80
17
|
}
|
|
81
18
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvCarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
82
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: KvCarouselComponent, selector: "kv-carousel", inputs: { carouselData: "carouselData"
|
|
19
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: KvCarouselComponent, selector: "kv-carousel", inputs: { carouselData: "carouselData" }, ngImport: i0, template: "<p-carousel id=\"carousel\" [value]=\"carouselData\" [indicatorStyleClass]=\"'carousel-indicator'\" [autoplayInterval]=\"5000\" \r\n [showIndicators]=\"true\" [showNavigators]=\"false\" [numVisible]=\"1\" [numScroll]=\"1\" [circular]=\"true\" styleClass=\"h-full\">\r\n>\r\n <ng-template pTemplate=\"item\" let-banner class=\"justify-content-center align-items-center \">\r\n <img [src]=\"banner.img\" class=\"w-full border-round\" [style.height.px]=\"heightCarousel\"\r\n (click)=\"navigateToLink(banner.link)\">\r\n </ng-template>\r\n</p-carousel>\r\n\r\n{{getCarouselHeight()}}", styles: ["::ng-deep .p-carousel-indicators{position:absolute;left:50%;transform:translate(-50%);bottom:-1rem}::ng-deep .carousel-indicator{width:15px!important;height:4px!important;margin:-3px!important;padding:0!important;background-color:#eeeeeed0}::ng-deep .carousel-indicator:hover{background-color:#efefef}button.p-carousel-indicator.p-link{background-color:#f0f8ff!important}::ng-deep .p-carousel .p-carousel-content{overflow:hidden!important;position:relative}::ng-deep .border-round{border-radius:20px!important}\n"], dependencies: [{ kind: "directive", type: i1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i2.Carousel, selector: "p-carousel", inputs: ["page", "numVisible", "numScroll", "responsiveOptions", "orientation", "verticalViewPortHeight", "contentClass", "indicatorsContentClass", "indicatorsContentStyle", "indicatorStyleClass", "indicatorStyle", "value", "circular", "showIndicators", "showNavigators", "autoplayInterval", "style", "styleClass"], outputs: ["onPage"] }] }); }
|
|
83
20
|
}
|
|
84
21
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvCarouselComponent, decorators: [{
|
|
85
22
|
type: Component,
|
|
86
|
-
args: [{ selector: 'kv-carousel', template: "<p-carousel\
|
|
23
|
+
args: [{ selector: 'kv-carousel', template: "<p-carousel id=\"carousel\" [value]=\"carouselData\" [indicatorStyleClass]=\"'carousel-indicator'\" [autoplayInterval]=\"5000\" \r\n [showIndicators]=\"true\" [showNavigators]=\"false\" [numVisible]=\"1\" [numScroll]=\"1\" [circular]=\"true\" styleClass=\"h-full\">\r\n>\r\n <ng-template pTemplate=\"item\" let-banner class=\"justify-content-center align-items-center \">\r\n <img [src]=\"banner.img\" class=\"w-full border-round\" [style.height.px]=\"heightCarousel\"\r\n (click)=\"navigateToLink(banner.link)\">\r\n </ng-template>\r\n</p-carousel>\r\n\r\n{{getCarouselHeight()}}", styles: ["::ng-deep .p-carousel-indicators{position:absolute;left:50%;transform:translate(-50%);bottom:-1rem}::ng-deep .carousel-indicator{width:15px!important;height:4px!important;margin:-3px!important;padding:0!important;background-color:#eeeeeed0}::ng-deep .carousel-indicator:hover{background-color:#efefef}button.p-carousel-indicator.p-link{background-color:#f0f8ff!important}::ng-deep .p-carousel .p-carousel-content{overflow:hidden!important;position:relative}::ng-deep .border-round{border-radius:20px!important}\n"] }]
|
|
87
24
|
}], ctorParameters: () => [], propDecorators: { carouselData: [{
|
|
88
25
|
type: Input
|
|
89
|
-
}], exibirCarousel: [{
|
|
90
|
-
type: Input
|
|
91
|
-
}], onWindowResize: [{
|
|
92
|
-
type: HostListener,
|
|
93
|
-
args: ['window:resize', ['$event']]
|
|
94
26
|
}] } });
|
|
95
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia3YtY2Fyb3VzZWwuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMva2Vldm8tY29tcG9uZW50cy9zcmMvbGliL2NvbXBvbmVudHMva3YtY2Fyb3VzZWwva3YtY2Fyb3VzZWwuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMva2Vldm8tY29tcG9uZW50cy9zcmMvbGliL2NvbXBvbmVudHMva3YtY2Fyb3VzZWwva3YtY2Fyb3VzZWwuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBZ0IsS0FBSyxFQUFVLE1BQU0sZUFBZSxDQUFDOzs7O0FBT3ZFLE1BQU0sT0FBTyxtQkFBbUI7SUFJOUI7UUFGUyxpQkFBWSxHQUFVLEVBQUUsQ0FBQztJQUVsQixDQUFDO0lBRWpCLGNBQWMsQ0FBQyxJQUFZO1FBQ3pCLE1BQU0sQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLFFBQVEsQ0FBQyxDQUFDO0lBQzlCLENBQUM7SUFLRCxpQkFBaUI7UUFDZixJQUFJLGlCQUFpQixHQUFHLFFBQVEsQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLEVBQUUsWUFBWSxDQUFDO1FBRTFFLE9BQU8sQ0FBQyxHQUFHLENBQUMsaUJBQWlCLEVBQUUsbUJBQW1CLENBQUMsQ0FBQTtRQUVuRCxJQUFJLGlCQUFpQjtZQU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