MCPcopy
hub / github.com/DevCloudFE/ng-devui / renderCarouselItem

Method renderCarouselItem

devui/alert/alert.component.ts:73–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71 }
72
73 renderCarouselItem() {
74 this.carouselNum = this.carouselItems.length;
75 if (this.carouselNum > 1) {
76 if (!this.autoplayHeight) {
77 const itemHeights = this.carouselItems.map((item) => {
78 const rect = item?.el.nativeElement.getBoundingClientRect();
79 return rect?.height || 0;
80 });
81 const maxHeight = Math.max(...itemHeights);
82 this.autoplayHeight = maxHeight ? `${maxHeight}px` : this.SINGLE_LINE_HEIGHT;
83 }
84 this.el.nativeElement.style.setProperty('--devui-alert-carousel-item-height', this.autoplayHeight);
85 this.renderer.setStyle(this.box.nativeElement, 'transition', `top ${this.transitionSpeed}ms ease`);
86 this.autoScheduleTransition();
87 }
88 }
89
90 next = (): void => {
91 if (this.currentIndex < this.carouselNum) {

Callers 1

ngAfterViewInitMethod · 0.95

Calls 3

getBoundingClientRectMethod · 0.80
maxMethod · 0.80

Tested by

no test coverage detected