{"version":3,"names":["newsCarouselDefaultCss","Spacer","h","style","flex","NewsCarouselDefault","this","_client","NewsClient","slidesPerView","spaceBetween","day","month","onCategoriesChange","value","categories","coerceNumberArray","onItemsChange","items","onExcludeCategoriesChange","excludeCategories","onExcludeItemsChange","excludeItems","onItemsConfigChange","itemsConfig","coerceCarouselContainerBreackpoints","onLoopChange","loop","coerceBooleanProperty","onAutoplayChange","autoplay","onDateFormatChange","dateFormat","coerceDateFormatOptions","async","setPrevNextState","page","setPage","getArticles","itemsCount","articles","coerceItemsConfig","split","reduce","acc","curr","containerWidth","Object","assign","values","forEach","config","_a","_b","swiper","_slidesRef","getSwiper","writeTask","prevEnabled","isBeginning","nextEnabled","isEnd","render","cssClassNames","sliderOptions","touchStartForcePreventDefault","breakpoints","breakpointsBase","delay","autoplayDelay","pauseOnMouseEnter","disableOnInteraction","prevBtn","disablePrevNextButtons","class","onClick","slidePrev","title","name","nextBtn","slideNext","pager","disablePager","pagerShape","ref","el","paginationEl","showAllLink","showAllLinkText","headerText","header","headerPosition","positionalRender","push","pagerPosition","prevNextButtonsPosition","showAllLinkPosition","topEmpty","length","bottomEmpty","Host","empty","map","customPaginationElement","options","article","linkProps","ItemLinkProps","tileProps","width","readMoreButton","tileTitleProps","category","categoryNames","categoryCssClassNames","categoryPosition","disableTeaserPicture","src","teaserPictureUrl","datePosition","DateRender","parts","date","created","format","showCategory","contentHeaderIcon","disableTeaserText","truncated","teaserText","readMoreButtonType","readMoreButtonText","shape"],"sources":["./src/components/news/special/news-carousel-default/news-carousel-default.scss?tag=c7-news-carousel-default","./src/components/news/special/news-carousel-default/news-carousel-default.tsx"],"sourcesContent":["c7-news-carousel-default {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n position: relative;\n padding: 1rem;\n\n --pagination-active: var(--c7-500);\n --pagination-inactive: lightgray;\n --prev-next: var(--pagination-inactive);\n\n --c7-news-special-padding-inner: 1rem;\n\n .c7-news-carousel-bottom, .c7-news-carousel-top{\n display: flex;\n align-items: center;\n gap: 1rem;\n min-height: 74px;\n padding: 0 var(--c7-news-special-padding-inner);\n\n &.empty {\n display: none;\n }\n\n }\n\n .c7-news-carousel-center {\n display: flex;\n min-width: 0;\n\n .c7-news-carousel-left, .c7-news-carousel-right {\n display: flex;\n align-items: center;\n\n &:empty {\n display: none;\n }\n }\n\n > .c7-news-carousel-main {\n min-width: 0;\n flex: 1 1 auto;\n overflow: hidden;\n padding: var(--c7-news-special-padding-inner);\n }\n }\n\n .c7-news-carousel-header {\n font-size: 2rem;\n color: var(--c7-500);\n margin: .5rem 0;\n }\n\n .swiper-pagination {\n height: 74px;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: .5rem;\n position: relative;\n width: fit-content !important;\n bottom: unset !important;\n\n .swiper-pagination-bullet {\n cursor: pointer;\n background: var(--pagination-inactive);\n }\n\n .swiper-pagination-bullet-active{\n background: var(--pagination-active);\n }\n\n &.bullet-style-capsule {\n .swiper-pagination-bullet {\n width: 30px;\n height: 5px;\n border-radius: 100px;\n }\n }\n\n &.bullet-style-circle {\n .swiper-pagination-bullet {\n width: 13px;\n height: 13px;\n border-radius: 50%;\n }\n }\n }\n\n .c7-carousel-navigation {\n width: 44px;\n height: 44px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n padding: 0;\n color: var(--prev-next);\n\n &:not([disabled]) {\n cursor: pointer;\n }\n\n > ion-icon {\n width: 36px;\n height: 36px;\n pointer-events: none;\n }\n }\n\n .c7-carousel-navigation-wrapper {\n display: flex;\n align-items: center;\n }\n\n\n\n c7-tile {\n height: 100%;\n\n .date-above-content, .header-icon {\n font-size: calc(var(--font-size) * 0.9);\n opacity: 0.54;\n margin-bottom: -.5rem;\n }\n\n .c7-button {\n margin-top: auto;\n\n &.button-text {\n --c7-button-width: 100%;\n }\n\n &.button-text-box {\n --c7-button-width: 50%;\n }\n }\n\n .c7-tile-img-wrapper {\n position: relative;\n\n .c7-category {\n line-height: 2;\n padding: 0 1rem;\n position: absolute;\n max-width: 100%;\n min-width: 45%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n background-color: var(--c7-500, #e6e6e6);\n color: var(--c7-500-contrast, #000000);\n\n &.bottom-left {\n bottom: 0;\n left: 0;\n }\n\n &.bottom-right {\n bottom: 0;\n right: 0;\n }\n\n &.top-left {\n top: 0;\n left: 0;\n }\n\n &.top-right {\n top: 0;\n right: 0;\n }\n }\n\n .c7-tile-img-date {\n position: absolute;\n top: 1rem;\n left: 1rem;\n width: 70px;\n height: 70px;\n background-color: var(--c7-500);\n border-radius: 50%;\n\n .c7-date {\n display: flex;\n justify-content: center;\n flex-direction: column;\n text-align: center;\n height: 100%;\n color: var(--c7-500-contrast);\n line-height: 15px;\n }\n }\n }\n\n .c7-tile-more-wrapper {\n &.c7-tile-more-wrapper-plus {\n padding: 24px;\n margin-top: auto;\n\n display: flex;\n justify-content: center;\n\n .c7-button {\n width: 48px;\n height: 48px;\n }\n }\n }\n }\n\n c7-slide.swiper-slide {\n height: auto !important;\n text-align: initial;\n }\n\n}\n","import { Component, Host, h, Prop, State, Watch, writeTask, Listen } from '@stencil/core';\nimport { NewsArticleTeaserDto, NewsClient } from '../../../../api/APIClient';\nimport { setPage } from '../../../../utils/page';\nimport { coerceBooleanProperty, coerceNumberArray } from '../../../../utils/coerce';\nimport { coerceDateFormatOptions, DateRender } from '../../../utility/date/date';\nimport { ItemLinkProps } from '../../../../utils/link';\nimport Swiper, { SwiperOptions } from 'swiper';\nimport { DateSplitRender } from '../../../utility/date/date-split';\nimport { coerceCarouselContainerBreackpoints } from '../../../ui/carousel/carousel.utils';\n\n\nconst Spacer = () => ;\n\n/**\n * @type news\n * @group special\n */\n@Component({\n tag: 'c7-news-carousel-default',\n styleUrl: 'news-carousel-default.scss',\n shadow: false\n})\nexport class NewsCarouselDefault {\n\n @Prop({mutable: true}) page!: number;\n\n @Prop() slug: string;\n\n /**\n * @group categories\n */\n @Prop({mutable: true}) categories: number[] | string = [];\n @Watch('categories')\n onCategoriesChange(value) {\n this.categories = coerceNumberArray(value);\n }\n\n /**\n * @group items\n */\n @Prop({mutable: true}) items: number[] | string = [];\n @Watch('items')\n onItemsChange(value) {\n this.items = coerceNumberArray(value);\n }\n\n /**\n * @group categories\n */\n @Prop({mutable: true}) excludeCategories: number[] | string = [];\n @Watch('excludeCategories')\n onExcludeCategoriesChange(value: number[] | string) {\n this.excludeCategories = coerceNumberArray(value);\n }\n\n /**\n * @group items\n */\n @Prop({mutable: true}) excludeItems: number[] | string = [];\n @Watch('excludeItems')\n onExcludeItemsChange(value: number[] | string) {\n this.excludeItems = coerceNumberArray(value);\n }\n\n /**\n * @group pagination\n */\n @Prop() itemsCount: number = 9;\n\n /**\n * @group pagination\n */\n @Prop() spaceBetween: number = 30;\n\n\n /**\n * @group pagination\n * @type swiperConfig\n */\n @Prop({mutable: true}) itemsConfig: {\n [key: string]: {\n slidesPerView: number,\n spaceBetween: number\n }\n } | any = {\n 360: {\n slidesPerView: 1.5,\n spaceBetween: this.spaceBetween\n },\n 720: {\n slidesPerView: 2.5,\n spaceBetween: this.spaceBetween\n },\n 920: {\n slidesPerView: 3.5,\n spaceBetween: this.spaceBetween\n },\n };\n @Watch('itemsConfig')\n onItemsConfigChange(value: any) {\n const {spaceBetween} = this;\n this.itemsConfig = coerceCarouselContainerBreackpoints(value, {spaceBetween});\n }\n\n /**\n * @group pagination\n */\n @Prop() loop: boolean = false;\n @Watch('loop')\n onLoopChange(value) {\n this.loop = coerceBooleanProperty(value);\n }\n\n /**\n * @group pagination\n */\n @Prop() disablePager: boolean;\n\n /**\n * @group pagination\n */\n @Prop() pagerPosition: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' = 'bottom-left'\n\n /**\n * @group pagination\n */\n @Prop() pagerShape: 'capsule' | 'circle' = 'capsule';\n\n /**\n * @group pagination\n */\n @Prop() disablePrevNextButtons: boolean;\n\n /**\n * @group pagination\n */\n @Prop() prevNextButtonsPosition: 'center' | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' = 'bottom-right';\n\n /**\n * @group pagination\n */\n @Prop() autoplay: boolean = false;\n @Watch('autoplay')\n onAutoplayChange(value) {\n this.autoplay = coerceBooleanProperty(value)\n }\n\n /**\n * @group pagination\n */\n @Prop() autoplayDelay: number = 5000;\n\n /**\n * @group readMore\n */\n @Prop() readMoreButton: boolean;\n\n /**\n * @group readMore\n */\n @Prop() readMoreButtonType: \"text\" | \"text-box\" | \"plus\" = \"text\";\n\n /**\n * @group readMore\n */\n @Prop() readMoreButtonText: string = 'weiterlesen';\n\n /**\n * @group showAll\n */\n @Prop() showAllLink: boolean;\n\n /**\n * @group showAll\n */\n @Prop() showAllLinkText: string = 'Alle anzeigen';\n\n /**\n * @group showAll\n */\n @Prop() showAllLinkPosition: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' = 'top-left';\n\n /**\n * @group content\n */\n @Prop() header: string;\n\n /**\n * @group content\n */\n @Prop() headerPosition: 'top-left' | 'top-center' | 'top-right' = 'top-center';\n\n /**\n * @group content\n */\n @Prop() datePosition: 'in-content' | 'above-content' | 'in-pic' = 'in-content';\n\n /**\n * @group content\n * @type dateFormat\n */\n @Prop() dateFormat: Intl.DateTimeFormatOptions | any = {day: '2-digit', month: 'long'};\n @Watch('dateFormat')\n onDateFormatChange(value) {\n this.dateFormat = coerceDateFormatOptions(value);\n }\n\n /**\n * @group content\n */\n @Prop() showCategory: boolean;\n\n /**\n * @group content\n */\n @Prop() categoryPosition: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' = 'bottom-right';\n\n /**\n * @group content\n */\n @Prop() disableTeaserPicture: boolean;\n\n /**\n * @group content\n */\n @Prop()\n disableTeaserText: boolean;\n\n\n /**\n * @group content\n */\n @Prop() contentHeaderIcon: string;\n\n @State() articles: NewsArticleTeaserDto[] = [];\n\n @State() prevEnabled: boolean = false;\n @State() nextEnabled: boolean = true;\n\n @Listen('c7-slide-did-change')\n async onSlideChange() {\n await this.setPrevNextState();\n }\n\n\n private _client: NewsClient = new NewsClient();\n\n private _slidesRef!: HTMLC7SlidesElement;\n\n private paginationEl!: HTMLElement;\n\n\n async componentWillLoad() {\n if (!this.page) {\n await setPage(this);\n }\n\n this.categories = coerceNumberArray(this.categories);\n this.items = coerceNumberArray(this.items);\n this.excludeCategories = coerceNumberArray(this.excludeCategories);\n this.excludeItems = coerceNumberArray(this.excludeItems);\n this.dateFormat = coerceDateFormatOptions(this.dateFormat);\n\n if (typeof this.itemsConfig === 'string') {\n const {spaceBetween} = this;\n this.itemsConfig = coerceCarouselContainerBreackpoints(this.itemsConfig, {spaceBetween});\n }\n }\n\n async componentDidLoad() {\n const {items} = await this._client.getArticles(this.page, 1, this.itemsCount, this.categories as number[], this.items as number[], this.excludeCategories as number[], this.excludeItems as number[]);\n this.articles = items;\n }\n\n private coerceItemsConfig(value: any) {\n if (typeof value === 'string') {\n value = value.split(',').reduce((acc, curr) => {\n\n const {0:containerWidth, 1: slidesPerView, 2: spaceBetween} = curr.split(':');\n acc = {\n ...acc,\n [+containerWidth]: {\n slidesPerView: slidesPerView ? +slidesPerView : 1,\n spaceBetween: spaceBetween ? +spaceBetween : this.spaceBetween\n }\n }\n\n return acc;\n }, {});\n\n return value;\n } else {\n Object.values(value).forEach((config: any) => {\n config.slidesPerView = config.slidesPerView ?? 1;\n config.spaceBetween = config.spaceBetween ?? this.spaceBetween;\n })\n\n return value;\n }\n }\n\n\n private async setPrevNextState() {\n const swiper = await this._slidesRef.getSwiper() as Swiper;\n writeTask(() => {\n this.prevEnabled = !swiper.isBeginning;\n this.nextEnabled = !swiper.isEnd;\n });\n }\n\n\n render() {\n const cssClassNames = {\n 'c7-news-carousel-default': true\n }\n\n const sliderOptions: SwiperOptions = {\n loop: this.loop,\n spaceBetween: this.spaceBetween,\n touchStartForcePreventDefault: true,\n breakpoints: {\n ...this.itemsConfig\n },\n breakpointsBase: 'container'\n }\n\n if (this.autoplay) {\n sliderOptions.autoplay = {\n delay: this.autoplayDelay,\n pauseOnMouseEnter: true,\n disableOnInteraction: false\n }\n }\n\n\n const prevBtn = !this.disablePrevNextButtons && (\n \n );\n\n const nextBtn = !this.disablePrevNextButtons && (\n \n );\n\n const pager = !this.disablePager &&\n