()
| 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) { |
no test coverage detected