UNPKG

primeng

Version:

PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeB

1 lines 66.5 kB
{"version":3,"file":"primeng-carousel.mjs","sources":["../../src/carousel/style/carouselstyle.ts","../../src/carousel/carousel.ts","../../src/carousel/primeng-carousel.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { style } from '@primeuix/styles/carousel';\nimport { BaseStyle } from 'primeng/base';\n\nconst classes = {\n root: ({ instance }) => [\n 'p-carousel p-component',\n {\n 'p-carousel-vertical': instance.isVertical(),\n 'p-carousel-horizontal': !instance.isVertical()\n }\n ],\n header: 'p-carousel-header',\n contentContainer: 'p-carousel-content-container',\n content: 'p-carousel-content',\n pcPrevButton: ({ instance }) => [\n 'p-carousel-prev-button',\n {\n 'p-disabled': instance.isBackwardNavDisabled()\n }\n ],\n viewport: 'p-carousel-viewport',\n itemList: 'p-carousel-item-list',\n itemClone: ({ instance, index }) => [\n 'p-carousel-item p-carousel-item-clone',\n {\n 'p-carousel-item-active': instance.totalShiftedItems * -1 === instance.value.length,\n 'p-carousel-item-start': 0 === index,\n 'p-carousel-item-end': instance.clonedItemsForStarting.length - 1 === index\n }\n ],\n item: ({ instance, index }) => [\n 'p-carousel-item',\n {\n 'p-carousel-item-active': instance.firstIndex() <= index && instance.lastIndex() >= index,\n 'p-carousel-item-start': instance.firstIndex() === index,\n 'p-carousel-item-end': instance.lastIndex() === index\n }\n ],\n pcNextButton: ({ instance }) => [\n 'p-carousel-next-button',\n {\n 'p-disabled': instance.isForwardNavDisabled()\n }\n ],\n indicatorList: ({ instance }) => ['p-carousel-indicator-list', instance.indicatorsContentClass],\n indicator: ({ instance, index }) => [\n 'p-carousel-indicator',\n {\n 'p-carousel-indicator-active': instance._page === index\n }\n ],\n indicatorButton: ({ instance }) => ['p-carousel-indicator-button', instance.indicatorStyleClass],\n footer: 'p-carousel-footer'\n};\n\n@Injectable()\nexport class CarouselStyle extends BaseStyle {\n name = 'carousel';\n\n theme = style;\n\n classes = classes;\n}\n\n/**\n *\n * Carousel is a content slider featuring various customization options.\n *\n * [Live Demo](https://www.primeng.org/carousel/)\n *\n * @module carouselstyle\n *\n */\nexport enum CarouselClasses {\n /**\n * Class name of the root element\n */\n root = 'p-carousel',\n /**\n * Class name of the header element\n */\n header = 'p-carousel-header',\n /**\n * Class name of the content container element\n */\n contentContainer = 'p-carousel-content-container',\n /**\n * Class name of the content element\n */\n content = 'p-carousel-content',\n /**\n * Class name of the previous button element\n */\n pcPrevButton = 'p-carousel-prev-button',\n /**\n * Class name of the viewport element\n */\n viewport = 'p-carousel-viewport',\n /**\n * Class name of the item list element\n */\n itemList = 'p-carousel-item-list',\n /**\n * Class name of the item clone element\n */\n itemClone = 'p-carousel-item-clone',\n /**\n * Class name of the item element\n */\n item = 'p-carousel-item',\n /**\n * Class name of the next button element\n */\n pcNextButton = 'p-carousel-next-button',\n /**\n * Class name of the indicator list element\n */\n indicatorList = 'p-carousel-indicator-list',\n /**\n * Class name of the indicator element\n */\n indicator = 'p-carousel-indicator',\n /**\n * Class name of the indicator button element\n */\n indicatorButton = 'p-carousel-indicator-button',\n /**\n * Class name of the footer element\n */\n footer = 'p-carousel-footer'\n}\n\nexport interface CarouselStyle extends BaseStyle {}\n","import { CommonModule, isPlatformBrowser } from '@angular/common';\nimport {\n AfterContentInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ContentChildren,\n ElementRef,\n EventEmitter,\n inject,\n Input,\n NgModule,\n NgZone,\n numberAttribute,\n Output,\n QueryList,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { find, findSingle, getAttribute, setAttribute, uuid } from '@primeuix/utils';\nimport { Footer, Header, PrimeTemplate, SharedModule } from 'primeng/api';\nimport { BaseComponent } from 'primeng/basecomponent';\nimport { ButtonModule, ButtonProps } from 'primeng/button';\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon } from 'primeng/icons';\nimport { CarouselPageEvent, CarouselResponsiveOptions } from './carousel.interface';\nimport { CarouselStyle } from './style/carouselstyle';\n\n/**\n * Carousel is a content slider featuring various customization options.\n * @group Components\n */\n@Component({\n selector: 'p-carousel',\n standalone: true,\n imports: [CommonModule, ChevronRightIcon, ButtonModule, ChevronLeftIcon, ChevronDownIcon, ChevronUpIcon, SharedModule],\n template: `\n <div [class]=\"cx('header')\" *ngIf=\"headerFacet || headerTemplate\">\n <ng-content select=\"p-header\"></ng-content>\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </div>\n <div [class]=\"contentClass\" [ngClass]=\"cx('contentContainer')\">\n <div [class]=\"cx('content')\" [attr.aria-live]=\"allowAutoplay ? 'polite' : 'off'\">\n <p-button *ngIf=\"showNavigators\" [class]=\"cx('pcPrevButton')\" [attr.aria-label]=\"ariaPrevButtonLabel()\" (click)=\"navBackward($event)\" [text]=\"true\" [buttonProps]=\"prevButtonProps\">\n <ng-template #icon>\n <ng-container *ngIf=\"!previousIconTemplate && !_previousIconTemplate && !prevButtonProps?.icon\">\n <svg data-p-icon=\"chevron-left\" *ngIf=\"!isVertical()\" />\n <svg data-p-icon=\"chevron-up\" *ngIf=\"isVertical()\" />\n </ng-container>\n <ng-container *ngIf=\"(previousIconTemplate || _previousIconTemplate) && !prevButtonProps?.icon\">\n <ng-template *ngTemplateOutlet=\"previousIconTemplate || _previousIconTemplate\"></ng-template>\n </ng-container>\n </ng-template>\n </p-button>\n <div [class]=\"cx('viewport')\" [ngStyle]=\"{ height: isVertical() ? verticalViewPortHeight : 'auto' }\" (touchend)=\"onTouchEnd($event)\" (touchstart)=\"onTouchStart($event)\" (touchmove)=\"onTouchMove($event)\">\n <div #itemsContainer [class]=\"cx('itemList')\" (transitionend)=\"onTransitionEnd()\">\n <div\n *ngFor=\"let item of clonedItemsForStarting; let index = index\"\n [class]=\"cx('itemClone', { index })\"\n [attr.aria-hidden]=\"!(totalShiftedItems * -1 === value.length)\"\n [attr.aria-label]=\"ariaSlideNumber(index)\"\n [attr.aria-roledescription]=\"ariaSlideLabel()\"\n >\n <ng-container *ngTemplateOutlet=\"itemTemplate || _itemTemplate; context: { $implicit: item }\"></ng-container>\n </div>\n <div\n *ngFor=\"let item of value; let index = index\"\n [class]=\"cx('item', { index })\"\n [attr.aria-hidden]=\"!(firstIndex() <= index && lastIndex() >= index)\"\n [attr.aria-label]=\"ariaSlideNumber(index)\"\n [attr.aria-roledescription]=\"ariaSlideLabel()\"\n >\n <ng-container *ngTemplateOutlet=\"itemTemplate || _itemTemplate; context: { $implicit: item }\"></ng-container>\n </div>\n <div *ngFor=\"let item of clonedItemsForFinishing; let index = index\" [class]=\"cx('itemClone', { index })\">\n <ng-container *ngTemplateOutlet=\"itemTemplate || _itemTemplate; context: { $implicit: item }\"></ng-container>\n </div>\n </div>\n </div>\n <p-button type=\"button\" *ngIf=\"showNavigators\" [class]=\"cx('pcNextButton')\" (click)=\"navForward($event)\" [attr.aria-label]=\"ariaNextButtonLabel()\" [buttonProps]=\"nextButtonProps\" [text]=\"true\">\n <ng-template #icon>\n <ng-container *ngIf=\"!nextIconTemplate && !_nextIconTemplate && !nextButtonProps?.icon\">\n <svg data-p-icon=\"chevron-right\" *ngIf=\"!isVertical()\" />\n <svg data-p-icon=\"chevron-down\" *ngIf=\"isVertical()\" />\n </ng-container>\n <span *ngIf=\"nextIconTemplate || (_nextIconTemplate && !nextButtonProps?.icon)\">\n <ng-template *ngTemplateOutlet=\"nextIconTemplate || _nextIconTemplate\"></ng-template>\n </span>\n </ng-template>\n </p-button>\n </div>\n <ul #indicatorContent [class]=\"cx('indicatorList')\" [ngStyle]=\"indicatorsContentStyle\" *ngIf=\"showIndicators\" (keydown)=\"onIndicatorKeydown($event)\">\n <li *ngFor=\"let totalDot of totalDotsArray(); let i = index\" [class]=\"cx('indicator', { index: i })\" [attr.data-pc-section]=\"'indicator'\">\n <button\n type=\"button\"\n [class]=\"cx('indicatorButton')\"\n (click)=\"onDotClick($event, i)\"\n [ngStyle]=\"indicatorStyle\"\n [attr.aria-label]=\"ariaPageLabel(i + 1)\"\n [attr.aria-current]=\"_page === i ? 'page' : undefined\"\n [tabindex]=\"_page === i ? 0 : -1\"\n ></button>\n </li>\n </ul>\n </div>\n <div [class]=\"cx('footer')\" *ngIf=\"footerFacet || footerTemplate || _footerTemplate\">\n <ng-content select=\"p-footer\"></ng-content>\n <ng-container *ngTemplateOutlet=\"footerTemplate || _footerTemplate\"></ng-container>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [CarouselStyle],\n host: {\n '[attr.id]': 'id',\n '[attr.role]': \"'region'\",\n '[class]': \"cn(cx('root'), styleClass)\"\n }\n})\nexport class Carousel extends BaseComponent implements AfterContentInit {\n /**\n * Index of the first item.\n * @defaultValue 0\n * @group Props\n */\n @Input() get page(): number {\n return this._page;\n }\n\n set page(val: number) {\n if (this.isCreated && val !== this._page) {\n if (this.autoplayInterval) {\n this.stopAutoplay();\n }\n\n if (val > this._page && val <= this.totalDots() - 1) {\n this.step(-1, val);\n } else if (val < this._page) {\n this.step(1, val);\n }\n }\n\n this._page = val;\n }\n\n /**\n * Number of items per page.\n * @defaultValue 1\n * @group Props\n */\n @Input() get numVisible(): number {\n return this._numVisible;\n }\n\n set numVisible(val: number) {\n this._numVisible = val;\n }\n\n /**\n * Number of items to scroll.\n * @defaultValue 1\n * @group Props\n */\n @Input() get numScroll(): number {\n return this._numVisible;\n }\n\n set numScroll(val: number) {\n this._numScroll = val;\n }\n\n /**\n * An array of options for responsive design.\n * @see {CarouselResponsiveOptions}\n * @group Props\n */\n @Input() responsiveOptions: CarouselResponsiveOptions[] | undefined;\n /**\n * Specifies the layout of the component.\n * @group Props\n */\n @Input() orientation: 'horizontal' | 'vertical' = 'horizontal';\n /**\n * Height of the viewport in vertical layout.\n * @group Props\n */\n @Input() verticalViewPortHeight: string = '300px';\n /**\n * Style class of main content.\n * @group Props\n */\n @Input() contentClass: string = '';\n /**\n * Style class of the indicator items.\n * @group Props\n */\n @Input() indicatorsContentClass: string = '';\n /**\n * Inline style of the indicator items.\n * @group Props\n */\n @Input() indicatorsContentStyle: { [klass: string]: any } | null | undefined;\n /**\n * Style class of the indicators.\n * @group Props\n */\n @Input() indicatorStyleClass: string = '';\n /**\n * Style of the indicators.\n * @group Props\n */\n @Input() indicatorStyle: { [klass: string]: any } | null | undefined;\n\n /**\n * An array of objects to display.\n * @defaultValue null\n * @group Props\n */\n @Input() get value(): any[] {\n return this._value as any[];\n }\n\n set value(val) {\n this._value = val;\n }\n\n /**\n * Defines if scrolling would be infinite.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) circular: boolean = false;\n /**\n * Whether to display indicator container.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) showIndicators: boolean = true;\n /**\n * Whether to display navigation buttons in container.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) showNavigators: boolean = true;\n /**\n * Time in milliseconds to scroll items automatically.\n * @group Props\n */\n @Input({ transform: numberAttribute }) autoplayInterval: number = 0;\n /**\n * Style class of the viewport container.\n * @deprecated since v20.0.0, use `class` instead.\n * @group Props\n */\n @Input() styleClass: string | undefined;\n /**\n * Used to pass all properties of the ButtonProps to the Button component.\n * @group Props\n */\n @Input() prevButtonProps: ButtonProps = {\n severity: 'secondary',\n text: true,\n rounded: true\n };\n /**\n * Used to pass all properties of the ButtonProps to the Button component.\n * @group Props\n */\n @Input() nextButtonProps: ButtonProps = {\n severity: 'secondary',\n text: true,\n rounded: true\n };\n /**\n * Callback to invoke after scroll.\n * @param {CarouselPageEvent} event - Custom page event.\n * @group Emits\n */\n @Output() onPage: EventEmitter<CarouselPageEvent> = new EventEmitter<CarouselPageEvent>();\n\n @ViewChild('itemsContainer') itemsContainer: ElementRef | undefined;\n\n @ViewChild('indicatorContent') indicatorContent: ElementRef | undefined;\n\n @ContentChild(Header) headerFacet: QueryList<Header> | undefined;\n\n @ContentChild(Footer) footerFacet: QueryList<Footer> | undefined;\n\n _numVisible: number = 1;\n\n _numScroll: number = 1;\n\n _oldNumScroll: number = 0;\n\n prevState: any = {\n numScroll: 0,\n numVisible: 0,\n value: []\n };\n\n defaultNumScroll: number = 1;\n\n defaultNumVisible: number = 1;\n\n _page: number = 0;\n\n _value: any[] | null | undefined;\n\n carouselStyle: any;\n\n id: string | undefined;\n\n totalShiftedItems;\n\n isRemainingItemsAdded: boolean = false;\n\n animationTimeout: any;\n\n translateTimeout: any;\n\n remainingItems: number = 0;\n\n _items: any[] | undefined;\n\n startPos: any;\n\n documentResizeListener: any;\n\n clonedItemsForStarting: any[] | undefined;\n\n clonedItemsForFinishing: any[] | undefined;\n\n allowAutoplay: boolean | undefined;\n\n interval: any;\n\n isCreated: boolean | undefined;\n\n swipeThreshold: number = 20;\n\n /**\n * Template for carousel items.\n * @group Templates\n */\n @ContentChild('item', { descendants: false }) itemTemplate: TemplateRef<any> | undefined;\n\n /**\n * Template for the carousel header.\n * @group Templates\n */\n @ContentChild('header', { descendants: false }) headerTemplate: TemplateRef<any> | undefined;\n\n /**\n * Template for the carousel footer.\n * @group Templates\n */\n @ContentChild('footer', { descendants: false }) footerTemplate: TemplateRef<any> | undefined;\n\n /**\n * Template for the previous button icon.\n * @group Templates\n */\n @ContentChild('previousicon', { descendants: false }) previousIconTemplate: TemplateRef<any> | undefined;\n\n /**\n * Template for the next button icon.\n * @group Templates\n */\n @ContentChild('nexticon', { descendants: false }) nextIconTemplate: TemplateRef<any> | undefined;\n\n _itemTemplate: TemplateRef<any> | undefined;\n\n _headerTemplate: TemplateRef<any> | undefined;\n\n _footerTemplate: TemplateRef<any> | undefined;\n\n _previousIconTemplate: TemplateRef<any> | undefined;\n\n _nextIconTemplate: TemplateRef<any> | undefined;\n\n window: Window;\n\n _componentStyle = inject(CarouselStyle);\n\n constructor(\n public el: ElementRef,\n public zone: NgZone\n ) {\n super();\n this.totalShiftedItems = this.page * this.numScroll * -1;\n this.window = this.document.defaultView as Window;\n }\n\n ngOnChanges(simpleChange: SimpleChanges) {\n if (isPlatformBrowser(this.platformId)) {\n if (simpleChange.value) {\n if (this.circular && this._value) {\n this.setCloneItems();\n }\n }\n\n if (this.isCreated) {\n if (simpleChange.numVisible) {\n if (this.responsiveOptions) {\n this.defaultNumVisible = this.numVisible;\n }\n\n if (this.isCircular()) {\n this.setCloneItems();\n }\n\n this.createStyle();\n this.calculatePosition();\n }\n\n if (simpleChange.numScroll) {\n if (this.responsiveOptions) {\n this.defaultNumScroll = this.numScroll;\n }\n }\n }\n }\n this.cd.markForCheck();\n }\n\n @ContentChildren(PrimeTemplate) templates: QueryList<PrimeTemplate> | undefined;\n\n ngAfterContentInit() {\n this.id = uuid('pn_id_');\n if (isPlatformBrowser(this.platformId)) {\n this.allowAutoplay = !!this.autoplayInterval;\n\n if (this.circular) {\n this.setCloneItems();\n }\n\n if (this.responsiveOptions) {\n this.defaultNumScroll = this._numScroll;\n this.defaultNumVisible = this._numVisible;\n }\n\n this.createStyle();\n this.calculatePosition();\n\n if (this.responsiveOptions) {\n this.bindDocumentListeners();\n }\n }\n\n this.templates?.forEach((item) => {\n switch (item.getType()) {\n case 'item':\n this._itemTemplate = item.template;\n break;\n\n case 'header':\n this._headerTemplate = item.template;\n break;\n\n case 'footer':\n this._footerTemplate = item.template;\n break;\n\n case 'previousicon':\n this._previousIconTemplate = item.template;\n break;\n\n case 'nexticon':\n this._nextIconTemplate = item.template;\n break;\n\n default:\n this._itemTemplate = item.template;\n break;\n }\n });\n\n this.cd.detectChanges();\n }\n\n ngAfterContentChecked() {\n if (isPlatformBrowser(this.platformId)) {\n const isCircular = this.isCircular();\n let totalShiftedItems = this.totalShiftedItems;\n\n if (this.value && this.itemsContainer && (this.prevState.numScroll !== this._numScroll || this.prevState.numVisible !== this._numVisible || this.prevState.value.length !== this.value.length)) {\n if (this.autoplayInterval) {\n this.stopAutoplay(false);\n }\n\n this.remainingItems = (this.value.length - this._numVisible) % this._numScroll;\n\n let page = this._page;\n if (this.totalDots() !== 0 && page >= this.totalDots()) {\n page = this.totalDots() - 1;\n this._page = page;\n this.onPage.emit({\n page: this.page\n });\n }\n\n totalShiftedItems = page * this._numScroll * -1;\n if (isCircular) {\n totalShiftedItems -= this._numVisible;\n }\n\n if (page === this.totalDots() - 1 && this.remainingItems > 0) {\n totalShiftedItems += -1 * this.remainingItems + this._numScroll;\n this.isRemainingItemsAdded = true;\n } else {\n this.isRemainingItemsAdded = false;\n }\n\n if (totalShiftedItems !== this.totalShiftedItems) {\n this.totalShiftedItems = totalShiftedItems;\n }\n\n this._oldNumScroll = this._numScroll;\n this.prevState.numScroll = this._numScroll;\n this.prevState.numVisible = this._numVisible;\n this.prevState.value = [...(this._value as any[])];\n\n if (this.totalDots() > 0 && this.itemsContainer.nativeElement) {\n this.itemsContainer.nativeElement.style.transform = this.isVertical() ? `translate3d(0, ${totalShiftedItems * (100 / this._numVisible)}%, 0)` : `translate3d(${totalShiftedItems * (100 / this._numVisible)}%, 0, 0)`;\n }\n\n this.isCreated = true;\n\n if (this.autoplayInterval && this.isAutoplay()) {\n this.startAutoplay();\n }\n }\n\n if (isCircular) {\n if (this.page === 0) {\n totalShiftedItems = -1 * this._numVisible;\n } else if (totalShiftedItems === 0) {\n totalShiftedItems = -1 * this.value.length;\n if (this.remainingItems > 0) {\n this.isRemainingItemsAdded = true;\n }\n }\n\n if (totalShiftedItems !== this.totalShiftedItems) {\n this.totalShiftedItems = totalShiftedItems;\n }\n }\n }\n }\n\n createStyle() {\n if (!this.carouselStyle) {\n this.carouselStyle = this.renderer.createElement('style');\n this.carouselStyle.type = 'text/css';\n this.renderer.appendChild(this.document.head, this.carouselStyle);\n setAttribute(this.carouselStyle, 'nonce', this.config?.csp()?.nonce);\n }\n\n let innerHTML = `\n #${this.id} .p-carousel-item {\n\t\t\t\tflex: 1 0 ${100 / this.numVisible}%\n\t\t\t}\n `;\n\n if (this.responsiveOptions) {\n this.responsiveOptions.sort((data1, data2) => {\n const value1 = data1.breakpoint;\n const value2 = data2.breakpoint;\n let result = null;\n\n if (value1 == null && value2 != null) result = -1;\n else if (value1 != null && value2 == null) result = 1;\n else if (value1 == null && value2 == null) result = 0;\n else if (typeof value1 === 'string' && typeof value2 === 'string') result = value1.localeCompare(value2, undefined, { numeric: true });\n else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;\n\n return -1 * result;\n });\n\n for (let i = 0; i < this.responsiveOptions.length; i++) {\n let res = this.responsiveOptions[i];\n\n innerHTML += `\n @media screen and (max-width: ${res.breakpoint}) {\n #${this.id} .p-carousel-item {\n flex: 1 0 ${100 / res.numVisible}%\n }\n }\n `;\n }\n }\n\n this.carouselStyle.innerHTML = innerHTML;\n }\n\n calculatePosition() {\n if (this.responsiveOptions) {\n let matchedResponsiveData = {\n numVisible: this.defaultNumVisible,\n numScroll: this.defaultNumScroll\n };\n\n if (typeof window !== 'undefined') {\n let windowWidth = window.innerWidth;\n for (let i = 0; i < this.responsiveOptions.length; i++) {\n let res = this.responsiveOptions[i];\n\n if (parseInt(res.breakpoint, 10) >= windowWidth) {\n matchedResponsiveData = res;\n }\n }\n }\n\n if (this._numScroll !== matchedResponsiveData.numScroll) {\n let page = this._page;\n page = Math.floor((page * this._numScroll) / matchedResponsiveData.numScroll);\n\n let totalShiftedItems = matchedResponsiveData.numScroll * this.page * -1;\n\n if (this.isCircular()) {\n totalShiftedItems -= matchedResponsiveData.numVisible;\n }\n\n this.totalShiftedItems = totalShiftedItems;\n this._numScroll = matchedResponsiveData.numScroll;\n\n this._page = page;\n this.onPage.emit({\n page: this.page\n });\n }\n\n if (this._numVisible !== matchedResponsiveData.numVisible) {\n this._numVisible = matchedResponsiveData.numVisible;\n this.setCloneItems();\n }\n\n this.cd.markForCheck();\n }\n }\n\n setCloneItems() {\n this.clonedItemsForStarting = [];\n this.clonedItemsForFinishing = [];\n if (this.isCircular()) {\n this.clonedItemsForStarting.push(...this.value.slice(-1 * this._numVisible));\n this.clonedItemsForFinishing.push(...this.value.slice(0, this._numVisible));\n }\n }\n\n firstIndex() {\n return this.isCircular() ? -1 * (this.totalShiftedItems + this.numVisible) : this.totalShiftedItems * -1;\n }\n\n lastIndex() {\n return this.firstIndex() + this.numVisible - 1;\n }\n\n totalDots() {\n return this.value?.length ? Math.ceil((this.value.length - this._numVisible) / this._numScroll) + 1 : 0;\n }\n\n totalDotsArray() {\n const totalDots = this.totalDots();\n return totalDots <= 0 ? [] : Array(totalDots).fill(0);\n }\n\n isVertical() {\n return this.orientation === 'vertical';\n }\n\n isCircular() {\n return this.circular && this.value && this.value.length >= this.numVisible;\n }\n\n isAutoplay() {\n return this.autoplayInterval && this.allowAutoplay;\n }\n\n isForwardNavDisabled() {\n return this.isEmpty() || (this._page >= this.totalDots() - 1 && !this.isCircular());\n }\n\n isBackwardNavDisabled() {\n return this.isEmpty() || (this._page <= 0 && !this.isCircular());\n }\n\n isEmpty() {\n return !this.value || this.value.length === 0;\n }\n\n navForward(e: MouseEvent | TouchEvent, index?: number) {\n if (this.isCircular() || this._page < this.totalDots() - 1) {\n this.step(-1, index);\n }\n\n if (this.autoplayInterval) {\n this.stopAutoplay();\n }\n\n if (e && e.cancelable) {\n e.preventDefault();\n }\n }\n\n navBackward(e: MouseEvent | TouchEvent, index?: number) {\n if (this.isCircular() || this._page !== 0) {\n this.step(1, index);\n }\n\n if (this.autoplayInterval) {\n this.stopAutoplay();\n }\n\n if (e && e.cancelable) {\n e.preventDefault();\n }\n }\n\n onDotClick(e: MouseEvent, index: number) {\n let page = this._page;\n\n if (this.autoplayInterval) {\n this.stopAutoplay();\n }\n\n if (index > page) {\n this.navForward(e, index);\n } else if (index < page) {\n this.navBackward(e, index);\n }\n }\n\n onIndicatorKeydown(event: KeyboardEvent) {\n switch (event.code) {\n case 'ArrowRight':\n this.onRightKey();\n break;\n\n case 'ArrowLeft':\n this.onLeftKey();\n break;\n }\n }\n\n onRightKey() {\n const indicators = [...find(this.indicatorContent.nativeElement, '[data-pc-section=\"indicator\"]')];\n const activeIndex = this.findFocusedIndicatorIndex();\n\n this.changedFocusedIndicator(activeIndex, activeIndex + 1 === indicators.length ? indicators.length - 1 : activeIndex + 1);\n }\n\n onLeftKey() {\n const activeIndex = this.findFocusedIndicatorIndex();\n\n this.changedFocusedIndicator(activeIndex, activeIndex - 1 <= 0 ? 0 : activeIndex - 1);\n }\n\n onHomeKey() {\n const activeIndex = this.findFocusedIndicatorIndex();\n\n this.changedFocusedIndicator(activeIndex, 0);\n }\n\n onEndKey() {\n const indicators = [...find(this.indicatorContent.nativeElement, '[data-pc-section=\"indicator\"]r')];\n const activeIndex = this.findFocusedIndicatorIndex();\n\n this.changedFocusedIndicator(activeIndex, indicators.length - 1);\n }\n\n onTabKey() {\n const indicators = <any>[...find(this.indicatorContent.nativeElement, '[data-pc-section=\"indicator\"]')];\n const highlightedIndex = indicators.findIndex((ind) => getAttribute(ind, 'data-p-highlight') === true);\n\n const activeIndicator = <any>findSingle(this.indicatorContent.nativeElement, '[data-pc-section=\"indicator\"] > button[tabindex=\"0\"]');\n const activeIndex = indicators.findIndex((ind) => ind === activeIndicator.parentElement);\n\n indicators[activeIndex].children[0].tabIndex = '-1';\n indicators[highlightedIndex].children[0].tabIndex = '0';\n }\n\n findFocusedIndicatorIndex() {\n const indicators = [...find(this.indicatorContent.nativeElement, '[data-pc-section=\"indicator\"]')];\n const activeIndicator = findSingle(this.indicatorContent.nativeElement, '[data-pc-section=\"indicator\"] > button[tabindex=\"0\"]');\n\n return indicators.findIndex((ind) => ind === activeIndicator.parentElement);\n }\n\n changedFocusedIndicator(prevInd, nextInd) {\n const indicators = <any>[...find(this.indicatorContent.nativeElement, '[data-pc-section=\"indicator\"]')];\n\n indicators[prevInd].children[0].tabIndex = '-1';\n indicators[nextInd].children[0].tabIndex = '0';\n indicators[nextInd].children[0].focus();\n }\n\n step(dir: number, page?: number) {\n let totalShiftedItems = this.totalShiftedItems;\n const isCircular = this.isCircular();\n\n if (page != null) {\n totalShiftedItems = this._numScroll * page * -1;\n\n if (isCircular) {\n totalShiftedItems -= this._numVisible;\n }\n\n this.isRemainingItemsAdded = false;\n } else {\n totalShiftedItems += this._numScroll * dir;\n if (this.isRemainingItemsAdded) {\n totalShiftedItems += this.remainingItems - this._numScroll * dir;\n this.isRemainingItemsAdded = false;\n }\n\n let originalShiftedItems = isCircular ? totalShiftedItems + this._numVisible : totalShiftedItems;\n page = Math.abs(Math.floor(originalShiftedItems / this._numScroll));\n }\n\n if (isCircular && this.page === this.totalDots() - 1 && dir === -1) {\n totalShiftedItems = -1 * (this.value.length + this._numVisible);\n page = 0;\n } else if (isCircular && this.page === 0 && dir === 1) {\n totalShiftedItems = 0;\n page = this.totalDots() - 1;\n } else if (page === this.totalDots() - 1 && this.remainingItems > 0) {\n totalShiftedItems += this.remainingItems * -1 - this._numScroll * dir;\n this.isRemainingItemsAdded = true;\n }\n\n if (this.itemsContainer) {\n this.itemsContainer.nativeElement.style.transform = this.isVertical() ? `translate3d(0, ${totalShiftedItems * (100 / this._numVisible)}%, 0)` : `translate3d(${totalShiftedItems * (100 / this._numVisible)}%, 0, 0)`;\n this.itemsContainer.nativeElement.style.transition = 'transform 500ms ease 0s';\n }\n\n this.totalShiftedItems = totalShiftedItems;\n this._page = page;\n this.onPage.emit({\n page: this.page\n });\n this.cd.markForCheck();\n }\n\n startAutoplay() {\n this.interval = setInterval(() => {\n if (this.totalDots() > 0) {\n if (this.page === this.totalDots() - 1) {\n this.step(-1, 0);\n } else {\n this.step(-1, this.page + 1);\n }\n }\n }, this.autoplayInterval);\n this.allowAutoplay = true;\n this.cd.markForCheck();\n }\n\n stopAutoplay(changeAllow: boolean = true) {\n if (this.interval) {\n clearInterval(this.interval);\n this.interval = undefined;\n if (changeAllow) {\n this.allowAutoplay = false;\n }\n }\n this.cd.markForCheck();\n }\n\n isPlaying(): boolean {\n return !!this.interval;\n }\n\n onTransitionEnd() {\n if (this.itemsContainer) {\n this.itemsContainer.nativeElement.style.transition = '';\n\n if ((this.page === 0 || this.page === this.totalDots() - 1) && this.isCircular()) {\n this.itemsContainer.nativeElement.style.transform = this.isVertical() ? `translate3d(0, ${this.totalShiftedItems * (100 / this._numVisible)}%, 0)` : `translate3d(${this.totalShiftedItems * (100 / this._numVisible)}%, 0, 0)`;\n }\n }\n }\n\n onTouchStart(e: TouchEvent) {\n let touchobj = e.changedTouches[0];\n\n this.startPos = {\n x: touchobj.pageX,\n y: touchobj.pageY\n };\n }\n\n onTouchMove(e: TouchEvent | MouseEvent) {\n if (e.cancelable) {\n e.preventDefault();\n }\n }\n\n onTouchEnd(e: TouchEvent) {\n let touchobj = e.changedTouches[0];\n\n if (this.isVertical()) {\n this.changePageOnTouch(e, touchobj.pageY - this.startPos.y);\n } else {\n this.changePageOnTouch(e, touchobj.pageX - this.startPos.x);\n }\n }\n\n changePageOnTouch(e: TouchEvent | MouseEvent, diff: number) {\n if (Math.abs(diff) > this.swipeThreshold) {\n if (diff < 0) {\n this.navForward(e);\n } else {\n this.navBackward(e);\n }\n }\n }\n\n ariaPrevButtonLabel() {\n return this.config.translation.aria ? this.config.translation.aria.prevPageLabel : undefined;\n }\n\n ariaSlideLabel() {\n return this.config.translation.aria ? this.config.translation.aria.slide : undefined;\n }\n\n ariaNextButtonLabel() {\n return this.config.translation.aria ? this.config.translation.aria.nextPageLabel : undefined;\n }\n\n ariaSlideNumber(value) {\n return this.config.translation.aria ? this.config.translation.aria.slideNumber.replace(/{slideNumber}/g, value) : undefined;\n }\n\n ariaPageLabel(value) {\n return this.config.translation.aria ? this.config.translation.aria.pageLabel.replace(/{page}/g, value) : undefined;\n }\n\n bindDocumentListeners() {\n if (isPlatformBrowser(this.platformId)) {\n if (!this.documentResizeListener) {\n this.documentResizeListener = this.renderer.listen(this.window, 'resize', (event) => {\n this.calculatePosition();\n });\n }\n }\n }\n\n unbindDocumentListeners() {\n if (isPlatformBrowser(this.platformId)) {\n if (this.documentResizeListener) {\n this.documentResizeListener();\n this.documentResizeListener = null;\n }\n }\n }\n\n ngOnDestroy() {\n if (this.responsiveOptions) {\n this.unbindDocumentListeners();\n }\n if (this.autoplayInterval) {\n this.stopAutoplay();\n }\n }\n}\n\n@NgModule({\n imports: [Carousel, SharedModule],\n exports: [Carousel, SharedModule]\n})\nexport class CarouselModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAIA,MAAM,OAAO,GAAG;AACZ,IAAA,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK;QACpB,wBAAwB;AACxB,QAAA;AACI,YAAA,qBAAqB,EAAE,QAAQ,CAAC,UAAU,EAAE;AAC5C,YAAA,uBAAuB,EAAE,CAAC,QAAQ,CAAC,UAAU;AAChD;AACJ,KAAA;AACD,IAAA,MAAM,EAAE,mBAAmB;AAC3B,IAAA,gBAAgB,EAAE,8BAA8B;AAChD,IAAA,OAAO,EAAE,oBAAoB;AAC7B,IAAA,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK;QAC5B,wBAAwB;AACxB,QAAA;AACI,YAAA,YAAY,EAAE,QAAQ,CAAC,qBAAqB;AAC/C;AACJ,KAAA;AACD,IAAA,QAAQ,EAAE,qBAAqB;AAC/B,IAAA,QAAQ,EAAE,sBAAsB;IAChC,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK;QAChC,uCAAuC;AACvC,QAAA;AACI,YAAA,wBAAwB,EAAE,QAAQ,CAAC,iBAAiB,GAAG,CAAC,CAAC,KAAK,QAAQ,CAAC,KAAK,CAAC,MAAM;YACnF,uBAAuB,EAAE,CAAC,KAAK,KAAK;YACpC,qBAAqB,EAAE,QAAQ,CAAC,sBAAsB,CAAC,MAAM,GAAG,CAAC,KAAK;AACzE;AACJ,KAAA;IACD,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK;QAC3B,iBAAiB;AACjB,QAAA;AACI,YAAA,wBAAwB,EAAE,QAA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